[U-Boot] [PATCH 0/5] Marvell: reduce dependence files

Reduce the dependence between driver files and platform files
Lei Wen (5): ARM: pantheon: reduce dependence of including platform file ARM: armada100: reduce dependence of including platform file ARM: kirkwood: reduce dependence of including platform file serial: reduce include platform file for marvell chip gpio: mvmfp: reduce include platform file
arch/arm/cpu/arm926ejs/armada100/cpu.c | 2 +- arch/arm/cpu/arm926ejs/armada100/dram.c | 1 + arch/arm/cpu/arm926ejs/armada100/timer.c | 1 + arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/dram.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/mpp.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/timer.c | 1 + arch/arm/cpu/arm926ejs/pantheon/cpu.c | 2 +- arch/arm/cpu/arm926ejs/pantheon/dram.c | 1 + arch/arm/cpu/arm926ejs/pantheon/timer.c | 1 + arch/arm/include/asm/arch-armada100/armada100.h | 63 ----------------------- arch/arm/include/asm/arch-armada100/config.h | 1 + arch/arm/include/asm/arch-armada100/cpu.h | 57 ++++++++++++++++++++ arch/arm/include/asm/arch-kirkwood/config.h | 1 + arch/arm/include/asm/arch-kirkwood/kirkwood.h | 6 -- arch/arm/include/asm/arch-pantheon/config.h | 2 + arch/arm/include/asm/arch-pantheon/pantheon.h | 7 --- board/Marvell/aspenite/aspenite.c | 1 + board/Marvell/guruplug/guruplug.c | 1 + board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c | 1 + board/Marvell/openrd/openrd.c | 1 + board/Marvell/rd6281a/rd6281a.c | 1 + board/Marvell/sheevaplug/sheevaplug.c | 1 + board/keymile/km_arm/km_arm.c | 1 + drivers/gpio/kw_gpio.c | 1 + drivers/gpio/mvmfp.c | 7 --- drivers/net/mvgbe.c | 2 + drivers/serial/serial.c | 9 --- drivers/spi/kirkwood_spi.c | 1 + drivers/usb/host/ehci-kirkwood.c | 1 + 30 files changed, 86 insertions(+), 94 deletions(-)

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- arch/arm/cpu/arm926ejs/pantheon/cpu.c | 2 +- arch/arm/cpu/arm926ejs/pantheon/dram.c | 1 + arch/arm/cpu/arm926ejs/pantheon/timer.c | 1 + arch/arm/include/asm/arch-pantheon/config.h | 2 ++ arch/arm/include/asm/arch-pantheon/pantheon.h | 7 ------- 5 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/pantheon/cpu.c b/arch/arm/cpu/arm926ejs/pantheon/cpu.c index 8b2eafa..efc9395 100644 --- a/arch/arm/cpu/arm926ejs/pantheon/cpu.c +++ b/arch/arm/cpu/arm926ejs/pantheon/cpu.c @@ -23,8 +23,8 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/pantheon.h> -#include <asm/io.h>
#define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1)) #define SET_MRVL_ID (1<<8) diff --git a/arch/arm/cpu/arm926ejs/pantheon/dram.c b/arch/arm/cpu/arm926ejs/pantheon/dram.c index bbca7ee..a3d719e 100644 --- a/arch/arm/cpu/arm926ejs/pantheon/dram.c +++ b/arch/arm/cpu/arm926ejs/pantheon/dram.c @@ -23,6 +23,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/pantheon.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/pantheon/timer.c b/arch/arm/cpu/arm926ejs/pantheon/timer.c index c71162a..17045b1 100644 --- a/arch/arm/cpu/arm926ejs/pantheon/timer.c +++ b/arch/arm/cpu/arm926ejs/pantheon/timer.c @@ -23,6 +23,7 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/pantheon.h>
/* diff --git a/arch/arm/include/asm/arch-pantheon/config.h b/arch/arm/include/asm/arch-pantheon/config.h index 5658592..fd23c97 100644 --- a/arch/arm/include/asm/arch-pantheon/config.h +++ b/arch/arm/include/asm/arch-pantheon/config.h @@ -25,6 +25,8 @@ #ifndef _PANTHEON_CONFIG_H #define _PANTHEON_CONFIG_H
+#include <asm/arch/pantheon.h> + #define CONFIG_ARM926EJS 1 /* Basic Architecture */
#define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */ diff --git a/arch/arm/include/asm/arch-pantheon/pantheon.h b/arch/arm/include/asm/arch-pantheon/pantheon.h index e4ed087..c7fe646 100644 --- a/arch/arm/include/asm/arch-pantheon/pantheon.h +++ b/arch/arm/include/asm/arch-pantheon/pantheon.h @@ -25,13 +25,6 @@ #ifndef _PANTHEON_H #define _PANTHEON_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - -#include <asm/arch/cpu.h> - /* Common APB clock register bit definitions */ #define APBC_APBCLK (1<<0) /* APB Bus Clock Enable */ #define APBC_FNCLK (1<<1) /* Functional Clock Enable */

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- arch/arm/cpu/arm926ejs/armada100/cpu.c | 2 +- arch/arm/cpu/arm926ejs/armada100/dram.c | 1 + arch/arm/cpu/arm926ejs/armada100/timer.c | 1 + arch/arm/include/asm/arch-armada100/armada100.h | 63 ----------------------- arch/arm/include/asm/arch-armada100/config.h | 1 + arch/arm/include/asm/arch-armada100/cpu.h | 57 ++++++++++++++++++++ board/Marvell/aspenite/aspenite.c | 1 + 7 files changed, 62 insertions(+), 64 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c b/arch/arm/cpu/arm926ejs/armada100/cpu.c index c21938e..14121a0 100644 --- a/arch/arm/cpu/arm926ejs/armada100/cpu.c +++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c @@ -24,8 +24,8 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/armada100.h> -#include <asm/io.h>
#define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1)) #define SET_MRVL_ID (1<<8) diff --git a/arch/arm/cpu/arm926ejs/armada100/dram.c b/arch/arm/cpu/arm926ejs/armada100/dram.c index eacec23..8609004 100644 --- a/arch/arm/cpu/arm926ejs/armada100/dram.c +++ b/arch/arm/cpu/arm926ejs/armada100/dram.c @@ -24,6 +24,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/armada100.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c index 82a6d7b..fbade4b 100644 --- a/arch/arm/cpu/arm926ejs/armada100/timer.c +++ b/arch/arm/cpu/arm926ejs/armada100/timer.c @@ -24,6 +24,7 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/armada100.h>
/* diff --git a/arch/arm/include/asm/arch-armada100/armada100.h b/arch/arm/include/asm/arch-armada100/armada100.h index d5d125a..f27c4f6 100644 --- a/arch/arm/include/asm/arch-armada100/armada100.h +++ b/arch/arm/include/asm/arch-armada100/armada100.h @@ -26,13 +26,7 @@ #ifndef _ASM_ARCH_ARMADA100_H #define _ASM_ARCH_ARMADA100_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - #if defined (CONFIG_ARMADA100) -#include <asm/arch/cpu.h>
/* Common APB clock register bit definitions */ #define APBC_APBCLK (1<<0) /* APB Bus Clock Enable */ @@ -60,62 +54,5 @@ #define ARMD1_APMU_BASE 0xD4282800 #define ARMD1_CPU_BASE 0xD4282C00
-/* - * Main Power Management (MPMU) Registers - * Refer Datasheet Appendix A.8 - */ -struct armd1mpmu_registers { - u8 pad0[0x08 - 0x00]; - u32 fccr; /*0x0008*/ - u32 pocr; /*0x000c*/ - u32 posr; /*0x0010*/ - u32 succr; /*0x0014*/ - u8 pad1[0x030 - 0x014 - 4]; - u32 gpcr; /*0x0030*/ - u8 pad2[0x200 - 0x030 - 4]; - u32 wdtpcr; /*0x0200*/ - u8 pad3[0x1000 - 0x200 - 4]; - u32 apcr; /*0x1000*/ - u32 apsr; /*0x1004*/ - u8 pad4[0x1020 - 0x1004 - 4]; - u32 aprr; /*0x1020*/ - u32 acgr; /*0x1024*/ - u32 arsr; /*0x1028*/ -}; - -/* - * APB1 Clock Reset/Control Registers - * Refer Datasheet Appendix A.10 - */ -struct armd1apb1_registers { - u32 uart1; /*0x000*/ - u32 uart2; /*0x004*/ - u32 gpio; /*0x008*/ - u32 pwm1; /*0x00c*/ - u32 pwm2; /*0x010*/ - u32 pwm3; /*0x014*/ - u32 pwm4; /*0x018*/ - u8 pad0[0x028 - 0x018 - 4]; - u32 rtc; /*0x028*/ - u32 twsi0; /*0x02c*/ - u32 kpc; /*0x030*/ - u32 timers; /*0x034*/ - u8 pad1[0x03c - 0x034 - 4]; - u32 aib; /*0x03c*/ - u32 sw_jtag; /*0x040*/ - u32 timer1; /*0x044*/ - u32 onewire; /*0x048*/ - u8 pad2[0x050 - 0x048 - 4]; - u32 asfar; /*0x050 AIB Secure First Access Reg*/ - u32 assar; /*0x054 AIB Secure Second Access Reg*/ - u8 pad3[0x06c - 0x054 - 4]; - u32 twsi1; /*0x06c*/ - u32 uart3; /*0x070*/ - u8 pad4[0x07c - 0x070 - 4]; - u32 timer2; /*0x07C*/ - u8 pad5[0x084 - 0x07c - 4]; - u32 ac97; /*0x084*/ -}; - #endif /* CONFIG_ARMADA100 */ #endif /* _ASM_ARCH_ARMADA100_H */ diff --git a/arch/arm/include/asm/arch-armada100/config.h b/arch/arm/include/asm/arch-armada100/config.h index 1126b38..d2094e5 100644 --- a/arch/arm/include/asm/arch-armada100/config.h +++ b/arch/arm/include/asm/arch-armada100/config.h @@ -31,6 +31,7 @@ #ifndef _ARMD1_CONFIG_H #define _ARMD1_CONFIG_H
+#include <asm/arch/armada100.h> #define CONFIG_ARM926EJS 1 /* Basic Architecture */
#define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */ diff --git a/arch/arm/include/asm/arch-armada100/cpu.h b/arch/arm/include/asm/arch-armada100/cpu.h index 0518a6a..f7ec938 100644 --- a/arch/arm/include/asm/arch-armada100/cpu.h +++ b/arch/arm/include/asm/arch-armada100/cpu.h @@ -29,6 +29,63 @@ #include <asm/system.h>
/* + * Main Power Management (MPMU) Registers + * Refer Datasheet Appendix A.8 + */ +struct armd1mpmu_registers { + u8 pad0[0x08 - 0x00]; + u32 fccr; /*0x0008*/ + u32 pocr; /*0x000c*/ + u32 posr; /*0x0010*/ + u32 succr; /*0x0014*/ + u8 pad1[0x030 - 0x014 - 4]; + u32 gpcr; /*0x0030*/ + u8 pad2[0x200 - 0x030 - 4]; + u32 wdtpcr; /*0x0200*/ + u8 pad3[0x1000 - 0x200 - 4]; + u32 apcr; /*0x1000*/ + u32 apsr; /*0x1004*/ + u8 pad4[0x1020 - 0x1004 - 4]; + u32 aprr; /*0x1020*/ + u32 acgr; /*0x1024*/ + u32 arsr; /*0x1028*/ +}; + +/* + * APB1 Clock Reset/Control Registers + * Refer Datasheet Appendix A.10 + */ +struct armd1apb1_registers { + u32 uart1; /*0x000*/ + u32 uart2; /*0x004*/ + u32 gpio; /*0x008*/ + u32 pwm1; /*0x00c*/ + u32 pwm2; /*0x010*/ + u32 pwm3; /*0x014*/ + u32 pwm4; /*0x018*/ + u8 pad0[0x028 - 0x018 - 4]; + u32 rtc; /*0x028*/ + u32 twsi0; /*0x02c*/ + u32 kpc; /*0x030*/ + u32 timers; /*0x034*/ + u8 pad1[0x03c - 0x034 - 4]; + u32 aib; /*0x03c*/ + u32 sw_jtag; /*0x040*/ + u32 timer1; /*0x044*/ + u32 onewire; /*0x048*/ + u8 pad2[0x050 - 0x048 - 4]; + u32 asfar; /*0x050 AIB Secure First Access Reg*/ + u32 assar; /*0x054 AIB Secure Second Access Reg*/ + u8 pad3[0x06c - 0x054 - 4]; + u32 twsi1; /*0x06c*/ + u32 uart3; /*0x070*/ + u8 pad4[0x07c - 0x070 - 4]; + u32 timer2; /*0x07C*/ + u8 pad5[0x084 - 0x07c - 4]; + u32 ac97; /*0x084*/ +}; + +/* * CPU Interface Registers * Refer Datasheet Appendix A.2 */ diff --git a/board/Marvell/aspenite/aspenite.c b/board/Marvell/aspenite/aspenite.c index 34ac7aa..3be33bf 100644 --- a/board/Marvell/aspenite/aspenite.c +++ b/board/Marvell/aspenite/aspenite.c @@ -25,6 +25,7 @@
#include <common.h> #include <mvmfp.h> +#include <asm/arch/cpu.h> #include <asm/arch/mfp.h> #include <asm/arch/armada100.h>

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 2 ++ arch/arm/cpu/arm926ejs/kirkwood/dram.c | 2 ++ arch/arm/cpu/arm926ejs/kirkwood/mpp.c | 2 ++ arch/arm/cpu/arm926ejs/kirkwood/timer.c | 1 + arch/arm/include/asm/arch-kirkwood/config.h | 1 + arch/arm/include/asm/arch-kirkwood/kirkwood.h | 6 ------ board/Marvell/guruplug/guruplug.c | 1 + board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c | 1 + board/Marvell/openrd/openrd.c | 1 + board/Marvell/rd6281a/rd6281a.c | 1 + board/Marvell/sheevaplug/sheevaplug.c | 1 + board/keymile/km_arm/km_arm.c | 1 + drivers/gpio/kw_gpio.c | 1 + drivers/net/mvgbe.c | 2 ++ drivers/spi/kirkwood_spi.c | 1 + drivers/usb/host/ehci-kirkwood.c | 1 + 16 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c index b4a4c04..8f04ddb 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c @@ -26,6 +26,8 @@ #include <netdev.h> #include <asm/cache.h> #include <u-boot/md5.h> +#include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <hush.h>
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c b/arch/arm/cpu/arm926ejs/kirkwood/dram.c index 2441554..181b3e7 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c @@ -24,6 +24,8 @@
#include <config.h> #include <common.h> +#include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/kirkwood/mpp.c b/arch/arm/cpu/arm926ejs/kirkwood/mpp.c index b2f0ad5..3da6c98 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/mpp.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/mpp.c @@ -10,6 +10,8 @@ */
#include <common.h> +#include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h>
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/timer.c b/arch/arm/cpu/arm926ejs/kirkwood/timer.c index b4f6cf8..a98f54c 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/timer.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/timer.c @@ -22,6 +22,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/kirkwood.h>
#define UBOOT_CNTR 0 /* counter to use for uboot timer */ diff --git a/arch/arm/include/asm/arch-kirkwood/config.h b/arch/arm/include/asm/arch-kirkwood/config.h index b7dae1e..ab7201b 100644 --- a/arch/arm/include/asm/arch-kirkwood/config.h +++ b/arch/arm/include/asm/arch-kirkwood/config.h @@ -39,6 +39,7 @@ #error "SOC Name not defined" #endif /* CONFIG_KW88F6281 */
+#include <asm/arch/kirkwood.h> #define CONFIG_ARM926EJS 1 /* Basic Architecture */
#define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */ diff --git a/arch/arm/include/asm/arch-kirkwood/kirkwood.h b/arch/arm/include/asm/arch-kirkwood/kirkwood.h index 3c843a0..0035ed5 100644 --- a/arch/arm/include/asm/arch-kirkwood/kirkwood.h +++ b/arch/arm/include/asm/arch-kirkwood/kirkwood.h @@ -27,13 +27,7 @@ #ifndef _ASM_ARCH_KIRKWOOD_H #define _ASM_ARCH_KIRKWOOD_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - #if defined (CONFIG_FEROCEON_88FR131) || defined (CONFIG_SHEEVA_88SV131) -#include <asm/arch/cpu.h>
/* SOC specific definations */ #define INTREG_BASE 0xd0000000 diff --git a/board/Marvell/guruplug/guruplug.c b/board/Marvell/guruplug/guruplug.c index 1f0e67a..057c558 100644 --- a/board/Marvell/guruplug/guruplug.c +++ b/board/Marvell/guruplug/guruplug.c @@ -24,6 +24,7 @@
#include <common.h> #include <miiphy.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "guruplug.h" diff --git a/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c index 80fd20b..4c41f3b 100644 --- a/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c +++ b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c @@ -26,6 +26,7 @@
#include <common.h> #include <netdev.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "mv88f6281gtw_ge.h" diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index 87939de..2a10e69 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -29,6 +29,7 @@
#include <common.h> #include <miiphy.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "openrd.h" diff --git a/board/Marvell/rd6281a/rd6281a.c b/board/Marvell/rd6281a/rd6281a.c index ecdea82..9c768bf 100644 --- a/board/Marvell/rd6281a/rd6281a.c +++ b/board/Marvell/rd6281a/rd6281a.c @@ -25,6 +25,7 @@ #include <common.h> #include <miiphy.h> #include <netdev.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "rd6281a.h" diff --git a/board/Marvell/sheevaplug/sheevaplug.c b/board/Marvell/sheevaplug/sheevaplug.c index d7dc80c..71e6793 100644 --- a/board/Marvell/sheevaplug/sheevaplug.c +++ b/board/Marvell/sheevaplug/sheevaplug.c @@ -24,6 +24,7 @@
#include <common.h> #include <miiphy.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "sheevaplug.h" diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index a8f2b23..35dca5f 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -34,6 +34,7 @@ #include <netdev.h> #include <miiphy.h> #include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h>
diff --git a/drivers/gpio/kw_gpio.c b/drivers/gpio/kw_gpio.c index 56383c2..c86c28f 100644 --- a/drivers/gpio/kw_gpio.c +++ b/drivers/gpio/kw_gpio.c @@ -31,6 +31,7 @@
#include <common.h> #include <asm/bitops.h> +#include <asm/io.h> #include <asm/arch/kirkwood.h> #include <asm/arch/gpio.h>
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index c701f43..c7f7446 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -32,8 +32,10 @@ #include <net.h> #include <malloc.h> #include <miiphy.h> +#include <asm/io.h> #include <asm/errno.h> #include <asm/types.h> +#include <asm/system.h> #include <asm/byteorder.h>
#if defined(CONFIG_KIRKWOOD) diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c index a1c3070..6f502f0 100644 --- a/drivers/spi/kirkwood_spi.c +++ b/drivers/spi/kirkwood_spi.c @@ -27,6 +27,7 @@ #include <common.h> #include <malloc.h> #include <spi.h> +#include <asm/io.h> #include <asm/arch/kirkwood.h> #include <asm/arch/spi.h> #include <asm/arch/mpp.h> diff --git a/drivers/usb/host/ehci-kirkwood.c b/drivers/usb/host/ehci-kirkwood.c index 5570fc6..6300587 100644 --- a/drivers/usb/host/ehci-kirkwood.c +++ b/drivers/usb/host/ehci-kirkwood.c @@ -27,6 +27,7 @@ #include <usb.h> #include "ehci.h" #include "ehci-core.h" +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h>
#define rdl(off) readl(KW_USB20_BASE + (off))

