All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCHv2 00/13] ST-Ericsson Ux500 support
@ 2010-04-08 13:43 Rabin Vincent
  2010-04-08 13:43 ` [U-Boot] [PATCHv2 01/13] Nomadik: move nomadik.h to asm/arch/nhk8815.h Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

v2: Addressed review comments.

This series adds base support for ST-Ericsson's Ux500 series of Cortex-A9 based
SoCs.  Several peripherals are shared with the Nomadik family, for which
support already exists in U-Boot.

Rabin Vincent (13):
  Nomadik: move nomadik.h to asm/arch/nhk8815.h
  Nomadik: timer: push down single-use macros
  Nomadik: timer: remove header and use C structs
  Nomadik: move timer code to drivers/misc
  Nomadik: move gpio driver to drivers/gpio
  nomadik-gpio: check for invalid gpio numbers
  nomadik-gpio: get base address from platform code
  nomadik-mtu: support configurable clock rates
  arm: add Cortex A9 support
  ARM Cortex A9: ifdef code calling lowlevel init
  ux500: add SoC-specific code
  pl01x: add support for Ux500 variant of pl011
  mop500: add board-specific files

 MAINTAINERS                                        |    4 +
 MAKEALL                                            |    9 +
 Makefile                                           |    9 +-
 board/st/nhk8815/nhk8815.c                         |   11 +-
 board/stericsson/mop500/Makefile                   |   54 +++
 board/stericsson/mop500/config.mk                  |   23 ++
 board/stericsson/mop500/mop500.c                   |   72 ++++
 cpu/arm926ejs/nomadik/Makefile                     |    1 -
 cpu/arm_cortexa9/Makefile                          |   47 +++
 cpu/arm_cortexa9/config.mk                         |   33 ++
 cpu/arm_cortexa9/cpu.c                             |   83 ++++
 cpu/arm_cortexa9/start.S                           |  394 ++++++++++++++++++++
 cpu/arm_cortexa9/u-boot.lds                        |   58 +++
 cpu/arm_cortexa9/ux500/Makefile                    |   45 +++
 .../gpio.h => cpu/arm_cortexa9/ux500/clock.c       |   48 ++-
 .../gpio.h => cpu/arm_cortexa9/ux500/cpu.c         |   45 ++-
 drivers/gpio/Makefile                              |    1 +
 .../nomadik/gpio.c => drivers/gpio/nomadik_gpio.c  |   28 +-
 drivers/misc/Makefile                              |    1 +
 .../nomadik/timer.c => drivers/misc/nomadik_mtu.c  |   65 +++-
 drivers/serial/serial_pl01x.c                      |    8 +
 drivers/serial/serial_pl01x.h                      |    1 +
 include/asm-arm/arch-nomadik/mtu.h                 |   66 ----
 include/asm-arm/arch-nomadik/nmdk8815.h            |   40 ++
 include/asm-arm/arch-ux500/clock.h                 |   80 ++++
 include/asm-arm/arch-ux500/hardware.h              |   72 ++++
 include/configs/mop500.h                           |  108 ++++++
 include/configs/nhk8815.h                          |   14 +-
 include/nomadik.h                                  |   74 ++--
 29 files changed, 1323 insertions(+), 171 deletions(-)
 create mode 100644 board/stericsson/mop500/Makefile
 create mode 100644 board/stericsson/mop500/config.mk
 create mode 100644 board/stericsson/mop500/mop500.c
 create mode 100644 cpu/arm_cortexa9/Makefile
 create mode 100644 cpu/arm_cortexa9/config.mk
 create mode 100644 cpu/arm_cortexa9/cpu.c
 create mode 100644 cpu/arm_cortexa9/start.S
 create mode 100644 cpu/arm_cortexa9/u-boot.lds
 create mode 100644 cpu/arm_cortexa9/ux500/Makefile
 copy include/asm-arm/arch-nomadik/gpio.h => cpu/arm_cortexa9/ux500/clock.c (51%)
 rename include/asm-arm/arch-nomadik/gpio.h => cpu/arm_cortexa9/ux500/cpu.c (55%)
 rename cpu/arm926ejs/nomadik/gpio.c => drivers/gpio/nomadik_gpio.c (90%)
 rename cpu/arm926ejs/nomadik/timer.c => drivers/misc/nomadik_mtu.c (57%)
 delete mode 100644 include/asm-arm/arch-nomadik/mtu.h
 create mode 100644 include/asm-arm/arch-nomadik/nmdk8815.h
 create mode 100644 include/asm-arm/arch-ux500/clock.h
 create mode 100644 include/asm-arm/arch-ux500/hardware.h
 create mode 100644 include/configs/mop500.h

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 01/13] Nomadik: move nomadik.h to asm/arch/nhk8815.h
  2010-04-08 13:43 [U-Boot] [PATCHv2 00/13] ST-Ericsson Ux500 support Rabin Vincent
@ 2010-04-08 13:43 ` Rabin Vincent
  2010-04-08 13:43   ` [U-Boot] [PATCHv2 02/13] Nomadik: timer: push down single-use macros Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

It contains only 8815-specific addresses, so move it to an appropriate
location and name, freeing up the nomadik.h name for common
Nomadik-family peripherals.

Cc: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 .../{nomadik.h => asm-arm/arch-nomadik/nmdk8815.h} |    0
 include/configs/nhk8815.h                          |    2 +-
 2 files changed, 1 insertions(+), 1 deletions(-)
 rename include/{nomadik.h => asm-arm/arch-nomadik/nmdk8815.h} (100%)

diff --git a/include/nomadik.h b/include/asm-arm/arch-nomadik/nmdk8815.h
similarity index 100%
rename from include/nomadik.h
rename to include/asm-arm/arch-nomadik/nmdk8815.h
diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
index 2b640dc..376f43d 100644
--- a/include/configs/nhk8815.h
+++ b/include/configs/nhk8815.h
@@ -26,7 +26,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <nomadik.h>
+#include <asm/arch/nmdk8815.h>
 
 #define CONFIG_ARM926EJS
 #define CONFIG_NOMADIK
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 02/13] Nomadik: timer: push down single-use macros
  2010-04-08 13:43 ` [U-Boot] [PATCHv2 01/13] Nomadik: move nomadik.h to asm/arch/nhk8815.h Rabin Vincent
@ 2010-04-08 13:43   ` Rabin Vincent
  2010-04-08 13:43     ` [U-Boot] [PATCHv2 03/13] Nomadik: timer: remove header and use C structs Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Eliminate some single-use macros.  USEC_TO_COUNT and COUNT_TO_USEC are
replaced in a later patch.

Cc: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 cpu/arm926ejs/nomadik/timer.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/cpu/arm926ejs/nomadik/timer.c b/cpu/arm926ejs/nomadik/timer.c
index 1d98ef3..fdab650 100644
--- a/cpu/arm926ejs/nomadik/timer.c
+++ b/cpu/arm926ejs/nomadik/timer.c
@@ -31,8 +31,6 @@
 #define TIMER_CLOCK		(24 * 100 * 1000)
 #define COUNT_TO_USEC(x)	((x) * 5 / 12)	/* overflows at 6min */
 #define USEC_TO_COUNT(x)	((x) * 12 / 5)	/* overflows at 6min */
-#define TICKS_PER_HZ		(TIMER_CLOCK / CONFIG_SYS_HZ)
-#define TICKS_TO_HZ(x)		((x) / TICKS_PER_HZ)
 
 /* macro to read the decrementing 32 bit timer as an increasing count */
 #define READ_TIMER() (0 - readl(CONFIG_SYS_TIMERBASE + MTU_VAL(0)))
