[U-Boot] [PATCH v2 0/4] Kirkwood: Add support for OpenRD-Client & OpenRD-Ultimate

From: Julian Pidancet julian.pidancet@citrix.com
This patch modifies existing OpenRD-Base support to deal with all the three OpenRD boards (OpenRD-Base, OpenRD-Client & OpenRD-Ultimate). This is based on an original patch sent by Tanmay Upadhyay. Most of the credits goes to him. Previous version of this patch has been reworked to separate file renaming from the actual addition of Client and Ultimate variants support.
A nice future improvement would be to add variant detection and configuration at run-time as suggested on the mailing-list in a recent email. So one could use the same binary for all board variants.
Julian Pidancet (4): Kirkwood: Rename openrd_base board files to openrd. Change OpenRD Base board identification string. Add support for the Client variant of the OpenRD board. Add support for the Ultimate variant of the OpenRD board
MAKEALL | 2 + board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 28 ++++- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 6 +- boards.cfg | 4 +- include/configs/openrd.h | 107 ++++++++++++++++++++ include/configs/openrd_base.h | 85 ++-------------- include/configs/openrd_client.h | 44 ++++++++ include/configs/openrd_ultimate.h | 44 ++++++++ 10 files changed, 235 insertions(+), 87 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (83%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (95%) create mode 100644 include/configs/openrd.h create mode 100644 include/configs/openrd_client.h create mode 100644 include/configs/openrd_ultimate.h

From: Julian Pidancet julian.pidancet@citrix.com
This patch renames openrd_base to openrd in order to add support for other boards of the OpenRD family in future commits. The openrd_base board name remain in use.
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (97%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (95%) create mode 100644 include/configs/openrd.h
diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd/Makefile similarity index 98% rename from board/Marvell/openrd_base/Makefile rename to board/Marvell/openrd/Makefile index d6d0ed3..19020e4 100644 --- a/board/Marvell/openrd_base/Makefile +++ b/board/Marvell/openrd/Makefile @@ -31,7 +31,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).o
-COBJS := openrd_base.o +COBJS := openrd.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg similarity index 100% rename from board/Marvell/openrd_base/kwbimage.cfg rename to board/Marvell/openrd/kwbimage.cfg diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd/openrd.c similarity index 97% rename from board/Marvell/openrd_base/openrd_base.c rename to board/Marvell/openrd/openrd.c index 10109c1..b395df7 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd/openrd.c @@ -31,7 +31,7 @@ #include <miiphy.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> -#include "openrd_base.h" +#include "openrd.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -110,7 +110,7 @@ int board_init(void) /* * arch number of board */ - gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; + gd->bd->bi_arch_number = MACH_TYPE_OPENRD;
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd/openrd.h similarity index 95% rename from board/Marvell/openrd_base/openrd_base.h rename to board/Marvell/openrd/openrd.h index f3daf17..638d2ff 100644 --- a/board/Marvell/openrd_base/openrd_base.h +++ b/board/Marvell/openrd/openrd.h @@ -27,8 +27,8 @@ * MA 02110-1301 USA */
-#ifndef __OPENRD_BASE_H -#define __OPENRD_BASE_H +#ifndef __OPENRD_H +#define __OPENRD_H
#define OPENRD_OE_LOW (~(1<<28)) /* RS232 / RS485 */ #define OPENRD_OE_HIGH (~(1<<2)) /* SD / UART1 */ @@ -43,4 +43,4 @@ #define MV88E1116_RGMII_TXTM_CTRL (1 << 4) #define MV88E1116_RGMII_RXTM_CTRL (1 << 5)
-#endif /* __OPENRD_BASE_H */ +#endif /* __OPENRD_H */ diff --git a/boards.cfg b/boards.cfg index 45c3102..07c904b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd Marvell kirkwood rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd.h b/include/configs/openrd.h new file mode 100644 index 0000000..d7973dc --- /dev/null +++ b/include/configs/openrd.h @@ -0,0 +1,107 @@ +/* + * (C) Copyright 2009 + * Net Insight <www.netinsight.net> + * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net + * + * Based on sheevaplug.h: + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar prafulla@marvell.com + * + * 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 _CONFIG_OPENRD_H +#define _CONFIG_OPENRD_H + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_OPENRD /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_AUTOSCRIPT +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_MII +#define CONFIG_CMD_NAND +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND +#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x20000 /* 128k */ +#define CONFIG_ENV_ADDR 0x60000 +#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "${x_bootcmd_usb}; bootm 0x6400000;" + +#define MTDIDS_DEFAULT "nand0=nand_mtd" +#define MTDPARTS_DEFAULT "mtdparts=nand_mtd:0x100000@0x000000(uboot),"\ + "0x400000@0x100000(uImage),"\ + "0x1fb00000@0x500000(rootfs)" + +#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \ + "=ttyS0,115200 "MTDPARTS_DEFAULT " rw ubi.mtd=2,2048\0" \ + "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootargs_root=root=ubi0:rootfs rootfstype=ubifs\0" \ + "mtdids="MTDIDS_DEFAULT"\0" \ + "mtdparts="MTDPARTS_DEFAULT"\0" + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +#endif /* _CONFIG_OPENRD_H */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index cfdd09c..136d3bf 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -30,91 +30,24 @@ #ifndef _CONFIG_OPENRD_BASE_H #define _CONFIG_OPENRD_BASE_H
+#include <configs/openrd.h> + /* * Version number information */ #define CONFIG_IDENT_STRING "\nOpenRD_base"
-/* - * High Level Configuration Options (easy to change) - */ -#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ -#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ -#define CONFIG_KW88F6281 1 /* SOC Name */ -#define CONFIG_MACH_OPENRD_BASE /* Machine type */ -#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ - -/* - * Commands configuration - */ -#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ -#include <config_cmd_default.h> -#define CONFIG_CMD_AUTOSCRIPT -#define CONFIG_CMD_DHCP -#define CONFIG_CMD_ENV -#define CONFIG_CMD_MII -#define CONFIG_CMD_NAND -#define CONFIG_CMD_PING -#define CONFIG_CMD_USB -#define CONFIG_CMD_IDE - -/* - * mv-common.h should be defined after CMD configs since it used them - * to enable certain macros - */ -#include "mv-common.h" - -/* - * Environment variables configurations - */ -#ifdef CONFIG_CMD_NAND -#define CONFIG_ENV_IS_IN_NAND 1 -#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -#else -#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ -#endif -/* - * max 4k env size is enough, but in case of nand - * it has to be rounded to sector size - */ -#define CONFIG_ENV_SIZE 0x20000 /* 128k */ -#define CONFIG_ENV_ADDR 0x60000 -#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ - -/* - * Default environment variables - */ -#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \ - "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ - "${x_bootcmd_usb}; bootm 0x6400000;" - -#define MTDIDS_DEFAULT "nand0=nand_mtd" -#define MTDPARTS_DEFAULT "mtdparts=nand_mtd:0x100000@0x000000(uboot),"\ - "0x400000@0x100000(uImage),"\ - "0x1fb00000@0x500000(rootfs)" - -#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \ - "=ttyS0,115200 "MTDPARTS_DEFAULT " rw ubi.mtd=2,2048\0" \ - "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \ - "x_bootcmd_usb=usb start\0" \ - "x_bootargs_root=root=ubi0:rootfs rootfstype=ubifs\0" \ - "mtdids="MTDIDS_DEFAULT"\0" \ - "mtdparts="MTDPARTS_DEFAULT"\0" +/* Machine type */ +#define MACH_TYPE_OPENRD MACH_TYPE_OPENRD_BASE
/* * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +/* enable port 0 only */ +#define CONFIG_MVGBE_PORTS {1, 0} +#define CONFIG_PHY_BASE_ADR 0x8 +#define PHY_NO "88E1116" #endif /* CONFIG_CMD_NET */
-/* - * SATA Driver configuration - */ -#ifdef CONFIG_MVSATA_IDE -#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET -#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET -#endif /*CONFIG_MVSATA_IDE*/ - #endif /* _CONFIG_OPENRD_BASE_H */

-----Original Message----- From: Julian Pidancet [mailto:swaplinker@gmail.com] On Behalf Of julian.pidancet@citrix.com Sent: Friday, March 25, 2011 2:19 PM To: u-boot@lists.denx.de Cc: tanmay.upadhyay@einfochips.com; Prafulla Wadaskar; Julian Pidancet Subject: [PATCH v2 1/4] Kirkwood: Rename openrd_base board files to openrd.
From: Julian Pidancet julian.pidancet@citrix.com
This patch renames openrd_base to openrd in order to add support for other boards of the OpenRD family in future commits. The openrd_base board name remain in use.
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (97%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (95%) create mode 100644 include/configs/openrd.h
diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd/Makefile similarity index 98% rename from board/Marvell/openrd_base/Makefile rename to board/Marvell/openrd/Makefile index d6d0ed3..19020e4 100644 --- a/board/Marvell/openrd_base/Makefile +++ b/board/Marvell/openrd/Makefile @@ -31,7 +31,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).o
-COBJS := openrd_base.o +COBJS := openrd.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg similarity index 100% rename from board/Marvell/openrd_base/kwbimage.cfg rename to board/Marvell/openrd/kwbimage.cfg diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd/openrd.c similarity index 97% rename from board/Marvell/openrd_base/openrd_base.c rename to board/Marvell/openrd/openrd.c index 10109c1..b395df7 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd/openrd.c @@ -31,7 +31,7 @@ #include <miiphy.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> -#include "openrd_base.h" +#include "openrd.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -110,7 +110,7 @@ int board_init(void) /* * arch number of board */
- gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE;
- gd->bd->bi_arch_number = MACH_TYPE_OPENRD;
NAK for this, the MACH_TYPE for any board is coming form external world. Tweaking it in u-boot is not recommended.
You can have conditional code here to use different predefined MACH_TYPES instead of macros defining it.
...snip...
diff --git a/boards.cfg b/boards.cfg index 45c3102..07c904b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd Marvell Kirkwood
You can pass additional options here to identify your board uniquely out of several supported boards (to be coming) For ex: +openrd_base arm arm926ejs openrd +Marvell Kirkwood openrd_common:BOARD_IS_OPENRD_BASE
This approach will help better way to add conditional code for other boards type
For more details refer syntax in the top of this file.
Regards.. Prafulla . .

--- MAKEALL | 2 ++ boards.cfg | 4 +++- include/configs/openrd_base.h | 14 +++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/MAKEALL b/MAKEALL index e1b928f..011cead 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,8 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/boards.cfg b/boards.cfg index d25f3f2..425d51b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,9 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_BASE +openrd_client arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_CLIENT +openrd_ultimate arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index cfdd09c..5e05890 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -33,7 +33,19 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif
/* * High Level Configuration Options (easy to change)

(rework of Julian Pidancet's patch) --- board/Marvell/openrd_base/openrd_base.c | 22 ++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index 10109c1..aea4760 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -118,12 +118,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -148,6 +147,21 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); + + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 5e05890..aa13908 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -117,8 +117,18 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*

-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Thursday, April 07, 2011 12:25 AM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; julian.pidancet@citrix.com; Clint Adams Subject: [PATCH 2/2] Initialize second PHY on OpenRD-Client and OpenRD- Ultimate.
(rework of Julian Pidancet's patch)
board/Marvell/openrd_base/openrd_base.c | 22 ++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index 10109c1..aea4760 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -118,12 +118,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr;
char *name = "egiga0";
if (miiphy_set_current_dev(name)) return;
@@ -148,6 +147,21 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name);
- printf(PHY_NO" Initialized on %s\n", name);
+}
+void reset_phy(void) +{
mv_phy_init("egiga0");
+#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
/* Kirkwood ethernet driver is written with the assumption that
in case
* of multiple PHYs, their addresses are consecutive. But
unfortunately
* in case of OpenRD-Client, PHY addresses are not
consecutive.*/
miiphy_write("egiga1", 0xEE, 0xEE, 24);
/* configure and initialize both PHY's */
mv_phy_init("egiga1");
+#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 5e05890..aa13908 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -117,8 +117,18 @@
- Ethernet Driver configuration
*/ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
This looks pretty good. Ack for both the patches.
Regards.. Prafulla ..

Le 07/04/2011 08:17, Prafulla Wadaskar a écrit :
-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Thursday, April 07, 2011 12:25 AM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; julian.pidancet@citrix.com; Clint Adams Subject: [PATCH 2/2] Initialize second PHY on OpenRD-Client and OpenRD- Ultimate.
(rework of Julian Pidancet's patch)
board/Marvell/openrd_base/openrd_base.c | 22 ++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index 10109c1..aea4760 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -118,12 +118,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr;
char *name = "egiga0";
if (miiphy_set_current_dev(name)) return;
@@ -148,6 +147,21 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name);
- printf(PHY_NO" Initialized on %s\n", name);
+}
+void reset_phy(void) +{
mv_phy_init("egiga0");
+#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
/* Kirkwood ethernet driver is written with the assumption that
in case
* of multiple PHYs, their addresses are consecutive. But
unfortunately
* in case of OpenRD-Client, PHY addresses are not
consecutive.*/
miiphy_write("egiga1", 0xEE, 0xEE, 24);
/* configure and initialize both PHY's */
mv_phy_init("egiga1");
+#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 5e05890..aa13908 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -117,8 +117,18 @@
- Ethernet Driver configuration
*/ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
This looks pretty good. Ack for both the patches.
Regards.. Prafulla ..
Didn't Julian re-post patches that actually separates Base, Client and Ultimate into distinct config header files plus a common one? How does this affect Clint's patchset?
Amicalement,

-----Original Message----- From: Albert ARIBAUD [mailto:albert.aribaud@free.fr] Sent: Thursday, April 07, 2011 12:48 PM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; Clint Adams Subject: Re: [U-Boot] [PATCH 2/2] Initialize second PHY on OpenRD-Client and OpenRD-Ultimate.
Le 07/04/2011 08:17, Prafulla Wadaskar a écrit :
-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Thursday, April 07, 2011 12:25 AM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; julian.pidancet@citrix.com; Clint Adams Subject: [PATCH 2/2] Initialize second PHY on OpenRD-Client and
OpenRD-
Ultimate.
(rework of Julian Pidancet's patch)
board/Marvell/openrd_base/openrd_base.c | 22 ++++++++++++++++++--
--
include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index 10109c1..aea4760 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -118,12 +118,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr;
char *name = "egiga0";
if (miiphy_set_current_dev(name)) return;
@@ -148,6 +147,21 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name);
- printf(PHY_NO" Initialized on %s\n", name);
+}
+void reset_phy(void) +{
mv_phy_init("egiga0");
+#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
/* Kirkwood ethernet driver is written with the assumption
that
in case
* of multiple PHYs, their addresses are consecutive. But
unfortunately
* in case of OpenRD-Client, PHY addresses are not
consecutive.*/
miiphy_write("egiga1", 0xEE, 0xEE, 24);
/* configure and initialize both PHY's */
mv_phy_init("egiga1");
+#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 5e05890..aa13908 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -117,8 +117,18 @@
- Ethernet Driver configuration
*/ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
This looks pretty good. Ack for both the patches.
Regards.. Prafulla ..
Didn't Julian re-post patches that actually separates Base, Client and Ultimate into distinct config header files plus a common one? How does this affect Clint's patchset?
I acked for the method used here.
We don't need separate config headers. Using CONFIG_BOARD_IS_OPENRD_* the boards related stuff can be identified.
To me this looks better that what Julian had posted
I have tested these patches and works for openRD-Base, certainly it may not work for ultimate and client since respective machine ids are not programmed.
Hi Julian/Clint May you please provide tuned version of these patches?
Regards.. Prafulla . .
Amicalement,
Albert.

Hi Prafulle,
Le 11/04/2011 14:03, Prafulla Wadaskar a écrit :
board/Marvell/openrd_base/openrd_base.c | 22 ++++++++++++++++++--
--
include/configs/openrd_base.h | 14 ++++++++++++--
Didn't Julian re-post patches that actually separates Base, Client and Ultimate into distinct config header files plus a common one? How does this affect Clint's patchset?
I acked for the method used here.
We don't need separate config headers. Using CONFIG_BOARD_IS_OPENRD_* the boards related stuff can be identified.
If the two files above are to be used for all Open-RD boards (which is fine for me), then they should be renamed from openrd_base.* to openrd.* for the sake of clarity as to what they actually support.
Amicalement,

-----Original Message----- From: Albert ARIBAUD [mailto:albert.u.boot@aribaud.net] Sent: Monday, April 11, 2011 6:15 PM To: Prafulla Wadaskar Cc: u-boot@lists.denx.de; Clint Adams; Julian Pidancet Subject: Re: [U-Boot] [PATCH 2/2] Initialize second PHY on OpenRD-Client and OpenRD-Ultimate.
Hi Prafulle,
Le 11/04/2011 14:03, Prafulla Wadaskar a écrit :
board/Marvell/openrd_base/openrd_base.c | 22
++++++++++++++++++--
--
include/configs/openrd_base.h | 14 ++++++++++++--
Didn't Julian re-post patches that actually separates Base, Client
and
Ultimate into distinct config header files plus a common one? How
does
this affect Clint's patchset?
I acked for the method used here.
We don't need separate config headers. Using CONFIG_BOARD_IS_OPENRD_*
the boards related stuff can be identified.
If the two files above are to be used for all Open-RD boards (which is fine for me), then they should be renamed from openrd_base.* to openrd.* for the sake of clarity as to what they actually support.
Ack, I hope this will be addressed in next version.
Regards.. Prafulla . .
Amicalement,
Albert.

--- MAKEALL | 2 ++ board/Marvell/openrd_base/openrd_base.c | 6 ++++++ boards.cfg | 4 +++- include/configs/openrd_base.h | 14 +++++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/MAKEALL b/MAKEALL index e1b928f..011cead 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,8 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index 10109c1..f7c63ac 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -110,7 +110,13 @@ int board_init(void) /* * arch number of board */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/boards.cfg b/boards.cfg index a45bd83..ee5d5f4 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,9 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_BASE +openrd_client arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_CLIENT +openrd_ultimate arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index cfdd09c..5e05890 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -33,7 +33,19 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif
/* * High Level Configuration Options (easy to change)

(rework of Julian Pidancet's patch) --- board/Marvell/openrd_base/openrd_base.c | 22 ++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index f7c63ac..c71d1ef 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -154,6 +153,21 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); + + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 5e05890..aa13908 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -117,8 +117,18 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*

Thank you for reworking this patch.
On 04/12/2011 09:09 AM, Clint Adams wrote:
(rework of Julian Pidancet's patch)
board/Marvell/openrd_base/openrd_base.c | 22 ++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index f7c63ac..c71d1ef 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr;
char *name = "egiga0";
if (miiphy_set_current_dev(name)) return;
@@ -154,6 +153,21 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name);
- printf(PHY_NO" Initialized on %s\n", name);
+}
+void reset_phy(void) +{
mv_phy_init("egiga0");
+#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
/* Kirkwood ethernet driver is written with the assumption that in case
* of multiple PHYs, their addresses are consecutive. But unfortunately
* in case of OpenRD-Client, PHY addresses are not consecutive.*/
miiphy_write("egiga1", 0xEE, 0xEE, 24);
/* configure and initialize both PHY's */
mv_phy_init("egiga1");
+#endif
This part only initialize second PHY for the OpenRD-Client board and not the OpenRD-Ultimate. I would do something like:
#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) #if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) miiphy_write("egiga1", 0xEE, 0xEE, 24); #endif mv_phy_init("egiga1"); #endif
Or similar.
} #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 5e05890..aa13908 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -117,8 +117,18 @@
- Ethernet Driver configuration
*/ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*
Thanks.