Build pass with following config: dkb_config aspenite_config edminiv2_config openrd_ultimate_config sheevaplug_config mv88f6281gtw_ge_config rd6281a_config guruplug_config km_kirkwood_config
Signed-off-by: Lei Wen leiwen@marvell.com --- drivers/serial/serial.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 0d56e78..0d6ad62 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -28,15 +28,6 @@ #ifdef CONFIG_NS87308 #include <ns87308.h> #endif -#ifdef CONFIG_KIRKWOOD -#include <asm/arch/kirkwood.h> -#elif defined(CONFIG_ORION5X) -#include <asm/arch/orion5x.h> -#elif defined(CONFIG_ARMADA100) -#include <asm/arch/armada100.h> -#elif defined(CONFIG_PANTHEON) -#include <asm/arch/pantheon.h> -#endif
#if defined (CONFIG_SERIAL_MULTI) #include <serial.h>

-----Original Message----- From: Lei Wen [mailto:adrian.wenl@gmail.com] Sent: Sunday, October 02, 2011 7:47 PM To: Prafulla Wadaskar; u-boot@lists.denx.de Subject: [PATCH 4/5] serial: reduce include platform file for marvell chip
Build pass with following config: dkb_config aspenite_config edminiv2_config openrd_ultimate_config sheevaplug_config mv88f6281gtw_ge_config rd6281a_config guruplug_config km_kirkwood_config
Signed-off-by: Lei Wen leiwen@marvell.com
drivers/serial/serial.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 0d56e78..0d6ad62 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -28,15 +28,6 @@ #ifdef CONFIG_NS87308 #include <ns87308.h> #endif -#ifdef CONFIG_KIRKWOOD -#include <asm/arch/kirkwood.h> -#elif defined(CONFIG_ORION5X) -#include <asm/arch/orion5x.h> -#elif defined(CONFIG_ARMADA100) -#include <asm/arch/armada100.h> -#elif defined(CONFIG_PANTHEON) -#include <asm/arch/pantheon.h> -#endif
Hi Lei This is very good cleanup, I am okay with entire patch series. Any more comments welcomed.
Regards.. Prafulla . .

Dear Lei Wen,
In message 1317565013-22438-5-git-send-email-leiwen@marvell.com you wrote:
Build pass with following config: dkb_config aspenite_config edminiv2_config openrd_ultimate_config sheevaplug_config mv88f6281gtw_ge_config rd6281a_config guruplug_config km_kirkwood_config
Signed-off-by: Lei Wen leiwen@marvell.com
drivers/serial/serial.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
Acked-by: Wolfgang Denk wd@denx.de
Prafulla, please apply with the rest of the patch series.
Best regards,
Wolfgang Denk

Hi all,
Le 02/10/2011 16:16, Lei Wen a écrit :
Build pass with following config: dkb_config aspenite_config edminiv2_config openrd_ultimate_config sheevaplug_config mv88f6281gtw_ge_config rd6281a_config guruplug_config km_kirkwood_config
Signed-off-by: Lei Wenleiwen@marvell.com
drivers/serial/serial.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 0d56e78..0d6ad62 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -28,15 +28,6 @@ #ifdef CONFIG_NS87308 #include<ns87308.h> #endif -#ifdef CONFIG_KIRKWOOD -#include<asm/arch/kirkwood.h> -#elif defined(CONFIG_ORION5X) -#include<asm/arch/orion5x.h> -#elif defined(CONFIG_ARMADA100) -#include<asm/arch/armada100.h> -#elif defined(CONFIG_PANTHEON) -#include<asm/arch/pantheon.h> -#endif
#if defined (CONFIG_SERIAL_MULTI) #include<serial.h>
This breaks ED Mini V2 (orion5x) with the following message:
serial.c:65: error: 'ORION5X_UART0_BASE' undeclared here (not in a function) serial.c: In function 'calc_divisor': serial.c:152: error: 'CONFIG_SYS_TCLK' undeclared (first use in this function) serial.c:152: error: (Each undeclared identifier is reported only once serial.c:152: error: for each function it appears in.)
Lei Wen, please provide a patch for orion5x as you provided for armada, pantheon and kirkwood.
Amicalement,