@@ -64,7 +62,8 @@ void reset_timer(void)
 /* Return how many HZ passed since "base" */
 ulong get_timer(ulong base)
 {
-	return  TICKS_TO_HZ(READ_TIMER()) - base;
+	ulong hz = READ_TIMER() / (TIMER_CLOCK / CONFIG_SYS_HZ);
+	return hz - base;
 }
 
 /* Delay x useconds */
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 03/13] Nomadik: timer: remove header and use C structs
  2010-04-08 13:43   ` [U-Boot] [PATCHv2 02/13] Nomadik: timer: push down single-use macros Rabin Vincent
@ 2010-04-08 13:43     ` Rabin Vincent
  2010-04-08 13:43       ` [U-Boot] [PATCHv2 04/13] Nomadik: move timer code to drivers/misc Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Eliminate register address #defines by using C structs, and move the
rest of the header contents into timer.c.

Cc: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 cpu/arm926ejs/nomadik/timer.c      |   45 ++++++++++++++++++------
 include/asm-arm/arch-nomadik/mtu.h |   66 ------------------------------------
 2 files changed, 34 insertions(+), 77 deletions(-)
 delete mode 100644 include/asm-arm/arch-nomadik/mtu.h

diff --git a/cpu/arm926ejs/nomadik/timer.c b/cpu/arm926ejs/nomadik/timer.c
index fdab650..0aeeb63 100644
--- a/cpu/arm926ejs/nomadik/timer.c
+++ b/cpu/arm926ejs/nomadik/timer.c
@@ -22,7 +22,25 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/mtu.h>
+
+struct mtu {
+	uint	imsc;
+	uint	ris;
+	uint	mis;
+	uint	icr;
+	struct mtu_timer {
+		uint	lr;
+		uint	val;
+		uint	cr;
+		uint	bglr;
+	} timer[4];
+};
+
+#define MTU_CRn_ENA		0x80
+#define MTU_CRn_PRESCALE_1	0x00
+#define MTU_CRn_PRESCALE_16	0x04
+#define MTU_CRn_PRESCALE_256	0x08
+#define MTU_CRn_32BITS		0x02
 
 /*
  * The timer is a decrementer, we'll left it free running at 2.4MHz.
@@ -32,14 +50,19 @@
 #define COUNT_TO_USEC(x)	((x) * 5 / 12)	/* overflows at 6min */
 #define USEC_TO_COUNT(x)	((x) * 12 / 5)	/* overflows at 6min */
 
-/* macro to read the decrementing 32 bit timer as an increasing count */
-#define READ_TIMER() (0 - readl(CONFIG_SYS_TIMERBASE + MTU_VAL(0)))
+static const struct mtu_timer *timer
+	= &((struct mtu *) CONFIG_SYS_TIMERBASE)->timer[0];
+
+/* read the decrementing 32 bit timer as an increasing count */
+static ulong read_timer(void)
+{
+	return 0 - readl(&timer->val);
+}
 
 /* Configure a free-running, auto-wrap counter with no prescaler */
 int timer_init(void)
 {
-	writel(MTU_CRn_ENA | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS,
-	       CONFIG_SYS_TIMERBASE + MTU_CR(0));
+	writel(MTU_CRn_ENA | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS, &timer->cr);
 	reset_timer();
 	return 0;
 }
@@ -48,21 +71,21 @@ int timer_init(void)
 void reset_timer(void)
 {
 	ulong val;
-	writel(0, CONFIG_SYS_TIMERBASE + MTU_LR(0));
+	writel(0, &timer->lr);
 	/*
 	 * The load-register isn't really immediate: it changes on clock
 	 * edges, so we must wait for our newly-written value to appear.
 	 * Since we might miss reading 0, wait for any change in value.
 	 */
-	val = READ_TIMER();
-	while (READ_TIMER() == val)
+	val = read_timer();
+	while (read_timer() == val)
 		;
 }
 
 /* Return how many HZ passed since "base" */
 ulong get_timer(ulong base)
 {
-	ulong hz = READ_TIMER() / (TIMER_CLOCK / CONFIG_SYS_HZ);
+	ulong hz = read_timer() / (TIMER_CLOCK / CONFIG_SYS_HZ);
 	return hz - base;
 }
 
@@ -71,8 +94,8 @@ void __udelay(unsigned long usec)
 {
 	ulong ini, end;
 
-	ini = READ_TIMER();
+	ini = read_timer();
 	end = ini + USEC_TO_COUNT(usec);
-	while ((signed)(end - READ_TIMER()) > 0)
+	while ((signed)(end - read_timer()) > 0)
 		;
 }
diff --git a/include/asm-arm/arch-nomadik/mtu.h b/include/asm-arm/arch-nomadik/mtu.h
deleted file mode 100644
index a87be9e..0000000
--- a/include/asm-arm/arch-nomadik/mtu.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * (C) Copyright 2009 Alessandro Rubini
- *
- * 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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef __ASM_ARCH_MTU_H
-#define __ASM_ARCH_MTU_H
-
-/*
- * The MTU device hosts four different counters, with 4 set of
- * registers. These are register names.
- */
-
-#define MTU_IMSC	0x00	/* Interrupt mask set/clear */
-#define MTU_RIS		0x04	/* Raw interrupt status */
-#define MTU_MIS		0x08	/* Masked interrupt status */
-#define MTU_ICR		0x0C	/* Interrupt clear register */
-
-/* per-timer registers take 0..3 as argument */
-#define MTU_LR(x)	(0x10 + 0x10 * (x) + 0x00)	/* Load value */
-#define MTU_VAL(x)	(0x10 + 0x10 * (x) + 0x04)	/* Current value */
-#define MTU_CR(x)	(0x10 + 0x10 * (x) + 0x08)	/* Control reg */
-#define MTU_BGLR(x)	(0x10 + 0x10 * (x) + 0x0c)	/* At next overflow */
-
-/* bits for the control register */
-#define MTU_CRn_ENA		0x80
-#define MTU_CRn_PERIODIC	0x40	/* if 0 = free-running */
-#define MTU_CRn_PRESCALE_MASK	0x0c
-#define MTU_CRn_PRESCALE_1		0x00
-#define MTU_CRn_PRESCALE_16		0x04
-#define MTU_CRn_PRESCALE_256		0x08
-#define MTU_CRn_32BITS		0x02
-#define MTU_CRn_ONESHOT		0x01	/* if 0 = wraps reloading from BGLR*/
-
-/* Other registers are usual amba/primecell registers, currently not used */
-#define MTU_ITCR	0xff0
-#define MTU_ITOP	0xff4
-
-#define MTU_PERIPH_ID0	0xfe0
-#define MTU_PERIPH_ID1	0xfe4
-#define MTU_PERIPH_ID2	0xfe8
-#define MTU_PERIPH_ID3	0xfeC
-
-#define MTU_PCELL0	0xff0
-#define MTU_PCELL1	0xff4
-#define MTU_PCELL2	0xff8
-#define MTU_PCELL3	0xffC
-
-#endif /* __ASM_ARCH_MTU_H */
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 04/13] Nomadik: move timer code to drivers/misc
  2010-04-08 13:43     ` [U-Boot] [PATCHv2 03/13] Nomadik: timer: remove header and use C structs Rabin Vincent
@ 2010-04-08 13:43       ` Rabin Vincent
  2010-04-08 13:43         ` [U-Boot] [PATCHv2 05/13] Nomadik: move gpio driver to drivers/gpio Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

The Nomadik MTU driver will also be used on the U8500 SoC, so move it
out of platform-specific code.

Acked-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 cpu/arm926ejs/nomadik/Makefile                     |    2 +-
 drivers/misc/Makefile                              |    1 +
 .../nomadik/timer.c => drivers/misc/nomadik_mtu.c  |    0
 include/configs/nhk8815.h                          |    1 +
 4 files changed, 3 insertions(+), 1 deletions(-)
 rename cpu/arm926ejs/nomadik/timer.c => drivers/misc/nomadik_mtu.c (100%)

diff --git a/cpu/arm926ejs/nomadik/Makefile b/cpu/arm926ejs/nomadik/Makefile
index 0fc9f2a..180db8b 100644
--- a/cpu/arm926ejs/nomadik/Makefile
+++ b/cpu/arm926ejs/nomadik/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= timer.o gpio.o
+COBJS	= gpio.o
 SOBJS	= reset.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index f6df60f..5c0c6f3 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -28,6 +28,7 @@ LIB	:= $(obj)libmisc.a
 COBJS-$(CONFIG_ALI152X) += ali512x.o
 COBJS-$(CONFIG_DS4510)  += ds4510.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
+COBJS-$(CONFIG_NOMADIK_MTU) += nomadik_mtu.o
 COBJS-$(CONFIG_NS87308) += ns87308.o
 COBJS-$(CONFIG_STATUS_LED) += status_led.o
 COBJS-$(CONFIG_TWL4030_LED) += twl4030_led.o
diff --git a/cpu/arm926ejs/nomadik/timer.c b/drivers/misc/nomadik_mtu.c
similarity index 100%
rename from cpu/arm926ejs/nomadik/timer.c
rename to drivers/misc/nomadik_mtu.c
diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
index 376f43d..d84e787 100644
--- a/include/configs/nhk8815.h
+++ b/include/configs/nhk8815.h
@@ -97,6 +97,7 @@
 /* timing informazion */
 #define CONFIG_SYS_HZ		1000 /* Mandatory... */
 #define CONFIG_SYS_TIMERBASE	0x101E2000