--- MAKEALL | 2 ++ board/Marvell/openrd_base/openrd_base.c | 6 ++++++ boards.cfg | 4 +++- include/configs/openrd_base.h | 14 +++++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/MAKEALL b/MAKEALL index e1b928f..011cead 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,8 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index 10109c1..f7c63ac 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -110,7 +110,13 @@ int board_init(void) /* * arch number of board */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/boards.cfg b/boards.cfg index a45bd83..ee5d5f4 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,9 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_BASE +openrd_client arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_CLIENT +openrd_ultimate arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index cfdd09c..5e05890 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -33,7 +33,19 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif
/* * High Level Configuration Options (easy to change)

(rework of Julian Pidancet's patch) --- board/Marvell/openrd_base/openrd_base.c | 24 ++++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index f7c63ac..cb0f0fe 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -154,6 +153,23 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); +#endif + +#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 5e05890..aa13908 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -117,8 +117,18 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*

Hi Clint,
(rework of Julian Pidancet's patch)
board/Marvell/openrd_base/openrd_base.c | 24 ++++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 32 insertions(+), 6 deletions(-)
Sorry to jump in a little bit late here, but can you please look at the excellent work of Andy Flemin on an universal phy infrastructure[1]? Can't we use that also as a base for your board and eliminate duplicated phy code?
Thanks for looking into this! Detlev
[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/97560

-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Wednesday, April 13, 2011 12:14 AM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; julian.pidancet@citrix.com; Clint Adams Subject: [PATCH 2/3] Initialize second PHY on OpenRD-Client and OpenRD- Ultimate.
(rework of Julian Pidancet's patch)
board/Marvell/openrd_base/openrd_base.c | 24 ++++++++++++++++++++---- include/configs/openrd_base.h | 14 ++++++++++++-- 2 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index f7c63ac..cb0f0fe 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr;
char *name = "egiga0";
if (miiphy_set_current_dev(name)) return;
@@ -154,6 +153,23 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name);
- printf(PHY_NO" Initialized on %s\n", name);
+}
+void reset_phy(void) +{
mv_phy_init("egiga0");
+#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
/* Kirkwood ethernet driver is written with the assumption that
in case
* of multiple PHYs, their addresses are consecutive. But
unfortunately
* in case of OpenRD-Client, PHY addresses are not
consecutive.*/
miiphy_write("egiga1", 0xEE, 0xEE, 24);
+#endif
+#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE)
The line is too long >80 chars
Regards.. Prafulla . .

