[U-Boot] [PATCH 1/2] kirkwood: Rename dns325 to dnskw

Jamie Lentin jm at lentin.co.uk
Tue May 1 11:25:29 CEST 2012


So we can re-use DNS-325 configuration for the DNS-320 without things getting
confusing, rename all common parts from dns325 to dnskw, and use a config
option to configure DNS-325 specifics.

Signed-off-by: Jamie Lentin <jm at lentin.co.uk>
Cc: prafulla at marvell.com
Cc: albert.u.boot at aribaud.net
---
 board/d-link/{dns325 => dnskw}/Makefile            |    2 +-
 board/d-link/{dns325/dns325.c => dnskw/dnskw.c}    |   10 ++++----
 board/d-link/{dns325/dns325.h => dnskw/dnskw.h}    |   24 ++++++++++++--------
 .../kwbimage.cfg => dnskw/kwbimage.dns325.cfg}     |    0
 boards.cfg                                         |    2 +-
 include/configs/{dns325.h => dnskw.h}              |   11 ++++++---
 6 files changed, 29 insertions(+), 20 deletions(-)
 rename board/d-link/{dns325 => dnskw}/Makefile (98%)
 rename board/d-link/{dns325/dns325.c => dnskw/dnskw.c} (94%)
 rename board/d-link/{dns325/dns325.h => dnskw/dnskw.h} (73%)
 rename board/d-link/{dns325/kwbimage.cfg => dnskw/kwbimage.dns325.cfg} (100%)
 rename include/configs/{dns325.h => dnskw.h} (95%)

diff --git a/board/d-link/dns325/Makefile b/board/d-link/dnskw/Makefile
similarity index 98%
rename from board/d-link/dns325/Makefile
rename to board/d-link/dnskw/Makefile
index 35da21a..174127e 100644
--- a/board/d-link/dns325/Makefile
+++ b/board/d-link/dnskw/Makefile
@@ -30,7 +30,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= dns325.o
+COBJS	:= dnskw.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
diff --git a/board/d-link/dns325/dns325.c b/board/d-link/dnskw/dnskw.c
similarity index 94%
rename from board/d-link/dns325/dns325.c
rename to board/d-link/dnskw/dnskw.c
index 990d79f..28ce1ba 100644
--- a/board/d-link/dns325/dns325.c
+++ b/board/d-link/dnskw/dnskw.c
@@ -33,15 +33,15 @@
 #include <asm/arch/kirkwood.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/gpio.h>
-#include "dns325.h"
+#include "dnskw.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_early_init_f(void)
 {
 	/* Gpio configuration */
-	kw_config_gpio(DNS325_OE_VAL_LOW, DNS325_OE_VAL_HIGH,
-			DNS325_OE_LOW, DNS325_OE_HIGH);
+	kw_config_gpio(DNSKW_OE_VAL_LOW, DNSKW_OE_VAL_HIGH,
+			DNSKW_OE_LOW, DNSKW_OE_HIGH);
 
 	/* Multi-Purpose Pins Functionality configuration */
 	u32 kwmpp_config[] = {
@@ -99,9 +99,9 @@ int board_early_init_f(void)
 	};
 	kirkwood_mpp_conf(kwmpp_config);
 
-	kw_gpio_set_blink(DNS325_GPIO_LED_POWER , 1);
+	kw_gpio_set_blink(DNSKW_GPIO_LED_POWER , 1);
 
-	kw_gpio_set_value(DNS325_GPIO_SATA0_EN , 1);
+	kw_gpio_set_value(DNSKW_GPIO_SATA0_EN , 1);
 	return 0;
 }
 
diff --git a/board/d-link/dns325/dns325.h b/board/d-link/dnskw/dnskw.h
similarity index 73%
rename from board/d-link/dns325/dns325.h
rename to board/d-link/dnskw/dnskw.h
index 7859cea..4b11cb6 100644
--- a/board/d-link/dns325/dns325.h
+++ b/board/d-link/dnskw/dnskw.h
@@ -26,18 +26,22 @@
  * MA 02110-1301 USA
  */
 
