[U-Boot] [PATCH V5: 1/5] kirkwood: Rename dns325 to dnskw
Bastien ROUCARIÈS
roucaries.bastien at gmail.com
Fri Jul 4 22:08:52 CEST 2014
From: Jamie Lentin <jm at lentin.co.uk>
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 (93%)
rename board/d-link/{dns325/dns325.c => dnskw/dnskw.c} (93%)
rename board/d-link/{dns325/dns325.h => dnskw/dnskw.h} (52%)
rename board/d-link/{dns325/kwbimage.cfg => dnskw/kwbimage.dns325.cfg} (100%)
rename include/configs/{dns325.h => dnskw.h} (94%)
diff --git a/board/d-link/dns325/Makefile b/board/d-link/dnskw/Makefile
similarity index 93%
rename from board/d-link/dns325/Makefile
rename to board/d-link/dnskw/Makefile
index b8a5ea1..85cebf7 100644
--- a/board/d-link/dns325/Makefile
+++ b/board/d-link/dnskw/Makefile
@@ -10,4 +10,4 @@
# SPDX-License-Identifier: GPL-2.0+
#
-obj-y := dns325.o
+obj-y := dnskw.o
diff --git a/board/d-link/dns325/dns325.c b/board/d-link/dnskw/dnskw.c
similarity index 93%
rename from board/d-link/dns325/dns325.c
rename to board/d-link/dnskw/dnskw.c
index ff70e94..22b0ffb 100644
--- a/board/d-link/dns325/dns325.c
+++ b/board/d-link/dnskw/dnskw.c
@@ -17,15 +17,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 */
static const u32 kwmpp_config[] = {
@@ -83,9 +83,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 52%
rename from board/d-link/dns325/dns325.h
rename to board/d-link/dnskw/dnskw.h
index f7b25f2..8d2e2b1 100644
--- a/board/d-link/dns325/dns325.h
+++ b/board/d-link/dnskw/dnskw.h
@@ -10,18 +10,22 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-#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
@@ -29,4 +33,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 8e2db82..5259b27 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -163,7 +163,7 @@ Active arm arm926ejs davinci omicron calimain
Active arm arm926ejs kirkwood buffalo lsxl lschlv2 lsxl:LSCHLV2 Michael Walle <michael at walle.cc>
Active arm arm926ejs kirkwood buffalo lsxl lsxhl lsxl:LSXHL Michael Walle <michael at walle.cc>
Active arm arm926ejs kirkwood cloudengines - pogo_e02 - Dave Purdy <david.c.purdy at gmail.com>
-Active arm arm926ejs kirkwood d-link - dns325 - Stefan Herbrechtsmeier <stefan at code.herbrechtsmeier.net>
+Active arm arm926ejs kirkwood d-link dnskw dns325 dnskw:BOARD_IS_DNS325 Stefan Herbrechtsmeier <stefan at code.herbrechtsmeier.net>
Active arm arm926ejs kirkwood iomega - iconnect - Luka Perkov <luka at openwrt.org>
Active arm arm926ejs kirkwood karo tk71 tk71 - -
Active arm arm926ejs kirkwood keymile km_arm km_kirkwood km_kirkwood:KM_KIRKWOOD Valentin Longchamp <valentin.longchamp at keymile.com>
diff --git a/include/configs/dns325.h b/include/configs/dnskw.h
similarity index 94%
rename from include/configs/dns325.h
rename to include/configs/dnskw.h
index 96db44f..b415216 100644
--- a/include/configs/dns325.h
+++ b/include/configs/dnskw.h
@@ -10,16 +10,21 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-#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)
*/
@@ -167,4 +172,4 @@
"fi;" \
"run setnandbootenv subbootcmd;"
-#endif /* _CONFIG_DNS325_H */
+#endif /* _CONFIG_DNSKW_H */
--
2.0.0
More information about the U-Boot
mailing list