--- board/Marvell/openrd/Makefile | 56 ++++++++++ board/Marvell/openrd/kwbimage.cfg | 168 +++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.c | 175 +++++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.h | 46 ++++++++ board/Marvell/openrd_base/Makefile | 56 ---------- board/Marvell/openrd_base/kwbimage.cfg | 168 ----------------------------- board/Marvell/openrd_base/openrd_base.c | 175 ------------------------------- board/Marvell/openrd_base/openrd_base.h | 46 -------- boards.cfg | 6 +- include/configs/openrd.h | 142 +++++++++++++++++++++++++ include/configs/openrd_base.h | 142 ------------------------- 11 files changed, 590 insertions(+), 590 deletions(-) create mode 100644 board/Marvell/openrd/Makefile create mode 100644 board/Marvell/openrd/kwbimage.cfg create mode 100644 board/Marvell/openrd/openrd.c create mode 100644 board/Marvell/openrd/openrd.h delete mode 100644 board/Marvell/openrd_base/Makefile delete mode 100644 board/Marvell/openrd_base/kwbimage.cfg delete mode 100644 board/Marvell/openrd_base/openrd_base.c delete mode 100644 board/Marvell/openrd_base/openrd_base.h create mode 100644 include/configs/openrd.h delete mode 100644 include/configs/openrd_base.h
diff --git a/board/Marvell/openrd/Makefile b/board/Marvell/openrd/Makefile new file mode 100644 index 0000000..19020e4 --- /dev/null +++ b/board/Marvell/openrd/Makefile @@ -0,0 +1,56 @@ +# +# (C) Copyright 2009 +# Net Insight <www.netinsight.net> +# Written-by: Simon Kagstrom simon.kagstrom@netinsight.net +# +# Based on sheevaplug: +# (C) Copyright 2009 +# Marvell Semiconductor <www.marvell.com> +# Written-by: Prafulla Wadaskar prafulla@marvell.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := openrd.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/Marvell/openrd/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg new file mode 100644 index 0000000..757eb28 --- /dev/null +++ b/board/Marvell/openrd/kwbimage.cfg @@ -0,0 +1,168 @@ +# +# (C) Copyright 2009 +# Marvell Semiconductor <www.marvell.com> +# Written-by: Prafulla Wadaskar prafulla@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM nand +NAND_ECC_MODE default +NAND_PAGE_SIZE 0x0800 + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b1b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 00, Cs0width=x8 +# bit3-2: 11, Cs0size=1Gb +# bit5-4: 00, Cs1width=x8 +# bit7-6: 11, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000042 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 1, DDR drive strength reduced +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB) + +DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 + +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00120012 # DDR ODT Control (Low) +# bit3-0: 0010, (read) M_ODT[0] is asserted during read from DRAM CS1 +# bit7-4: 0001, (read) M_ODT[1] is asserted during read from DRAM CS0 +# bit19-16: 0010, (write) M_ODT[0] is asserted during write to DRAM CS1. +# bit23-20: 0001, (write) M_ODT[1] is asserted during write to DRAM CS0. +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) + +DATA 0xFFD0149C 0x0000E40f # CPU ODT Control +# bit3-0: 1111, internal ODT is asserted during read from DRAM bank 0-3 +# bit11-10: 01, M_DQ, M_DM, and M_DQS I/O buffer ODT Select: 150 ohm +# bit13-12: 10, M_STARTBURST_IN I/O buffer ODT Select: 75 ohm +# bit14: 1, M_STARTBURST_IN ODT: Enabled +# bit15: 1, DDR IO ODT Unit: Use ODT block +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c new file mode 100644 index 0000000..a50709e --- /dev/null +++ b/board/Marvell/openrd/openrd.c @@ -0,0 +1,175 @@ +/* + * (C) Copyright 2009 + * Net Insight <www.netinsight.net> + * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net + * + * Based on sheevaplug.c: + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar prafulla@marvell.com + * + * 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 + */ + +#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "openrd.h" + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers + * the below configuration configures mainly initial LED status + */ + kw_config_gpio(OPENRD_OE_VAL_LOW, + OPENRD_OE_VAL_HIGH, + OPENRD_OE_LOW, OPENRD_OE_HIGH); + + /* 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, + MPP6_SYSRST_OUTn, + MPP7_GPO, + MPP8_TW_SDA, + MPP9_TW_SCK, + MPP10_UART0_TXD, + MPP11_UART0_RXD, + MPP12_SD_CLK, + MPP13_SD_CMD, /* Alt UART1_TXD */ + MPP14_SD_D0, /* Alt UART1_RXD */ + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_GE1_0, + MPP21_GE1_1, + MPP22_GE1_2, + MPP23_GE1_3, + MPP24_GE1_4, + MPP25_GE1_5, + MPP26_GE1_6, + MPP27_GE1_7, + MPP28_GPIO, + MPP29_TSMP9, + MPP30_GE1_10, + MPP31_GE1_11, + MPP32_GE1_12, + MPP33_GE1_13, + MPP34_GPIO, /* UART1 / SD sel */ + MPP35_TDM_CH0_TX_QL, + MPP36_TDM_SPI_CS1, + MPP37_TDM_CH2_TX_QL, + MPP38_TDM_CH2_RX_QL, + MPP39_AUDIO_I2SBCLK, + MPP40_AUDIO_I2SDO, + MPP41_AUDIO_I2SLRC, + MPP42_AUDIO_I2SMCLK, + MPP43_AUDIO_I2SDI, + MPP44_AUDIO_EXTCLK, + MPP45_TDM_PCLK, + MPP46_TDM_FS, + MPP47_TDM_DRX, + MPP48_TDM_DTX, + MPP49_TDM_CH0_RX_QL, + 0 + }; + + kirkwood_mpp_conf(kwmpp_config); + return 0; +} + +int board_init(void) +{ + /* + * arch number of board + */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif + + /* adress of boot parameters */ + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; + return 0; +} + +#ifdef CONFIG_RESET_PHY_R +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) +{ + u16 reg; + u16 devadr; + + if (miiphy_set_current_dev(name)) + return; + + /* command to read PHY dev address */ + if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { + printf("Err..%s could not read PHY dev address\n", + __FUNCTION__); + return; + } + + /* + * Enable RGMII delay on Tx and Rx for CPU port + * Ref: sec 4.7.2 of chip datasheet + */ + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); + miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, ®); + reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); + miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg); + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); + + /* reset the phy */ + miiphy_reset(name, devadr); + + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); +#endif + +#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif +} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/openrd/openrd.h b/board/Marvell/openrd/openrd.h new file mode 100644 index 0000000..f3daf17 --- /dev/null +++ b/board/Marvell/openrd/openrd.h @@ -0,0 +1,46 @@ +/* + * (C) Copyright 2009 + * Net Insight <www.netinsight.net> + * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net + * + * Based on sheevaplug.h: + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar prafulla@marvell.com + * + * 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 __OPENRD_BASE_H +#define __OPENRD_BASE_H + +#define OPENRD_OE_LOW (~(1<<28)) /* RS232 / RS485 */ +#define OPENRD_OE_HIGH (~(1<<2)) /* SD / UART1 */ +#define OPENRD_OE_VAL_LOW (0) /* Sel RS232 */ +#define OPENRD_OE_VAL_HIGH (1 << 2) /* Sel SD */ + +/* 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 /* __OPENRD_BASE_H */ diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd_base/Makefile deleted file mode 100644 index d6d0ed3..0000000 --- a/board/Marvell/openrd_base/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -# -# (C) Copyright 2009 -# Net Insight <www.netinsight.net> -# Written-by: Simon Kagstrom simon.kagstrom@netinsight.net -# -# Based on sheevaplug: -# (C) Copyright 2009 -# Marvell Semiconductor <www.marvell.com> -# Written-by: Prafulla Wadaskar prafulla@marvell.com -# -# 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 -# - -include $(TOPDIR)/config.mk - -LIB = $(obj)lib$(BOARD).o - -COBJS := openrd_base.o - -SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(COBJS)) -SOBJS := $(addprefix $(obj),$(SOBJS)) - -$(LIB): $(obj).depend $(OBJS) $(SOBJS) - $(call cmd_link_o_target, $(OBJS) $(SOBJS)) - -clean: - rm -f $(SOBJS) $(OBJS) - -distclean: clean - rm -f $(LIB) core *.bak .depend - -######################################################################### - -# defines $(obj).depend target -include $(SRCTREE)/rules.mk - -sinclude $(obj).depend - -######################################################################### diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd_base/kwbimage.cfg deleted file mode 100644 index 757eb28..0000000 --- a/board/Marvell/openrd_base/kwbimage.cfg +++ /dev/null @@ -1,168 +0,0 @@ -# -# (C) Copyright 2009 -# Marvell Semiconductor <www.marvell.com> -# Written-by: Prafulla Wadaskar prafulla@marvell.com -# -# 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 -# -# Refer docs/README.kwimage for more details about how-to configure -# and create kirkwood boot image -# - -# Boot Media configurations -BOOT_FROM nand -NAND_ECC_MODE default -NAND_PAGE_SIZE 0x0800 - -# SOC registers configuration using bootrom header extension -# Maximum KWBIMAGE_MAX_CONFIG configurations allowed - -# Configure RGMII-0 interface pad voltage to 1.8V -DATA 0xFFD100e0 0x1b1b1b9b - -#Dram initalization for SINGLE x16 CL=5 @ 400MHz -DATA 0xFFD01400 0x43000c30 # DDR Configuration register -# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) -# bit23-14: zero -# bit24: 1= enable exit self refresh mode on DDR access -# bit25: 1 required -# bit29-26: zero -# bit31-30: 01 - -DATA 0xFFD01404 0x37543000 # DDR Controller Control Low -# bit 4: 0=addr/cmd in smame cycle -# bit 5: 0=clk is driven during self refresh, we don't care for APX -# bit 6: 0=use recommended falling edge of clk for addr/cmd -# bit14: 0=input buffer always powered up -# bit18: 1=cpu lock transaction enabled -# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 -# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM -# bit30-28: 3 required -# bit31: 0=no additional STARTBURST delay - -DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) -# bit3-0: TRAS lsbs -# bit7-4: TRCD -# bit11- 8: TRP -# bit15-12: TWR -# bit19-16: TWTR -# bit20: TRAS msb -# bit23-21: 0x0 -# bit27-24: TRRD -# bit31-28: TRTP - -DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) -# bit6-0: TRFC -# bit8-7: TR2R -# bit10-9: TR2W -# bit12-11: TW2W -# bit31-13: zero required - -DATA 0xFFD01410 0x000000cc # DDR Address Control -# bit1-0: 00, Cs0width=x8 -# bit3-2: 11, Cs0size=1Gb -# bit5-4: 00, Cs1width=x8 -# bit7-6: 11, Cs1size=1Gb -# bit9-8: 00, Cs2width=nonexistent -# bit11-10: 00, Cs2size =nonexistent -# bit13-12: 00, Cs3width=nonexistent -# bit15-14: 00, Cs3size =nonexistent -# bit16: 0, Cs0AddrSel -# bit17: 0, Cs1AddrSel -# bit18: 0, Cs2AddrSel -# bit19: 0, Cs3AddrSel -# bit31-20: 0 required - -DATA 0xFFD01414 0x00000000 # DDR Open Pages Control -# bit0: 0, OpenPage enabled -# bit31-1: 0 required - -DATA 0xFFD01418 0x00000000 # DDR Operation -# bit3-0: 0x0, DDR cmd -# bit31-4: 0 required - -DATA 0xFFD0141C 0x00000C52 # DDR Mode -# bit2-0: 2, BurstLen=2 required -# bit3: 0, BurstType=0 required -# bit6-4: 4, CL=5 -# bit7: 0, TestMode=0 normal -# bit8: 0, DLL reset=0 normal -# bit11-9: 6, auto-precharge write recovery ???????????? -# bit12: 0, PD must be zero -# bit31-13: 0 required - -DATA 0xFFD01420 0x00000042 # DDR Extended Mode -# bit0: 0, DDR DLL enabled -# bit1: 1, DDR drive strength reduced -# bit2: 0, DDR ODT control lsd (disabled) -# bit5-3: 000, required -# bit6: 1, DDR ODT control msb, (disabled) -# bit9-7: 000, required -# bit10: 0, differential DQS enabled -# bit11: 0, required -# bit12: 0, DDR output buffer enabled -# bit31-13: 0 required - -DATA 0xFFD01424 0x0000F17F # DDR Controller Control High -# bit2-0: 111, required -# bit3 : 1 , MBUS Burst Chop disabled -# bit6-4: 111, required -# bit7 : 0 -# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz -# bit9 : 0 , no half clock cycle addition to dataout -# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals -# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh -# bit15-12: 1111 required -# bit31-16: 0 required - -DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) -DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) - -DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 -DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size -# bit0: 1, Window enabled -# bit1: 0, Write Protect disabled -# bit3-2: 00, CS0 hit selected -# bit23-4: ones, required -# bit31-24: 0x0F, Size (i.e. 256MB) - -DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb -DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 - -DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled -DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled - -DATA 0xFFD01494 0x00120012 # DDR ODT Control (Low) -# bit3-0: 0010, (read) M_ODT[0] is asserted during read from DRAM CS1 -# bit7-4: 0001, (read) M_ODT[1] is asserted during read from DRAM CS0 -# bit19-16: 0010, (write) M_ODT[0] is asserted during write to DRAM CS1. -# bit23-20: 0001, (write) M_ODT[1] is asserted during write to DRAM CS0. -DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) - -DATA 0xFFD0149C 0x0000E40f # CPU ODT Control -# bit3-0: 1111, internal ODT is asserted during read from DRAM bank 0-3 -# bit11-10: 01, M_DQ, M_DM, and M_DQS I/O buffer ODT Select: 150 ohm -# bit13-12: 10, M_STARTBURST_IN I/O buffer ODT Select: 75 ohm -# bit14: 1, M_STARTBURST_IN ODT: Enabled -# bit15: 1, DDR IO ODT Unit: Use ODT block -DATA 0xFFD01480 0x00000001 # DDR Initialization Control -#bit0=1, enable DDR init upon this register write - -# End of Header extension -DATA 0x0 0x0 diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c deleted file mode 100644 index cb0f0fe..0000000 --- a/board/Marvell/openrd_base/openrd_base.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * (C) Copyright 2009 - * Net Insight <www.netinsight.net> - * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net - * - * Based on sheevaplug.c: - * (C) Copyright 2009 - * Marvell Semiconductor <www.marvell.com> - * Written-by: Prafulla Wadaskar prafulla@marvell.com - * - * 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 - */ - -#include <common.h> -#include <miiphy.h> -#include <asm/arch/kirkwood.h> -#include <asm/arch/mpp.h> -#include "openrd_base.h" - -DECLARE_GLOBAL_DATA_PTR; - -int board_early_init_f(void) -{ - /* - * default gpio configuration - * There are maximum 64 gpios controlled through 2 sets of registers - * the below configuration configures mainly initial LED status - */ - kw_config_gpio(OPENRD_OE_VAL_LOW, - OPENRD_OE_VAL_HIGH, - OPENRD_OE_LOW, OPENRD_OE_HIGH); - - /* 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, - MPP6_SYSRST_OUTn, - MPP7_GPO, - MPP8_TW_SDA, - MPP9_TW_SCK, - MPP10_UART0_TXD, - MPP11_UART0_RXD, - MPP12_SD_CLK, - MPP13_SD_CMD, /* Alt UART1_TXD */ - MPP14_SD_D0, /* Alt UART1_RXD */ - MPP15_SD_D1, - MPP16_SD_D2, - MPP17_SD_D3, - MPP18_NF_IO0, - MPP19_NF_IO1, - MPP20_GE1_0, - MPP21_GE1_1, - MPP22_GE1_2, - MPP23_GE1_3, - MPP24_GE1_4, - MPP25_GE1_5, - MPP26_GE1_6, - MPP27_GE1_7, - MPP28_GPIO, - MPP29_TSMP9, - MPP30_GE1_10, - MPP31_GE1_11, - MPP32_GE1_12, - MPP33_GE1_13, - MPP34_GPIO, /* UART1 / SD sel */ - MPP35_TDM_CH0_TX_QL, - MPP36_TDM_SPI_CS1, - MPP37_TDM_CH2_TX_QL, - MPP38_TDM_CH2_RX_QL, - MPP39_AUDIO_I2SBCLK, - MPP40_AUDIO_I2SDO, - MPP41_AUDIO_I2SLRC, - MPP42_AUDIO_I2SMCLK, - MPP43_AUDIO_I2SDI, - MPP44_AUDIO_EXTCLK, - MPP45_TDM_PCLK, - MPP46_TDM_FS, - MPP47_TDM_DRX, - MPP48_TDM_DTX, - MPP49_TDM_CH0_RX_QL, - 0 - }; - - kirkwood_mpp_conf(kwmpp_config); - return 0; -} - -int board_init(void) -{ - /* - * arch number of board - */ -#if defined(CONFIG_BOARD_IS_OPENRD_BASE) - gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; -#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) - gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; -#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) - gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; -#endif - - /* adress of boot parameters */ - gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; - return 0; -} - -#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116/88E1121 PHY */ -void mv_phy_init(char *name) -{ - u16 reg; - u16 devadr; - - if (miiphy_set_current_dev(name)) - return; - - /* command to read PHY dev address */ - if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { - printf("Err..%s could not read PHY dev address\n", - __FUNCTION__); - return; - } - - /* - * Enable RGMII delay on Tx and Rx for CPU port - * Ref: sec 4.7.2 of chip datasheet - */ - miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); - miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, ®); - reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); - miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg); - miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); - - /* reset the phy */ - miiphy_reset(name, devadr); - - printf(PHY_NO" Initialized on %s\n", name); -} - -void reset_phy(void) -{ - mv_phy_init("egiga0"); - -#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT - /* Kirkwood ethernet driver is written with the assumption that in case - * of multiple PHYs, their addresses are consecutive. But unfortunately - * in case of OpenRD-Client, PHY addresses are not consecutive.*/ - miiphy_write("egiga1", 0xEE, 0xEE, 24); -#endif - -#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) - /* configure and initialize both PHY's */ - mv_phy_init("egiga1"); -#endif -} -#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd_base/openrd_base.h deleted file mode 100644 index f3daf17..0000000 --- a/board/Marvell/openrd_base/openrd_base.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright 2009 - * Net Insight <www.netinsight.net> - * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net - * - * Based on sheevaplug.h: - * (C) Copyright 2009 - * Marvell Semiconductor <www.marvell.com> - * Written-by: Prafulla Wadaskar prafulla@marvell.com - * - * 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 __OPENRD_BASE_H -#define __OPENRD_BASE_H - -#define OPENRD_OE_LOW (~(1<<28)) /* RS232 / RS485 */ -#define OPENRD_OE_HIGH (~(1<<2)) /* SD / UART1 */ -#define OPENRD_OE_VAL_LOW (0) /* Sel RS232 */ -#define OPENRD_OE_VAL_HIGH (1 << 2) /* Sel SD */ - -/* 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 /* __OPENRD_BASE_H */ diff --git a/boards.cfg b/boards.cfg index ee5d5f4..7c38b1b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,9 +96,9 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_BASE -openrd_client arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_CLIENT -openrd_ultimate arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_ULTIMATE +openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE +openrd_client arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_CLIENT +openrd_ultimate arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd.h b/include/configs/openrd.h new file mode 100644 index 0000000..8d86067 --- /dev/null +++ b/include/configs/openrd.h @@ -0,0 +1,142 @@ +/* + * (C) Copyright 2009 + * Net Insight <www.netinsight.net> + * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net + * + * Based on sheevaplug.h: + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar prafulla@marvell.com + * + * 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 _CONFIG_OPENRD_H +#define _CONFIG_OPENRD_H + +/* + * Version number information + */ +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_OPENRD_BASE /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_AUTOSCRIPT +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_MII +#define CONFIG_CMD_NAND +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND +#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x20000 /* 128k */ +#define CONFIG_ENV_ADDR 0x60000 +#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "${x_bootcmd_usb}; bootm 0x6400000;" + +#define MTDIDS_DEFAULT "nand0=nand_mtd" +#define MTDPARTS_DEFAULT "mtdparts=nand_mtd:0x100000@0x000000(uboot),"\ + "0x400000@0x100000(uImage),"\ + "0x1fb00000@0x500000(rootfs)" + +#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \ + "=ttyS0,115200 "MTDPARTS_DEFAULT " rw ubi.mtd=2,2048\0" \ + "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootargs_root=root=ubi0:rootfs rootfstype=ubifs\0" \ + "mtdids="MTDIDS_DEFAULT"\0" \ + "mtdparts="MTDPARTS_DEFAULT"\0" + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif +#endif /* CONFIG_CMD_NET */ + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +#endif /* _CONFIG_OPENRD_BASE_H */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h deleted file mode 100644 index aa13908..0000000 --- a/include/configs/openrd_base.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * (C) Copyright 2009 - * Net Insight <www.netinsight.net> - * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net - * - * Based on sheevaplug.h: - * (C) Copyright 2009 - * Marvell Semiconductor <www.marvell.com> - * Written-by: Prafulla Wadaskar prafulla@marvell.com - * - * 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 _CONFIG_OPENRD_BASE_H -#define _CONFIG_OPENRD_BASE_H - -/* - * Version number information - */ -#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE -# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" -#else -# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT -# define CONFIG_IDENT_STRING "\nOpenRD-Client" -# else -# ifdef CONFIG_BOARD_IS_OPENRD_BASE -# define CONFIG_IDENT_STRING "\nOpenRD-Base" -# else -# error Unknown OpenRD board specified -# endif -# endif -#endif - -/* - * High Level Configuration Options (easy to change) - */ -#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ -#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ -#define CONFIG_KW88F6281 1 /* SOC Name */ -#define CONFIG_MACH_OPENRD_BASE /* Machine type */ -#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ - -/* - * Commands configuration - */ -#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ -#include <config_cmd_default.h> -#define CONFIG_CMD_AUTOSCRIPT -#define CONFIG_CMD_DHCP -#define CONFIG_CMD_ENV -#define CONFIG_CMD_MII -#define CONFIG_CMD_NAND -#define CONFIG_CMD_PING -#define CONFIG_CMD_USB -#define CONFIG_CMD_IDE - -/* - * mv-common.h should be defined after CMD configs since it used them - * to enable certain macros - */ -#include "mv-common.h" - -/* - * Environment variables configurations - */ -#ifdef CONFIG_CMD_NAND -#define CONFIG_ENV_IS_IN_NAND 1 -#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -#else -#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ -#endif -/* - * max 4k env size is enough, but in case of nand - * it has to be rounded to sector size - */ -#define CONFIG_ENV_SIZE 0x20000 /* 128k */ -#define CONFIG_ENV_ADDR 0x60000 -#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ - -/* - * Default environment variables - */ -#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \ - "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ - "${x_bootcmd_usb}; bootm 0x6400000;" - -#define MTDIDS_DEFAULT "nand0=nand_mtd" -#define MTDPARTS_DEFAULT "mtdparts=nand_mtd:0x100000@0x000000(uboot),"\ - "0x400000@0x100000(uImage),"\ - "0x1fb00000@0x500000(rootfs)" - -#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \ - "=ttyS0,115200 "MTDPARTS_DEFAULT " rw ubi.mtd=2,2048\0" \ - "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \ - "x_bootcmd_usb=usb start\0" \ - "x_bootargs_root=root=ubi0:rootfs rootfstype=ubifs\0" \ - "mtdids="MTDIDS_DEFAULT"\0" \ - "mtdparts="MTDPARTS_DEFAULT"\0" - -/* - * Ethernet Driver configuration - */ -#ifdef CONFIG_CMD_NET -# ifdef CONFIG_BOARD_IS_OPENRD_BASE -# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -# else -# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ -# endif -# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE -# define CONFIG_PHY_BASE_ADR 0x0 -# define PHY_NO "88E1121" -# else -# define CONFIG_PHY_BASE_ADR 0x8 -# define PHY_NO "88E1116" -# endif -#endif /* CONFIG_CMD_NET */ - -/* - * SATA Driver configuration - */ -#ifdef CONFIG_MVSATA_IDE -#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET -#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET -#endif /*CONFIG_MVSATA_IDE*/ - -#endif /* _CONFIG_OPENRD_BASE_H */

