Patchwork [U-Boot,08/14] zynq: Move macros to hardware.h

login
register
mail settings
Submitter Michal Simek
Date April 22, 2013, 2:52 p.m.
Message ID <96216a6d01e3687d946f0ba2a8a84814293c8019.1366641836.git.michal.simek@xilinx.com>
Download mbox | patch
Permalink /patch/238556/
State Changes Requested
Delegated to: Tom Rini
Headers show

Comments

Michal Simek - April 22, 2013, 2:52 p.m.
Add all fixed addresses to hardware.h and change petalinux
configuration to support this.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 arch/arm/include/asm/arch-zynq/hardware.h |  2 ++
 board/xilinx/zynq/board.c                 | 12 +++++++++---
 include/configs/zynq.h                    |  2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)

--
1.8.2.1
Tom Rini - April 22, 2013, 4:02 p.m.
On Mon, Apr 22, 2013 at 04:52:06PM +0200, Michal Simek wrote:

> Add all fixed addresses to hardware.h and change petalinux
> configuration to support this.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>  arch/arm/include/asm/arch-zynq/hardware.h |  2 ++
>  board/xilinx/zynq/board.c                 | 12 +++++++++---
>  include/configs/zynq.h                    |  2 +-
>  3 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-zynq/hardware.h b/arch/arm/include/asm/arch-zynq/hardware.h
> index bee7b09..e0f6eba 100644
> --- a/arch/arm/include/asm/arch-zynq/hardware.h
> +++ b/arch/arm/include/asm/arch-zynq/hardware.h
> @@ -27,6 +27,8 @@
>  #define XPSS_DEV_CFG_APB_BASEADDR	0xF8007000
>  #define XPSS_SCU_BASEADDR		0xF8F00000
>  #define CONFIG_SCUTIMER_BASEADDR	0xF8F00600
> +#define CONFIG_ZYNQ_GEM_BASEADDR0	0xE000B000
> +#define CONFIG_ZYNQ_GEM_BASEADDR1	0xE000C000

Are these configurable really or no?  If they're in <hardware.h> they
shouldn't be CONFIG named.

Patch

diff --git a/arch/arm/include/asm/arch-zynq/hardware.h b/arch/arm/include/asm/arch-zynq/hardware.h
index bee7b09..e0f6eba 100644
--- a/arch/arm/include/asm/arch-zynq/hardware.h
+++ b/arch/arm/include/asm/arch-zynq/hardware.h
@@ -27,6 +27,8 @@ 
 #define XPSS_DEV_CFG_APB_BASEADDR	0xF8007000
 #define XPSS_SCU_BASEADDR		0xF8F00000
 #define CONFIG_SCUTIMER_BASEADDR	0xF8F00600
+#define CONFIG_ZYNQ_GEM_BASEADDR0	0xE000B000
+#define CONFIG_ZYNQ_GEM_BASEADDR1	0xE000C000

 /* Reflect slcr offsets */
 struct slcr_regs {
diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 8ed75c3..8da476c 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -22,6 +22,8 @@ 

 #include <common.h>
 #include <netdev.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/sys_proto.h>

 DECLARE_GLOBAL_DATA_PTR;

@@ -38,10 +40,14 @@  int board_eth_init(bd_t *bis)
 {
 	u32 ret = 0;

-#if defined(CONFIG_ZYNQ_GEM) && defined(CONFIG_ZYNQ_GEM_BASEADDR0)
-	ret = zynq_gem_initialize(bis, CONFIG_ZYNQ_GEM_BASEADDR0);
+#if defined(CONFIG_ZYNQ_GEM)
+# if defined(CONFIG_ZYNQ_GEM0)
+	ret |= zynq_gem_initialize(bis, CONFIG_ZYNQ_GEM_BASEADDR0);
+# endif
+# if defined(CONFIG_ZYNQ_GEM1)
+	ret |= zynq_gem_initialize(bis, CONFIG_ZYNQ_GEM_BASEADDR1);
+# endif
 #endif
-
 	return ret;
 }
 #endif
diff --git a/include/configs/zynq.h b/include/configs/zynq.h
index 1147689..ebe1b1b 100644
--- a/include/configs/zynq.h
+++ b/include/configs/zynq.h
@@ -53,7 +53,7 @@ 
 /* Ethernet driver */
 #define CONFIG_NET_MULTI
 #define CONFIG_ZYNQ_GEM
-#define CONFIG_ZYNQ_GEM_BASEADDR0	0xE000B000
+#define CONFIG_ZYNQ_GEM0

 #if defined(CONFIG_ZYNQ_DCC)
 # define CONFIG_ARM_DCC