+#define CONFIG_NOMADIK_MTU
 
 /* serial port (PL011) configuration */
 #define CONFIG_PL011_SERIAL
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 05/13] Nomadik: move gpio driver to drivers/gpio
  2010-04-08 13:43       ` [U-Boot] [PATCHv2 04/13] Nomadik: move timer code to drivers/misc Rabin Vincent
@ 2010-04-08 13:43         ` Rabin Vincent
  2010-04-08 13:43           ` [U-Boot] [PATCHv2 06/13] nomadik-gpio: check for invalid gpio numbers Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

The Nomadik GPIO driver will also be used on the U8500 SoC, so move it
out of platform-specific code.

Acked-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 board/st/nhk8815/nhk8815.c                         |    2 +-
 cpu/arm926ejs/nomadik/Makefile                     |    1 -
 drivers/gpio/Makefile                              |    1 +
 .../nomadik/gpio.c => drivers/gpio/nomadik_gpio.c  |    2 +-
 include/configs/nhk8815.h                          |    7 +++++--
 include/{asm-arm/arch-nomadik/gpio.h => nomadik.h} |    0
 6 files changed, 8 insertions(+), 5 deletions(-)
 rename cpu/arm926ejs/nomadik/gpio.c => drivers/gpio/nomadik_gpio.c (98%)
 rename include/{asm-arm/arch-nomadik/gpio.h => nomadik.h} (100%)

diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c
index faef810..fc5d3b8 100644
--- a/board/st/nhk8815/nhk8815.c
+++ b/board/st/nhk8815/nhk8815.c
@@ -28,7 +28,7 @@
 #include <common.h>
 #include <netdev.h>
 #include <asm/io.h>
-#include <asm/arch/gpio.h>
+#include <nomadik.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/cpu/arm926ejs/nomadik/Makefile b/cpu/arm926ejs/nomadik/Makefile
index 180db8b..35550d7 100644
--- a/cpu/arm926ejs/nomadik/Makefile
+++ b/cpu/arm926ejs/nomadik/Makefile
@@ -25,7 +25,6 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= gpio.o
 SOBJS	= reset.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index d966082..d84f81e 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -28,6 +28,7 @@ LIB 	:= $(obj)libgpio.a
 COBJS-$(CONFIG_AT91_GPIO)	+= at91_gpio.o
 COBJS-$(CONFIG_KIRKWOOD_GPIO)	+= kw_gpio.o
 COBJS-$(CONFIG_MX31_GPIO)	+= mx31_gpio.o
+COBJS-$(CONFIG_NOMADIK_GPIO)	+= nomadik_gpio.o
 COBJS-$(CONFIG_PCA953X)		+= pca953x.o
 
 COBJS	:= $(COBJS-y)
diff --git a/cpu/arm926ejs/nomadik/gpio.c b/drivers/gpio/nomadik_gpio.c
similarity index 98%
rename from cpu/arm926ejs/nomadik/gpio.c
rename to drivers/gpio/nomadik_gpio.c
index 62a375b..670b684 100644
--- a/cpu/arm926ejs/nomadik/gpio.c
+++ b/drivers/gpio/nomadik_gpio.c
@@ -22,7 +22,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/gpio.h>
+#include <nomadik.h>
 
 static unsigned long gpio_base[4] = {
 	NOMADIK_GPIO0_BASE,
diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
index d84e787..f882715 100644
--- a/include/configs/nhk8815.h
+++ b/include/configs/nhk8815.h
@@ -99,6 +99,9 @@
 #define CONFIG_SYS_TIMERBASE	0x101E2000
 #define CONFIG_NOMADIK_MTU
 
+/* GPIO */
+#define CONFIG_NOMADIK_GPIO
+
 /* serial port (PL011) configuration */
 #define CONFIG_PL011_SERIAL
 #define CONFIG_CONS_INDEX	1
@@ -110,9 +113,9 @@
 #define CONFIG_PL01x_PORTS	{ (void *)CFG_SERIAL0, (void *)CFG_SERIAL1 }
 #define CONFIG_PL011_CLOCK	48000000
 
-/* i2c, for the port extenders (uses gpio.c in board directory) */
+/* i2c, for the port extenders */
 #ifndef __ASSEMBLY__
-#include <asm/arch/gpio.h>
+#include <nomadik.h>
 #define CONFIG_CMD_I2C
 #define CONFIG_SOFT_I2C
 #define CONFIG_SYS_I2C_SPEED	400000
diff --git a/include/asm-arm/arch-nomadik/gpio.h b/include/nomadik.h
similarity index 100%
rename from include/asm-arm/arch-nomadik/gpio.h
rename to include/nomadik.h
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 06/13] nomadik-gpio: check for invalid gpio numbers
  2010-04-08 13:43         ` [U-Boot] [PATCHv2 05/13] Nomadik: move gpio driver to drivers/gpio Rabin Vincent
@ 2010-04-08 13:43           ` Rabin Vincent
  2010-04-08 13:43             ` [U-Boot] [PATCHv2 07/13] nomadik-gpio: get base address from platform code Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Cc: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 drivers/gpio/nomadik_gpio.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/nomadik_gpio.c b/drivers/gpio/nomadik_gpio.c
index 670b684..d084235 100644
--- a/drivers/gpio/nomadik_gpio.c
+++ b/drivers/gpio/nomadik_gpio.c
@@ -45,6 +45,11 @@ enum gpio_registers {
 
 static inline unsigned long gpio_to_base(int gpio)
 {
+	if ((gpio / 32) >= ARRAY_SIZE(gpio_base)) {
+		printf("nomadik-gpio: invalid gpio %d\n", gpio);
+		return 0;
+	}
+
 	return gpio_base[gpio / 32];
 }
 
@@ -59,6 +64,9 @@ void nmk_gpio_af(int gpio, int alternate_function)
 	u32 bit = gpio_to_bit(gpio);
 	u32 afunc, bfunc;
 
+	if (!base)
+		return;
+
 	/* alternate function is 0..3, with one bit per register */
 	afunc = readl(base + GPIO_AFSLA) & ~bit;
 	bfunc = readl(base + GPIO_AFSLB) & ~bit;
@@ -73,6 +81,9 @@ void nmk_gpio_dir(int gpio, int dir)
 	unsigned long base = gpio_to_base(gpio);
 	u32 bit = gpio_to_bit(gpio);
 
+	if (!base)
+		return;
+
 	if (dir)
 		writel(bit, base + GPIO_DIRS);
 	else
@@ -84,6 +95,9 @@ void nmk_gpio_set(int gpio, int val)
 	unsigned long base = gpio_to_base(gpio);
 	u32 bit = gpio_to_bit(gpio);
 
+	if (!base)
+		return;
+
 	if (val)
 		writel(bit, base + GPIO_DATS);
 	else
@@ -95,5 +109,8 @@ int nmk_gpio_get(int gpio)
 	unsigned long base = gpio_to_base(gpio);
 	u32 bit = gpio_to_bit(gpio);
 
+	if (!base)
+		return -1;
+
 	return readl(base + GPIO_DAT) & bit;
 }
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 07/13] nomadik-gpio: get base address from platform code
  2010-04-08 13:43           ` [U-Boot] [PATCHv2 06/13] nomadik-gpio: check for invalid gpio numbers Rabin Vincent
@ 2010-04-08 13:43             ` Rabin Vincent
  2010-04-08 13:43               ` [U-Boot] [PATCHv2 08/13] nomadik-mtu: support configurable clock rates Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Change the Nomadik GPIO driver to get the base addresses from platform
specific code, since it will be used on multiple platforms with
different base addresses.

Acked-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 board/st/nhk8815/nhk8815.c  |    9 +++++++++
 drivers/gpio/nomadik_gpio.c |   11 ++---------
 include/configs/nhk8815.h   |    1 +
 include/nomadik.h           |    2 ++
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c
index fc5d3b8..08fb332 100644
--- a/board/st/nhk8815/nhk8815.c
+++ b/board/st/nhk8815/nhk8815.c
@@ -32,6 +32,15 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_NOMADIK_GPIO
+unsigned long nmk_gpio_base[CONFIG_NOMADIK_GPIO_NUM_BANKS] = {
+	NOMADIK_GPIO0_BASE,
+	NOMADIK_GPIO1_BASE,
+	NOMADIK_GPIO2_BASE,
+	NOMADIK_GPIO3_BASE
+};
+#endif
+
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 void show_boot_progress(int progress)
 {
diff --git a/drivers/gpio/nomadik_gpio.c b/drivers/gpio/nomadik_gpio.c
index d084235..721c167 100644
--- a/drivers/gpio/nomadik_gpio.c
+++ b/drivers/gpio/nomadik_gpio.c
@@ -24,13 +24,6 @@
 #include <asm/io.h>
 #include <nomadik.h>
 
-static unsigned long gpio_base[4] = {
-	NOMADIK_GPIO0_BASE,
-	NOMADIK_GPIO1_BASE,
-	NOMADIK_GPIO2_BASE,
-	NOMADIK_GPIO3_BASE
-};
-
 enum gpio_registers {
 	GPIO_DAT =	0x00,		/* data register */
 	GPIO_DATS =	0x04,		/* data set */
@@ -45,12 +38,12 @@ enum gpio_registers {
 
 static inline unsigned long gpio_to_base(int gpio)
 {
-	if ((gpio / 32) >= ARRAY_SIZE(gpio_base)) {
+	if ((gpio / 32) >= ARRAY_SIZE(nmk_gpio_base)) {
 		printf("nomadik-gpio: invalid gpio %d\n", gpio);
 		return 0;
 	}
 
-	return gpio_base[gpio / 32];
+	return nmk_gpio_base[gpio / 32];
 }
 
 static inline u32 gpio_to_bit(int gpio)
diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
index f882715..c7700b3 100644
--- a/include/configs/nhk8815.h
+++ b/include/configs/nhk8815.h
@@ -101,6 +101,7 @@
 
 /* GPIO */
 #define CONFIG_NOMADIK_GPIO
+#define CONFIG_NOMADIK_GPIO_NUM_BANKS	4
 
 /* serial port (PL011) configuration */
 #define CONFIG_PL011_SERIAL
diff --git a/include/nomadik.h b/include/nomadik.h
index 1d3c9ce..72f7e88 100644
--- a/include/nomadik.h
+++ b/include/nomadik.h
@@ -34,6 +34,8 @@ enum nmk_af { /* alternate function settings */
 	GPIO_ALT_C
 };
 
+extern unsigned long nmk_gpio_base[CONFIG_NOMADIK_GPIO_NUM_BANKS];
+
 extern void nmk_gpio_af(int gpio, int alternate_function);
 extern void nmk_gpio_dir(int gpio, int dir);
 extern void nmk_gpio_set(int gpio, int val);
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 08/13] nomadik-mtu: support configurable clock rates
  2010-04-08 13:43             ` [U-Boot] [PATCHv2 07/13] nomadik-gpio: get base address from platform code Rabin Vincent
