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

Jamie Lentin jm at lentin.co.uk
Mon Jul 30 23:55:57 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 11260fe..d29735c 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, NULL);
 
-	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 2d36d83..8b8bb45 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -139,7 +139,7 @@ hawkboard_uart               arm         arm926ejs   da8xxevm            davinci
 enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw           davinci
 calimain                     arm         arm926ejs   calimain            omicron        davinci
 pogo_e02                     arm         arm926ejs   -                   cloudengines   kirkwood
-dns325                       arm         arm926ejs   -                   d-link         kirkwood
+dns325                       arm         arm926ejs   dnskw               d-link         kirkwood        dnskw:BOARD_IS_DNS325
 lschlv2                      arm         arm926ejs   lsxl                buffalo        kirkwood    lsxl:LSCHLV2
 lsxhl                        arm         arm926ejs   lsxl                buffalo        kirkwood    lsxl:LSXHL
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood    km_kirkwood:KM_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 1f632ac..2995d42 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)
  */
@@ -184,4 +189,4 @@
 	"fi;" \
 	"run setnandbootenv subbootcmd;"
 
-#endif /* _CONFIG_DNS325_H */
+#endif /* _CONFIG_DNSKW_H */
-- 
1.7.10.4



More information about the U-Boot mailing list