Skip to contentSkip to conversation

Marvell: reduce dependence files

PATCH New Lei Wen 5 participants 29 messages Oct 2, 2011 – Oct 31, 2011

Subsystems (6)
lore
Share & tools
lore

Lei Wen

author
#0 lore raw

cover 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(-)
author
#1 lore raw

PATCH 1/5 ARM: pantheon: 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.

---
 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(-)
arch/arm/cpu/arm926ejs/pantheon/cpu.c +1 -1
index 8b2eafa..efc9395 100644
@@ -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)
arch/arm/cpu/arm926ejs/pantheon/dram.c +1 -0
index bbca7ee..a3d719e 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/pantheon.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/cpu/arm926ejs/pantheon/timer.c +1 -0
index c71162a..17045b1 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/pantheon.h>
 
 /*
arch/arm/include/asm/arch-pantheon/config.h +2 -0
index 5658592..fd23c97 100644
@@ -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 */
arch/arm/include/asm/arch-pantheon/pantheon.h +0 -7
index e4ed087..c7fe646 100644
@@ -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 */
Signature · 1 line
1.7.0.4
author
#2 lore raw

PATCH 2/5 ARM: armada100: reduce dependence of including platform file

In reply to Lei Wen

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.

---
 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(-)
arch/arm/cpu/arm926ejs/armada100/cpu.c +1 -1
index c21938e..14121a0 100644
@@ -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)
arch/arm/cpu/arm926ejs/armada100/dram.c +1 -0
index eacec23..8609004 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/armada100.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/cpu/arm926ejs/armada100/timer.c +1 -0
index 82a6d7b..fbade4b 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
 
 /*
arch/arm/include/asm/arch-armada100/armada100.h +0 -63

75 lines not on this page · raw message

arch/arm/include/asm/arch-armada100/config.h +1 -0
index 1126b38..d2094e5 100644
@@ -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 */
arch/arm/include/asm/arch-armada100/cpu.h +57 -0

63 lines not on this page · raw message

board/Marvell/aspenite/aspenite.c +1 -0
index 34ac7aa..3be33bf 100644
@@ -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>
 
Signature · 1 line
1.7.0.4
author
#3 lore raw

PATCH 3/5 ARM: kirkwood: reduce dependence of including platform file

In reply to Lei Wen

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.

---
 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(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -0
index b4a4c04..8f04ddb 100644
@@ -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>
 
arch/arm/cpu/arm926ejs/kirkwood/dram.c +2 -0
index 2441554..181b3e7 100644
@@ -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;
arch/arm/cpu/arm926ejs/kirkwood/mpp.c +2 -0
index b2f0ad5..3da6c98 100644
@@ -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>
 
arch/arm/cpu/arm926ejs/kirkwood/timer.c +1 -0
index b4f6cf8..a98f54c 100644
@@ -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 */
arch/arm/include/asm/arch-kirkwood/config.h +1 -0
index b7dae1e..ab7201b 100644
@@ -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 */
arch/arm/include/asm/arch-kirkwood/kirkwood.h +0 -6
index 3c843a0..0035ed5 100644
@@ -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
board/Marvell/guruplug/guruplug.c +1 -0
index 1f0e67a..057c558 100644
@@ -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"
board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c +1 -0
index 80fd20b..4c41f3b 100644
@@ -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"
board/Marvell/openrd/openrd.c +1 -0
index 87939de..2a10e69 100644
@@ -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"
board/Marvell/rd6281a/rd6281a.c +1 -0
index ecdea82..9c768bf 100644
@@ -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"
board/Marvell/sheevaplug/sheevaplug.c +1 -0
index d7dc80c..71e6793 100644
@@ -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"
board/keymile/km_arm/km_arm.c +1 -0
index a8f2b23..35dca5f 100644
@@ -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>
 
drivers/gpio/kw_gpio.c +1 -0
index 56383c2..c86c28f 100644
@@ -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>
 
drivers/net/mvgbe.c +2 -0
index c701f43..c7f7446 100644
@@ -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)
drivers/spi/kirkwood_spi.c +1 -0
index a1c3070..6f502f0 100644
@@ -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>
drivers/usb/host/ehci-kirkwood.c +1 -0
index 5570fc6..6300587 100644
@@ -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))
Signature · 1 line
1.7.0.4
author
#4 lore raw

PATCH 4/5 serial: reduce include platform file for marvell chip

In reply to Lei Wen

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