-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Wednesday, April 13, 2011 12:14 AM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; julian.pidancet@citrix.com; Clint Adams Subject: [PATCH 3/3] Rename openrd_base files to openrd.
board/Marvell/openrd/Makefile | 56 ++++++++++ board/Marvell/openrd/kwbimage.cfg | 168 +++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.c | 175 +++++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.h | 46 ++++++++ board/Marvell/openrd_base/Makefile | 56 ---------- board/Marvell/openrd_base/kwbimage.cfg | 168 ------------------------
board/Marvell/openrd_base/openrd_base.c | 175 ------------------------
board/Marvell/openrd_base/openrd_base.h | 46 -------- boards.cfg | 6 +- include/configs/openrd.h | 142 +++++++++++++++++++++++++ include/configs/openrd_base.h | 142 ------------------------
11 files changed, 590 insertions(+), 590 deletions(-) create mode 100644 board/Marvell/openrd/Makefile create mode 100644 board/Marvell/openrd/kwbimage.cfg create mode 100644 board/Marvell/openrd/openrd.c create mode 100644 board/Marvell/openrd/openrd.h delete mode 100644 board/Marvell/openrd_base/Makefile delete mode 100644 board/Marvell/openrd_base/kwbimage.cfg delete mode 100644 board/Marvell/openrd_base/openrd_base.c delete mode 100644 board/Marvell/openrd_base/openrd_base.h create mode 100644 include/configs/openrd.h delete mode 100644 include/configs/openrd_base.h
I think it would be good if you make this your first patch in the patch series, then rest of the code changes looks more relevant.
Also take care of additional suggestions form Albert about incremental versioning, change logs, and git-rename for delete/create logs
Also keep practice of adding some more information for patch description in the beginning of each patch.
Regards.. Prafulla . .