@ 2010-04-08 13:43               ` Rabin Vincent
  2010-04-08 13:43                 ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Change the Nomadik MTU driver to get the clock rate and prescaler from
the config file.  Also remove the hardcoded divisors and do the
calculations based on the configured rate.

Acked-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 drivers/misc/nomadik_mtu.c |   23 ++++++++++++-----------
 include/configs/nhk8815.h  |    3 +++
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/nomadik_mtu.c b/drivers/misc/nomadik_mtu.c
index 0aeeb63..612ab34 100644
--- a/drivers/misc/nomadik_mtu.c
+++ b/drivers/misc/nomadik_mtu.c
@@ -22,6 +22,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <div64.h>
 
 struct mtu {
 	uint	imsc;
@@ -42,14 +43,6 @@ struct mtu {
 #define MTU_CRn_PRESCALE_256	0x08
 #define MTU_CRn_32BITS		0x02
 
-/*
- * The timer is a decrementer, we'll left it free running at 2.4MHz.
- * We have 2.4 ticks per microsecond and an overflow in almost 30min
- */
-#define TIMER_CLOCK		(24 * 100 * 1000)
-#define COUNT_TO_USEC(x)	((x) * 5 / 12)	/* overflows at 6min */
-#define USEC_TO_COUNT(x)	((x) * 12 / 5)	/* overflows at 6min */
-
 static const struct mtu_timer *timer
 	= &((struct mtu *) CONFIG_SYS_TIMERBASE)->timer[0];
 
@@ -59,10 +52,18 @@ static ulong read_timer(void)
 	return 0 - readl(&timer->val);
 }
 
+static unsigned long usec_to_count(unsigned long long usec)
+{
+	unsigned long long count = usec * CONFIG_NOMADIK_MTU_CLOCK;
+	do_div(count, 1000000);
+	return count;
+}
+
 /* Configure a free-running, auto-wrap counter with no prescaler */
 int timer_init(void)
 {
-	writel(MTU_CRn_ENA | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS, &timer->cr);
+	writel(MTU_CRn_ENA | CONFIG_NOMADIK_MTU_PRESCALE | MTU_CRn_32BITS,
+	       &timer->cr);
 	reset_timer();
 	return 0;
 }
@@ -85,7 +86,7 @@ void reset_timer(void)
 /* Return how many HZ passed since "base" */
 ulong get_timer(ulong base)
 {
-	ulong hz = read_timer() / (TIMER_CLOCK / CONFIG_SYS_HZ);
+	ulong hz = read_timer() / (CONFIG_NOMADIK_MTU_CLOCK / CONFIG_SYS_HZ);
 	return hz - base;
 }
 
@@ -95,7 +96,7 @@ void __udelay(unsigned long usec)
 	ulong ini, end;
 
 	ini = read_timer();
-	end = ini + USEC_TO_COUNT(usec);
+	end = ini + usec_to_count(usec);
 	while ((signed)(end - read_timer()) > 0)
 		;
 }
diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
index c7700b3..2f8294b 100644
--- a/include/configs/nhk8815.h
+++ b/include/configs/nhk8815.h
@@ -98,6 +98,9 @@
 #define CONFIG_SYS_HZ		1000 /* Mandatory... */
 #define CONFIG_SYS_TIMERBASE	0x101E2000
 #define CONFIG_NOMADIK_MTU
+/* We have 2.4 ticks per microsecond and an overflow in almost 30min */
+#define CONFIG_NOMADIK_MTU_CLOCK	(24 * 100 * 1000)
+#define CONFIG_NOMADIK_MTU_PRESCALE	MTU_CRn_PRESCALE_1
 
 /* GPIO */
 #define CONFIG_NOMADIK_GPIO
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-08 13:43               ` [U-Boot] [PATCHv2 08/13] nomadik-mtu: support configurable clock rates Rabin Vincent
@ 2010-04-08 13:43                 ` Rabin Vincent
  2010-04-08 13:43                   ` [U-Boot] [PATCHv2 10/13] ARM Cortex A9: ifdef code calling lowlevel init Rabin Vincent
  2010-04-09 11:29                   ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Nishanth Menon
  0 siblings, 2 replies; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Add Cortex A9 support by copying the code for Cortex A8.  The only
change is a removal of some OMAP3 specific code.

Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 cpu/{arm_cortexa8 => arm_cortexa9}/Makefile   |    0
 cpu/{arm_cortexa8 => arm_cortexa9}/config.mk  |    0
 cpu/{arm_cortexa8 => arm_cortexa9}/cpu.c      |    0
 cpu/{arm_cortexa8 => arm_cortexa9}/start.S    |   26 +------------------------
 cpu/{arm_cortexa8 => arm_cortexa9}/u-boot.lds |    2 +-
 5 files changed, 2 insertions(+), 26 deletions(-)
 copy cpu/{arm_cortexa8 => arm_cortexa9}/Makefile (100%)
 copy cpu/{arm_cortexa8 => arm_cortexa9}/config.mk (100%)
 copy cpu/{arm_cortexa8 => arm_cortexa9}/cpu.c (100%)
 copy cpu/{arm_cortexa8 => arm_cortexa9}/start.S (91%)
 copy cpu/{arm_cortexa8 => arm_cortexa9}/u-boot.lds (97%)

diff --git a/cpu/arm_cortexa8/Makefile b/cpu/arm_cortexa9/Makefile
similarity index 100%
copy from cpu/arm_cortexa8/Makefile
copy to cpu/arm_cortexa9/Makefile
diff --git a/cpu/arm_cortexa8/config.mk b/cpu/arm_cortexa9/config.mk
similarity index 100%
copy from cpu/arm_cortexa8/config.mk
copy to cpu/arm_cortexa9/config.mk
diff --git a/cpu/arm_cortexa8/cpu.c b/cpu/arm_cortexa9/cpu.c
similarity index 100%
copy from cpu/arm_cortexa8/cpu.c
copy to cpu/arm_cortexa9/cpu.c
diff --git a/cpu/arm_cortexa8/start.S b/cpu/arm_cortexa9/start.S
similarity index 91%
copy from cpu/arm_cortexa8/start.S
copy to cpu/arm_cortexa9/start.S
index 29dae2f..d667f6e 100644
--- a/cpu/arm_cortexa8/start.S
+++ b/cpu/arm_cortexa9/start.S
@@ -1,5 +1,5 @@
 /*
- * armboot - Startup Code for OMAP3530/ARM Cortex CPU-core
+ * armboot - Startup Code for ARM Cortex-A9 CPU-core
  *
  * Copyright (c) 2004	Texas Instruments <r-woodruff2@ti.com>
  *
@@ -108,30 +108,6 @@ reset:
 	orr	r0, r0, #0xd3
 	msr	cpsr,r0
 
-#if (CONFIG_OMAP34XX)
-	/* Copy vectors to mask ROM indirect addr */
-	adr	r0, _start		@ r0 <- current position of code
-	add	r0, r0, #4		@ skip reset vector
-	mov	r2, #64			@ r2 <- size to copy
-	add	r2, r0, r2		@ r2 <- source end address
-	mov	r1, #SRAM_OFFSET0	@ build vect addr
-	mov	r3, #SRAM_OFFSET1
-	add	r1, r1, r3
-	mov	r3, #SRAM_OFFSET2
-	add	r1, r1, r3
-next:
-	ldmia	r0!, {r3 - r10}		@ copy from source address [r0]
-	stmia	r1!, {r3 - r10}		@ copy to   target address [r1]
-	cmp	r0, r2			@ until source end address [r2]
-	bne	next			@ loop until equal */
-#if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_ONENAND_BOOT)
-	/* No need to copy/exec the clock code - DPLL adjust already done
-	 * in NAND/oneNAND Boot.
-	 */
-	bl	cpy_clk_code		@ put dpll adjust code behind vectors
-#endif /* NAND Boot */
-#endif
-	/* the mask ROM code should have PLL and others stable */
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 	bl	cpu_init_crit
 #endif
diff --git a/cpu/arm_cortexa8/u-boot.lds b/cpu/arm_cortexa9/u-boot.lds
similarity index 97%
copy from cpu/arm_cortexa8/u-boot.lds
copy to cpu/arm_cortexa9/u-boot.lds
index 4f1711c..fc787cd 100644
--- a/cpu/arm_cortexa8/u-boot.lds
+++ b/cpu/arm_cortexa9/u-boot.lds
@@ -34,7 +34,7 @@ SECTIONS
 	. = ALIGN(4);
 	.text	:
 	{
-		cpu/arm_cortexa8/start.o	(.text)
+		cpu/arm_cortexa9/start.o	(.text)
 		*(.text)
 	}
 
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 10/13] ARM Cortex A9: ifdef code calling lowlevel init
  2010-04-08 13:43                 ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Rabin Vincent
@ 2010-04-08 13:43                   ` Rabin Vincent
  2010-04-08 13:43                     ` [U-Boot] [PATCHv2 11/13] ux500: add SoC-specific code Rabin Vincent
  2010-04-09 11:29                   ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Nishanth Menon
  1 sibling, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Conditionally compile the code calling lowlevel_init, to avoid the