Hi Albert,
On Tue, Oct 25, 2011 at 12:46 AM, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hi all,
Le 02/10/2011 16:16, Lei Wen a écrit :
Build pass with following config: dkb_config aspenite_config edminiv2_config openrd_ultimate_config sheevaplug_config mv88f6281gtw_ge_config rd6281a_config guruplug_config km_kirkwood_config
Signed-off-by: Lei Wenleiwen@marvell.com
drivers/serial/serial.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 0d56e78..0d6ad62 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -28,15 +28,6 @@ #ifdef CONFIG_NS87308 #include<ns87308.h> #endif -#ifdef CONFIG_KIRKWOOD -#include<asm/arch/kirkwood.h> -#elif defined(CONFIG_ORION5X) -#include<asm/arch/orion5x.h> -#elif defined(CONFIG_ARMADA100) -#include<asm/arch/armada100.h> -#elif defined(CONFIG_PANTHEON) -#include<asm/arch/pantheon.h> -#endif
#if defined (CONFIG_SERIAL_MULTI) #include<serial.h>
This breaks ED Mini V2 (orion5x) with the following message:
serial.c:65: error: 'ORION5X_UART0_BASE' undeclared here (not in a function) serial.c: In function 'calc_divisor': serial.c:152: error: 'CONFIG_SYS_TCLK' undeclared (first use in this function) serial.c:152: error: (Each undeclared identifier is reported only once serial.c:152: error: for each function it appears in.)
Lei Wen, please provide a patch for orion5x as you provided for armada, pantheon and kirkwood.
I see... My fault for this... I would post another patch to fix it.
Thanks, Lei

Dear Lei Wen,
In message CALZhoSQRKK_Mjf8zt3a__sn3raap706NrrySQPe6bU_yot07QA@mail.gmail.com you wrote:
Lei Wen, please provide a patch for orion5x as you provided for armada, pantheon and kirkwood.
I see... My fault for this... I would post another patch to fix it.
Instead, please submit a fixed patch. I will not pull these broken comits into mainline.
Best regards,
Wolfgang Denk

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- arch/arm/cpu/arm926ejs/orion5x/cpu.c | 3 ++- arch/arm/cpu/arm926ejs/orion5x/dram.c | 2 +- arch/arm/cpu/arm926ejs/orion5x/timer.c | 2 +- arch/arm/include/asm/arch-orion5x/orion5x.h | 6 ------ common/cmd_ide.c | 6 ------ include/configs/edminiv2.h | 1 + 6 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/orion5x/cpu.c b/arch/arm/cpu/arm926ejs/orion5x/cpu.c index 05bd45c..792b11d 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/cpu.c +++ b/arch/arm/cpu/arm926ejs/orion5x/cpu.c @@ -28,8 +28,9 @@ #include <common.h> #include <netdev.h> #include <asm/cache.h> +#include <asm/io.h> #include <u-boot/md5.h> -#include <asm/arch/orion5x.h> +#include <asm/arch/cpu.h> #include <hush.h>
#define BUFLEN 16 diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c b/arch/arm/cpu/arm926ejs/orion5x/dram.c index 5cc31a9..c0f7ef1 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/dram.c +++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c @@ -27,7 +27,7 @@
#include <common.h> #include <config.h> -#include <asm/arch/orion5x.h> +#include <asm/arch/cpu.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/arm/cpu/arm926ejs/orion5x/timer.c b/arch/arm/cpu/arm926ejs/orion5x/timer.c index 17df68f..e39ecc2 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/timer.c +++ b/arch/arm/cpu/arm926ejs/orion5x/timer.c @@ -25,7 +25,7 @@ */
#include <common.h> -#include <asm/arch/orion5x.h> +#include <asm/io.h>
#define UBOOT_CNTR 0 /* counter to use for uboot timer */
diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h b/arch/arm/include/asm/arch-orion5x/orion5x.h index 9aeef88..18225b9 100644 --- a/arch/arm/include/asm/arch-orion5x/orion5x.h +++ b/arch/arm/include/asm/arch-orion5x/orion5x.h @@ -30,13 +30,7 @@ #ifndef _ASM_ARCH_ORION5X_H #define _ASM_ARCH_ORION5X_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - #if defined(CONFIG_FEROCEON) -#include <asm/arch/cpu.h>
/* SOC specific definations */ #define ORION5X_REGISTER(x) (ORION5X_REGS_PHY_BASE + x) diff --git a/common/cmd_ide.c b/common/cmd_ide.c index da5189c..d909c54 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -46,12 +46,6 @@ #include <mpc5xxx.h> #endif
-#ifdef CONFIG_ORION5X -#include <asm/arch/orion5x.h> -#elif defined CONFIG_KIRKWOOD -#include <asm/arch/kirkwood.h> -#endif - #include <ide.h> #include <ata.h>
diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h index f8affa8..88d32b2 100644 --- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -45,6 +45,7 @@ #define CONFIG_88F5182 1 /* SOC Name */ #define CONFIG_MACH_EDMINIV2 1 /* Machine type */
+#include <asm/arch/orion5x.h> /* * CLKs configurations */

Dear Lei Wen,
In message 1319509652-5648-1-git-send-email-leiwen@marvell.com you wrote:
For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
...
--- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -45,6 +45,7 @@ #define CONFIG_88F5182 1 /* SOC Name */ #define CONFIG_MACH_EDMINIV2 1 /* Machine type */
+#include <asm/arch/orion5x.h>
I don't like this.
Board config files MUST NOT do any such includes. Keep in mind that one day we might want to try something like Kconfig, so board config files should ONLY contain configuration information in the form of #define's and the like.
NAK.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Tue, Oct 25, 2011 at 3:43 PM, Wolfgang Denk wd@denx.de wrote:
Dear Lei Wen,
In message 1319509652-5648-1-git-send-email-leiwen@marvell.com you wrote:
For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
...
--- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -45,6 +45,7 @@ #define CONFIG_88F5182 1 /* SOC Name */ #define CONFIG_MACH_EDMINIV2 1 /* Machine type */
+#include <asm/arch/orion5x.h>
I don't like this.
Board config files MUST NOT do any such includes. Keep in mind that one day we might want to try something like Kconfig, so board config files should ONLY contain configuration information in the form of #define's and the like.
NAK.
I should admit I have some bit of confusing here... What I see there are lots of include in the config file, 742 include usage case in the config files...: $ grep -Rn "#include" include/configs | wc -l 742
Or should I directly hard coding the CONFIG_SYS_NS16550_COM1 insteading the macro ORION5X_UART0_BASE, since this macro is defined in arch/arm/include/asm/arch-orion5x/orion5x.h...
Thanks, Lei