-#ifndef __DNS325_H
-#define __DNS325_H
+#ifndef __DNSKW_H
+#define __DNSKW_H
 
 /* GPIO configuration */
-#define DNS325_OE_LOW			0x00000000
-#define DNS325_OE_HIGH			0x00039604
-#define DNS325_OE_VAL_LOW		0x38000000	/* disable leds */
-#define DNS325_OE_VAL_HIGH		0x00000800	/* disable leds */
+#define DNSKW_OE_LOW			0x00000000
+#define DNSKW_OE_HIGH			0x00039604
 
-#define DNS325_GPIO_LED_POWER		26
-#define DNS325_GPIO_SATA0_EN		39
-#define DNS325_GPIO_SATA1_EN		40
+#define DNSKW_GPIO_LED_POWER		26
+#define DNSKW_GPIO_SATA0_EN		39
+#define DNSKW_GPIO_SATA1_EN		40
+
+/* DNS-325 specific configuration */
+#ifdef CONFIG_BOARD_IS_DNS325
+#define DNSKW_OE_VAL_LOW		0x38000000	/* disable leds */
+#define DNSKW_OE_VAL_HIGH		0x00000800	/* disable leds */
+#endif /* CONFIG_BOARD_IS_DNS325 */
 
 /* PHY related */
 #define MV88E1116_MAC_CTRL_REG		21
@@ -45,4 +49,4 @@
 #define MV88E1116_RGMII_TXTM_CTRL	(1 << 4)
 #define MV88E1116_RGMII_RXTM_CTRL	(1 << 5)
 
-#endif /* __DNS325_H */
+#endif /* __DNSKW_H */
diff --git a/board/d-link/dns325/kwbimage.cfg b/board/d-link/dnskw/kwbimage.dns325.cfg
similarity index 100%
rename from board/d-link/dns325/kwbimage.cfg
rename to board/d-link/dnskw/kwbimage.dns325.cfg
diff --git a/boards.cfg b/boards.cfg
index 3cf75c3..f7ffa9b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -136,7 +136,7 @@ hawkboard                    arm         arm926ejs   da8xxevm            davinci
 hawkboard_uart               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:UART_U_BOOT
 enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw           davinci
 calimain                     arm         arm926ejs   calimain            omicron        davinci
-dns325                       arm         arm926ejs   -                   d-link         kirkwood
+dns325                       arm         arm926ejs   dnskw               d-link         kirkwood        dnskw:BOARD_IS_DNS325
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_DISABLE_PCI
 km_kirkwood_pci              arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_RECONFIG_XLX
 mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood
diff --git a/include/configs/dns325.h b/include/configs/dnskw.h
similarity index 95%
rename from include/configs/dns325.h
rename to include/configs/dnskw.h
index b7a89d3..a9ff178 100644
--- a/include/configs/dns325.h
+++ b/include/configs/dnskw.h
@@ -26,16 +26,21 @@
  * MA 02110-1301 USA
  */
 
-#ifndef _CONFIG_DNS325_H
-#define _CONFIG_DNS325_H
+#ifndef _CONFIG_DNSKW_H
+#define _CONFIG_DNSKW_H
 
 /*
  * Machine number definition
  */
+#ifdef CONFIG_BOARD_IS_DNS325
 #define MACH_TYPE_DNS325		3800
 #define CONFIG_MACH_TYPE		MACH_TYPE_DNS325
 #define CONFIG_IDENT_STRING		"\nD-Link DNS-325"
 
+#define CONFIG_SYS_KWD_CONFIG		$(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.dns325.cfg
+
+#endif /* CONFIG_BOARD_IS_DNS325 */
+
 /*
  * High Level Configuration Options (easy to change)
  */
@@ -185,4 +190,4 @@
 	"fi;" \
 	"run setnandbootenv subbootcmd;"
 
-#endif /* _CONFIG_DNS325_H */
+#endif /* _CONFIG_DNSKW_H */
-- 
1.7.10



More information about the U-Boot mailing list