following build error when CONFIG_SKIP_LOWLEVEL_INIT is defined:

  start.S:218: undefined reference to `lowlevel_init'

Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 cpu/arm_cortexa9/start.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/cpu/arm_cortexa9/start.S b/cpu/arm_cortexa9/start.S
index d667f6e..90f30b0 100644
--- a/cpu/arm_cortexa9/start.S
+++ b/cpu/arm_cortexa9/start.S
@@ -157,7 +157,7 @@ clbss_l:
 
 _start_armboot: .word start_armboot
 
-
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*************************************************************************
  *
  * CPU_init_critical registers
@@ -194,6 +194,8 @@ cpu_init_crit:
 	bl	lowlevel_init		@ go setup pll,mux,memory
 	mov	lr, ip			@ restore link
 	mov	pc, lr			@ back to my caller
+#endif
+
 /*
  *************************************************************************
  *
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 11/13] ux500: add SoC-specific code
  2010-04-08 13:43                   ` [U-Boot] [PATCHv2 10/13] ARM Cortex A9: ifdef code calling lowlevel init Rabin Vincent
@ 2010-04-08 13:43                     ` Rabin Vincent
  2010-04-08 13:43                       ` [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
  0 siblings, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Add the base SoC code for ST-Ericsson's Ux500 series of Cortex A9 based
SoCs.

Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 cpu/arm_cortexa9/ux500/Makefile       |   45 ++++++++++++++++++
 cpu/arm_cortexa9/ux500/clock.c        |   56 +++++++++++++++++++++++
 cpu/arm_cortexa9/ux500/cpu.c          |   53 ++++++++++++++++++++++
 include/asm-arm/arch-ux500/clock.h    |   80 +++++++++++++++++++++++++++++++++
 include/asm-arm/arch-ux500/hardware.h |   72 +++++++++++++++++++++++++++++
 5 files changed, 306 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm_cortexa9/ux500/Makefile
 create mode 100644 cpu/arm_cortexa9/ux500/clock.c
 create mode 100644 cpu/arm_cortexa9/ux500/cpu.c
 create mode 100644 include/asm-arm/arch-ux500/clock.h
 create mode 100644 include/asm-arm/arch-ux500/hardware.h

diff --git a/cpu/arm_cortexa9/ux500/Makefile b/cpu/arm_cortexa9/ux500/Makefile
new file mode 100644
index 0000000..c671010
--- /dev/null
+++ b/cpu/arm_cortexa9/ux500/Makefile
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	=  $(obj)lib$(SOC).a
+
+COBJS	+= clock.o cpu.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:	 $(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/cpu/arm_cortexa9/ux500/clock.c b/cpu/arm_cortexa9/ux500/clock.c
new file mode 100644
index 0000000..4d4ec13
--- /dev/null
+++ b/cpu/arm_cortexa9/ux500/clock.c
@@ -0,0 +1,56 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ * Author: Rabin Vincent <rabin.vincent@stericsson.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct clkrst {
+	unsigned int pcken;
+	unsigned int pckdis;
+	unsigned int kcken;
+	unsigned int kckdis;
+};
+
+static unsigned int clkrst_base[] = {
+	U8500_CLKRST1_BASE,
+	U8500_CLKRST2_BASE,
+	U8500_CLKRST3_BASE,
+	0, /* No CLKRST for Periph4 */
+	U8500_CLKRST5_BASE,
+	U8500_CLKRST6_BASE,
+	U8500_CLKRST7_BASE,
+};
+
+/* Turn on peripheral clock at PRCC level */
+void u8500_clock_enable(int periph, int kern, int cluster)
+{
+	struct clkrst *clkrst = (struct clkrst *) clkrst_base[periph - 1];
+
+	if (kern != -1)
+		writel(1 << kern, &clkrst->kcken);
+
+	if (cluster != -1)
+		writel(1 << cluster, &clkrst->pcken);
+}
diff --git a/cpu/arm_cortexa9/ux500/cpu.c b/cpu/arm_cortexa9/ux500/cpu.c
new file mode 100644
index 0000000..98f0802
--- /dev/null
+++ b/cpu/arm_cortexa9/ux500/cpu.c
@@ -0,0 +1,53 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ * Author: Rabin Vincent <rabin.vincent@stericsson.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <nomadik.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_NOMADIK_GPIO
+unsigned long nmk_gpio_base[CONFIG_NOMADIK_GPIO_NUM_BANKS] = {
+	U8500_GPIO0_BASE,
+	U8500_GPIO1_BASE,
+	U8500_GPIO2_BASE,
+	U8500_GPIO3_BASE,
+	U8500_GPIO4_BASE,
+	U8500_GPIO5_BASE,
+	U8500_GPIO6_BASE,
+	U8500_GPIO7_BASE,
+	U8500_GPIO8_BASE
+};
+#endif
+
+void reset_cpu(unsigned long ignored)
+{
+	struct prcmu *prcmu = (struct prcmu *) U8500_PRCMU_BASE;
+
+	writel(0x1, &prcmu->ape_softrst);
+
+	while (1)
+		; /* infinite loop until reset */
+}
diff --git a/include/asm-arm/arch-ux500/clock.h b/include/asm-arm/arch-ux500/clock.h
new file mode 100644
index 0000000..b674699
--- /dev/null
+++ b/include/asm-arm/arch-ux500/clock.h
@@ -0,0 +1,80 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_CLOCK
+#define __ASM_ARCH_CLOCK
+
+#define PRCM_TCR_DOZE_MODE	(1 << 17)
+#define PRCM_CLKMGT_ENABLE	(1 << 8)
+
+/* Arguments to u8500_clock_enable() */
+#define U8500_CLK(periph, kern, cluster)	periph, kern, cluster
+#define U8500_CLK_MTU0		U8500_CLK(7, 2, -1)
+#define U8500_CLK_UART2		U8500_CLK(3, 6, 6)
+
+struct prcmu {
+	unsigned int armclkfix_mgt;
+	unsigned int armclk_mgt;
+	unsigned int svammdspclk_mgt;
+	unsigned int siammdspclk_mgt;
+	unsigned int reserved;
+	unsigned int sgaclk_mgt;
+	unsigned int uartclk_mgt;
+	unsigned int msp02clk_mgt;
+	unsigned int i2cclk_mgt;
+	unsigned int sdmmcclk_mgt;
+	unsigned int slimclk_mgt;
+	unsigned int per1clk_mgt;
+	unsigned int per2clk_mgt;
+	unsigned int per3clk_mgt;
+	unsigned int per5clk_mgt;
+	unsigned int per6clk_mgt;
+	unsigned int per7clk_mgt;
+	unsigned int lcdclk_mgt;
+	unsigned int reserved1;
+	unsigned int bmlclk_mgt;
+	unsigned int hsitxclk_mgt;
+	unsigned int hsirxclk_mgt;
+	unsigned int hdmiclk_mgt;
+	unsigned int apeatclk_mgt;
+	unsigned int apetraceclk_mgt;
+	unsigned int mcdeclk_mgt;
+	unsigned int ipi2cclk_mgt;
+	unsigned int dsialtclk_mgt;
+	unsigned int spare2clk_mgt;
+	unsigned int dmaclk_mgt;
+	unsigned int b2r2clk_mgt;
+	unsigned int tvclk_mgt;
+	unsigned int unused[82];
+	unsigned int tcr;
+	unsigned int unused1[23];
+	unsigned int ape_softrst;
+};
+
+extern void u8500_clock_enable(int periph, int kern, int cluster);
+
+static inline void u8500_prcmu_enable(unsigned int *reg)
+{
+	writel(readl(reg) | PRCM_CLKMGT_ENABLE, reg);
+}
+
+#endif /* __ASM_ARCH_CLOCK */
diff --git a/include/asm-arm/arch-ux500/hardware.h b/include/asm-arm/arch-ux500/hardware.h
new file mode 100644
index 0000000..5f32eaa
--- /dev/null
+++ b/include/asm-arm/arch-ux500/hardware.h
@@ -0,0 +1,72 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ *
+ * 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
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/* Peripheral clusters */
+#define U8500_PER3_BASE		0x80000000
+#define U8500_PER2_BASE		0x80110000
+#define U8500_PER1_BASE		0x80120000
+#define U8500_PER4_BASE		0x80150000
+#define U8500_PER6_BASE		0xa03c0000
+#define U8500_PER7_BASE		0xa03d0000
+#define U8500_PER5_BASE		0xa03e0000
+
+/* GPIO */
+#define U8500_GPIO0_BASE	(U8500_PER1_BASE + 0xE000)
+#define U8500_GPIO1_BASE	(U8500_PER1_BASE + 0xE000 + 0x80)
+#define U8500_GPIO2_BASE	(U8500_PER3_BASE + 0xE000)
+#define U8500_GPIO3_BASE	(U8500_PER3_BASE + 0xE000 + 0x80)
+#define U8500_GPIO4_BASE	(U8500_PER3_BASE + 0xE000 + 0x100)
+#define U8500_GPIO5_BASE	(U8500_PER3_BASE + 0xE000 + 0x180)
+#define U8500_GPIO6_BASE	(U8500_PER2_BASE + 0xE000)
+#define U8500_GPIO7_BASE	(U8500_PER2_BASE + 0xE000 + 0x80)
+#define U8500_GPIO8_BASE	(U8500_PER5_BASE + 0x1E000)
+
+/* Per7 */
+#define U8500_MTU0_BASE		(U8500_PER7_BASE + 0xa000)
+#define U8500_MTU1_BASE		(U8500_PER7_BASE + 0xb000)
+#define U8500_CLKRST7_BASE	(U8500_PER7_BASE + 0xf000)
+
+/* Per6 */
+#define U8500_CLKRST6_BASE	(U8500_PER6_BASE + 0xf000)
+
+/* Per5 */
+#define U8500_CLKRST5_BASE	(U8500_PER5_BASE + 0x1f000)
+
+/* Per4 */
+#define U8500_PRCMU_BASE	(U8500_PER4_BASE + 0x07000)
+
+/* Per3 */
+#define U8500_UART2_BASE	(U8500_PER3_BASE + 0x7000)
+#define U8500_CLKRST3_BASE	(U8500_PER3_BASE + 0xf000)
+
+/* Per2 */
+#define U8500_CLKRST2_BASE	(U8500_PER2_BASE + 0xf000)
+
+/* Per1 */
+#define U8500_UART0_BASE	(U8500_PER1_BASE + 0x0000)
+#define U8500_UART1_BASE	(U8500_PER1_BASE + 0x1000)
+#define U8500_CLKRST1_BASE	(U8500_PER1_BASE + 0xf000)
+
+#endif /* __ASM_ARCH_HARDWARE_H */
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011
  2010-04-08 13:43                     ` [U-Boot] [PATCHv2 11/13] ux500: add SoC-specific code Rabin Vincent
@ 2010-04-08 13:43                       ` Rabin Vincent
  2010-04-08 13:43                         ` [U-Boot] [PATCHv2 13/13] mop500: add board-specific files Rabin Vincent
  2010-04-09 23:04                         ` [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011 Wolfgang Denk
  0 siblings, 2 replies; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

The Ux500 variants of the pl011 have separate LCRH registers for RX and
TX.  The TX register is at the same offset as the unmodified pl011, so
we need to additionally program only the RX register.

Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 drivers/serial/serial_pl01x.c |    8 ++++++++
 drivers/serial/serial_pl01x.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index c645cef..c819f1d 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -144,6 +144,14 @@ int serial_init (void)
 	IO_WRITE (port[CONSOLE_PORT] + UART_PL011_LCRH,
 		  (UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN));
 
+#ifdef CONFIG_UX500
+	/*
+	 * On Ux500 variants, also set up the separate LCRH for RX.
+	 */
+	IO_WRITE (port[CONSOLE_PORT] + UART_PL011_LCRH_RX,
+		  (UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN));
+#endif
+
 	/*
 	 ** Finally, enable the UART
 	 */
diff --git a/drivers/serial/serial_pl01x.h b/drivers/serial/serial_pl01x.h
index 5f20fdd..0ff6203 100644
--- a/drivers/serial/serial_pl01x.h
+++ b/drivers/serial/serial_pl01x.h
@@ -93,6 +93,7 @@
  *  PL011 definitions
  *
  */
+#define UART_PL011_LCRH_RX              0x1C
 #define UART_PL011_IBRD                 0x24
 #define UART_PL011_FBRD                 0x28
 #define UART_PL011_LCRH                 0x2C
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 13/13] mop500: add board-specific files
  2010-04-08 13:43                       ` [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
@ 2010-04-08 13:43                         ` Rabin Vincent
  2010-04-09 23:04                         ` [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011 Wolfgang Denk
  1 sibling, 0 replies; 22+ messages in thread
From: Rabin Vincent @ 2010-04-08 13:43 UTC (permalink / raw)
  To: u-boot

Add base board code for the MOP500 board, which uses the U8500 SoC.

Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 MAINTAINERS                       |    4 ++
 MAKEALL                           |    9 +++
 Makefile                          |    9 +++-
 board/stericsson/mop500/Makefile  |   54 ++++++++++++++++++
 board/stericsson/mop500/config.mk |   23 ++++++++
 board/stericsson/mop500/mop500.c  |   72 ++++++++++++++++++++++++
 include/configs/mop500.h          |  108 +++++++++++++++++++++++++++++++++++++
 7 files changed, 278 insertions(+), 1 deletions(-)
 create mode 100644 board/stericsson/mop500/Makefile
 create mode 100644 board/stericsson/mop500/config.mk
 create mode 100644 board/stericsson/mop500/mop500.c
 create mode 100644 include/configs/mop500.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 0658bc3..2e556fe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -769,6 +769,10 @@ Hugo Villeneuve <hugo.villeneuve@lyrtech.com>
 
 	SFFSDR		ARM926EJS
 
+Rabin Vincent <rabin.vincent@stericsson.com>
+
+	mop500		ARM CORTEX-A9 (U8500 SoC)
+
 Prafulla Wadaskar <prafulla@marvell.com>
 
 	mv88f6281gtw_ge	ARM926EJS (Kirkwood SoC)
diff --git a/MAKEALL b/MAKEALL
index a88c31e..d8585de 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -642,6 +642,14 @@ LIST_ARM_CORTEX_A8="		\
 "
 
 #########################################################################
+## ARM Cortex-A9 Systems
+#########################################################################
+
+LIST_ARM_CORTEX_A9="		\
+	mop500			\
+"
+
+#########################################################################
 ## AT91 Systems
 #########################################################################
 
@@ -719,6 +727,7 @@ LIST_arm="			\
 	${LIST_ARM10}		\
 	${LIST_ARM11}		\
 	${LIST_ARM_CORTEX_A8}	\
+	${LIST_ARM_CORTEX_A9}	\
 	${LIST_at91}		\
 	${LIST_pxa}		\
 	${LIST_ixp}		\
diff --git a/Makefile b/Makefile
index 4532550..141a9f6 100644
--- a/Makefile
+++ b/Makefile
@@ -3141,7 +3141,7 @@ SMN42_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292
 
 #########################################################################
-## ARM CORTEX Systems
+## ARM CORTEX-A8 Systems
 #########################################################################
 
 devkit8000_config :	unconfig
@@ -3172,6 +3172,13 @@ smdkc100_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 smdkc100 samsung s5pc1xx
 
 #########################################################################
+## ARM CORTEX-A9 Systems
+#########################################################################
+
+mop500_config:		unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa9 mop500 stericsson ux500
+
+#########################################################################
 ## XScale Systems
 #########################################################################
 
diff --git a/board/stericsson/mop500/Makefile b/board/stericsson/mop500/Makefile
new file mode 100644
index 0000000..218d572
--- /dev/null
+++ b/board/stericsson/mop500/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2004
+# ARM Ltd.
+# Philippe Robin, <philippe.robin@arm.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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	:= mop500.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/stericsson/mop500/config.mk b/board/stericsson/mop500/config.mk
new file mode 100644
index 0000000..af246bd
--- /dev/null
+++ b/board/stericsson/mop500/config.mk
@@ -0,0 +1,23 @@
+#
+# (C) Copyright 2010 ST-Ericsson SA
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0x05600000
diff --git a/board/stericsson/mop500/mop500.c b/board/stericsson/mop500/mop500.c
new file mode 100644
index 0000000..1b03f65
--- /dev/null
+++ b/board/stericsson/mop500/mop500.c
@@ -0,0 +1,72 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ * Author: Rabin Vincent <rabin.vincent@stericsson.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <nomadik.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void gpio_init(void)
+{
+	/* UART2 */
+	nmk_gpio_af(29, GPIO_ALT_C);
+	nmk_gpio_af(30, GPIO_ALT_C);
+}
+
+static void clock_init(void)
+{
+	struct prcmu *prcmu = (struct prcmu *) U8500_PRCMU_BASE;
+
+	/* Enable timers */
+	writel(PRCM_TCR_DOZE_MODE, &prcmu->tcr);
+
+	u8500_prcmu_enable(&prcmu->per3clk_mgt);
+	u8500_prcmu_enable(&prcmu->per7clk_mgt);
+	u8500_prcmu_enable(&prcmu->uartclk_mgt);
+
+	u8500_clock_enable(U8500_CLK_MTU0);
+	u8500_clock_enable(U8500_CLK_UART2);
+}
+
+int board_init(void)
+{
+	gd->bd->bi_arch_number = MACH_TYPE_U8500;
+	gd->bd->bi_boot_params = 0x00000100;
+
+	gpio_init();
+	clock_init();
+
+	icache_enable();
+
+	return 0;
+}
+
+int dram_init(void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+	return 0;
+}
diff --git a/include/configs/mop500.h b/include/configs/mop500.h
new file mode 100644
index 0000000..71a003f
--- /dev/null
+++ b/include/configs/mop500.h
@@ -0,0 +1,108 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <asm/arch/hardware.h>
+
+#define CONFIG_ARMCORTEXA9
+#define CONFIG_UX500
+#define CONFIG_UX500_U8500	/* cpu variant */
+#define CONFIG_UX500_MOP500	/* board variant */
+
+#define CONFIG_L2_OFF
+#define CONFIG_SKIP_LOWLEVEL_INIT
+
+/* commands */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+#define CONFIG_SYS_NO_FLASH
+
+/* user interface */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT		"U8500> "
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE \
+					+ sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE /* Boot Arg Buffer Size */
+#define CONFIG_SYS_MAXARGS	16
+#define CONFIG_SYS_LOAD_ADDR	0x800000	/* default load address */
+#define CONFIG_SYS_LOADS_BAUD_CHANGE
+
+/* boot config */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_BOOTDELAY	1
+#define CONFIG_BOOTARGS	"root=/dev/ram0 console=ttyAMA2,115200n8 init=linuxrc"
+
+/* memory-related information */
+#define CONFIG_NR_DRAM_BANKS	1
+#define PHYS_SDRAM_1		0x00000000	/* DDR-SDRAM Bank #1 */
+#define PHYS_SDRAM_1_SIZE	0x10000000	/* 256 MB */
+
+#define CONFIG_STACKSIZE	(128 * 1024)	/* regular stack */
+#ifdef CONFIG_USE_IRQ
+#  define CONFIG_STACKSIZE_IRQ	(4 * 1024)	/* IRQ stack */
+#  define CONFIG_STACKSIZE_FIQ	(4 * 1024)	/* FIQ stack */
+#endif
+
+#define CONFIG_ENV_IS_NOWHERE
+
+#define CONFIG_ENV_SIZE			0x20000 /* 128 Kb */
+
+#define CONFIG_SYS_MEMTEST_START	0x00000000
+#define CONFIG_SYS_MEMTEST_END		0x0FFFFFFF
+#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 256 * 1024)
+#define CONFIG_SYS_GBL_DATA_SIZE	128	/* for initial data */
+
+/* timing informazion */
+#define CONFIG_SYS_HZ			1000 /* Mandatory... */
+#define CONFIG_SYS_TIMERBASE		U8500_MTU0_BASE
+#define CONFIG_NOMADIK_MTU
+#define CONFIG_NOMADIK_MTU_CLOCK	6250000
+#define CONFIG_NOMADIK_MTU_PRESCALE	MTU_CRn_PRESCALE_16
+
+/* GPIO */
+#define CONFIG_NOMADIK_GPIO
+#define CONFIG_NOMADIK_GPIO_NUM_BANKS	9
+
+/* serial port (PL011) configuration */
+#define CONFIG_PL011_SERIAL
+#define CONFIG_CONS_INDEX	2
+#define CONFIG_BAUDRATE		115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_PL01x_PORTS	{ (void *)U8500_UART0_BASE,	\
+				  (void *)U8500_UART1_BASE,	\
+				  (void *)U8500_UART2_BASE }
+#define CONFIG_PL011_CLOCK	38400000
+
+#endif /* __CONFIG_H */
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-08 13:43                 ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Rabin Vincent
  2010-04-08 13:43                   ` [U-Boot] [PATCHv2 10/13] ARM Cortex A9: ifdef code calling lowlevel init Rabin Vincent
@ 2010-04-09 11:29                   ` Nishanth Menon
  2010-04-09 13:27                     ` Vaibhav Bedia
  1 sibling, 1 reply; 22+ messages in thread
From: Nishanth Menon @ 2010-04-09 11:29 UTC (permalink / raw)
  To: u-boot

On 04/08/2010 08:43 AM, Rabin Vincent wrote:
> Add Cortex A9 support by copying the code for Cortex A8.  The only
> change is a removal of some OMAP3 specific code.
Thanks :), I was hoping to help in the near future by adding OMAP4 code 
in cortex a9.. ;)