Dear Lei Wen,
In message CALZhoSQyCPnYCXgrYQCkvu6A0NYCrmtzveXcQsb3OSCMV_TKcA@mail.gmail.com you wrote:
+#include <asm/arch/orion5x.h>
I don't like this.
Board config files MUST NOT do any such includes. Keep in mind that one day we might want to try something like Kconfig, so board config files should ONLY contain configuration information in the form of #define's and the like.
NAK.
I should admit I have some bit of confusing here... What I see there are lots of include in the config file, 742 include usage case in the config files...: $ grep -Rn "#include" include/configs | wc -l 742
There are includes. Some of them are OK, some aren't and should be fixed.
More than half of your number are "#include <config_cmd_default.h>" which are perfectly fine.
For example, it's also perfectly fine if all boards that are similar or that provide a similar look & feel (for example, because they come from a single vendor) include a common configuration file. Such examples are #include "amcc-common.h", #include "mv-common.h", #include <configs/bfin_adi_common.h>, #include "manroland/common.h", etc. etc. etc.
On the other hand, files from asm/arch/* should never define any config settings - if it cannot be avoided they may provide register definitions and the like, but any "#define CONFIG_*" has no place there.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Wed, Oct 26, 2011 at 2:50 AM, Wolfgang Denk wd@denx.de wrote:
Dear Lei Wen,
In message CALZhoSQyCPnYCXgrYQCkvu6A0NYCrmtzveXcQsb3OSCMV_TKcA@mail.gmail.com you wrote:
+#include <asm/arch/orion5x.h>
I don't like this.
Board config files MUST NOT do any such includes. Keep in mind that one day we might want to try something like Kconfig, so board config files should ONLY contain configuration information in the form of #define's and the like.
NAK.
I should admit I have some bit of confusing here... What I see there are lots of include in the config file, 742 include usage case in the config files...: $ grep -Rn "#include" include/configs | wc -l 742
There are includes. Some of them are OK, some aren't and should be fixed.
More than half of your number are "#include <config_cmd_default.h>" which are perfectly fine.
For example, it's also perfectly fine if all boards that are similar or that provide a similar look & feel (for example, because they come from a single vendor) include a common configuration file. Such examples are #include "amcc-common.h", #include "mv-common.h", #include <configs/bfin_adi_common.h>, #include "manroland/common.h", etc. etc. etc.
On the other hand, files from asm/arch/* should never define any config settings - if it cannot be avoided they may provide register definitions and the like, but any "#define CONFIG_*" has no place there.
Thanks for your detailed explanation! I post another patch to address those issues you have mentioned.
Thanks, Lei

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- Changelog: V2: seperate orion5x define structure as kirkwood and armada does
arch/arm/cpu/arm926ejs/orion5x/cpu.c | 2 + arch/arm/cpu/arm926ejs/orion5x/dram.c | 1 + arch/arm/cpu/arm926ejs/orion5x/timer.c | 1 + arch/arm/include/asm/arch-orion5x/config.h | 135 ++++++++++++++++++++++ arch/arm/include/asm/arch-orion5x/orion5x.h | 6 - common/cmd_ide.c | 6 - include/configs/edminiv2.h | 166 +-------------------------- 7 files changed, 141 insertions(+), 176 deletions(-) create mode 100644 arch/arm/include/asm/arch-orion5x/config.h
diff --git a/arch/arm/cpu/arm926ejs/orion5x/cpu.c b/arch/arm/cpu/arm926ejs/orion5x/cpu.c index 05bd45c..2b0c760 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/cpu.c +++ b/arch/arm/cpu/arm926ejs/orion5x/cpu.c @@ -28,7 +28,9 @@ #include <common.h> #include <netdev.h> #include <asm/cache.h> +#include <asm/io.h> #include <u-boot/md5.h> +#include <asm/arch/cpu.h> #include <asm/arch/orion5x.h> #include <hush.h>
diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c b/arch/arm/cpu/arm926ejs/orion5x/dram.c index 5cc31a9..028f046 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/dram.c +++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c @@ -27,6 +27,7 @@
#include <common.h> #include <config.h> +#include <asm/arch/cpu.h> #include <asm/arch/orion5x.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/orion5x/timer.c b/arch/arm/cpu/arm926ejs/orion5x/timer.c index 17df68f..0b49b69 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/timer.c +++ b/arch/arm/cpu/arm926ejs/orion5x/timer.c @@ -25,6 +25,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/orion5x.h>
#define UBOOT_CNTR 0 /* counter to use for uboot timer */ diff --git a/arch/arm/include/asm/arch-orion5x/config.h b/arch/arm/include/asm/arch-orion5x/config.h new file mode 100644 index 0000000..6db3554 --- /dev/null +++ b/arch/arm/include/asm/arch-orion5x/config.h @@ -0,0 +1,135 @@ +/* + * (C) Copyright 2011 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Lei Wen leiwen@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 + */ + +/* + * This file should be included in board config header file. + * + * It supports common definitions for Orion platform + */ + +#ifndef _ORION_CONFIG_H +#define _ORION_CONFIG_H + +#include <asm/arch/orion5x.h> +#define MV_UART_CONSOLE_BASE ORION5X_UART0_BASE + +/* + * Board-specific values for Orion5x MPP low level init: + * - MPPs 12 to 15 are SATA LEDs (mode 5) + * - Others are GPIO/unused (mode 3 for MPP0, mode 5 for + * MPP16 to MPP19, mode 0 for others + */ + +#define ORION5X_MPP0_7 0x00000003 +#define ORION5X_MPP8_15 0x55550000 +#define ORION5X_MPP16_23 0x00005555 + +/* + * Board-specific values for Orion5x GPIO low level init: + * - GPIO3 is input (RTC interrupt) + * - GPIO16 is Power LED control (0 = on, 1 = off) + * - GPIO17 is Power LED source select (0 = CPLD, 1 = GPIO16) + * - GPIO18 is Power Button status (0 = Released, 1 = Pressed) + * - Last GPIO is 26, further bits are supposed to be 0. + * Enable mask has ones for INPUT, 0 for OUTPUT. + * Default is LED ON. + */ + +#define ORION5X_GPIO_OUT_ENABLE 0x03fcffff +#define ORION5X_GPIO_OUT_VALUE 0x03fcffff + +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_SDRAM_BASE + 0x1000 - GENERATED_GBL_DATA_SIZE) +#define CONFIG_NR_DRAM_BANKS_MAX 1 +/* + * FLASH configuration + */ +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_FLASH_CFI_DRIVER +#define CONFIG_FLASH_CFI_LEGACY +#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of flash banks */ +#define CONFIG_SYS_MAX_FLASH_SECT 11 /* max num of sects on one chip */ +#define CONFIG_SYS_FLASH_BASE 0xfff80000 +#define CONFIG_SYS_FLASH_SECTSZ \ + {16384, 8192, 8192, 32768, \ + 65536, 65536, 65536, 65536, 65536, 65536, 65536} + +/* + * Network + */ + +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE /* Enable Marvell GbE Driver */ +#define CONFIG_MVGBE_PORTS {1} /* enable port 0 only */ +#define CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION /* don't randomize MAC */ +#define CONFIG_PHY_BASE_ADR 0x8 +#define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */ +#define CONFIG_NETCONSOLE /* include NetConsole support */ +#define CONFIG_MII /* expose smi ove miiphy interface */ +#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */ +#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */ +#endif + +/* + * IDE + */ +#ifdef CONFIG_CMD_IDE +#define __io +#define CONFIG_IDE_PREINIT +#define CONFIG_DOS_PARTITION +#define CONFIG_CMD_EXT2 +/* ED Mini V has an IDE-compatible SATA connector for port 1 */ +#define CONFIG_MVSATA_IDE +#define CONFIG_MVSATA_IDE_USE_PORT1 +/* Needs byte-swapping for ATA data register */ +#define CONFIG_IDE_SWAP_IO +/* Data, registers and alternate blocks are at the same offset */ +#define CONFIG_SYS_ATA_DATA_OFFSET (0x0100) +#define CONFIG_SYS_ATA_REG_OFFSET (0x0100) +#define CONFIG_SYS_ATA_ALT_OFFSET (0x0100) +/* Each 8-bit ATA register is aligned to a 4-bytes address */ +#define CONFIG_SYS_ATA_STRIDE 4 +/* Controller supports 48-bits LBA addressing */ +#define CONFIG_LBA48 +/* A single bus, a single device */ +#define CONFIG_SYS_IDE_MAXBUS 1 +#define CONFIG_SYS_IDE_MAXDEVICE 1 +/* ATA registers base is at SATA controller base */ +#define CONFIG_SYS_ATA_BASE_ADDR ORION5X_SATA_BASE +/* ATA bus 0 is orion5x port 1 on ED Mini V2 */ +#define CONFIG_SYS_ATA_IDE0_OFFSET ORION5X_SATA_PORT1_OFFSET +/* end of IDE defines */ +#endif /* CMD_IDE */ + +/* + * I2C related stuff + */ +#ifdef CONFIG_CMD_I2C +#define CONFIG_I2C_MVTWSI +#define CONFIG_I2C_MVTWSI_BASE ORION5X_TWSI_BASE +#define CONFIG_SYS_I2C_SLAVE 0x0 +#define CONFIG_SYS_I2C_SPEED 100000 +#endif + +#endif /* _ORION_CONFIG_H */ diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h b/arch/arm/include/asm/arch-orion5x/orion5x.h index 9aeef88..18225b9 100644 --- a/arch/arm/include/asm/arch-orion5x/orion5x.h +++ b/arch/arm/include/asm/arch-orion5x/orion5x.h @@ -30,13 +30,7 @@ #ifndef _ASM_ARCH_ORION5X_H #define _ASM_ARCH_ORION5X_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - #if defined(CONFIG_FEROCEON) -#include <asm/arch/cpu.h>
/* SOC specific definations */ #define ORION5X_REGISTER(x) (ORION5X_REGS_PHY_BASE + x) diff --git a/common/cmd_ide.c b/common/cmd_ide.c index da5189c..d909c54 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -46,12 +46,6 @@ #include <mpc5xxx.h> #endif
-#ifdef CONFIG_ORION5X -#include <asm/arch/orion5x.h> -#elif defined CONFIG_KIRKWOOD -#include <asm/arch/kirkwood.h> -#endif - #include <ide.h> #include <ata.h>
diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h index f8affa8..255e4fd 100644 --- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -46,150 +46,14 @@ #define CONFIG_MACH_EDMINIV2 1 /* Machine type */
/* - * CLKs configurations - */ - -#define CONFIG_SYS_HZ 1000 - -/* - * Board-specific values for Orion5x MPP low level init: - * - MPPs 12 to 15 are SATA LEDs (mode 5) - * - Others are GPIO/unused (mode 3 for MPP0, mode 5 for - * MPP16 to MPP19, mode 0 for others - */ - -#define ORION5X_MPP0_7 0x00000003 -#define ORION5X_MPP8_15 0x55550000 -#define ORION5X_MPP16_23 0x00005555 - -/* - * Board-specific values for Orion5x GPIO low level init: - * - GPIO3 is input (RTC interrupt) - * - GPIO16 is Power LED control (0 = on, 1 = off) - * - GPIO17 is Power LED source select (0 = CPLD, 1 = GPIO16) - * - GPIO18 is Power Button status (0 = Released, 1 = Pressed) - * - Last GPIO is 26, further bits are supposed to be 0. - * Enable mask has ones for INPUT, 0 for OUTPUT. - * Default is LED ON. - */ - -#define ORION5X_GPIO_OUT_ENABLE 0x03fcffff -#define ORION5X_GPIO_OUT_VALUE 0x03fcffff - -/* - * NS16550 Configuration - */ - -#define CONFIG_SYS_NS16550 -#define CONFIG_SYS_NS16550_SERIAL -#define CONFIG_SYS_NS16550_REG_SIZE (-4) -#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_TCLK -#define CONFIG_SYS_NS16550_COM1 ORION5X_UART0_BASE - -/* - * Serial Port configuration - * The following definitions let you select what serial you want to use - * for your console driver. - */ - -#define CONFIG_CONS_INDEX 1 /*Console on UART0 */ -#define CONFIG_BAUDRATE 115200 -#define CONFIG_SYS_BAUDRATE_TABLE \ - { 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 } - -/* - * FLASH configuration - */ - -#define CONFIG_SYS_FLASH_CFI -#define CONFIG_FLASH_CFI_DRIVER -#define CONFIG_FLASH_CFI_LEGACY -#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of flash banks */ -#define CONFIG_SYS_MAX_FLASH_SECT 11 /* max num of sects on one chip */ -#define CONFIG_SYS_FLASH_BASE 0xfff80000 -#define CONFIG_SYS_FLASH_SECTSZ \ - {16384, 8192, 8192, 32768, \ - 65536, 65536, 65536, 65536, 65536, 65536, 65536} - -/* auto boot */ -#define CONFIG_BOOTDELAY 3 /* default enable autoboot */ - -/* - * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is - * the maximum mapped by the Linux kernel during initialization. - */ -#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ -#define CONFIG_INITRD_TAG 1 /* enable INITRD tag */ -#define CONFIG_SETUP_MEMORY_TAGS 1 /* enable memory tag */ - -#define CONFIG_SYS_PROMPT "EDMiniV2> " /* Command Prompt */ -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */ -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \ - +sizeof(CONFIG_SYS_PROMPT) + 16) /* Print Buff */ -/* * Commands configuration - using default command set for now */ #include <config_cmd_default.h> #define CONFIG_CMD_IDE #define CONFIG_CMD_I2C
-/* - * Network - */ - -#ifdef CONFIG_CMD_NET -#define CONFIG_MVGBE /* Enable Marvell GbE Driver */ -#define CONFIG_MVGBE_PORTS {1} /* enable port 0 only */ -#define CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION /* don't randomize MAC */ -#define CONFIG_PHY_BASE_ADR 0x8 -#define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */ -#define CONFIG_NETCONSOLE /* include NetConsole support */ -#define CONFIG_MII /* expose smi ove miiphy interface */ -#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */ -#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */ -#endif - -/* - * IDE - */ -#ifdef CONFIG_CMD_IDE -#define __io -#define CONFIG_IDE_PREINIT -#define CONFIG_DOS_PARTITION -#define CONFIG_CMD_EXT2 -/* ED Mini V has an IDE-compatible SATA connector for port 1 */ -#define CONFIG_MVSATA_IDE -#define CONFIG_MVSATA_IDE_USE_PORT1 -/* Needs byte-swapping for ATA data register */ -#define CONFIG_IDE_SWAP_IO -/* Data, registers and alternate blocks are at the same offset */ -#define CONFIG_SYS_ATA_DATA_OFFSET (0x0100) -#define CONFIG_SYS_ATA_REG_OFFSET (0x0100) -#define CONFIG_SYS_ATA_ALT_OFFSET (0x0100) -/* Each 8-bit ATA register is aligned to a 4-bytes address */ -#define CONFIG_SYS_ATA_STRIDE 4 -/* Controller supports 48-bits LBA addressing */ -#define CONFIG_LBA48 -/* A single bus, a single device */ -#define CONFIG_SYS_IDE_MAXBUS 1 -#define CONFIG_SYS_IDE_MAXDEVICE 1 -/* ATA registers base is at SATA controller base */ -#define CONFIG_SYS_ATA_BASE_ADDR ORION5X_SATA_BASE -/* ATA bus 0 is orion5x port 1 on ED Mini V2 */ -#define CONFIG_SYS_ATA_IDE0_OFFSET ORION5X_SATA_PORT1_OFFSET -/* end of IDE defines */ -#endif /* CMD_IDE */ - -/* - * I2C related stuff - */ -#ifdef CONFIG_CMD_I2C -#define CONFIG_I2C_MVTWSI -#define CONFIG_I2C_MVTWSI_BASE ORION5X_TWSI_BASE -#define CONFIG_SYS_I2C_SLAVE 0x0 -#define CONFIG_SYS_I2C_SPEED 100000 -#endif +#include "mv-common.h" +#undef CONFIG_BOARD_EARLY_INIT_F
/* * Environment variables configurations @@ -199,30 +63,4 @@ #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_ENV_OFFSET 0x4000 /* env starts here */
-/* - * Size of malloc() pool - */ -#define CONFIG_SYS_MALLOC_LEN (1024 * 128) /* 128kB for malloc() */ - -/* - * Other required minimal configurations - */ -#define CONFIG_CONSOLE_INFO_QUIET /* some code reduction */ -#define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */ -#define CONFIG_ARCH_MISC_INIT /* call arch_misc_init() */ -#define CONFIG_DISPLAY_CPUINFO /* Display cpu info */ -#define CONFIG_NR_DRAM_BANKS 1 - -#define CONFIG_STACKSIZE 0x00100000 -#define CONFIG_SYS_LOAD_ADDR 0x00800000 -#define CONFIG_SYS_MEMTEST_START 0x00400000 -#define CONFIG_SYS_MEMTEST_END 0x007fffff -#define CONFIG_SYS_RESET_ADDRESS 0xffff0000 -#define CONFIG_SYS_MAXARGS 16 - -/* additions for new relocation code, must be added to all boards */ -#define CONFIG_SYS_SDRAM_BASE 0 -#define CONFIG_SYS_INIT_SP_ADDR \ - (CONFIG_SYS_SDRAM_BASE + 0x1000 - GENERATED_GBL_DATA_SIZE) - #endif /* _CONFIG_EDMINIV2_H */