This moves the renames to the begining, removes the unsightly periods from the commit logs, puts "V1" in the Subject headers, breaks up the >80-character line, and hopefully addresses all complaints except for Detlev Zundel's.
Clint Adams (3): Rename openrd_base files to openrd Add definitions for OpenRD-Client and OpenRD-Ultimate Initialize second PHY on OpenRD-Client and OpenRD-Ultimate
MAKEALL | 2 + board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 33 +++++++++++++++++--- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 4 ++- include/configs/{openrd_base.h => openrd.h} | 32 ++++++++++++++++--- 7 files changed, 61 insertions(+), 12 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (79%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (81%)

--- board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 2 +- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 2 +- include/configs/{openrd_base.h => openrd.h} | 4 ++-- 6 files changed, 5 insertions(+), 5 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (99%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (98%)
diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd/Makefile similarity index 98% rename from board/Marvell/openrd_base/Makefile rename to board/Marvell/openrd/Makefile index d6d0ed3..19020e4 100644 --- a/board/Marvell/openrd_base/Makefile +++ b/board/Marvell/openrd/Makefile @@ -31,7 +31,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).o
-COBJS := openrd_base.o +COBJS := openrd.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg similarity index 100% rename from board/Marvell/openrd_base/kwbimage.cfg rename to board/Marvell/openrd/kwbimage.cfg diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd/openrd.c similarity index 99% rename from board/Marvell/openrd_base/openrd_base.c rename to board/Marvell/openrd/openrd.c index 10109c1..e53fa16 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd/openrd.c @@ -31,7 +31,7 @@ #include <miiphy.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> -#include "openrd_base.h" +#include "openrd.h"
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd/openrd.h similarity index 100% rename from board/Marvell/openrd_base/openrd_base.h rename to board/Marvell/openrd/openrd.h diff --git a/boards.cfg b/boards.cfg index a45bd83..b0ad541 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_base.h b/include/configs/openrd.h similarity index 98% rename from include/configs/openrd_base.h rename to include/configs/openrd.h index cfdd09c..13dc34c 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd.h @@ -27,8 +27,8 @@ * MA 02110-1301 USA */
-#ifndef _CONFIG_OPENRD_BASE_H -#define _CONFIG_OPENRD_BASE_H +#ifndef _CONFIG_OPENRD_H +#define _CONFIG_OPENRD_H
/* * Version number information

--- MAKEALL | 2 ++ board/Marvell/openrd/openrd.c | 6 ++++++ boards.cfg | 2 ++ include/configs/openrd.h | 14 +++++++++++++- 4 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/MAKEALL b/MAKEALL index e1b928f..011cead 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,8 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index e53fa16..14ca88e 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -110,7 +110,13 @@ int board_init(void) /* * arch number of board */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/boards.cfg b/boards.cfg index b0ad541..7c38b1b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -97,6 +97,8 @@ suen3 arm arm926ejs km_arm keymile guruplug 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 +openrd_ultimate arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 13dc34c..7299749 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -33,7 +33,19 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif
/* * High Level Configuration Options (easy to change)

(rework of Julian Pidancet's patch) --- board/Marvell/openrd/openrd.c | 25 +++++++++++++++++++++---- include/configs/openrd.h | 14 ++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index 14ca88e..b2f7adb 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -154,6 +153,24 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); +#endif + +#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || \ + defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 7299749..8d86067 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -117,8 +117,18 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*

Le 13/04/2011 18:25, Clint Adams a écrit :
This moves the renames to the begining, removes the unsightly periods from the commit logs, puts "V1" in the Subject headers, breaks up the>80-character line, and hopefully addresses all complaints except for Detlev Zundel's.
If you can rework according to Detlev's suggestion before the end of the merge window, that would be perfect. If not, and unless Prafulla or Wolfgang objects, I will pull this in u-boot-arm, because it works and at last provides support for all of the Open-RD variants. PHY code convergence can come in later.
Amicalement,

On Wed, Apr 13, 2011 at 09:57:19PM +0200, Albert ARIBAUD wrote:
If you can rework according to Detlev's suggestion before the end of the merge window, that would be perfect. If not, and unless Prafulla or Wolfgang objects, I will pull this in u-boot-arm, because it works and at last provides support for all of the Open-RD variants. PHY code convergence can come in later.
Sorry for my ignorance here; how would I do that? Apply Andy Fleming's patchset and then rebase off of that?
I'd also like to enable CONFIG_SYS_MVFS for openrd; I notice that no boards are doing that now. Is this something to be avoided?
Thanks

Hi Clint,
Le 14/04/2011 02:11, Clint Adams a écrit :
On Wed, Apr 13, 2011 at 09:57:19PM +0200, Albert ARIBAUD wrote:
If you can rework according to Detlev's suggestion before the end of the merge window, that would be perfect. If not, and unless Prafulla or Wolfgang objects, I will pull this in u-boot-arm, because it works and at last provides support for all of the Open-RD variants. PHY code convergence can come in later.
Sorry for my ignorance here; how would I do that? Apply Andy Fleming's patchset and then rebase off of that?
Yes, and then modify your code to use the phy lib.
I'd also like to enable CONFIG_SYS_MVFS for openrd; I notice that no boards are doing that now. Is this something to be avoided?
I see no reason why I would not work.
Thanks
Amicalement,

v2: define CONFIG_SYS_MVFS
Clint Adams (4): Rename openrd_base files to openrd Add definitions for OpenRD-Client and OpenRD-Ultimate Initialize second PHY on OpenRD-Client and OpenRD-Ultimate Enable multiple fs options for Marvell SoC family on OpenRD boards
MAKEALL | 2 + board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 33 +++++++++++++++++--- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 4 ++- include/configs/{openrd_base.h => openrd.h} | 33 +++++++++++++++++--- 7 files changed, 62 insertions(+), 12 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (79%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (81%)

--- board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 2 +- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 2 +- include/configs/{openrd_base.h => openrd.h} | 4 ++-- 6 files changed, 5 insertions(+), 5 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (99%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (98%)
diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd/Makefile similarity index 98% rename from board/Marvell/openrd_base/Makefile rename to board/Marvell/openrd/Makefile index d6d0ed3..19020e4 100644 --- a/board/Marvell/openrd_base/Makefile +++ b/board/Marvell/openrd/Makefile @@ -31,7 +31,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).o
-COBJS := openrd_base.o +COBJS := openrd.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg similarity index 100% rename from board/Marvell/openrd_base/kwbimage.cfg rename to board/Marvell/openrd/kwbimage.cfg diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd/openrd.c similarity index 99% rename from board/Marvell/openrd_base/openrd_base.c rename to board/Marvell/openrd/openrd.c index 10109c1..e53fa16 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd/openrd.c @@ -31,7 +31,7 @@ #include <miiphy.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> -#include "openrd_base.h" +#include "openrd.h"
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd/openrd.h similarity index 100% rename from board/Marvell/openrd_base/openrd_base.h rename to board/Marvell/openrd/openrd.h diff --git a/boards.cfg b/boards.cfg index 554e06c..40a4476 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_base.h b/include/configs/openrd.h similarity index 98% rename from include/configs/openrd_base.h rename to include/configs/openrd.h index cfdd09c..13dc34c 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd.h @@ -27,8 +27,8 @@ * MA 02110-1301 USA */
-#ifndef _CONFIG_OPENRD_BASE_H -#define _CONFIG_OPENRD_BASE_H +#ifndef _CONFIG_OPENRD_H +#define _CONFIG_OPENRD_H
/* * Version number information

Dear Clint Adams,
In message 1303170450-4230-2-git-send-email-clint@debian.org you wrote:
board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 2 +- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 2 +- include/configs/{openrd_base.h => openrd.h} | 4 ++-- 6 files changed, 5 insertions(+), 5 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (99%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (98%)
Signed-off-by-line missing. NAK.
Best regards,
Wolfgang Denk

--- MAKEALL | 2 ++ board/Marvell/openrd/openrd.c | 6 ++++++ boards.cfg | 2 ++ include/configs/openrd.h | 14 +++++++++++++- 4 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/MAKEALL b/MAKEALL index 6acece7..9e7fd02 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,8 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index e53fa16..14ca88e 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -110,7 +110,13 @@ int board_init(void) /* * arch number of board */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/boards.cfg b/boards.cfg index 40a4476..ef38006 100644 --- a/boards.cfg +++ b/boards.cfg @@ -97,6 +97,8 @@ suen3 arm arm926ejs km_arm keymile guruplug 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 +openrd_ultimate arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 13dc34c..7299749 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -33,7 +33,19 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif
/* * High Level Configuration Options (easy to change)

Dear Clint Adams,
In message 1303170450-4230-3-git-send-email-clint@debian.org you wrote:
MAKEALL | 2 ++ board/Marvell/openrd/openrd.c | 6 ++++++ boards.cfg | 2 ++ include/configs/openrd.h | 14 +++++++++++++- 4 files changed, 23 insertions(+), 1 deletions(-)
Signed-off-by line missing. NAK.
Best regards,
Wolfgang Denk

Dear Clint Adams,
In message 1303170450-4230-3-git-send-email-clint@debian.org you wrote:
MAKEALL | 2 ++ board/Marvell/openrd/openrd.c | 6 ++++++ boards.cfg | 2 ++ include/configs/openrd.h | 14 +++++++++++++- 4 files changed, 23 insertions(+), 1 deletions(-)
Signed-off-by line missing, NAK.
Also, there is a lot of Coding Style issues (indentation not by TAB).
Please fix globally, and use checkpatch to verify result.
Best regards,
Wolfgang Denk

Changes for v4: - Various commit log and whitespace tweaks
Clint Adams (4): Rename openrd_base files to openrd Add definitions for OpenRD-Client and OpenRD-Ultimate Initialize second PHY on OpenRD-Client and OpenRD-Ultimate Enable multiple fs options for Marvell SoC family on OpenRD boards
MAKEALL | 2 + board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 33 +++++++++++++++++--- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 4 ++- include/configs/{openrd_base.h => openrd.h} | 33 +++++++++++++++++--- 7 files changed, 62 insertions(+), 12 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (80%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (81%)

Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com --- Changes for v4: - Added Signed-off-by: line to commit message --- board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 2 +- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 2 +- include/configs/{openrd_base.h => openrd.h} | 4 ++-- 6 files changed, 5 insertions(+), 5 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (99%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (98%)
diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd/Makefile similarity index 98% rename from board/Marvell/openrd_base/Makefile rename to board/Marvell/openrd/Makefile index d6d0ed3..19020e4 100644 --- a/board/Marvell/openrd_base/Makefile +++ b/board/Marvell/openrd/Makefile @@ -31,7 +31,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).o
-COBJS := openrd_base.o +COBJS := openrd.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg similarity index 100% rename from board/Marvell/openrd_base/kwbimage.cfg rename to board/Marvell/openrd/kwbimage.cfg diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd/openrd.c similarity index 99% rename from board/Marvell/openrd_base/openrd_base.c rename to board/Marvell/openrd/openrd.c index 10109c1..e53fa16 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd/openrd.c @@ -31,7 +31,7 @@ #include <miiphy.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> -#include "openrd_base.h" +#include "openrd.h"
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd/openrd.h similarity index 100% rename from board/Marvell/openrd_base/openrd_base.h rename to board/Marvell/openrd/openrd.h diff --git a/boards.cfg b/boards.cfg index d4cbb06..c07a6ba 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_base.h b/include/configs/openrd.h similarity index 98% rename from include/configs/openrd_base.h rename to include/configs/openrd.h index cfdd09c..13dc34c 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd.h @@ -27,8 +27,8 @@ * MA 02110-1301 USA */
-#ifndef _CONFIG_OPENRD_BASE_H -#define _CONFIG_OPENRD_BASE_H +#ifndef _CONFIG_OPENRD_H +#define _CONFIG_OPENRD_H
/* * Version number information

Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com --- Changes for v4: - Added Signed-off-by: line to commit message --- MAKEALL | 2 ++ board/Marvell/openrd/openrd.c | 6 ++++++ boards.cfg | 2 ++ include/configs/openrd.h | 14 +++++++++++++- 4 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/MAKEALL b/MAKEALL index 6acece7..9e7fd02 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,8 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index e53fa16..14ca88e 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -110,7 +110,13 @@ int board_init(void) /* * arch number of board */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/boards.cfg b/boards.cfg index c07a6ba..7b279ca 100644 --- a/boards.cfg +++ b/boards.cfg @@ -97,6 +97,8 @@ suen3 arm arm926ejs km_arm keymile guruplug 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 +openrd_ultimate arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 13dc34c..7299749 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -33,7 +33,19 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif
/* * High Level Configuration Options (easy to change)

Though the OpenRD-Base only has one gigabit Ethernet port, both the OpenRD-Client and OpenRD-Ultimate each have two.
On the Ultimate, the PHY addresses are consecutive, but on the Client they are not.
(based on 62a0952ce368acc725063a00a5ec680a639d6c27.1301040318.git.julian.pidancet@citrix.com ad0a2dc1e422698b005d6f0ceb6dd6f75a87e00a.1301040318.git.julian.pidancet@citrix.com )
Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com -- Changes for v3: - lengthened commit message Changes for v4: - Added Signed-off-by: line to commit message - Changed whitespace to TABs --- board/Marvell/openrd/openrd.c | 25 +++++++++++++++++++++---- include/configs/openrd.h | 14 ++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index 14ca88e..87939de 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -154,6 +153,24 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); +#endif + +#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || \ + defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 7299749..8d86067 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -117,8 +117,18 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*

Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com --- Changes for v4: - Added Signed-off-by: line to commit message --- include/configs/openrd.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 8d86067..3256cb3 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -60,6 +60,7 @@ * Commands configuration */ #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#define CONFIG_SYS_MVFS #include <config_cmd_default.h> #define CONFIG_CMD_AUTOSCRIPT #define CONFIG_CMD_DHCP

-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Tuesday, April 26, 2011 6:47 AM To: u-boot@lists.denx.de Cc: Albert ARIBAUD; Prafulla Wadaskar; Wolfgang Denk; Clint Adams Subject: [PATCH v4 0/4] OpenRD-Client and OpenRD-Ultimate support
Changes for v4:
- Various commit log and whitespace tweaks
Clint Adams (4): Rename openrd_base files to openrd Add definitions for OpenRD-Client and OpenRD-Ultimate Initialize second PHY on OpenRD-Client and OpenRD-Ultimate Enable multiple fs options for Marvell SoC family on OpenRD boards
MAKEALL | 2 + board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 33 +++++++++++++++++--- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 4 ++- include/configs/{openrd_base.h => openrd.h} | 33 +++++++++++++++++--- 7 files changed, 62 insertions(+), 12 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (80%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (81%)
Hi Clint
I have rebased u-boot-marvell.git master branch I am unable to apply this patch series cleanly to this rebased branch.
Kindly please provide the new patch series for the same.
Regards.. Prafulla . .

Changes for v5: - rebase against current u-boot-marvell.git/master
Clint Adams (4): Rename openrd_base files to openrd Add definitions for OpenRD-Client and OpenRD-Ultimate Initialize second PHY on OpenRD-Client and OpenRD-Ultimate Enable multiple fs options for Marvell SoC family on OpenRD boards
MAKEALL | 2 + board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 33 +++++++++++++++++--- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 4 ++- include/configs/{openrd_base.h => openrd.h} | 33 +++++++++++++++++--- 7 files changed, 62 insertions(+), 12 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (80%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (81%)

Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com --- board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 2 +- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 2 +- include/configs/{openrd_base.h => openrd.h} | 4 ++-- 6 files changed, 5 insertions(+), 5 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (99%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (98%)
diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd/Makefile similarity index 98% rename from board/Marvell/openrd_base/Makefile rename to board/Marvell/openrd/Makefile index d6d0ed3..19020e4 100644 --- a/board/Marvell/openrd_base/Makefile +++ b/board/Marvell/openrd/Makefile @@ -31,7 +31,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).o
-COBJS := openrd_base.o +COBJS := openrd.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg similarity index 100% rename from board/Marvell/openrd_base/kwbimage.cfg rename to board/Marvell/openrd/kwbimage.cfg diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd/openrd.c similarity index 99% rename from board/Marvell/openrd_base/openrd_base.c rename to board/Marvell/openrd/openrd.c index 10109c1..e53fa16 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd/openrd.c @@ -31,7 +31,7 @@ #include <miiphy.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> -#include "openrd_base.h" +#include "openrd.h"
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd/openrd.h similarity index 100% rename from board/Marvell/openrd_base/openrd_base.h rename to board/Marvell/openrd/openrd.h diff --git a/boards.cfg b/boards.cfg index 8b44006..4452de7 100644 --- a/boards.cfg +++ b/boards.cfg @@ -106,7 +106,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_base.h b/include/configs/openrd.h similarity index 98% rename from include/configs/openrd_base.h rename to include/configs/openrd.h index cfdd09c..13dc34c 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd.h @@ -27,8 +27,8 @@ * MA 02110-1301 USA */
-#ifndef _CONFIG_OPENRD_BASE_H -#define _CONFIG_OPENRD_BASE_H +#ifndef _CONFIG_OPENRD_H +#define _CONFIG_OPENRD_H
/* * Version number information

Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com --- MAKEALL | 2 ++ board/Marvell/openrd/openrd.c | 6 ++++++ boards.cfg | 2 ++ include/configs/openrd.h | 14 +++++++++++++- 4 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/MAKEALL b/MAKEALL index c3df657..d592374 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,8 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index e53fa16..14ca88e 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -110,7 +110,13 @@ int board_init(void) /* * arch number of board */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/boards.cfg b/boards.cfg index 4452de7..fd8ae8f 100644 --- a/boards.cfg +++ b/boards.cfg @@ -107,6 +107,8 @@ suen3 arm arm926ejs km_arm keymile guruplug 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 +openrd_ultimate arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 13dc34c..7299749 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -33,7 +33,19 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif
/* * High Level Configuration Options (easy to change)

Though the OpenRD-Base only has one gigabit Ethernet port, both the OpenRD-Client and OpenRD-Ultimate each have two.
On the Ultimate, the PHY addresses are consecutive, but on the Client they are not.
(based on 62a0952ce368acc725063a00a5ec680a639d6c27.1301040318.git.julian.pidancet@citrix.com ad0a2dc1e422698b005d6f0ceb6dd6f75a87e00a.1301040318.git.julian.pidancet@citrix.com )
Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com -- Changes for v3: - lengthened commit message Changes for v4: - Added Signed-off-by: line to commit message - Changed whitespace to TABs --- board/Marvell/openrd/openrd.c | 25 +++++++++++++++++++++---- include/configs/openrd.h | 14 ++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index 14ca88e..87939de 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -154,6 +153,24 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); +#endif + +#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || \ + defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 7299749..8d86067 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -117,8 +117,18 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*

Signed-off-by: Clint Adams clint@debian.org Cc: Albert ARIBAUD albert.u.boot@aribaud.net Cc: Prafulla Wadaskar prafulla@marvell.com Cc: Julian Pidancet julian.pidancet@citrix.com --- include/configs/openrd.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 8d86067..3256cb3 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -60,6 +60,7 @@ * Commands configuration */ #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#define CONFIG_SYS_MVFS #include <config_cmd_default.h> #define CONFIG_CMD_AUTOSCRIPT #define CONFIG_CMD_DHCP

-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Tuesday, May 03, 2011 8:31 PM To: u-boot@lists.denx.de Cc: Albert ARIBAUD; Prafulla Wadaskar; Wolfgang Denk; Ashish Karkare; Prabhanjan Sarnaik; Clint Adams Subject: [PATCH v5 0/4] OpenRD-Client and OpenRD-Ultimate support
Changes for v5:
- rebase against current u-boot-marvell.git/master
Clint Adams (4): Rename openrd_base files to openrd Add definitions for OpenRD-Client and OpenRD-Ultimate Initialize second PHY on OpenRD-Client and OpenRD-Ultimate Enable multiple fs options for Marvell SoC family on OpenRD boards
MAKEALL | 2 + board/Marvell/{openrd_base => openrd}/Makefile | 2 +- board/Marvell/{openrd_base => openrd}/kwbimage.cfg | 0 .../{openrd_base/openrd_base.c => openrd/openrd.c} | 33 +++++++++++++++++--- .../{openrd_base/openrd_base.h => openrd/openrd.h} | 0 boards.cfg | 4 ++- include/configs/{openrd_base.h => openrd.h} | 33 +++++++++++++++++--- 7 files changed, 62 insertions(+), 12 deletions(-) rename board/Marvell/{openrd_base => openrd}/Makefile (98%) rename board/Marvell/{openrd_base => openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c => openrd/openrd.c} (80%) rename board/Marvell/{openrd_base/openrd_base.h => openrd/openrd.h} (100%) rename include/configs/{openrd_base.h => openrd.h} (81%)
Applied this patch series to u-boot-marvell.git/master branch
Regards.. Prafulla . .

On Tue, Apr 26, 2011 at 12:12:36AM +0200, Wolfgang Denk wrote:
Please fix globally, and use checkpatch to verify result.
Thanks, that appears to be this: http://kernel.org/pub/linux/kernel/people/apw/checkpatch/

(rework of Julian Pidancet's patch) --- board/Marvell/openrd/openrd.c | 25 +++++++++++++++++++++---- include/configs/openrd.h | 14 ++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index 14ca88e..b2f7adb 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -154,6 +153,24 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); +#endif + +#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || \ + defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 7299749..8d86067 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -117,8 +117,18 @@ * Ethernet Driver configuration */ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*

-----Original Message----- From: Clint Adams [mailto:clint@debian.org] Sent: Tuesday, April 19, 2011 5:17 AM To: u-boot@lists.denx.de Cc: Albert ARIBAUD; Prafulla Wadaskar; julian.pidancet@citrix.com; Wolfgang Denk; Clint Adams Subject: [PATCH v2 3/4] Initialize second PHY on OpenRD-Client and OpenRD-Ultimate
(rework of Julian Pidancet's patch)
Hi Clint
Some meaning full description about this patch is useful to understand objective of this patch. It is very difficult to know which patch you are referring here. At least pointers are expected.
You must have captured change log history here. That is equally important too. Please refer "Sending updated patch versions" @ http://denx.de/wiki/U-Boot/Patches
Regards.. Prafulla . .
board/Marvell/openrd/openrd.c | 25 +++++++++++++++++++++---- include/configs/openrd.h | 14 ++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index 14ca88e..b2f7adb 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -124,12 +124,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr;
char *name = "egiga0";
if (miiphy_set_current_dev(name)) return;
@@ -154,6 +153,24 @@ void reset_phy(void) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name);
- printf(PHY_NO" Initialized on %s\n", name);
+}
+void reset_phy(void) +{
mv_phy_init("egiga0");
+#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
/* Kirkwood ethernet driver is written with the assumption that
in case
* of multiple PHYs, their addresses are consecutive. But
unfortunately
* in case of OpenRD-Client, PHY addresses are not
consecutive.*/
miiphy_write("egiga1", 0xEE, 0xEE, 24);
+#endif
+#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || \
- defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE)
/* configure and initialize both PHY's */
mv_phy_init("egiga1");
+#endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 7299749..8d86067 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -117,8 +117,18 @@
- Ethernet Driver configuration
*/ #ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -#define CONFIG_PHY_BASE_ADR 0x8 +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif #endif /* CONFIG_CMD_NET */
/*
1.7.4.1

Dear Clint Adams,
In message 1303170450-4230-4-git-send-email-clint@debian.org you wrote:
(rework of Julian Pidancet's patch)
board/Marvell/openrd/openrd.c | 25 +++++++++++++++++++++---- include/configs/openrd.h | 14 ++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-)
This is actually the patch with the Coding Style issues. And it has no Signed-off-by: line either.
NAK.
Best regards,
Wolfgang Denk

--- include/configs/openrd.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/openrd.h b/include/configs/openrd.h index 8d86067..3256cb3 100644 --- a/include/configs/openrd.h +++ b/include/configs/openrd.h @@ -60,6 +60,7 @@ * Commands configuration */ #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#define CONFIG_SYS_MVFS #include <config_cmd_default.h> #define CONFIG_CMD_AUTOSCRIPT #define CONFIG_CMD_DHCP

Dear Clint Adams,
In message 1303170450-4230-5-git-send-email-clint@debian.org you wrote:
include/configs/openrd.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Signed-off-by: line missing.
Best regards,
Wolfgang Denk

On Wed, Apr 13, 2011 at 09:57:19PM +0200, Albert ARIBAUD wrote:
If you can rework according to Detlev's suggestion before the end of the merge window, that would be perfect. If not, and unless Prafulla or Wolfgang objects, I will pull this in u-boot-arm, because it works and at last provides support for all of the Open-RD variants. PHY code convergence can come in later.
Hi Albert,
It is now looking exceedingly unlikely that I will have enough free time this month to figure the PHY business out, so I am sending v2 of the patchset and hoping that convergence does indeed come later.
Thanks

Le 12/04/2011 20:44, Clint Adams a écrit :
MAKEALL | 2 ++ board/Marvell/openrd_base/openrd_base.c | 6 ++++++ boards.cfg | 4 +++- include/configs/openrd_base.h | 14 +++++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-)
Is this yet another version of the patch set ? Please repost with "Vn" in the subject where n is the version number, and provide history of the versions.
P.S. Seems like my direct e-mails to you are bouncing because your mail server is trying some "sender verification callout" and failing.
Amicalement,

On Tue, Apr 12, 2011 at 11:38:13AM -0700, Julian Pidancet wrote:
This part only initialize second PHY for the OpenRD-Client board and not the OpenRD-Ultimate. I would do something like:
#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) #if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) miiphy_write("egiga1", 0xEE, 0xEE, 24); #endif mv_phy_init("egiga1"); #endif
Or similar.
Revised patchset on its way.

--- board/Marvell/openrd/Makefile | 56 ++++++++++ board/Marvell/openrd/kwbimage.cfg | 168 ++++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.c | 173 +++++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.h | 46 ++++++++ board/Marvell/openrd_base/Makefile | 56 ---------- board/Marvell/openrd_base/kwbimage.cfg | 168 ------------------------------ board/Marvell/openrd_base/openrd_base.c | 173 ------------------------------- board/Marvell/openrd_base/openrd_base.h | 46 -------- boards.cfg | 6 +- include/configs/openrd.h | 142 +++++++++++++++++++++++++ include/configs/openrd_base.h | 142 ------------------------- 11 files changed, 588 insertions(+), 588 deletions(-) create mode 100644 board/Marvell/openrd/Makefile create mode 100644 board/Marvell/openrd/kwbimage.cfg create mode 100644 board/Marvell/openrd/openrd.c create mode 100644 board/Marvell/openrd/openrd.h delete mode 100644 board/Marvell/openrd_base/Makefile delete mode 100644 board/Marvell/openrd_base/kwbimage.cfg delete mode 100644 board/Marvell/openrd_base/openrd_base.c delete mode 100644 board/Marvell/openrd_base/openrd_base.h create mode 100644 include/configs/openrd.h delete mode 100644 include/configs/openrd_base.h
diff --git a/board/Marvell/openrd/Makefile b/board/Marvell/openrd/Makefile new file mode 100644 index 0000000..19020e4 --- /dev/null +++ b/board/Marvell/openrd/Makefile @@ -0,0 +1,56 @@ +# +# (C) Copyright 2009 +# Net Insight <www.netinsight.net> +# Written-by: Simon Kagstrom simon.kagstrom@netinsight.net +# +# Based on sheevaplug: +# (C) Copyright 2009 +# Marvell Semiconductor <www.marvell.com> +# Written-by: Prafulla Wadaskar prafulla@marvell.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := openrd.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/Marvell/openrd/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg new file mode 100644 index 0000000..757eb28 --- /dev/null +++ b/board/Marvell/openrd/kwbimage.cfg @@ -0,0 +1,168 @@ +# +# (C) Copyright 2009 +# Marvell Semiconductor <www.marvell.com> +# Written-by: Prafulla Wadaskar prafulla@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM nand +NAND_ECC_MODE default +NAND_PAGE_SIZE 0x0800 + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b1b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 00, Cs0width=x8 +# bit3-2: 11, Cs0size=1Gb +# bit5-4: 00, Cs1width=x8 +# bit7-6: 11, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000042 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 1, DDR drive strength reduced +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB) + +DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 + +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00120012 # DDR ODT Control (Low) +# bit3-0: 0010, (read) M_ODT[0] is asserted during read from DRAM CS1 +# bit7-4: 0001, (read) M_ODT[1] is asserted during read from DRAM CS0 +# bit19-16: 0010, (write) M_ODT[0] is asserted during write to DRAM CS1. +# bit23-20: 0001, (write) M_ODT[1] is asserted during write to DRAM CS0. +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) + +DATA 0xFFD0149C 0x0000E40f # CPU ODT Control +# bit3-0: 1111, internal ODT is asserted during read from DRAM bank 0-3 +# bit11-10: 01, M_DQ, M_DM, and M_DQS I/O buffer ODT Select: 150 ohm +# bit13-12: 10, M_STARTBURST_IN I/O buffer ODT Select: 75 ohm +# bit14: 1, M_STARTBURST_IN ODT: Enabled +# bit15: 1, DDR IO ODT Unit: Use ODT block +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c new file mode 100644 index 0000000..622fb50 --- /dev/null +++ b/board/Marvell/openrd/openrd.c @@ -0,0 +1,173 @@ +/* + * (C) Copyright 2009 + * Net Insight <www.netinsight.net> + * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net + * + * Based on sheevaplug.c: + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar prafulla@marvell.com + * + * 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 + */ + +#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "openrd.h" + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers + * the below configuration configures mainly initial LED status + */ + kw_config_gpio(OPENRD_OE_VAL_LOW, + OPENRD_OE_VAL_HIGH, + OPENRD_OE_LOW, OPENRD_OE_HIGH); + + /* 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, + MPP6_SYSRST_OUTn, + MPP7_GPO, + MPP8_TW_SDA, + MPP9_TW_SCK, + MPP10_UART0_TXD, + MPP11_UART0_RXD, + MPP12_SD_CLK, + MPP13_SD_CMD, /* Alt UART1_TXD */ + MPP14_SD_D0, /* Alt UART1_RXD */ + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_GE1_0, + MPP21_GE1_1, + MPP22_GE1_2, + MPP23_GE1_3, + MPP24_GE1_4, + MPP25_GE1_5, + MPP26_GE1_6, + MPP27_GE1_7, + MPP28_GPIO, + MPP29_TSMP9, + MPP30_GE1_10, + MPP31_GE1_11, + MPP32_GE1_12, + MPP33_GE1_13, + MPP34_GPIO, /* UART1 / SD sel */ + MPP35_TDM_CH0_TX_QL, + MPP36_TDM_SPI_CS1, + MPP37_TDM_CH2_TX_QL, + MPP38_TDM_CH2_RX_QL, + MPP39_AUDIO_I2SBCLK, + MPP40_AUDIO_I2SDO, + MPP41_AUDIO_I2SLRC, + MPP42_AUDIO_I2SMCLK, + MPP43_AUDIO_I2SDI, + MPP44_AUDIO_EXTCLK, + MPP45_TDM_PCLK, + MPP46_TDM_FS, + MPP47_TDM_DRX, + MPP48_TDM_DTX, + MPP49_TDM_CH0_RX_QL, + 0 + }; + + kirkwood_mpp_conf(kwmpp_config); + return 0; +} + +int board_init(void) +{ + /* + * arch number of board + */ +#if defined(CONFIG_BOARD_IS_OPENRD_BASE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; +#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; +#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; +#endif + + /* adress of boot parameters */ + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; + return 0; +} + +#ifdef CONFIG_RESET_PHY_R +/* Configure and enable MV88E1116/88E1121 PHY */ +void mv_phy_init(char *name) +{ + u16 reg; + u16 devadr; + + if (miiphy_set_current_dev(name)) + return; + + /* command to read PHY dev address */ + if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { + printf("Err..%s could not read PHY dev address\n", + __FUNCTION__); + return; + } + + /* + * Enable RGMII delay on Tx and Rx for CPU port + * Ref: sec 4.7.2 of chip datasheet + */ + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); + miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, ®); + reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); + miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg); + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); + + /* reset the phy */ + miiphy_reset(name, devadr); + + printf(PHY_NO" Initialized on %s\n", name); +} + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); + + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif +} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/openrd/openrd.h b/board/Marvell/openrd/openrd.h new file mode 100644 index 0000000..f3daf17 --- /dev/null +++ b/board/Marvell/openrd/openrd.h @@ -0,0 +1,46 @@ +/* + * (C) Copyright 2009 + * Net Insight <www.netinsight.net> + * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net + * + * Based on sheevaplug.h: + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar prafulla@marvell.com + * + * 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 __OPENRD_BASE_H +#define __OPENRD_BASE_H + +#define OPENRD_OE_LOW (~(1<<28)) /* RS232 / RS485 */ +#define OPENRD_OE_HIGH (~(1<<2)) /* SD / UART1 */ +#define OPENRD_OE_VAL_LOW (0) /* Sel RS232 */ +#define OPENRD_OE_VAL_HIGH (1 << 2) /* Sel SD */ + +/* 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 /* __OPENRD_BASE_H */ diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd_base/Makefile deleted file mode 100644 index d6d0ed3..0000000 --- a/board/Marvell/openrd_base/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -# -# (C) Copyright 2009 -# Net Insight <www.netinsight.net> -# Written-by: Simon Kagstrom simon.kagstrom@netinsight.net -# -# Based on sheevaplug: -# (C) Copyright 2009 -# Marvell Semiconductor <www.marvell.com> -# Written-by: Prafulla Wadaskar prafulla@marvell.com -# -# 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 -# - -include $(TOPDIR)/config.mk - -LIB = $(obj)lib$(BOARD).o - -COBJS := openrd_base.o - -SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(COBJS)) -SOBJS := $(addprefix $(obj),$(SOBJS)) - -$(LIB): $(obj).depend $(OBJS) $(SOBJS) - $(call cmd_link_o_target, $(OBJS) $(SOBJS)) - -clean: - rm -f $(SOBJS) $(OBJS) - -distclean: clean - rm -f $(LIB) core *.bak .depend - -######################################################################### - -# defines $(obj).depend target -include $(SRCTREE)/rules.mk - -sinclude $(obj).depend - -######################################################################### diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd_base/kwbimage.cfg deleted file mode 100644 index 757eb28..0000000 --- a/board/Marvell/openrd_base/kwbimage.cfg +++ /dev/null @@ -1,168 +0,0 @@ -# -# (C) Copyright 2009 -# Marvell Semiconductor <www.marvell.com> -# Written-by: Prafulla Wadaskar prafulla@marvell.com -# -# 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 -# -# Refer docs/README.kwimage for more details about how-to configure -# and create kirkwood boot image -# - -# Boot Media configurations -BOOT_FROM nand -NAND_ECC_MODE default -NAND_PAGE_SIZE 0x0800 - -# SOC registers configuration using bootrom header extension -# Maximum KWBIMAGE_MAX_CONFIG configurations allowed - -# Configure RGMII-0 interface pad voltage to 1.8V -DATA 0xFFD100e0 0x1b1b1b9b - -#Dram initalization for SINGLE x16 CL=5 @ 400MHz -DATA 0xFFD01400 0x43000c30 # DDR Configuration register -# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) -# bit23-14: zero -# bit24: 1= enable exit self refresh mode on DDR access -# bit25: 1 required -# bit29-26: zero -# bit31-30: 01 - -DATA 0xFFD01404 0x37543000 # DDR Controller Control Low -# bit 4: 0=addr/cmd in smame cycle -# bit 5: 0=clk is driven during self refresh, we don't care for APX -# bit 6: 0=use recommended falling edge of clk for addr/cmd -# bit14: 0=input buffer always powered up -# bit18: 1=cpu lock transaction enabled -# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 -# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM -# bit30-28: 3 required -# bit31: 0=no additional STARTBURST delay - -DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) -# bit3-0: TRAS lsbs -# bit7-4: TRCD -# bit11- 8: TRP -# bit15-12: TWR -# bit19-16: TWTR -# bit20: TRAS msb -# bit23-21: 0x0 -# bit27-24: TRRD -# bit31-28: TRTP - -DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) -# bit6-0: TRFC -# bit8-7: TR2R -# bit10-9: TR2W -# bit12-11: TW2W -# bit31-13: zero required - -DATA 0xFFD01410 0x000000cc # DDR Address Control -# bit1-0: 00, Cs0width=x8 -# bit3-2: 11, Cs0size=1Gb -# bit5-4: 00, Cs1width=x8 -# bit7-6: 11, Cs1size=1Gb -# bit9-8: 00, Cs2width=nonexistent -# bit11-10: 00, Cs2size =nonexistent -# bit13-12: 00, Cs3width=nonexistent -# bit15-14: 00, Cs3size =nonexistent -# bit16: 0, Cs0AddrSel -# bit17: 0, Cs1AddrSel -# bit18: 0, Cs2AddrSel -# bit19: 0, Cs3AddrSel -# bit31-20: 0 required - -DATA 0xFFD01414 0x00000000 # DDR Open Pages Control -# bit0: 0, OpenPage enabled -# bit31-1: 0 required - -DATA 0xFFD01418 0x00000000 # DDR Operation -# bit3-0: 0x0, DDR cmd -# bit31-4: 0 required - -DATA 0xFFD0141C 0x00000C52 # DDR Mode -# bit2-0: 2, BurstLen=2 required -# bit3: 0, BurstType=0 required -# bit6-4: 4, CL=5 -# bit7: 0, TestMode=0 normal -# bit8: 0, DLL reset=0 normal -# bit11-9: 6, auto-precharge write recovery ???????????? -# bit12: 0, PD must be zero -# bit31-13: 0 required - -DATA 0xFFD01420 0x00000042 # DDR Extended Mode -# bit0: 0, DDR DLL enabled -# bit1: 1, DDR drive strength reduced -# bit2: 0, DDR ODT control lsd (disabled) -# bit5-3: 000, required -# bit6: 1, DDR ODT control msb, (disabled) -# bit9-7: 000, required -# bit10: 0, differential DQS enabled -# bit11: 0, required -# bit12: 0, DDR output buffer enabled -# bit31-13: 0 required - -DATA 0xFFD01424 0x0000F17F # DDR Controller Control High -# bit2-0: 111, required -# bit3 : 1 , MBUS Burst Chop disabled -# bit6-4: 111, required -# bit7 : 0 -# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz -# bit9 : 0 , no half clock cycle addition to dataout -# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals -# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh -# bit15-12: 1111 required -# bit31-16: 0 required - -DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) -DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) - -DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 -DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size -# bit0: 1, Window enabled -# bit1: 0, Write Protect disabled -# bit3-2: 00, CS0 hit selected -# bit23-4: ones, required -# bit31-24: 0x0F, Size (i.e. 256MB) - -DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb -DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 - -DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled -DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled - -DATA 0xFFD01494 0x00120012 # DDR ODT Control (Low) -# bit3-0: 0010, (read) M_ODT[0] is asserted during read from DRAM CS1 -# bit7-4: 0001, (read) M_ODT[1] is asserted during read from DRAM CS0 -# bit19-16: 0010, (write) M_ODT[0] is asserted during write to DRAM CS1. -# bit23-20: 0001, (write) M_ODT[1] is asserted during write to DRAM CS0. -DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) - -DATA 0xFFD0149C 0x0000E40f # CPU ODT Control -# bit3-0: 1111, internal ODT is asserted during read from DRAM bank 0-3 -# bit11-10: 01, M_DQ, M_DM, and M_DQS I/O buffer ODT Select: 150 ohm -# bit13-12: 10, M_STARTBURST_IN I/O buffer ODT Select: 75 ohm -# bit14: 1, M_STARTBURST_IN ODT: Enabled -# bit15: 1, DDR IO ODT Unit: Use ODT block -DATA 0xFFD01480 0x00000001 # DDR Initialization Control -#bit0=1, enable DDR init upon this register write - -# End of Header extension -DATA 0x0 0x0 diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c deleted file mode 100644 index c71d1ef..0000000 --- a/board/Marvell/openrd_base/openrd_base.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * (C) Copyright 2009 - * Net Insight <www.netinsight.net> - * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net - * - * Based on sheevaplug.c: - * (C) Copyright 2009 - * Marvell Semiconductor <www.marvell.com> - * Written-by: Prafulla Wadaskar prafulla@marvell.com - * - * 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 - */ - -#include <common.h> -#include <miiphy.h> -#include <asm/arch/kirkwood.h> -#include <asm/arch/mpp.h> -#include "openrd_base.h" - -DECLARE_GLOBAL_DATA_PTR; - -int board_early_init_f(void) -{ - /* - * default gpio configuration - * There are maximum 64 gpios controlled through 2 sets of registers - * the below configuration configures mainly initial LED status - */ - kw_config_gpio(OPENRD_OE_VAL_LOW, - OPENRD_OE_VAL_HIGH, - OPENRD_OE_LOW, OPENRD_OE_HIGH); - - /* 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, - MPP6_SYSRST_OUTn, - MPP7_GPO, - MPP8_TW_SDA, - MPP9_TW_SCK, - MPP10_UART0_TXD, - MPP11_UART0_RXD, - MPP12_SD_CLK, - MPP13_SD_CMD, /* Alt UART1_TXD */ - MPP14_SD_D0, /* Alt UART1_RXD */ - MPP15_SD_D1, - MPP16_SD_D2, - MPP17_SD_D3, - MPP18_NF_IO0, - MPP19_NF_IO1, - MPP20_GE1_0, - MPP21_GE1_1, - MPP22_GE1_2, - MPP23_GE1_3, - MPP24_GE1_4, - MPP25_GE1_5, - MPP26_GE1_6, - MPP27_GE1_7, - MPP28_GPIO, - MPP29_TSMP9, - MPP30_GE1_10, - MPP31_GE1_11, - MPP32_GE1_12, - MPP33_GE1_13, - MPP34_GPIO, /* UART1 / SD sel */ - MPP35_TDM_CH0_TX_QL, - MPP36_TDM_SPI_CS1, - MPP37_TDM_CH2_TX_QL, - MPP38_TDM_CH2_RX_QL, - MPP39_AUDIO_I2SBCLK, - MPP40_AUDIO_I2SDO, - MPP41_AUDIO_I2SLRC, - MPP42_AUDIO_I2SMCLK, - MPP43_AUDIO_I2SDI, - MPP44_AUDIO_EXTCLK, - MPP45_TDM_PCLK, - MPP46_TDM_FS, - MPP47_TDM_DRX, - MPP48_TDM_DTX, - MPP49_TDM_CH0_RX_QL, - 0 - }; - - kirkwood_mpp_conf(kwmpp_config); - return 0; -} - -int board_init(void) -{ - /* - * arch number of board - */ -#if defined(CONFIG_BOARD_IS_OPENRD_BASE) - gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE; -#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT) - gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT; -#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE) - gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE; -#endif - - /* adress of boot parameters */ - gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; - return 0; -} - -#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116/88E1121 PHY */ -void mv_phy_init(char *name) -{ - u16 reg; - u16 devadr; - - if (miiphy_set_current_dev(name)) - return; - - /* command to read PHY dev address */ - if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { - printf("Err..%s could not read PHY dev address\n", - __FUNCTION__); - return; - } - - /* - * Enable RGMII delay on Tx and Rx for CPU port - * Ref: sec 4.7.2 of chip datasheet - */ - miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); - miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, ®); - reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); - miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg); - miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); - - /* reset the phy */ - miiphy_reset(name, devadr); - - printf(PHY_NO" Initialized on %s\n", name); -} - -void reset_phy(void) -{ - mv_phy_init("egiga0"); - -#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT - /* Kirkwood ethernet driver is written with the assumption that in case - * of multiple PHYs, their addresses are consecutive. But unfortunately - * in case of OpenRD-Client, PHY addresses are not consecutive.*/ - miiphy_write("egiga1", 0xEE, 0xEE, 24); - - /* configure and initialize both PHY's */ - mv_phy_init("egiga1"); -#endif -} -#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd_base/openrd_base.h deleted file mode 100644 index f3daf17..0000000 --- a/board/Marvell/openrd_base/openrd_base.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright 2009 - * Net Insight <www.netinsight.net> - * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net - * - * Based on sheevaplug.h: - * (C) Copyright 2009 - * Marvell Semiconductor <www.marvell.com> - * Written-by: Prafulla Wadaskar prafulla@marvell.com - * - * 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 __OPENRD_BASE_H -#define __OPENRD_BASE_H - -#define OPENRD_OE_LOW (~(1<<28)) /* RS232 / RS485 */ -#define OPENRD_OE_HIGH (~(1<<2)) /* SD / UART1 */ -#define OPENRD_OE_VAL_LOW (0) /* Sel RS232 */ -#define OPENRD_OE_VAL_HIGH (1 << 2) /* Sel SD */ - -/* 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 /* __OPENRD_BASE_H */ diff --git a/boards.cfg b/boards.cfg index ee5d5f4..7c38b1b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,9 +96,9 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood -openrd_base arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_BASE -openrd_client arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_CLIENT -openrd_ultimate arm arm926ejs openrd_base Marvell kirkwood openrd_base:BOARD_IS_OPENRD_ULTIMATE +openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE +openrd_client arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_CLIENT +openrd_ultimate arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_ULTIMATE rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd.h b/include/configs/openrd.h new file mode 100644 index 0000000..8d86067 --- /dev/null +++ b/include/configs/openrd.h @@ -0,0 +1,142 @@ +/* + * (C) Copyright 2009 + * Net Insight <www.netinsight.net> + * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net + * + * Based on sheevaplug.h: + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar prafulla@marvell.com + * + * 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 _CONFIG_OPENRD_H +#define _CONFIG_OPENRD_H + +/* + * Version number information + */ +#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" +#else +# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT +# define CONFIG_IDENT_STRING "\nOpenRD-Client" +# else +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_IDENT_STRING "\nOpenRD-Base" +# else +# error Unknown OpenRD board specified +# endif +# endif +#endif + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_OPENRD_BASE /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_AUTOSCRIPT +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_MII +#define CONFIG_CMD_NAND +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND +#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x20000 /* 128k */ +#define CONFIG_ENV_ADDR 0x60000 +#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "${x_bootcmd_usb}; bootm 0x6400000;" + +#define MTDIDS_DEFAULT "nand0=nand_mtd" +#define MTDPARTS_DEFAULT "mtdparts=nand_mtd:0x100000@0x000000(uboot),"\ + "0x400000@0x100000(uImage),"\ + "0x1fb00000@0x500000(rootfs)" + +#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \ + "=ttyS0,115200 "MTDPARTS_DEFAULT " rw ubi.mtd=2,2048\0" \ + "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootargs_root=root=ubi0:rootfs rootfstype=ubifs\0" \ + "mtdids="MTDIDS_DEFAULT"\0" \ + "mtdparts="MTDPARTS_DEFAULT"\0" + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +# ifdef CONFIG_BOARD_IS_OPENRD_BASE +# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +# else +# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +# endif +# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE +# define CONFIG_PHY_BASE_ADR 0x0 +# define PHY_NO "88E1121" +# else +# define CONFIG_PHY_BASE_ADR 0x8 +# define PHY_NO "88E1116" +# endif +#endif /* CONFIG_CMD_NET */ + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +#endif /* _CONFIG_OPENRD_BASE_H */ diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h deleted file mode 100644 index aa13908..0000000 --- a/include/configs/openrd_base.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * (C) Copyright 2009 - * Net Insight <www.netinsight.net> - * Written-by: Simon Kagstrom simon.kagstrom@netinsight.net - * - * Based on sheevaplug.h: - * (C) Copyright 2009 - * Marvell Semiconductor <www.marvell.com> - * Written-by: Prafulla Wadaskar prafulla@marvell.com - * - * 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 _CONFIG_OPENRD_BASE_H -#define _CONFIG_OPENRD_BASE_H - -/* - * Version number information - */ -#ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE -# define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" -#else -# ifdef CONFIG_BOARD_IS_OPENRD_CLIENT -# define CONFIG_IDENT_STRING "\nOpenRD-Client" -# else -# ifdef CONFIG_BOARD_IS_OPENRD_BASE -# define CONFIG_IDENT_STRING "\nOpenRD-Base" -# else -# error Unknown OpenRD board specified -# endif -# endif -#endif - -/* - * High Level Configuration Options (easy to change) - */ -#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ -#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ -#define CONFIG_KW88F6281 1 /* SOC Name */ -#define CONFIG_MACH_OPENRD_BASE /* Machine type */ -#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ - -/* - * Commands configuration - */ -#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ -#include <config_cmd_default.h> -#define CONFIG_CMD_AUTOSCRIPT -#define CONFIG_CMD_DHCP -#define CONFIG_CMD_ENV -#define CONFIG_CMD_MII -#define CONFIG_CMD_NAND -#define CONFIG_CMD_PING -#define CONFIG_CMD_USB -#define CONFIG_CMD_IDE - -/* - * mv-common.h should be defined after CMD configs since it used them - * to enable certain macros - */ -#include "mv-common.h" - -/* - * Environment variables configurations - */ -#ifdef CONFIG_CMD_NAND -#define CONFIG_ENV_IS_IN_NAND 1 -#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -#else -#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ -#endif -/* - * max 4k env size is enough, but in case of nand - * it has to be rounded to sector size - */ -#define CONFIG_ENV_SIZE 0x20000 /* 128k */ -#define CONFIG_ENV_ADDR 0x60000 -#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ - -/* - * Default environment variables - */ -#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \ - "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ - "${x_bootcmd_usb}; bootm 0x6400000;" - -#define MTDIDS_DEFAULT "nand0=nand_mtd" -#define MTDPARTS_DEFAULT "mtdparts=nand_mtd:0x100000@0x000000(uboot),"\ - "0x400000@0x100000(uImage),"\ - "0x1fb00000@0x500000(rootfs)" - -#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \ - "=ttyS0,115200 "MTDPARTS_DEFAULT " rw ubi.mtd=2,2048\0" \ - "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \ - "x_bootcmd_usb=usb start\0" \ - "x_bootargs_root=root=ubi0:rootfs rootfstype=ubifs\0" \ - "mtdids="MTDIDS_DEFAULT"\0" \ - "mtdparts="MTDPARTS_DEFAULT"\0" - -/* - * Ethernet Driver configuration - */ -#ifdef CONFIG_CMD_NET -# ifdef CONFIG_BOARD_IS_OPENRD_BASE -# define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -# else -# define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ -# endif -# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE -# define CONFIG_PHY_BASE_ADR 0x0 -# define PHY_NO "88E1121" -# else -# define CONFIG_PHY_BASE_ADR 0x8 -# define PHY_NO "88E1116" -# endif -#endif /* CONFIG_CMD_NET */ - -/* - * SATA Driver configuration - */ -#ifdef CONFIG_MVSATA_IDE -#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET -#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET -#endif /*CONFIG_MVSATA_IDE*/ - -#endif /* _CONFIG_OPENRD_BASE_H */

Hi Clint,
Le 12/04/2011 18:09, Clint Adams a écrit :
board/Marvell/openrd/Makefile | 56 ++++++++++ board/Marvell/openrd/kwbimage.cfg | 168 ++++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.c | 173 +++++++++++++++++++++++++++++++ board/Marvell/openrd/openrd.h | 46 ++++++++ board/Marvell/openrd_base/Makefile | 56 ---------- board/Marvell/openrd_base/kwbimage.cfg | 168 ------------------------------ board/Marvell/openrd_base/openrd_base.c | 173 ------------------------------- board/Marvell/openrd_base/openrd_base.h | 46 -------- boards.cfg | 6 +- include/configs/openrd.h | 142 +++++++++++++++++++++++++ include/configs/openrd_base.h | 142 ------------------------- 11 files changed, 588 insertions(+), 588 deletions(-) create mode 100644 board/Marvell/openrd/Makefile create mode 100644 board/Marvell/openrd/kwbimage.cfg create mode 100644 board/Marvell/openrd/openrd.c create mode 100644 board/Marvell/openrd/openrd.h delete mode 100644 board/Marvell/openrd_base/Makefile delete mode 100644 board/Marvell/openrd_base/kwbimage.cfg delete mode 100644 board/Marvell/openrd_base/openrd_base.c delete mode 100644 board/Marvell/openrd_base/openrd_base.h create mode 100644 include/configs/openrd.h delete mode 100644 include/configs/openrd_base.h
Since these are only renames, they should appear as such. Can you redo this one in the next patchset with git-format-patch option -M or -C in order for the renames to be detected as such and not presented as delete/create pairs?
Amicalement,

Le 12/04/2011 18:09, Clint Adams a écrit :
MAKEALL | 2 ++ board/Marvell/openrd_base/openrd_base.c | 6 ++++++ boards.cfg | 4 +++- include/configs/openrd_base.h | 14 +++++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-)
This is a new version -- please add version in subject and provide patch history.
Amicalement,

On Mon, Apr 11, 2011 at 05:03:32AM -0700, Prafulla Wadaskar wrote:
I have tested these patches and works for openRD-Base, certainly it may not work for ultimate and client since respective machine ids are not programmed.
I can't believe I forgot this part.
May you please provide tuned version of these patches?
Sending with the MACH_TYPE fix and the file renames.

On Tue, Mar 29, 2011 at 05:53:14AM -0700, Prafulla Wadaskar wrote:
You can pass additional options here to identify your board uniquely out of several supported boards (to be coming) For ex: +openrd_base arm arm926ejs openrd +Marvell Kirkwood openrd_common:BOARD_IS_OPENRD_BASE
This approach will help better way to add conditional code for other boards type
For more details refer syntax in the top of this file.
The following two patches use that method, without the file rename.

From: Julian Pidancet julian.pidancet@citrix.com
Renamed from "Openrd_base" to "OpenRD-Base"
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 136d3bf..ba57d90 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -35,7 +35,7 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#define CONFIG_IDENT_STRING "\nOpenRD-Base"
/* Machine type */ #define MACH_TYPE_OPENRD MACH_TYPE_OPENRD_BASE

-----Original Message----- From: Julian Pidancet [mailto:swaplinker@gmail.com] On Behalf Of julian.pidancet@citrix.com Sent: Friday, March 25, 2011 2:19 PM To: u-boot@lists.denx.de Cc: tanmay.upadhyay@einfochips.com; Prafulla Wadaskar; Julian Pidancet Subject: [PATCH v2 2/4] Change OpenRD Base board identification string.
From: Julian Pidancet julian.pidancet@citrix.com
Renamed from "Openrd_base" to "OpenRD-Base"
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 136d3bf..ba57d90 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -35,7 +35,7 @@ /*
- Version number information
*/ -#define CONFIG_IDENT_STRING "\nOpenRD_base" +#define CONFIG_IDENT_STRING "\nOpenRD-Base"
Ack
Regards.. Prafulla . .

From: Julian Pidancet julian.pidancet@citrix.com
This patch takes care of initializing the second PHY of the OpenRD board.
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
create mode 100644 include/configs/openrd_client.h
diff --git a/MAKEALL b/MAKEALL index a732e6a..ddf4a70 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,7 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index b395df7..fded3f0 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -118,12 +118,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/MV88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -150,4 +149,19 @@ void reset_phy(void)
printf("88E1116 Initialized on %s\n", name); } + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#if (MACH_TYPE_OPENRD == MACH_TYPE_OPENRD_CLIENT) + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); + + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif +} #endif /* CONFIG_RESET_PHY_R */ diff --git a/boards.cfg b/boards.cfg index 07c904b..5f5d2bf 100644 --- a/boards.cfg +++ b/boards.cfg @@ -97,6 +97,7 @@ suen3 arm arm926ejs km_arm keymile guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood +openrd_client arm arm926ejs openrd Marvell kirkwood rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_client.h b/include/configs/openrd_client.h new file mode 100644 index 0000000..1ffc29f --- /dev/null +++ b/include/configs/openrd_client.h @@ -0,0 +1,44 @@ +/* + * 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 _CONFIG_OPENRD_CLIENT_H +#define _CONFIG_OPENRD_CLIENT_H + +#include <configs/openrd.h> + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nOpenRD-Client" + +/* Machine type */ +#define MACH_TYPE_OPENRD MACH_TYPE_OPENRD_CLIENT + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +/* enable both ports */ +#define CONFIG_MVGBE_PORTS {1, 1} +#define CONFIG_PHY_BASE_ADR 0x8 +#define PHY_NO "88E1116" +#endif /* CONFIG_CMD_NET */ + +#endif /* _CONFIG_OPENRD_CLIENT_H */