>
> Acked-by: Michael Brandt<michael.brandt@stericsson.com>
> Signed-off-by: Rabin Vincent<rabin.vincent@stericsson.com>
> ---
>   cpu/{arm_cortexa8 =>  arm_cortexa9}/Makefile   |    0
>   cpu/{arm_cortexa8 =>  arm_cortexa9}/config.mk  |    0
>   cpu/{arm_cortexa8 =>  arm_cortexa9}/cpu.c      |    0
>   cpu/{arm_cortexa8 =>  arm_cortexa9}/start.S    |   26 +------------------------
>   cpu/{arm_cortexa8 =>  arm_cortexa9}/u-boot.lds |    2 +-
>   5 files changed, 2 insertions(+), 26 deletions(-)
>   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/Makefile (100%)
>   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/config.mk (100%)
>   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/cpu.c (100%)
>   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/start.S (91%)
>   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/u-boot.lds (97%)

looking at the % of reuse.. for a9, cant we avoid a copy? since a9 and 
a8 are both v7 instruction set anyways,

how about cpu/arm_cortexa8,a9 etc replaced by cpu/armv7 and have cortex 
and soc specific code within it?

option a:
cpu/armv7/
	common code.[cS..]
	/cortex_a8/
	/cortex_a9/
	soc specific code:
	option 1:
	cpu/armv7/cortex_a[89]/soc
	or option 2:
	cpu/armv7/soc
	