-----Original Message----- From: Lei Wen [mailto:leiwen@marvell.com] Sent: Wednesday, October 26, 2011 7:52 AM To: Wolfgang Denk; Albert ARIBAUD; Prafulla Wadaskar; u- boot@lists.denx.de Subject: [PATCH V2] ARM: orion5x: reduce dependence of including platform file
For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com
Changelog: V2: seperate orion5x define structure as kirkwood and armada does
arch/arm/cpu/arm926ejs/orion5x/cpu.c | 2 + arch/arm/cpu/arm926ejs/orion5x/dram.c | 1 + arch/arm/cpu/arm926ejs/orion5x/timer.c | 1 + arch/arm/include/asm/arch-orion5x/config.h | 135 ++++++++++++++++++++++ arch/arm/include/asm/arch-orion5x/orion5x.h | 6 - common/cmd_ide.c | 6 - include/configs/edminiv2.h | 166 +--------
I think you are mixing two objective in one patch here.
1. using mv-common.h for orion5x platforms. 2. orion5x: reduce dependence of including platform file (i.e. ide, serial)
May you please split them accordingly?
...snip....
diff --git a/arch/arm/include/asm/arch-orion5x/config.h b/arch/arm/include/asm/arch-orion5x/config.h new file mode 100644 index 0000000..6db3554 --- /dev/null +++ b/arch/arm/include/asm/arch-orion5x/config.h @@ -0,0 +1,135 @@ +/*
- (C) Copyright 2011
- Marvell Semiconductor <www.marvell.com>
- Written-by: Lei Wen leiwen@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
- */
+/*
- This file should be included in board config header file.
- It supports common definitions for Orion platform
- */
+#ifndef _ORION_CONFIG_H +#define _ORION_CONFIG_H
+#include <asm/arch/orion5x.h> +#define MV_UART_CONSOLE_BASE ORION5X_UART0_BASE
+/*
- Board-specific values for Orion5x MPP low level init:
- MPPs 12 to 15 are SATA LEDs (mode 5)
- Others are GPIO/unused (mode 3 for MPP0, mode 5 for
- MPP16 to MPP19, mode 0 for others
- */
+#define ORION5X_MPP0_7 0x00000003 +#define ORION5X_MPP8_15 0x55550000 +#define ORION5X_MPP16_23 0x00005555
+/*
- Board-specific values for Orion5x GPIO low level init:
- GPIO3 is input (RTC interrupt)
- GPIO16 is Power LED control (0 = on, 1 = off)
- GPIO17 is Power LED source select (0 = CPLD, 1 = GPIO16)
- GPIO18 is Power Button status (0 = Released, 1 = Pressed)
- Last GPIO is 26, further bits are supposed to be 0.
- Enable mask has ones for INPUT, 0 for OUTPUT.
- Default is LED ON.
- */
+#define ORION5X_GPIO_OUT_ENABLE 0x03fcffff +#define ORION5X_GPIO_OUT_VALUE 0x03fcffff
MPP and GPIO configs are specific to each board and must go to board config file
Regards.. Prafulla ..

Hi Prafulla,
On Thu, Oct 27, 2011 at 5:02 PM, Prafulla Wadaskar prafulla@marvell.com wrote:
-----Original Message----- From: Lei Wen [mailto:leiwen@marvell.com] Sent: Wednesday, October 26, 2011 7:52 AM To: Wolfgang Denk; Albert ARIBAUD; Prafulla Wadaskar; u- boot@lists.denx.de Subject: [PATCH V2] ARM: orion5x: reduce dependence of including platform file
For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com
Changelog: V2: seperate orion5x define structure as kirkwood and armada does
arch/arm/cpu/arm926ejs/orion5x/cpu.c | 2 + arch/arm/cpu/arm926ejs/orion5x/dram.c | 1 + arch/arm/cpu/arm926ejs/orion5x/timer.c | 1 + arch/arm/include/asm/arch-orion5x/config.h | 135 ++++++++++++++++++++++ arch/arm/include/asm/arch-orion5x/orion5x.h | 6 - common/cmd_ide.c | 6 - include/configs/edminiv2.h | 166 +--------
I think you are mixing two objective in one patch here.
- using mv-common.h for orion5x platforms.
- orion5x: reduce dependence of including platform file (i.e. ide, serial)
May you please split them accordingly?
...snip....
diff --git a/arch/arm/include/asm/arch-orion5x/config.h b/arch/arm/include/asm/arch-orion5x/config.h new file mode 100644 index 0000000..6db3554 --- /dev/null +++ b/arch/arm/include/asm/arch-orion5x/config.h @@ -0,0 +1,135 @@ +/*
- (C) Copyright 2011
- Marvell Semiconductor <www.marvell.com>
- Written-by: Lei Wen leiwen@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
- */
+/*
- This file should be included in board config header file.
- It supports common definitions for Orion platform
- */
+#ifndef _ORION_CONFIG_H +#define _ORION_CONFIG_H
+#include <asm/arch/orion5x.h> +#define MV_UART_CONSOLE_BASE ORION5X_UART0_BASE
+/*
- Board-specific values for Orion5x MPP low level init:
- MPPs 12 to 15 are SATA LEDs (mode 5)
- Others are GPIO/unused (mode 3 for MPP0, mode 5 for
- MPP16 to MPP19, mode 0 for others
- */
+#define ORION5X_MPP0_7 0x00000003 +#define ORION5X_MPP8_15 0x55550000 +#define ORION5X_MPP16_23 0x00005555
+/*
- Board-specific values for Orion5x GPIO low level init:
- GPIO3 is input (RTC interrupt)
- GPIO16 is Power LED control (0 = on, 1 = off)
- GPIO17 is Power LED source select (0 = CPLD, 1 = GPIO16)
- GPIO18 is Power Button status (0 = Released, 1 = Pressed)
- Last GPIO is 26, further bits are supposed to be 0.
- Enable mask has ones for INPUT, 0 for OUTPUT.
- Default is LED ON.
- */
+#define ORION5X_GPIO_OUT_ENABLE 0x03fcffff +#define ORION5X_GPIO_OUT_VALUE 0x03fcffff
MPP and GPIO configs are specific to each board and must go to board config file
It seems to me that orion5x fixing patch already merged in both u-boot-marvell.git and u-boot-arm.git. And I try to build the edminiv2_config in both git, no preview warning at all...
So it seems this v2 patch could be abondoned...
Best regards, Lei