---
 drivers/serial/serial.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
drivers/serial/serial.c +0 -9
index 0d56e78..0d6ad62 100644
@@ -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>
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH 4/5 serial: reduce include platform file for marvell chip

Quoted 32 lines

-----Original Message-----
From: Lei Wen [mailto:adrian.wenl at gmail.com]
Sent: Sunday, October 02, 2011 7:47 PM
To: Prafulla Wadaskar; u-boot at 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

---
 drivers/serial/serial.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
drivers/serial/serial.c +0 -0
index 0d56e78..0d6ad62 100644
@@ -28,15 +28,6 @@
 #ifdef CONFIG_NS87308
 #include <ns87308.h>

drivers/serial/serial.c line 39

Quoted 10 lines
drivers/serial/serial.c +0 -9
 #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 . .

#6 lore raw

PATCH 4/5 serial: reduce include platform file for marvell chip

In reply to Lei Wen

Dear Lei Wen,

Quoted 11 lines · In message <[email protected]> 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

Quoted 4 lines
---
 drivers/serial/serial.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

Prafulla, please apply with the rest of the patch series.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
They say, well, meybe it _is_ smelly, maybe it _is_ overcrowded, may-
be it _is_ a bit like Hell would be if they shut the  fires  off  and
stabled  a  herd  of  incontinent cows there for a year, but you must
admit that it is full of sheer, vibrant, dynamic _life_.
                                 - Terry Pratchett, _Moving Pictures_
#7 lore raw

PATCH 4/5 serial: reduce include platform file for marvell chip

In reply to Lei Wen

Hi all,

Le 02/10/2011 16:16, Lei Wen a ?crit :

Quoted 26 lines

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

---
  drivers/serial/serial.c |    9 ---------
  1 files changed, 0 insertions(+), 9 deletions(-)
drivers/serial/serial.c +0 -2
index 0d56e78..0d6ad62 100644
@@ -28,15 +28,6 @@
  #ifdef CONFIG_NS87308
  #include<ns87308.h>
  #endif
-#ifdef CONFIG_KIRKWOOD
-#include<asm/arch/kirkwood.h>

drivers/serial/serial.c line 33

Quoted 10 lines
drivers/serial/serial.c +0 -7
-#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,

Signature · 1 line
Albert.
author
#8 lore raw

PATCH 4/5 serial: reduce include platform file for marvell chip

Hi Albert,

Quoted 50 lines · Albert ARIBAUD

Hi all,

Le 02/10/2011 16:16, Lei Wen a ?crit :

Quoted 35 lines

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

---
?drivers/serial/serial.c | ? ?9 ---------
?1 files changed, 0 insertions(+), 9 deletions(-)

drivers/serial/serial.c +0 -0
index 0d56e78..0d6ad62 100644
@@ -28,15 +28,6 @@

?#ifdef CONFIG_NS87308
?#include<ns87308.h>
?#endif

drivers/serial/serial.c +0 -9
-#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
Quoted 2 lines

?#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.)

Quoted 3 lines

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

#9 lore raw

PATCH 4/5 serial: reduce include platform file for marvell chip

Dear Lei Wen,

Quoted 7 lines · In message <CALZhoSQRKK_Mjf8zt3a__sn3raap706NrrySQPe6bU_yot07QA@mail.gmail.com>…
Quoted 4 lines

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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
O Staat!   Wie tief dir alle Besten fluchen!  Du bist kein Ziel.  Der
Mensch mu? weiter suchen.                     - Christian Morgenstern
#10 lore raw

PATCH 1/1 ARM: orion5x: reduce dependence of including platform file

In reply to Albert ARIBAUD

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.

---
 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(-)
arch/arm/cpu/arm926ejs/orion5x/cpu.c +2 -1
index 05bd45c..792b11d 100644
@@ -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
arch/arm/cpu/arm926ejs/orion5x/dram.c +1 -1
index 5cc31a9..c0f7ef1 100644
@@ -27,7 +27,7 @@
 
 #include <common.h>
 #include <config.h>
-#include <asm/arch/orion5x.h>
+#include <asm/arch/cpu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/cpu/arm926ejs/orion5x/timer.c +1 -1
index 17df68f..e39ecc2 100644
@@ -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 */
 
arch/arm/include/asm/arch-orion5x/orion5x.h +0 -6
index 9aeef88..18225b9 100644
@@ -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)
common/cmd_ide.c +0 -6
index da5189c..d909c54 100644
@@ -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>
 