option b:
cpu/armv7_common/
cpu/cortex_a8/
cpu/cortex_a9/

(socs thier usual place cpu/cortex_a[89]/socx
option c:
cpu/armv7
cpu/armv7/soc1
cpu/armv7/soc2
etc..
v7 has both a8 and a9 codebases..

Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-09 11:29                   ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Nishanth Menon
@ 2010-04-09 13:27                     ` Vaibhav Bedia
  2010-04-09 23:06                       ` Wolfgang Denk
  2010-04-10 16:54                       ` Rabin Vincent
  0 siblings, 2 replies; 22+ messages in thread
From: Vaibhav Bedia @ 2010-04-09 13:27 UTC (permalink / raw)
  To: u-boot

On Fri, Apr 9, 2010 at 4:59 PM, Nishanth Menon <menon.nishanth@gmail.com>wrote:

> On 04/08/2010 08:43 AM, Rabin Vincent wrote:
> > Add Cortex A9 support by copying the code for Cortex A8.  The only
> > change is a removal of some OMAP3 specific code.
> Thanks :), I was hoping to help in the near future by adding OMAP4 code
> in cortex a9.. ;)
>
> >
> > Acked-by: Michael Brandt<michael.brandt@stericsson.com>
> > Signed-off-by: Rabin Vincent<rabin.vincent@stericsson.com>
> > ---
> >   cpu/{arm_cortexa8 =>  arm_cortexa9}/Makefile   |    0
> >   cpu/{arm_cortexa8 =>  arm_cortexa9}/config.mk  |    0
> >   cpu/{arm_cortexa8 =>  arm_cortexa9}/cpu.c      |    0
> >   cpu/{arm_cortexa8 =>  arm_cortexa9}/start.S    |   26
> +------------------------
> >   cpu/{arm_cortexa8 =>  arm_cortexa9}/u-boot.lds |    2 +-
> >   5 files changed, 2 insertions(+), 26 deletions(-)
> >   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/Makefile (100%)
> >   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/config.mk (100%)
> >   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/cpu.c (100%)
> >   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/start.S (91%)
> >   copy cpu/{arm_cortexa8 =>  arm_cortexa9}/u-boot.lds (97%)
>
> looking at the % of reuse.. for a9, cant we avoid a copy? since a9 and
> a8 are both v7 instruction set anyways,
>
> how about cpu/arm_cortexa8,a9 etc replaced by cpu/armv7 and have cortex
> and soc specific code within it?
>
> Making the folders based on ISA version would be confusing as the other ARM
cores are not grouped that way.
As all Cortex processors implement the ARMv7 architecture a better grouping
IMHO would be cpu/cortex/a8 and cpu/cortex/a9. The common stuff can be under
cpu/cortex/.


> option a:
> cpu/armv7/
>        common code.[cS..]
>        /cortex_a8/
>        /cortex_a9/
>        soc specific code:
>        option 1:
>        cpu/armv7/cortex_a[89]/soc
>        or option 2:
>        cpu/armv7/soc
>
> option b:
> cpu/armv7_common/
> cpu/cortex_a8/
> cpu/cortex_a9/
>
> (socs thier usual place cpu/cortex_a[89]/socx
> option c:
> cpu/armv7
> cpu/armv7/soc1
> cpu/armv7/soc2
> etc..
> v7 has both a8 and a9 codebases..
>
> Regards,
> Nishanth Menon
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



-- 
Regards,
Vaibhav

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011
  2010-04-08 13:43                       ` [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
  2010-04-08 13:43                         ` [U-Boot] [PATCHv2 13/13] mop500: add board-specific files Rabin Vincent
@ 2010-04-09 23:04                         ` Wolfgang Denk
  1 sibling, 0 replies; 22+ messages in thread
From: Wolfgang Denk @ 2010-04-09 23:04 UTC (permalink / raw)
  To: u-boot

Dear Rabin Vincent,

In message <1270734200-17762-13-git-send-email-rabin.vincent@stericsson.com> you wrote:
>
> --- a/drivers/serial/serial_pl01x.h
> +++ b/drivers/serial/serial_pl01x.h
> @@ -93,6 +93,7 @@
>   *  PL011 definitions
>   *
>   */
> +#define UART_PL011_LCRH_RX              0x1C
>  #define UART_PL011_IBRD                 0x24
>  #define UART_PL011_FBRD                 0x28
>  #define UART_PL011_LCRH                 0x2C

This should be turned into a C struct.

Best regards,

Wolfgang Denk

-- 
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
Alles Gescheite ist schon gedacht worden, man mu? nur versuchen,
es noch einmal zu denken.          -- Goethe, Maximen und Reflexionen

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-09 13:27                     ` Vaibhav Bedia
@ 2010-04-09 23:06                       ` Wolfgang Denk
  2010-04-10  0:22                         ` Nishanth Menon
  2010-04-10 16:54                       ` Rabin Vincent
  1 sibling, 1 reply; 22+ messages in thread
From: Wolfgang Denk @ 2010-04-09 23:06 UTC (permalink / raw)
  To: u-boot

Dear Vaibhav Bedia,

In message <q2ybaa2b3351004090627jecaaf94byd1e5edf46e0644d@mail.gmail.com> you wrote:
>
> > Making the folders based on ISA version would be confusing as the other ARM
> cores are not grouped that way.
> As all Cortex processors implement the ARMv7 architecture a better grouping
> IMHO would be cpu/cortex/a8 and cpu/cortex/a9. The common stuff can be under
> cpu/cortex/.

Sounds good to me.

Best regards,

Wolfgang Denk

-- 
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
"I can call spirits from the vasty deep."
"Why so can I, or so can any man; but will they come when you do call
for them?"          - Shakespeare, 1 King Henry IV, Act III, Scene I.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-09 23:06                       ` Wolfgang Denk
@ 2010-04-10  0:22                         ` Nishanth Menon
  0 siblings, 0 replies; 22+ messages in thread
From: Nishanth Menon @ 2010-04-10  0:22 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk had written, on 04/09/2010 06:06 PM, the following:
> Dear Vaibhav Bedia,
> 
> In message <q2ybaa2b3351004090627jecaaf94byd1e5edf46e0644d@mail.gmail.com> you wrote:
>>> Making the folders based on ISA version would be confusing as the other ARM
>> cores are not grouped that way.
>> As all Cortex processors implement the ARMv7 architecture a better grouping
>> IMHO would be cpu/cortex/a8 and cpu/cortex/a9. The common stuff can be under
>> cpu/cortex/.
> 
> Sounds good to me.
> 

Ack.

-- 
Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-09 13:27                     ` Vaibhav Bedia
  2010-04-09 23:06                       ` Wolfgang Denk
@ 2010-04-10 16:54                       ` Rabin Vincent
  2010-04-11 20:45                         ` Tom
  1 sibling, 1 reply; 22+ messages in thread
From: Rabin Vincent @ 2010-04-10 16:54 UTC (permalink / raw)
  To: u-boot

On Fri, Apr 9, 2010 at 6:57 PM, Vaibhav Bedia <vaibhav.bedia@gmail.com> wrote:
> As all Cortex processors implement the ARMv7 architecture a better grouping
> IMHO would be cpu/cortex/a8 and cpu/cortex/a9. The common stuff can be under
> cpu/cortex/.

Perhaps Tom can clarify if he's OK with this, since he wanted a separate
cpu/cortex_a9 directory to be created (The first version of my patch series
just put the Ux500 code into cortex_a8).

The only potential problem I see with this is that some fixups will have to be
done in the Makefiles for lib$(CPU).a generation since $(CPU) would have a
slash in it after this.  This could be avoided by keeping the SOC directories
for all Cortexes in cpu/arm_cortex itself instead of a8 and a9 subdirectories.

Rabin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-10 16:54                       ` Rabin Vincent
@ 2010-04-11 20:45                         ` Tom
  2010-04-20 12:16                           ` Rabin VINCENT
  0 siblings, 1 reply; 22+ messages in thread
From: Tom @ 2010-04-11 20:45 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> On Fri, Apr 9, 2010 at 6:57 PM, Vaibhav Bedia <vaibhav.bedia@gmail.com> wrote:
>> As all Cortex processors implement the ARMv7 architecture a better grouping
>> IMHO would be cpu/cortex/a8 and cpu/cortex/a9. The common stuff can be under
>> cpu/cortex/.
> 
> Perhaps Tom can clarify if he's OK with this, since he wanted a separate
> cpu/cortex_a9 directory to be created (The first version of my patch series
> just put the Ux500 code into cortex_a8).
> 
> The only potential problem I see with this is that some fixups will have to be
> done in the Makefiles for lib$(CPU).a generation since $(CPU) would have a
> slash in it after this.  This could be avoided by keeping the SOC directories
> for all Cortexes in cpu/arm_cortex itself instead of a8 and a9 subdirectories.
> 
> Rabin

The change the Nishanth proposed is better.
I am ok with this change.

My concern with the original Ux500 code was not to include a9 in a8.
As this would in the long run make for less readable and less maintainable code.
The new change would mean less copying of files but more reordering.

I would suggest that 'fix me' warnings would be added to the a8 boards to defer 
the reordering. The reordering need not all in the ux500 patchset.  If you want 
to take up all the reordering, that is fine too.

Tom

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support
  2010-04-11 20:45                         ` Tom
@ 2010-04-20 12:16                           ` Rabin VINCENT
  0 siblings, 0 replies; 22+ messages in thread
From: Rabin VINCENT @ 2010-04-20 12:16 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Sun, Apr 11, 2010 at 10:45:41PM +0200, Tom wrote:
> Rabin Vincent wrote:
> > On Fri, Apr 9, 2010 at 6:57 PM, Vaibhav Bedia <vaibhav.bedia@gmail.com> wrote:
> >> As all Cortex processors implement the ARMv7 architecture a better grouping
> >> IMHO would be cpu/cortex/a8 and cpu/cortex/a9. The common stuff can be under
> >> cpu/cortex/.
> > 
> > Perhaps Tom can clarify if he's OK with this, since he wanted a separate
> > cpu/cortex_a9 directory to be created (The first version of my patch series
> > just put the Ux500 code into cortex_a8).
> > 
> > The only potential problem I see with this is that some fixups will have to be
> > done in the Makefiles for lib$(CPU).a generation since $(CPU) would have a
> > slash in it after this.  This could be avoided by keeping the SOC directories
> > for all Cortexes in cpu/arm_cortex itself instead of a8 and a9 subdirectories.
> > 
> > Rabin
> 
> The change the Nishanth proposed is better.
> I am ok with this change.
> 
> My concern with the original Ux500 code was not to include a9 in a8.
> As this would in the long run make for less readable and less maintainable code.
> The new change would mean less copying of files but more reordering.
> 
> I would suggest that 'fix me' warnings would be added to the a8 boards to defer 
> the reordering. The reordering need not all in the ux500 patchset.  If you want 
> to take up all the reordering, that is fine too.

I've posted a set of patches which adds the Makefile modifications
necessary to support this directory structure, and also moves all
Cortex-A8 SOCs into the new locations.   If you find those patches
acceptable, I'll rebase the Ux500 patchset based on top of that.

Rabin

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-04-20 12:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 13:43 [U-Boot] [PATCHv2 00/13] ST-Ericsson Ux500 support Rabin Vincent
2010-04-08 13:43 ` [U-Boot] [PATCHv2 01/13] Nomadik: move nomadik.h to asm/arch/nhk8815.h Rabin Vincent
2010-04-08 13:43   ` [U-Boot] [PATCHv2 02/13] Nomadik: timer: push down single-use macros Rabin Vincent
2010-04-08 13:43     ` [U-Boot] [PATCHv2 03/13] Nomadik: timer: remove header and use C structs Rabin Vincent
2010-04-08 13:43       ` [U-Boot] [PATCHv2 04/13] Nomadik: move timer code to drivers/misc Rabin Vincent
2010-04-08 13:43         ` [U-Boot] [PATCHv2 05/13] Nomadik: move gpio driver to drivers/gpio Rabin Vincent
2010-04-08 13:43           ` [U-Boot] [PATCHv2 06/13] nomadik-gpio: check for invalid gpio numbers Rabin Vincent
2010-04-08 13:43             ` [U-Boot] [PATCHv2 07/13] nomadik-gpio: get base address from platform code Rabin Vincent
2010-04-08 13:43               ` [U-Boot] [PATCHv2 08/13] nomadik-mtu: support configurable clock rates Rabin Vincent
2010-04-08 13:43                 ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Rabin Vincent
2010-04-08 13:43                   ` [U-Boot] [PATCHv2 10/13] ARM Cortex A9: ifdef code calling lowlevel init Rabin Vincent
2010-04-08 13:43                     ` [U-Boot] [PATCHv2 11/13] ux500: add SoC-specific code Rabin Vincent
2010-04-08 13:43                       ` [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
2010-04-08 13:43                         ` [U-Boot] [PATCHv2 13/13] mop500: add board-specific files Rabin Vincent
2010-04-09 23:04                         ` [U-Boot] [PATCHv2 12/13] pl01x: add support for Ux500 variant of pl011 Wolfgang Denk
2010-04-09 11:29                   ` [U-Boot] [PATCHv2 09/13] arm: add Cortex A9 support Nishanth Menon
2010-04-09 13:27                     ` Vaibhav Bedia
2010-04-09 23:06                       ` Wolfgang Denk
2010-04-10  0:22                         ` Nishanth Menon
2010-04-10 16:54                       ` Rabin Vincent
2010-04-11 20:45                         ` Tom
2010-04-20 12:16                           ` Rabin VINCENT

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.