Build pass with following config: dkb_config aspenite_config
Signed-off-by: Lei Wen leiwen@marvell.com --- drivers/gpio/mvmfp.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/mvmfp.c b/drivers/gpio/mvmfp.c index e7830c6..f56c037 100644 --- a/drivers/gpio/mvmfp.c +++ b/drivers/gpio/mvmfp.c @@ -26,13 +26,6 @@ #include <asm/io.h> #include <mvmfp.h> #include <asm/arch/mfp.h> -#ifdef CONFIG_ARMADA100 -#include <asm/arch/armada100.h> -#elif defined(CONFIG_PANTHEON) -#include <asm/arch/pantheon.h> -#else -#error Unsupported SoC... -#endif
/* * mfp_config

Dear Lei
I was pulling this patch series. I found certain patches could not be applied, I had resolved them since gplugd are in. But I found certain warnings and errors if I build with aspenite_config
May you please pull the u-boot-marvell.git master and rebase and resend your patches with above resolution?
Regards.. Prafulla . . .
-----Original Message----- From: Lei Wen [mailto:adrian.wenl@gmail.com] Sent: Sunday, October 02, 2011 7:47 PM To: Prafulla Wadaskar; u-boot@lists.denx.de Subject: [PATCH 0/5] Marvell: reduce dependence files
Reduce the dependence between driver files and platform files
Lei Wen (5): ARM: pantheon: reduce dependence of including platform file ARM: armada100: reduce dependence of including platform file ARM: kirkwood: reduce dependence of including platform file serial: reduce include platform file for marvell chip gpio: mvmfp: reduce include platform file
arch/arm/cpu/arm926ejs/armada100/cpu.c | 2 +- arch/arm/cpu/arm926ejs/armada100/dram.c | 1 + arch/arm/cpu/arm926ejs/armada100/timer.c | 1 + arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/dram.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/mpp.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/timer.c | 1 + arch/arm/cpu/arm926ejs/pantheon/cpu.c | 2 +- arch/arm/cpu/arm926ejs/pantheon/dram.c | 1 + arch/arm/cpu/arm926ejs/pantheon/timer.c | 1 + arch/arm/include/asm/arch-armada100/armada100.h | 63 ----------------
arch/arm/include/asm/arch-armada100/config.h | 1 + arch/arm/include/asm/arch-armada100/cpu.h | 57 ++++++++++++++++++++ arch/arm/include/asm/arch-kirkwood/config.h | 1 + arch/arm/include/asm/arch-kirkwood/kirkwood.h | 6 -- arch/arm/include/asm/arch-pantheon/config.h | 2 + arch/arm/include/asm/arch-pantheon/pantheon.h | 7 --- board/Marvell/aspenite/aspenite.c | 1 + board/Marvell/guruplug/guruplug.c | 1 + board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c | 1 + board/Marvell/openrd/openrd.c | 1 + board/Marvell/rd6281a/rd6281a.c | 1 + board/Marvell/sheevaplug/sheevaplug.c | 1 + board/keymile/km_arm/km_arm.c | 1 + drivers/gpio/kw_gpio.c | 1 + drivers/gpio/mvmfp.c | 7 --- drivers/net/mvgbe.c | 2 + drivers/serial/serial.c | 9 --- drivers/spi/kirkwood_spi.c | 1 + drivers/usb/host/ehci-kirkwood.c | 1 + 30 files changed, 86 insertions(+), 94 deletions(-)

Hi Prafulla,
On Fri, Oct 14, 2011 at 6:19 PM, Prafulla Wadaskar prafulla@marvell.com wrote:
Dear Lei
I was pulling this patch series. I found certain patches could not be applied, I had resolved them since gplugd are in. But I found certain warnings and errors if I build with aspenite_config
May you please pull the u-boot-marvell.git master and rebase and resend your patches with above resolution?
I have resubmit the patch against latest u-boot-marvell.git, and test with aspenite and dkb config build. Please help to merge again.
Thanks, Lei

Changelog: V2: rebase over latest u-boot-marvell.git
Lei Wen (5): ARM: pantheon: reduce dependence of including platform file ARM: armada100: reduce dependence of including platform file ARM: kirkwood: reduce dependence of including platform file serial: reduce include platform file for marvell chip gpio: mvmfp: reduce include platform file
arch/arm/cpu/arm926ejs/armada100/cpu.c | 2 +- arch/arm/cpu/arm926ejs/armada100/dram.c | 1 + arch/arm/cpu/arm926ejs/armada100/timer.c | 1 + arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/dram.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/mpp.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/timer.c | 1 + arch/arm/cpu/arm926ejs/pantheon/cpu.c | 2 +- arch/arm/cpu/arm926ejs/pantheon/dram.c | 1 + arch/arm/cpu/arm926ejs/pantheon/timer.c | 1 + arch/arm/include/asm/arch-armada100/armada100.h | 131 ----------------------- arch/arm/include/asm/arch-armada100/config.h | 1 + arch/arm/include/asm/arch-armada100/cpu.h | 57 ++++++++++ arch/arm/include/asm/arch-kirkwood/config.h | 1 + arch/arm/include/asm/arch-kirkwood/kirkwood.h | 6 - arch/arm/include/asm/arch-pantheon/config.h | 2 + arch/arm/include/asm/arch-pantheon/pantheon.h | 7 -- board/Marvell/aspenite/aspenite.c | 1 + board/Marvell/guruplug/guruplug.c | 1 + board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c | 1 + board/Marvell/openrd/openrd.c | 1 + board/Marvell/rd6281a/rd6281a.c | 1 + board/Marvell/sheevaplug/sheevaplug.c | 1 + board/keymile/km_arm/km_arm.c | 1 + drivers/gpio/kw_gpio.c | 1 + drivers/gpio/mvmfp.c | 7 -- drivers/net/mvgbe.c | 2 + drivers/serial/serial.c | 9 -- drivers/spi/kirkwood_spi.c | 1 + drivers/usb/host/ehci-kirkwood.c | 1 + 30 files changed, 86 insertions(+), 162 deletions(-)

-----Original Message----- From: Lei Wen [mailto:leiwen@marvell.com] Sent: Friday, October 14, 2011 8:04 PM To: Prafulla Wadaskar; Wolfgang Denk; u-boot@lists.denx.de Subject: [PATCH V2 0/5] Marvell: reduce dependence files
Changelog: V2: rebase over latest u-boot-marvell.git
Lei Wen (5): ARM: pantheon: reduce dependence of including platform file ARM: armada100: reduce dependence of including platform file ARM: kirkwood: reduce dependence of including platform file serial: reduce include platform file for marvell chip gpio: mvmfp: reduce include platform file
arch/arm/cpu/arm926ejs/armada100/cpu.c | 2 +- arch/arm/cpu/arm926ejs/armada100/dram.c | 1 + arch/arm/cpu/arm926ejs/armada100/timer.c | 1 + arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/dram.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/mpp.c | 2 + arch/arm/cpu/arm926ejs/kirkwood/timer.c | 1 + arch/arm/cpu/arm926ejs/pantheon/cpu.c | 2 +- arch/arm/cpu/arm926ejs/pantheon/dram.c | 1 + arch/arm/cpu/arm926ejs/pantheon/timer.c | 1 + arch/arm/include/asm/arch-armada100/armada100.h | 131 ----------------
arch/arm/include/asm/arch-armada100/config.h | 1 + arch/arm/include/asm/arch-armada100/cpu.h | 57 ++++++++++ arch/arm/include/asm/arch-kirkwood/config.h | 1 + arch/arm/include/asm/arch-kirkwood/kirkwood.h | 6 - arch/arm/include/asm/arch-pantheon/config.h | 2 + arch/arm/include/asm/arch-pantheon/pantheon.h | 7 -- board/Marvell/aspenite/aspenite.c | 1 + board/Marvell/guruplug/guruplug.c | 1 + board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c | 1 + board/Marvell/openrd/openrd.c | 1 + board/Marvell/rd6281a/rd6281a.c | 1 + board/Marvell/sheevaplug/sheevaplug.c | 1 + board/keymile/km_arm/km_arm.c | 1 + drivers/gpio/kw_gpio.c | 1 + drivers/gpio/mvmfp.c | 7 -- drivers/net/mvgbe.c | 2 + drivers/serial/serial.c | 9 -- drivers/spi/kirkwood_spi.c | 1 + drivers/usb/host/ehci-kirkwood.c | 1 + 30 files changed, 86 insertions(+), 162 deletions(-)
Applied the patch series to u-boot-marvell.git master branch
Regards.. Prafulla . .

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- Changelog: V2: no change
arch/arm/cpu/arm926ejs/pantheon/cpu.c | 2 +- arch/arm/cpu/arm926ejs/pantheon/dram.c | 1 + arch/arm/cpu/arm926ejs/pantheon/timer.c | 1 + arch/arm/include/asm/arch-pantheon/config.h | 2 ++ arch/arm/include/asm/arch-pantheon/pantheon.h | 7 ------- 5 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/pantheon/cpu.c b/arch/arm/cpu/arm926ejs/pantheon/cpu.c index 8b2eafa..efc9395 100644 --- a/arch/arm/cpu/arm926ejs/pantheon/cpu.c +++ b/arch/arm/cpu/arm926ejs/pantheon/cpu.c @@ -23,8 +23,8 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/pantheon.h> -#include <asm/io.h>
#define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1)) #define SET_MRVL_ID (1<<8) diff --git a/arch/arm/cpu/arm926ejs/pantheon/dram.c b/arch/arm/cpu/arm926ejs/pantheon/dram.c index bbca7ee..a3d719e 100644 --- a/arch/arm/cpu/arm926ejs/pantheon/dram.c +++ b/arch/arm/cpu/arm926ejs/pantheon/dram.c @@ -23,6 +23,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/pantheon.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/pantheon/timer.c b/arch/arm/cpu/arm926ejs/pantheon/timer.c index c71162a..17045b1 100644 --- a/arch/arm/cpu/arm926ejs/pantheon/timer.c +++ b/arch/arm/cpu/arm926ejs/pantheon/timer.c @@ -23,6 +23,7 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/pantheon.h>
/* diff --git a/arch/arm/include/asm/arch-pantheon/config.h b/arch/arm/include/asm/arch-pantheon/config.h index 5658592..fd23c97 100644 --- a/arch/arm/include/asm/arch-pantheon/config.h +++ b/arch/arm/include/asm/arch-pantheon/config.h @@ -25,6 +25,8 @@ #ifndef _PANTHEON_CONFIG_H #define _PANTHEON_CONFIG_H
+#include <asm/arch/pantheon.h> + #define CONFIG_ARM926EJS 1 /* Basic Architecture */
#define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */ diff --git a/arch/arm/include/asm/arch-pantheon/pantheon.h b/arch/arm/include/asm/arch-pantheon/pantheon.h index e4ed087..c7fe646 100644 --- a/arch/arm/include/asm/arch-pantheon/pantheon.h +++ b/arch/arm/include/asm/arch-pantheon/pantheon.h @@ -25,13 +25,6 @@ #ifndef _PANTHEON_H #define _PANTHEON_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - -#include <asm/arch/cpu.h> - /* Common APB clock register bit definitions */ #define APBC_APBCLK (1<<0) /* APB Bus Clock Enable */ #define APBC_FNCLK (1<<1) /* Functional Clock Enable */

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- Changelog: V2: no change
arch/arm/cpu/arm926ejs/armada100/cpu.c | 2 +- arch/arm/cpu/arm926ejs/armada100/dram.c | 1 + arch/arm/cpu/arm926ejs/armada100/timer.c | 1 + arch/arm/include/asm/arch-armada100/armada100.h | 131 ----------------------- arch/arm/include/asm/arch-armada100/config.h | 1 + arch/arm/include/asm/arch-armada100/cpu.h | 57 ++++++++++ board/Marvell/aspenite/aspenite.c | 1 + 7 files changed, 62 insertions(+), 132 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c b/arch/arm/cpu/arm926ejs/armada100/cpu.c index c21938e..14121a0 100644 --- a/arch/arm/cpu/arm926ejs/armada100/cpu.c +++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c @@ -24,8 +24,8 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/armada100.h> -#include <asm/io.h>
#define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1)) #define SET_MRVL_ID (1<<8) diff --git a/arch/arm/cpu/arm926ejs/armada100/dram.c b/arch/arm/cpu/arm926ejs/armada100/dram.c index eacec23..8609004 100644 --- a/arch/arm/cpu/arm926ejs/armada100/dram.c +++ b/arch/arm/cpu/arm926ejs/armada100/dram.c @@ -24,6 +24,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/armada100.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c index 82a6d7b..fbade4b 100644 --- a/arch/arm/cpu/arm926ejs/armada100/timer.c +++ b/arch/arm/cpu/arm926ejs/armada100/timer.c @@ -24,6 +24,7 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/armada100.h>
/* diff --git a/arch/arm/include/asm/arch-armada100/armada100.h b/arch/arm/include/asm/arch-armada100/armada100.h index a8181b6..0ed3a8e 100644 --- a/arch/arm/include/asm/arch-armada100/armada100.h +++ b/arch/arm/include/asm/arch-armada100/armada100.h @@ -26,13 +26,7 @@ #ifndef _ASM_ARCH_ARMADA100_H #define _ASM_ARCH_ARMADA100_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - #if defined (CONFIG_ARMADA100) -#include <asm/arch/cpu.h>
/* Common APB clock register bit definitions */ #define APBC_APBCLK (1<<0) /* APB Bus Clock Enable */ @@ -69,130 +63,5 @@ #define ARMD1_APMU_BASE 0xD4282800 #define ARMD1_CPU_BASE 0xD4282C00
-/* - * Main Power Management (MPMU) Registers - * Refer Datasheet Appendix A.8 - */ -struct armd1mpmu_registers { - u8 pad0[0x08 - 0x00]; - u32 fccr; /*0x0008*/ - u32 pocr; /*0x000c*/ - u32 posr; /*0x0010*/ - u32 succr; /*0x0014*/ - u8 pad1[0x030 - 0x014 - 4]; - u32 gpcr; /*0x0030*/ - u8 pad2[0x200 - 0x030 - 4]; - u32 wdtpcr; /*0x0200*/ - u8 pad3[0x1000 - 0x200 - 4]; - u32 apcr; /*0x1000*/ - u32 apsr; /*0x1004*/ - u8 pad4[0x1020 - 0x1004 - 4]; - u32 aprr; /*0x1020*/ - u32 acgr; /*0x1024*/ - u32 arsr; /*0x1028*/ -}; - -/* - * Application Subsystem Power Management - * Refer Datasheet Appendix A.9 - */ -struct armd1apmu_registers { - u32 pcr; /* 0x000 */ - u32 ccr; /* 0x004 */ - u32 pad1; - u32 ccsr; /* 0x00C */ - u32 fc_timer; /* 0x010 */ - u32 pad2; - u32 ideal_cfg; /* 0x018 */ - u8 pad3[0x04C - 0x018 - 4]; - u32 lcdcrc; /* 0x04C */ - u32 cciccrc; /* 0x050 */ - u32 sd1crc; /* 0x054 */ - u32 sd2crc; /* 0x058 */ - u32 usbcrc; /* 0x05C */ - u32 nfccrc; /* 0x060 */ - u32 dmacrc; /* 0x064 */ - u32 pad4; - u32 buscrc; /* 0x06C */ - u8 pad5[0x07C - 0x06C - 4]; - u32 wake_clr; /* 0x07C */ - u8 pad6[0x090 - 0x07C - 4]; - u32 core_status; /* 0x090 */ - u32 rfsc; /* 0x094 */ - u32 imr; /* 0x098 */ - u32 irwc; /* 0x09C */ - u32 isr; /* 0x0A0 */ - u8 pad7[0x0B0 - 0x0A0 - 4]; - u32 mhst; /* 0x0B0 */ - u32 msr; /* 0x0B4 */ - u8 pad8[0x0C0 - 0x0B4 - 4]; - u32 msst; /* 0x0C0 */ - u32 pllss; /* 0x0C4 */ - u32 smb; /* 0x0C8 */ - u32 gccrc; /* 0x0CC */ - u8 pad9[0x0D4 - 0x0CC - 4]; - u32 smccrc; /* 0x0D4 */ - u32 pad10; - u32 xdcrc; /* 0x0DC */ - u32 sd3crc; /* 0x0E0 */ - u32 sd4crc; /* 0x0E4 */ - u8 pad11[0x0F0 - 0x0E4 - 4]; - u32 cfcrc; /* 0x0F0 */ - u32 mspcrc; /* 0x0F4 */ - u32 cmucrc; /* 0x0F8 */ - u32 fecrc; /* 0x0FC */ - u32 pciecrc; /* 0x100 */ - u32 epdcrc; /* 0x104 */ -}; - -/* - * APB1 Clock Reset/Control Registers - * Refer Datasheet Appendix A.10 - */ -struct armd1apb1_registers { - u32 uart1; /*0x000*/ - u32 uart2; /*0x004*/ - u32 gpio; /*0x008*/ - u32 pwm1; /*0x00c*/ - u32 pwm2; /*0x010*/ - u32 pwm3; /*0x014*/ - u32 pwm4; /*0x018*/ - u8 pad0[0x028 - 0x018 - 4]; - u32 rtc; /*0x028*/ - u32 twsi0; /*0x02c*/ - u32 kpc; /*0x030*/ - u32 timers; /*0x034*/ - u8 pad1[0x03c - 0x034 - 4]; - u32 aib; /*0x03c*/ - u32 sw_jtag; /*0x040*/ - u32 timer1; /*0x044*/ - u32 onewire; /*0x048*/ - u8 pad2[0x050 - 0x048 - 4]; - u32 asfar; /*0x050 AIB Secure First Access Reg*/ - u32 assar; /*0x054 AIB Secure Second Access Reg*/ - u8 pad3[0x06c - 0x054 - 4]; - u32 twsi1; /*0x06c*/ - u32 uart3; /*0x070*/ - u8 pad4[0x07c - 0x070 - 4]; - u32 timer2; /*0x07C*/ - u8 pad5[0x084 - 0x07c - 4]; - u32 ac97; /*0x084*/ -}; - -/* -* APB2 Clock Reset/Control Registers -* Refer Datasheet Appendix A.11 -*/ -struct armd1apb2_registers { - u32 pad1[0x01C - 0x000]; - u32 ssp1_clkrst; /* 0x01C */ - u32 ssp2_clkrst; /* 0x020 */ - u32 pad2[0x04C - 0x020 - 4]; - u32 ssp3_clkrst; /* 0x04C */ - u32 pad3[0x058 - 0x04C - 4]; - u32 ssp4_clkrst; /* 0x058 */ - u32 ssp5_clkrst; /* 0x05C */ -}; - #endif /* CONFIG_ARMADA100 */ #endif /* _ASM_ARCH_ARMADA100_H */ diff --git a/arch/arm/include/asm/arch-armada100/config.h b/arch/arm/include/asm/arch-armada100/config.h index 1126b38..d2094e5 100644 --- a/arch/arm/include/asm/arch-armada100/config.h +++ b/arch/arm/include/asm/arch-armada100/config.h @@ -31,6 +31,7 @@ #ifndef _ARMD1_CONFIG_H #define _ARMD1_CONFIG_H
+#include <asm/arch/armada100.h> #define CONFIG_ARM926EJS 1 /* Basic Architecture */
#define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */ diff --git a/arch/arm/include/asm/arch-armada100/cpu.h b/arch/arm/include/asm/arch-armada100/cpu.h index 0518a6a..f7ec938 100644 --- a/arch/arm/include/asm/arch-armada100/cpu.h +++ b/arch/arm/include/asm/arch-armada100/cpu.h @@ -29,6 +29,63 @@ #include <asm/system.h>
/* + * Main Power Management (MPMU) Registers + * Refer Datasheet Appendix A.8 + */ +struct armd1mpmu_registers { + u8 pad0[0x08 - 0x00]; + u32 fccr; /*0x0008*/ + u32 pocr; /*0x000c*/ + u32 posr; /*0x0010*/ + u32 succr; /*0x0014*/ + u8 pad1[0x030 - 0x014 - 4]; + u32 gpcr; /*0x0030*/ + u8 pad2[0x200 - 0x030 - 4]; + u32 wdtpcr; /*0x0200*/ + u8 pad3[0x1000 - 0x200 - 4]; + u32 apcr; /*0x1000*/ + u32 apsr; /*0x1004*/ + u8 pad4[0x1020 - 0x1004 - 4]; + u32 aprr; /*0x1020*/ + u32 acgr; /*0x1024*/ + u32 arsr; /*0x1028*/ +}; + +/* + * APB1 Clock Reset/Control Registers + * Refer Datasheet Appendix A.10 + */ +struct armd1apb1_registers { + u32 uart1; /*0x000*/ + u32 uart2; /*0x004*/ + u32 gpio; /*0x008*/ + u32 pwm1; /*0x00c*/ + u32 pwm2; /*0x010*/ + u32 pwm3; /*0x014*/ + u32 pwm4; /*0x018*/ + u8 pad0[0x028 - 0x018 - 4]; + u32 rtc; /*0x028*/ + u32 twsi0; /*0x02c*/ + u32 kpc; /*0x030*/ + u32 timers; /*0x034*/ + u8 pad1[0x03c - 0x034 - 4]; + u32 aib; /*0x03c*/ + u32 sw_jtag; /*0x040*/ + u32 timer1; /*0x044*/ + u32 onewire; /*0x048*/ + u8 pad2[0x050 - 0x048 - 4]; + u32 asfar; /*0x050 AIB Secure First Access Reg*/ + u32 assar; /*0x054 AIB Secure Second Access Reg*/ + u8 pad3[0x06c - 0x054 - 4]; + u32 twsi1; /*0x06c*/ + u32 uart3; /*0x070*/ + u8 pad4[0x07c - 0x070 - 4]; + u32 timer2; /*0x07C*/ + u8 pad5[0x084 - 0x07c - 4]; + u32 ac97; /*0x084*/ +}; + +/* * CPU Interface Registers * Refer Datasheet Appendix A.2 */ diff --git a/board/Marvell/aspenite/aspenite.c b/board/Marvell/aspenite/aspenite.c index 34ac7aa..3be33bf 100644 --- a/board/Marvell/aspenite/aspenite.c +++ b/board/Marvell/aspenite/aspenite.c @@ -25,6 +25,7 @@
#include <common.h> #include <mvmfp.h> +#include <asm/arch/cpu.h> #include <asm/arch/mfp.h> #include <asm/arch/armada100.h>