include/configs/edminiv2.h +1 -0
index f8affa8..88d32b2 100644
@@ -45,6 +45,7 @@
 #define CONFIG_88F5182		1	/* SOC Name */
 #define CONFIG_MACH_EDMINIV2	1	/* Machine type */
 
+#include <asm/arch/orion5x.h>
 /*
  * CLKs configurations
  */
Signature · 1 line
1.7.0.4
#11 lore raw

PATCH 1/1 ARM: orion5x: reduce dependence of including platform file

Dear Lei Wen,

Quoted 6 lines · In message <[email protected]> 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.

...

include/configs/edminiv2.h line 48

Quoted 7 lines
include/configs/edminiv2.h +1 -0
@@ -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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Wisdom is one of the few things that looks bigger the further away it
is.                               - Terry Pratchett, _Witches Abroad_
author
#12 lore raw

PATCH 1/1 ARM: orion5x: reduce dependence of including platform file

Hi Wolfgang,

Quoted 22 lines · Wolfgang Denk

Dear Lei Wen,

Quoted 6 lines · In message <[email protected]> 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.

...

Quoted 7 lines
include/configs/edminiv2.h +0 -0
@@ -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.

Quoted 6 lines

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

#13 lore raw

PATCH 1/1 ARM: orion5x: reduce dependence of including platform file

Dear Lei Wen,

Quoted 11 lines · In message <CALZhoSQyCPnYCXgrYQCkvu6A0NYCrmtzveXcQsb3OSCMV_TKcA@mail.gmail.com>…
Quoted 11 lines
Quoted 2 lines

+#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.

Quoted 7 lines
Quoted 1 line

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

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Our business is run on trust.  We trust you will pay in advance.
author
#14 lore raw

PATCH 1/1 ARM: orion5x: reduce dependence of including platform file

Hi Wolfgang,

Quoted 36 lines · Wolfgang Denk

Dear Lei Wen,

Quoted 11 lines · In message <CALZhoSQyCPnYCXgrYQCkvu6A0NYCrmtzveXcQsb3OSCMV_TKcA@mail.gmail.com>…
Quoted 11 lines
Quoted 2 lines

+#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.

Quoted 7 lines
Quoted 1 line

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.

Quoted 5 lines

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

#15 lore raw

PATCH v2 1/1 ARM: orion5x: reduce dependence of including platform file

In reply to Lei Wen

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.

---
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
arch/arm/cpu/arm926ejs/orion5x/cpu.c +2 -0
index 05bd45c..2b0c760 100644
@@ -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>
 
arch/arm/cpu/arm926ejs/orion5x/dram.c +1 -0
index 5cc31a9..028f046 100644
@@ -27,6 +27,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/orion5x.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/cpu/arm926ejs/orion5x/timer.c +1 -0
index 17df68f..0b49b69 100644
@@ -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 */
arch/arm/include/asm/arch-orion5x/config.h new file +135 -0

135 lines not on this page · raw message

arch/arm/include/asm/arch-orion5x/orion5x.h +0 -6
index 9aeef88..18225b9 100644
@@ -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)
common/cmd_ide.c +0 -6
index da5189c..d909c54 100644
@@ -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>
 
include/configs/edminiv2.h +2 -164

182 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#16 lore raw

PATCH v2 1/1 ARM: orion5x: reduce dependence of including platform file

Quoted 24 lines

-----Original Message-----
From: Lei Wen [mailto:leiwen at marvell.com]
Sent: Wednesday, October 26, 2011 7:52 AM
To: Wolfgang Denk; Albert ARIBAUD; Prafulla Wadaskar; u- boot at 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.

---
Changelog:
V2: seperate orion5x define structure as kirkwood and armada does

Quoted 8 lines
 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....

Quoted 64 lines
arch/arm/include/asm/arch-orion5x/config.h new file +9 -0
new file mode 100644
index 0000000..6db3554
@@ -0,0 +1,135 @@
+/*
+ * (C) Copyright 2011
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Lei Wen <[email protected]>
+ *
+ * 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
+ */