-----Original Message----- From: Julian Pidancet [mailto:swaplinker@gmail.com] On Behalf Of julian.pidancet@citrix.com Sent: Friday, March 25, 2011 2:19 PM To: u-boot@lists.denx.de Cc: tanmay.upadhyay@einfochips.com; Prafulla Wadaskar; Julian Pidancet Subject: [PATCH v2 3/4] Add support for the Client variant of the OpenRD board.
From: Julian Pidancet julian.pidancet@citrix.com
This patch takes care of initializing the second PHY of the OpenRD board.
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
create mode 100644 include/configs/openrd_client.h
...snip...
--- /dev/null +++ b/include/configs/openrd_client.h @@ -0,0 +1,44 @@ +/*
- 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 _CONFIG_OPENRD_CLIENT_H +#define _CONFIG_OPENRD_CLIENT_H
+#include <configs/openrd.h>
+/*
- Version number information
- */
+#define CONFIG_IDENT_STRING "\nOpenRD-Client"
+/* Machine type */ +#define MACH_TYPE_OPENRD MACH_TYPE_OPENRD_CLIENT
NAK for this
Regards.. Prafulla . .

From: Julian Pidancet julian.pidancet@citrix.com
This patch adds proper initialization code for the two PHYs present on the board.
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
create mode 100644 include/configs/openrd_ultimate.h
diff --git a/MAKEALL b/MAKEALL index ddf4a70..4b6da98 100755 --- a/MAKEALL +++ b/MAKEALL @@ -362,6 +362,7 @@ LIST_ARM9=" \ omap730p2 \ openrd_base \ openrd_client \ + openrd_ultimate \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index fded3f0..d1b2554 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -147,7 +147,7 @@ void mv_phy_init(char *name) /* reset the phy */ miiphy_reset(name, devadr);
- printf("88E1116 Initialized on %s\n", name); + printf(PHY_NO" Initialized on %s\n", name); }
void reset_phy(void) @@ -162,6 +162,8 @@ void reset_phy(void)
/* configure and initialize both PHY's */ mv_phy_init("egiga1"); +#elif (MACH_TYPE_OPENRD == MACH_TYPE_OPENRD_ULTIMATE) + mv_phy_init("egiga1"); #endif } #endif /* CONFIG_RESET_PHY_R */ diff --git a/boards.cfg b/boards.cfg index 5f5d2bf..513aa04 100644 --- a/boards.cfg +++ b/boards.cfg @@ -98,6 +98,7 @@ guruplug arm arm926ejs - Marvell mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood openrd_client arm arm926ejs openrd Marvell kirkwood +openrd_ultimate arm arm926ejs openrd Marvell kirkwood rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_ultimate.h b/include/configs/openrd_ultimate.h new file mode 100644 index 0000000..b616d6a --- /dev/null +++ b/include/configs/openrd_ultimate.h @@ -0,0 +1,44 @@ +/* + * 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 _CONFIG_OPENRD_ULTIMATE_H +#define _CONFIG_OPENRD_ULTIMATE_H + +#include <configs/openrd.h> + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nOpenRD-Ultimate" + +/* Machine type */ +#define MACH_TYPE_OPENRD MACH_TYPE_OPENRD_ULTIMATE + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +/* enable both ports */ +#define CONFIG_MVGBE_PORTS {1, 1} +#define CONFIG_PHY_BASE_ADR 0x0 +#define PHY_NO "88E1121" +#endif /* CONFIG_CMD_NET */ + +#endif /* _CONFIG_OPENRD_ULTIMATE_H */