-----Original Message----- From: Lei Wen [mailto:leiwen@marvell.com] Sent: Friday, October 14, 2011 8:04 PM To: Prafulla Wadaskar; Wolfgang Denk; u-boot@lists.denx.de Subject: [PATCH V2 2/5] ARM: armada100: reduce dependence of including platform file
For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com
Changelog: V2: no change
arch/arm/cpu/arm926ejs/armada100/cpu.c | 2 +- arch/arm/cpu/arm926ejs/armada100/dram.c | 1 + arch/arm/cpu/arm926ejs/armada100/timer.c | 1 + arch/arm/include/asm/arch-armada100/armada100.h | 131 ----------------
arch/arm/include/asm/arch-armada100/config.h | 1 + arch/arm/include/asm/arch-armada100/cpu.h | 57 ++++++++++
Hi Lei
You have not added the same set of lines to cpu.h those are removed from armada100.h, that gives build error for gplugd board.
I have updated this patch and committed.
Regards.. Prafulla . .
board/Marvell/aspenite/aspenite.c | 1 + 7 files changed, 62 insertions(+), 132 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c b/arch/arm/cpu/arm926ejs/armada100/cpu.c index c21938e..14121a0 100644 --- a/arch/arm/cpu/arm926ejs/armada100/cpu.c +++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c @@ -24,8 +24,8 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/armada100.h> -#include <asm/io.h>
#define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1)) #define SET_MRVL_ID (1<<8) diff --git a/arch/arm/cpu/arm926ejs/armada100/dram.c b/arch/arm/cpu/arm926ejs/armada100/dram.c index eacec23..8609004 100644 --- a/arch/arm/cpu/arm926ejs/armada100/dram.c +++ b/arch/arm/cpu/arm926ejs/armada100/dram.c @@ -24,6 +24,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/armada100.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c index 82a6d7b..fbade4b 100644 --- a/arch/arm/cpu/arm926ejs/armada100/timer.c +++ b/arch/arm/cpu/arm926ejs/armada100/timer.c @@ -24,6 +24,7 @@ */
#include <common.h> +#include <asm/arch/cpu.h> #include <asm/arch/armada100.h>
/* diff --git a/arch/arm/include/asm/arch-armada100/armada100.h b/arch/arm/include/asm/arch-armada100/armada100.h index a8181b6..0ed3a8e 100644 --- a/arch/arm/include/asm/arch-armada100/armada100.h +++ b/arch/arm/include/asm/arch-armada100/armada100.h @@ -26,13 +26,7 @@ #ifndef _ASM_ARCH_ARMADA100_H #define _ASM_ARCH_ARMADA100_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */
#if defined (CONFIG_ARMADA100) -#include <asm/arch/cpu.h>
/* Common APB clock register bit definitions */ #define APBC_APBCLK (1<<0) /* APB Bus Clock Enable */ @@ -69,130 +63,5 @@ #define ARMD1_APMU_BASE 0xD4282800 #define ARMD1_CPU_BASE 0xD4282C00
-/*
- Main Power Management (MPMU) Registers
- Refer Datasheet Appendix A.8
- */
-struct armd1mpmu_registers {
- u8 pad0[0x08 - 0x00];
- u32 fccr; /*0x0008*/
- u32 pocr; /*0x000c*/
- u32 posr; /*0x0010*/
- u32 succr; /*0x0014*/
- u8 pad1[0x030 - 0x014 - 4];
- u32 gpcr; /*0x0030*/
- u8 pad2[0x200 - 0x030 - 4];
- u32 wdtpcr; /*0x0200*/
- u8 pad3[0x1000 - 0x200 - 4];
- u32 apcr; /*0x1000*/
- u32 apsr; /*0x1004*/
- u8 pad4[0x1020 - 0x1004 - 4];
- u32 aprr; /*0x1020*/
- u32 acgr; /*0x1024*/
- u32 arsr; /*0x1028*/
-};
-/*
- Application Subsystem Power Management
- Refer Datasheet Appendix A.9
- */
-struct armd1apmu_registers {
- u32 pcr; /* 0x000 */
- u32 ccr; /* 0x004 */
- u32 pad1;
- u32 ccsr; /* 0x00C */
- u32 fc_timer; /* 0x010 */
- u32 pad2;
- u32 ideal_cfg; /* 0x018 */
- u8 pad3[0x04C - 0x018 - 4];
- u32 lcdcrc; /* 0x04C */
- u32 cciccrc; /* 0x050 */
- u32 sd1crc; /* 0x054 */
- u32 sd2crc; /* 0x058 */
- u32 usbcrc; /* 0x05C */
- u32 nfccrc; /* 0x060 */
- u32 dmacrc; /* 0x064 */
- u32 pad4;
- u32 buscrc; /* 0x06C */
- u8 pad5[0x07C - 0x06C - 4];
- u32 wake_clr; /* 0x07C */
- u8 pad6[0x090 - 0x07C - 4];
- u32 core_status; /* 0x090 */
- u32 rfsc; /* 0x094 */
- u32 imr; /* 0x098 */
- u32 irwc; /* 0x09C */
- u32 isr; /* 0x0A0 */
- u8 pad7[0x0B0 - 0x0A0 - 4];
- u32 mhst; /* 0x0B0 */
- u32 msr; /* 0x0B4 */
- u8 pad8[0x0C0 - 0x0B4 - 4];
- u32 msst; /* 0x0C0 */
- u32 pllss; /* 0x0C4 */
- u32 smb; /* 0x0C8 */
- u32 gccrc; /* 0x0CC */
- u8 pad9[0x0D4 - 0x0CC - 4];
- u32 smccrc; /* 0x0D4 */
- u32 pad10;
- u32 xdcrc; /* 0x0DC */
- u32 sd3crc; /* 0x0E0 */
- u32 sd4crc; /* 0x0E4 */
- u8 pad11[0x0F0 - 0x0E4 - 4];
- u32 cfcrc; /* 0x0F0 */
- u32 mspcrc; /* 0x0F4 */
- u32 cmucrc; /* 0x0F8 */
- u32 fecrc; /* 0x0FC */
- u32 pciecrc; /* 0x100 */
- u32 epdcrc; /* 0x104 */
-};
-/*
- APB1 Clock Reset/Control Registers
- Refer Datasheet Appendix A.10
- */
-struct armd1apb1_registers {
- u32 uart1; /*0x000*/
- u32 uart2; /*0x004*/
- u32 gpio; /*0x008*/
- u32 pwm1; /*0x00c*/
- u32 pwm2; /*0x010*/
- u32 pwm3; /*0x014*/
- u32 pwm4; /*0x018*/
- u8 pad0[0x028 - 0x018 - 4];
- u32 rtc; /*0x028*/
- u32 twsi0; /*0x02c*/
- u32 kpc; /*0x030*/
- u32 timers; /*0x034*/
- u8 pad1[0x03c - 0x034 - 4];
- u32 aib; /*0x03c*/
- u32 sw_jtag; /*0x040*/
- u32 timer1; /*0x044*/
- u32 onewire; /*0x048*/
- u8 pad2[0x050 - 0x048 - 4];
- u32 asfar; /*0x050 AIB Secure First Access Reg*/
- u32 assar; /*0x054 AIB Secure Second Access Reg*/
- u8 pad3[0x06c - 0x054 - 4];
- u32 twsi1; /*0x06c*/
- u32 uart3; /*0x070*/
- u8 pad4[0x07c - 0x070 - 4];
- u32 timer2; /*0x07C*/
- u8 pad5[0x084 - 0x07c - 4];
- u32 ac97; /*0x084*/
-};
-/* -* APB2 Clock Reset/Control Registers -* Refer Datasheet Appendix A.11 -*/ -struct armd1apb2_registers {
- u32 pad1[0x01C - 0x000];
- u32 ssp1_clkrst; /* 0x01C */
- u32 ssp2_clkrst; /* 0x020 */
- u32 pad2[0x04C - 0x020 - 4];
- u32 ssp3_clkrst; /* 0x04C */
- u32 pad3[0x058 - 0x04C - 4];
- u32 ssp4_clkrst; /* 0x058 */
- u32 ssp5_clkrst; /* 0x05C */
-};
#endif /* CONFIG_ARMADA100 */ #endif /* _ASM_ARCH_ARMADA100_H */ diff --git a/arch/arm/include/asm/arch-armada100/config.h b/arch/arm/include/asm/arch-armada100/config.h index 1126b38..d2094e5 100644 --- a/arch/arm/include/asm/arch-armada100/config.h +++ b/arch/arm/include/asm/arch-armada100/config.h @@ -31,6 +31,7 @@ #ifndef _ARMD1_CONFIG_H #define _ARMD1_CONFIG_H
+#include <asm/arch/armada100.h> #define CONFIG_ARM926EJS 1 /* Basic Architecture */
#define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */ diff --git a/arch/arm/include/asm/arch-armada100/cpu.h b/arch/arm/include/asm/arch-armada100/cpu.h index 0518a6a..f7ec938 100644 --- a/arch/arm/include/asm/arch-armada100/cpu.h +++ b/arch/arm/include/asm/arch-armada100/cpu.h @@ -29,6 +29,63 @@ #include <asm/system.h>
/*
- Main Power Management (MPMU) Registers
- Refer Datasheet Appendix A.8
- */
+struct armd1mpmu_registers {
- u8 pad0[0x08 - 0x00];
- u32 fccr; /*0x0008*/
- u32 pocr; /*0x000c*/
- u32 posr; /*0x0010*/
- u32 succr; /*0x0014*/
- u8 pad1[0x030 - 0x014 - 4];
- u32 gpcr; /*0x0030*/
- u8 pad2[0x200 - 0x030 - 4];
- u32 wdtpcr; /*0x0200*/
- u8 pad3[0x1000 - 0x200 - 4];
- u32 apcr; /*0x1000*/
- u32 apsr; /*0x1004*/
- u8 pad4[0x1020 - 0x1004 - 4];
- u32 aprr; /*0x1020*/
- u32 acgr; /*0x1024*/
- u32 arsr; /*0x1028*/
+};
+/*
- APB1 Clock Reset/Control Registers
- Refer Datasheet Appendix A.10
- */
+struct armd1apb1_registers {
- u32 uart1; /*0x000*/
- u32 uart2; /*0x004*/
- u32 gpio; /*0x008*/
- u32 pwm1; /*0x00c*/
- u32 pwm2; /*0x010*/
- u32 pwm3; /*0x014*/
- u32 pwm4; /*0x018*/
- u8 pad0[0x028 - 0x018 - 4];
- u32 rtc; /*0x028*/
- u32 twsi0; /*0x02c*/
- u32 kpc; /*0x030*/
- u32 timers; /*0x034*/
- u8 pad1[0x03c - 0x034 - 4];
- u32 aib; /*0x03c*/
- u32 sw_jtag; /*0x040*/
- u32 timer1; /*0x044*/
- u32 onewire; /*0x048*/
- u8 pad2[0x050 - 0x048 - 4];
- u32 asfar; /*0x050 AIB Secure First Access Reg*/
- u32 assar; /*0x054 AIB Secure Second Access Reg*/
- u8 pad3[0x06c - 0x054 - 4];
- u32 twsi1; /*0x06c*/
- u32 uart3; /*0x070*/
- u8 pad4[0x07c - 0x070 - 4];
- u32 timer2; /*0x07C*/
- u8 pad5[0x084 - 0x07c - 4];
- u32 ac97; /*0x084*/
+};
+/*
- CPU Interface Registers
- Refer Datasheet Appendix A.2
*/ diff --git a/board/Marvell/aspenite/aspenite.c b/board/Marvell/aspenite/aspenite.c index 34ac7aa..3be33bf 100644 --- a/board/Marvell/aspenite/aspenite.c +++ b/board/Marvell/aspenite/aspenite.c @@ -25,6 +25,7 @@
#include <common.h> #include <mvmfp.h> +#include <asm/arch/cpu.h> #include <asm/arch/mfp.h> #include <asm/arch/armada100.h>
-- 1.7.0.4