arch/arm/include/asm/arch-orion5x/config.h new file +27 -0
+
+/*
+ * 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)

arch/arm/include/asm/arch-orion5x/config.h line 60

Quoted 10 lines
arch/arm/include/asm/arch-orion5x/config.h new file +10 -0
+ * - 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 ..

author
#17 lore raw

PATCH v2 1/1 ARM: orion5x: reduce dependence of including platform file

Hi Prafulla,

Quoted 109 lines · Prafulla Wadaskar
Quoted 24 lines

-----Original Message-----
From: Lei Wen [mailto:leiwen at marvell.com]
Sent: Wednesday, October 26, 2011 7:52 AM
To: Wolfgang Denk; Albert ARIBAUD; Prafulla Wadaskar; u- boot at 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.

---
Changelog:
V2: seperate orion5x define structure as kirkwood and armada does

Quoted 8 lines
?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....

Quoted 68 lines
arch/arm/include/asm/arch-orion5x/config.h new file +9 -0
new file mode 100644
index 0000000..6db3554
@@ -0,0 +1,135 @@
+/*
+ * (C) Copyright 2011
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Lei Wen <[email protected]>
+ *
+ * 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
+ */

arch/arm/include/asm/arch-orion5x/config.h new file +31 -0
+
+/*
+ * 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.
Quoted 9 lines

arch/arm/include/asm/arch-orion5x/config.h

Quoted 6 lines

+ * Enable mask has ones for INPUT, 0 for OUTPUT.
+ * Default is LED ON.
+ */

arch/arm/include/asm/arch-orion5x/config.h new file +3 -0
+
+#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

author
#18 lore raw

PATCH 5/5 gpio: mvmfp: reduce include platform file

In reply to Lei Wen

Build pass with following config:
dkb_config
aspenite_config

---
 drivers/gpio/mvmfp.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
drivers/gpio/mvmfp.c +0 -7
index e7830c6..f56c037 100644
@@ -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
Signature · 1 line
1.7.0.4
#19 lore raw

cover Marvell: reduce dependence files

In reply to Lei Wen

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 . . .

Quoted 48 lines

-----Original Message-----
From: Lei Wen [mailto:adrian.wenl at gmail.com]
Sent: Sunday, October 02, 2011 7:47 PM
To: Prafulla Wadaskar; u-boot at 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(-)
author
#20 lore raw

cover Marvell: reduce dependence files

Hi Prafulla,

Quoted 7 lines · Prafulla Wadaskar

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

#21 lore raw

v2 cover Marvell: reduce dependence files

In reply to Lei Wen

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(-)
#22 lore raw

v2 cover Marvell: reduce dependence files

Quoted 42 lines

-----Original Message-----
From: Lei Wen [mailto:leiwen at marvell.com]
Sent: Friday, October 14, 2011 8:04 PM
To: Prafulla Wadaskar; Wolfgang Denk; u-boot at 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 +
Quoted 8 lines
 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 . .

#23 lore raw

PATCH v2 1/5 ARM: pantheon: reduce dependence of including platform file

In reply to Lei Wen

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.

---
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(-)
arch/arm/cpu/arm926ejs/pantheon/cpu.c +1 -1
index 8b2eafa..efc9395 100644
@@ -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)
arch/arm/cpu/arm926ejs/pantheon/dram.c +1 -0
index bbca7ee..a3d719e 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/pantheon.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/cpu/arm926ejs/pantheon/timer.c +1 -0
index c71162a..17045b1 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/pantheon.h>
 
 /*
arch/arm/include/asm/arch-pantheon/config.h +2 -0
index 5658592..fd23c97 100644
@@ -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 */
arch/arm/include/asm/arch-pantheon/pantheon.h +0 -7
index e4ed087..c7fe646 100644
@@ -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 */
Signature · 1 line
1.7.0.4
#24 lore raw

PATCH v2 2/5 ARM: armada100: reduce dependence of including platform file

In reply to Lei Wen

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.

---
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(-)
arch/arm/cpu/arm926ejs/armada100/cpu.c +1 -1
index c21938e..14121a0 100644
@@ -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)
arch/arm/cpu/arm926ejs/armada100/dram.c +1 -0
index eacec23..8609004 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/armada100.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/cpu/arm926ejs/armada100/timer.c +1 -0
index 82a6d7b..fbade4b 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
 
 /*
arch/arm/include/asm/arch-armada100/armada100.h +0 -131

143 lines not on this page · raw message

arch/arm/include/asm/arch-armada100/config.h +1 -0
index 1126b38..d2094e5 100644
@@ -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 */
arch/arm/include/asm/arch-armada100/cpu.h +57 -0

63 lines not on this page · raw message

board/Marvell/aspenite/aspenite.c +1 -0
index 34ac7aa..3be33bf 100644
@@ -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>
 