Julian Pidancet wrote:
A nice future improvement would be to add variant detection and configuration at run-time as suggested on the mailing-list in a recent email. So one could use the same binary for all board variants.
Does anyone know offhand how to do this? I have heard rumors of a GPIO method but I haven't found any details.

-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de] On Behalf Of Clint Adams Sent: Saturday, March 26, 2011 3:32 AM To: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH v2 0/4] Kirkwood: Add support for OpenRD- Client & OpenRD-Ultimate
Julian Pidancet wrote:
A nice future improvement would be to add variant detection and
configuration
at run-time as suggested on the mailing-list in a recent email. So one
could
use the same binary for all board variants.
Does anyone know offhand how to do this? I have heard rumors of a GPIO method but I haven't found any details.
1. One possibility is to use some GPIOs and configure them on all board to detect the board version, read these GPIOs in the u-boot code and take board variant specific execution/configuration.
2. One can have similar approach keeping some data in separate EEPROM.
3. one can read availability of specific h/w on the board.
Of which #3 will be better but may not be suitable for all boards variant.
I personally do not like this method. Since there is always chance to have wrong configuration.
I would always prefer to have build time configuration passing as per board variant.
Regards.. Prafulla . . .

Julian,
U-Boot is now running on my OpenRD-Ultimate board with these patches.
Thanks,
Harro Haan

Hi Julian,
Le 25/03/2011 09:48, julian.pidancet@citrix.com a écrit :
From: Julian Pidancetjulian.pidancet@citrix.com
Kirkwood: Rename openrd_base board files to openrd. Change OpenRD Base board identification string. Add support for the Client variant of the OpenRD board.
Just a remark: short commit message does not usually end with a period.
Apart from that, it works on my OpenRD Client.
Tested-by: Albert ARIBAUD albert.aribaud@free.fr
Amicalement,
participants (9)
-
Albert ARIBAUD
-
Albert ARIBAUD
-
Clint Adams
-
Detlev Zundel
-
Harro Haan
-
Julian Pidancet
-
julian.pidancet@citrix.com
-
Prafulla Wadaskar
-
Wolfgang Denk