For files like the drivers/serial/serial.c, it must include the platform file, as the CONFIG_SYS_NS16550_COM1 must reference to the definition in the platform definition files.
Include the platform definition file in the config file, so that it would decouple the dependence for the driver files.
Signed-off-by: Lei Wen leiwen@marvell.com --- Changelog: V2: no change
arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 2 ++ arch/arm/cpu/arm926ejs/kirkwood/dram.c | 2 ++ arch/arm/cpu/arm926ejs/kirkwood/mpp.c | 2 ++ arch/arm/cpu/arm926ejs/kirkwood/timer.c | 1 + arch/arm/include/asm/arch-kirkwood/config.h | 1 + arch/arm/include/asm/arch-kirkwood/kirkwood.h | 6 ------ board/Marvell/guruplug/guruplug.c | 1 + board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c | 1 + board/Marvell/openrd/openrd.c | 1 + board/Marvell/rd6281a/rd6281a.c | 1 + board/Marvell/sheevaplug/sheevaplug.c | 1 + board/keymile/km_arm/km_arm.c | 1 + drivers/gpio/kw_gpio.c | 1 + drivers/net/mvgbe.c | 2 ++ drivers/spi/kirkwood_spi.c | 1 + drivers/usb/host/ehci-kirkwood.c | 1 + 16 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c index b4a4c04..8f04ddb 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c @@ -26,6 +26,8 @@ #include <netdev.h> #include <asm/cache.h> #include <u-boot/md5.h> +#include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <hush.h>
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c b/arch/arm/cpu/arm926ejs/kirkwood/dram.c index 2441554..181b3e7 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c @@ -24,6 +24,8 @@
#include <config.h> #include <common.h> +#include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/cpu/arm926ejs/kirkwood/mpp.c b/arch/arm/cpu/arm926ejs/kirkwood/mpp.c index b2f0ad5..3da6c98 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/mpp.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/mpp.c @@ -10,6 +10,8 @@ */
#include <common.h> +#include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h>
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/timer.c b/arch/arm/cpu/arm926ejs/kirkwood/timer.c index b4f6cf8..a98f54c 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/timer.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/timer.c @@ -22,6 +22,7 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/arch/kirkwood.h>
#define UBOOT_CNTR 0 /* counter to use for uboot timer */ diff --git a/arch/arm/include/asm/arch-kirkwood/config.h b/arch/arm/include/asm/arch-kirkwood/config.h index b393b1a..f17f82d 100644 --- a/arch/arm/include/asm/arch-kirkwood/config.h +++ b/arch/arm/include/asm/arch-kirkwood/config.h @@ -39,6 +39,7 @@ #error "SOC Name not defined" #endif /* CONFIG_KW88F6281 */
+#include <asm/arch/kirkwood.h> #define CONFIG_ARM926EJS 1 /* Basic Architecture */
#define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */ diff --git a/arch/arm/include/asm/arch-kirkwood/kirkwood.h b/arch/arm/include/asm/arch-kirkwood/kirkwood.h index 3c843a0..0035ed5 100644 --- a/arch/arm/include/asm/arch-kirkwood/kirkwood.h +++ b/arch/arm/include/asm/arch-kirkwood/kirkwood.h @@ -27,13 +27,7 @@ #ifndef _ASM_ARCH_KIRKWOOD_H #define _ASM_ARCH_KIRKWOOD_H
-#ifndef __ASSEMBLY__ -#include <asm/types.h> -#include <asm/io.h> -#endif /* __ASSEMBLY__ */ - #if defined (CONFIG_FEROCEON_88FR131) || defined (CONFIG_SHEEVA_88SV131) -#include <asm/arch/cpu.h>
/* SOC specific definations */ #define INTREG_BASE 0xd0000000 diff --git a/board/Marvell/guruplug/guruplug.c b/board/Marvell/guruplug/guruplug.c index 1f0e67a..057c558 100644 --- a/board/Marvell/guruplug/guruplug.c +++ b/board/Marvell/guruplug/guruplug.c @@ -24,6 +24,7 @@
#include <common.h> #include <miiphy.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "guruplug.h" diff --git a/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c index 80fd20b..4c41f3b 100644 --- a/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c +++ b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c @@ -26,6 +26,7 @@
#include <common.h> #include <netdev.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "mv88f6281gtw_ge.h" diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index 87939de..2a10e69 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -29,6 +29,7 @@
#include <common.h> #include <miiphy.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "openrd.h" diff --git a/board/Marvell/rd6281a/rd6281a.c b/board/Marvell/rd6281a/rd6281a.c index ecdea82..9c768bf 100644 --- a/board/Marvell/rd6281a/rd6281a.c +++ b/board/Marvell/rd6281a/rd6281a.c @@ -25,6 +25,7 @@ #include <common.h> #include <miiphy.h> #include <netdev.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "rd6281a.h" diff --git a/board/Marvell/sheevaplug/sheevaplug.c b/board/Marvell/sheevaplug/sheevaplug.c index d7dc80c..71e6793 100644 --- a/board/Marvell/sheevaplug/sheevaplug.c +++ b/board/Marvell/sheevaplug/sheevaplug.c @@ -24,6 +24,7 @@
#include <common.h> #include <miiphy.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h> #include "sheevaplug.h" diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 67f158c..6ef5e5d 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -34,6 +34,7 @@ #include <netdev.h> #include <miiphy.h> #include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h> #include <asm/arch/mpp.h>
diff --git a/drivers/gpio/kw_gpio.c b/drivers/gpio/kw_gpio.c index 56383c2..c86c28f 100644 --- a/drivers/gpio/kw_gpio.c +++ b/drivers/gpio/kw_gpio.c @@ -31,6 +31,7 @@
#include <common.h> #include <asm/bitops.h> +#include <asm/io.h> #include <asm/arch/kirkwood.h> #include <asm/arch/gpio.h>
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index c701f43..c7f7446 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -32,8 +32,10 @@ #include <net.h> #include <malloc.h> #include <miiphy.h> +#include <asm/io.h> #include <asm/errno.h> #include <asm/types.h> +#include <asm/system.h> #include <asm/byteorder.h>
#if defined(CONFIG_KIRKWOOD) diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c index a1c3070..6f502f0 100644 --- a/drivers/spi/kirkwood_spi.c +++ b/drivers/spi/kirkwood_spi.c @@ -27,6 +27,7 @@ #include <common.h> #include <malloc.h> #include <spi.h> +#include <asm/io.h> #include <asm/arch/kirkwood.h> #include <asm/arch/spi.h> #include <asm/arch/mpp.h> diff --git a/drivers/usb/host/ehci-kirkwood.c b/drivers/usb/host/ehci-kirkwood.c index 5570fc6..6300587 100644 --- a/drivers/usb/host/ehci-kirkwood.c +++ b/drivers/usb/host/ehci-kirkwood.c @@ -27,6 +27,7 @@ #include <usb.h> #include "ehci.h" #include "ehci-core.h" +#include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h>
#define rdl(off) readl(KW_USB20_BASE + (off))

Build pass with following config: dkb_config aspenite_config edminiv2_config openrd_ultimate_config sheevaplug_config mv88f6281gtw_ge_config rd6281a_config guruplug_config km_kirkwood_config
Signed-off-by: Lei Wen leiwen@marvell.com Acked-by: Wolfgang Denk wd@denx.de --- Changelog: V2: no change
drivers/serial/serial.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 0d56e78..0d6ad62 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -28,15 +28,6 @@ #ifdef CONFIG_NS87308 #include <ns87308.h> #endif -#ifdef CONFIG_KIRKWOOD -#include <asm/arch/kirkwood.h> -#elif defined(CONFIG_ORION5X) -#include <asm/arch/orion5x.h> -#elif defined(CONFIG_ARMADA100) -#include <asm/arch/armada100.h> -#elif defined(CONFIG_PANTHEON) -#include <asm/arch/pantheon.h> -#endif
#if defined (CONFIG_SERIAL_MULTI) #include <serial.h>

Build pass with following config: dkb_config aspenite_config
Signed-off-by: Lei Wen leiwen@marvell.com --- Changelog: V2: no change
drivers/gpio/mvmfp.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/mvmfp.c b/drivers/gpio/mvmfp.c index e7830c6..f56c037 100644 --- a/drivers/gpio/mvmfp.c +++ b/drivers/gpio/mvmfp.c @@ -26,13 +26,6 @@ #include <asm/io.h> #include <mvmfp.h> #include <asm/arch/mfp.h> -#ifdef CONFIG_ARMADA100 -#include <asm/arch/armada100.h> -#elif defined(CONFIG_PANTHEON) -#include <asm/arch/pantheon.h> -#else -#error Unsupported SoC... -#endif
/* * mfp_config
participants (5)
-
Albert ARIBAUD
-
Lei Wen
-
Lei Wen
-
Prafulla Wadaskar
-
Wolfgang Denk