Signature · 1 line
1.7.0.4
#25 lore raw

PATCH v2 2/5 ARM: armada100: reduce dependence of including platform file

Quoted 21 lines

-----Original Message-----
From: Lei Wen [mailto:leiwen at marvell.com]
Sent: Friday, October 14, 2011 8:04 PM
To: Prafulla Wadaskar; Wolfgang Denk; u-boot at 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.

---
Changelog:
V2: no change

Quoted 7 lines
 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 . .

Quoted 291 lines
 board/Marvell/aspenite/aspenite.c               |    1 +
 7 files changed, 62 insertions(+), 132 deletions(-)
arch/arm/cpu/arm926ejs/armada100/cpu.c +1 -1
index c21938e..14121a0 100644
@@ -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)
arch/arm/cpu/arm926ejs/armada100/dram.c +1 -0
index eacec23..8609004 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/armada100.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/cpu/arm926ejs/armada100/timer.c +1 -0
index 82a6d7b..fbade4b 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
 
 /*
arch/arm/include/asm/arch-armada100/armada100.h +0 -131
index a8181b6..0ed3a8e 100644
@@ -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 */
arch/arm/include/asm/arch-armada100/config.h +1 -0
index 1126b38..d2094e5 100644
@@ -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 */
arch/arm/include/asm/arch-armada100/cpu.h +57 -0
index 0518a6a..f7ec938 100644
@@ -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
  */
board/Marvell/aspenite/aspenite.c +1 -1
index 34ac7aa..3be33bf 100644
@@ -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

#26 lore raw

PATCH v2 3/5 ARM: kirkwood: reduce dependence of including platform file

In reply to Lei Wen

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.

---
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(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -0
index b4a4c04..8f04ddb 100644
@@ -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>
 
arch/arm/cpu/arm926ejs/kirkwood/dram.c +2 -0
index 2441554..181b3e7 100644
@@ -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;
arch/arm/cpu/arm926ejs/kirkwood/mpp.c +2 -0
index b2f0ad5..3da6c98 100644
@@ -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>
 
arch/arm/cpu/arm926ejs/kirkwood/timer.c +1 -0
index b4f6cf8..a98f54c 100644
@@ -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 */
arch/arm/include/asm/arch-kirkwood/config.h +1 -0
index b393b1a..f17f82d 100644
@@ -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 */
arch/arm/include/asm/arch-kirkwood/kirkwood.h +0 -6
index 3c843a0..0035ed5 100644
@@ -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
board/Marvell/guruplug/guruplug.c +1 -0
index 1f0e67a..057c558 100644
@@ -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"
board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c +1 -0
index 80fd20b..4c41f3b 100644
@@ -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"
board/Marvell/openrd/openrd.c +1 -0
index 87939de..2a10e69 100644
@@ -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"
board/Marvell/rd6281a/rd6281a.c +1 -0
index ecdea82..9c768bf 100644
@@ -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"
board/Marvell/sheevaplug/sheevaplug.c +1 -0
index d7dc80c..71e6793 100644
@@ -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"
board/keymile/km_arm/km_arm.c +1 -0
index 67f158c..6ef5e5d 100644
@@ -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>
 
drivers/gpio/kw_gpio.c +1 -0
index 56383c2..c86c28f 100644
@@ -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>
 
drivers/net/mvgbe.c +2 -0
index c701f43..c7f7446 100644
@@ -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)
drivers/spi/kirkwood_spi.c +1 -0
index a1c3070..6f502f0 100644
@@ -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>
drivers/usb/host/ehci-kirkwood.c +1 -0
index 5570fc6..6300587 100644
@@ -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))
Signature · 1 line
1.7.0.4
#27 lore raw

PATCH v2 4/5 serial: reduce include platform file for marvell chip

In reply to Lei Wen

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

---
Changelog:
V2: no change

 drivers/serial/serial.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
drivers/serial/serial.c +0 -9
index 0d56e78..0d6ad62 100644
@@ -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>
Signature · 1 line
1.7.0.4
#28 lore raw

PATCH v2 5/5 gpio: mvmfp: reduce include platform file

In reply to Lei Wen

Build pass with following config:
dkb_config
aspenite_config

---
Changelog:
V2: no change

 drivers/gpio/mvmfp.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
drivers/gpio/mvmfp.c +0 -7
index e7830c6..f56c037 100644
@@ -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
Signature · 1 line
1.7.0.4