All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support
@ 2010-03-18  4:20 Rabin Vincent
  2010-03-18  4:20 ` [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc Rabin Vincent
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  4:20 UTC (permalink / raw)
  To: u-boot

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.

Note: The series must be applied on top of the patch "[PATCH V4] Nomadik: fix
reset_timer()" posted by Alessandro Rubini on 2009-11-25:
http://lists.denx.de/pipermail/u-boot/2009-November/064800.html
Cc: Alessandro Rubini <rubini@unipv.it>

Rabin Vincent (8):
  Nomadik: move timer code to drivers/misc
  Nomadik: move gpio driver to drivers/gpio
  nomadik_gpio: get base address from platform code
  nomadik_mtu: support configurable clock rates
  ARM Cortex A8: 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                                            |    1 +
 Makefile                                           |    3 +
 board/st/nhk8815/nhk8815.c                         |    9 ++-
 board/stericsson/mop500/Makefile                   |   54 ++++++++++
 board/stericsson/mop500/config.mk                  |   23 ++++
 board/stericsson/mop500/mop500.c                   |   72 +++++++++++++
 cpu/arm926ejs/nomadik/Makefile                     |    1 -
 cpu/arm_cortexa8/start.S                           |    4 +-
 cpu/arm_cortexa8/ux500/Makefile                    |   45 ++++++++
 .../gpio.h => cpu/arm_cortexa8/ux500/clock.c       |   48 ++++++---
 .../gpio.h => cpu/arm_cortexa8/ux500/cpu.c         |   41 +++++---
 drivers/gpio/Makefile                              |    1 +
 .../nomadik/gpio.c => drivers/gpio/nomadik_gpio.c  |   11 +--
 drivers/misc/Makefile                              |    1 +
 .../nomadik/timer.c => drivers/misc/nomadik_mtu.c  |   24 +++--
 drivers/serial/serial_pl01x.c                      |    8 ++
 drivers/serial/serial_pl01x.h                      |    1 +
 include/asm-arm/arch-ux500/clock.h                 |   72 +++++++++++++
 include/asm-arm/arch-ux500/hardware.h              |   78 ++++++++++++++
 include/configs/mop500.h                           |  107 ++++++++++++++++++++
 include/configs/nhk8815.h                          |   11 ++-
 .../arch-nomadik/gpio.h => nomadik_gpio.h}         |    2 +
 .../{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h}  |    0
 24 files changed, 563 insertions(+), 58 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_cortexa8/ux500/Makefile
 copy include/asm-arm/arch-nomadik/gpio.h => cpu/arm_cortexa8/ux500/clock.c (52%)
 copy include/asm-arm/arch-nomadik/gpio.h => cpu/arm_cortexa8/ux500/cpu.c (58%)
 rename cpu/arm926ejs/nomadik/gpio.c => drivers/gpio/nomadik_gpio.c (92%)
 rename cpu/arm926ejs/nomadik/timer.c => drivers/misc/nomadik_mtu.c (81%)
 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
 rename include/{asm-arm/arch-nomadik/gpio.h => nomadik_gpio.h} (97%)
 rename include/{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h} (100%)

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

* [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
@ 2010-03-18  4:20 ` Rabin Vincent
  2010-03-28 17:30   ` Tom
  2010-03-18  4:28 ` [U-Boot] [PATCH 2/8] Nomadik: move gpio driver to drivers/gpio Rabin Vincent
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  4:20 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  |    2 +-
 include/configs/nhk8815.h                          |    1 +
 .../{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h}  |    0
 5 files changed, 4 insertions(+), 2 deletions(-)
 rename cpu/arm926ejs/nomadik/timer.c => drivers/misc/nomadik_mtu.c (98%)
 rename include/{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h} (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 98%
rename from cpu/arm926ejs/nomadik/timer.c
rename to drivers/misc/nomadik_mtu.c
index 1d98ef3..b9c0fb1 100644
--- a/cpu/arm926ejs/nomadik/timer.c
+++ b/drivers/misc/nomadik_mtu.c
@@ -22,7 +22,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/mtu.h>
+#include <nomadik_mtu.h>
 
 /*
  * The timer is a decrementer, we'll left it free running at 2.4MHz.
diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
index 2b640dc..4dd391e 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
diff --git a/include/asm-arm/arch-nomadik/mtu.h b/include/nomadik_mtu.h
similarity index 100%
rename from include/asm-arm/arch-nomadik/mtu.h
rename to include/nomadik_mtu.h
-- 
1.7.0

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

* [U-Boot] [PATCH 2/8] Nomadik: move gpio driver to drivers/gpio
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
  2010-03-18  4:20 ` [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc Rabin Vincent
@ 2010-03-18  4:28 ` Rabin Vincent
  2010-03-28 17:32   ` Tom
  2010-03-18  5:02 ` [U-Boot] [PATCH 3/8] nomadik_gpio: get base address from platform code Rabin Vincent
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  4:28 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 +++++--
 .../arch-nomadik/gpio.h => nomadik_gpio.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_gpio.h} (100%)

diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c
index faef810..4f5f94f 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_gpio.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..e8a7bca 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_gpio.h>
 
 static unsigned long gpio_base[4] = {
 	NOMADIK_GPIO0_BASE,
diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
index 4dd391e..8ba1e5e 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 (uses drivers/gpio/nomadik_gpio.c) */
 #ifndef __ASSEMBLY__
-#include <asm/arch/gpio.h>
+#include <nomadik_gpio.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_gpio.h
similarity index 100%
rename from include/asm-arm/arch-nomadik/gpio.h
rename to include/nomadik_gpio.h
-- 
1.7.0

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

* [U-Boot] [PATCH 3/8] nomadik_gpio: get base address from platform code
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
  2010-03-18  4:20 ` [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc Rabin Vincent
  2010-03-18  4:28 ` [U-Boot] [PATCH 2/8] Nomadik: move gpio driver to drivers/gpio Rabin Vincent
@ 2010-03-18  5:02 ` Rabin Vincent
  2010-03-28 17:35   ` Tom
  2010-03-18  5:08 ` [U-Boot] [PATCH 4/8] nomadik_mtu: support configurable clock rates Rabin Vincent
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  5:02 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  |    7 +++++++
 drivers/gpio/nomadik_gpio.c |    9 +--------
 include/nomadik_gpio.h      |    2 ++
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c
index 4f5f94f..79c91a7 100644
--- a/board/st/nhk8815/nhk8815.c
+++ b/board/st/nhk8815/nhk8815.c
@@ -32,6 +32,13 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+unsigned long nmk_gpio_base[] = {
+	NOMADIK_GPIO0_BASE,
+	NOMADIK_GPIO1_BASE,
+	NOMADIK_GPIO2_BASE,
+	NOMADIK_GPIO3_BASE
+};
+
 #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 e8a7bca..deb2beb 100644
--- a/drivers/gpio/nomadik_gpio.c
+++ b/drivers/gpio/nomadik_gpio.c
@@ -24,13 +24,6 @@
 #include <asm/io.h>
 #include <nomadik_gpio.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,7 +38,7 @@ enum gpio_registers {
 
 static inline unsigned long gpio_to_base(int gpio)
 {
-	return gpio_base[gpio / 32];
+	return nmk_gpio_base[gpio / 32];
 }
 
 static inline u32 gpio_to_bit(int gpio)
diff --git a/include/nomadik_gpio.h b/include/nomadik_gpio.h
index 1d3c9ce..2822db4 100644
--- a/include/nomadik_gpio.h
+++ b/include/nomadik_gpio.h
@@ -34,6 +34,8 @@ enum nmk_af { /* alternate function settings */
 	GPIO_ALT_C
 };
 
+extern unsigned long nmk_gpio_base[];
+
 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] 26+ messages in thread

* [U-Boot] [PATCH 4/8] nomadik_mtu: support configurable clock rates
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
                   ` (2 preceding siblings ...)
  2010-03-18  5:02 ` [U-Boot] [PATCH 3/8] nomadik_gpio: get base address from platform code Rabin Vincent
@ 2010-03-18  5:08 ` Rabin Vincent
  2010-03-28 17:36   ` Tom
  2010-03-18  5:10 ` [U-Boot] [PATCH 5/8] ARM Cortex A8: ifdef code calling lowlevel init Rabin Vincent
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  5:08 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 |   22 +++++++++++++---------
 include/configs/nhk8815.h  |    3 +++
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/misc/nomadik_mtu.c b/drivers/misc/nomadik_mtu.c
index b9c0fb1..4ec75ad 100644
--- a/drivers/misc/nomadik_mtu.c
+++ b/drivers/misc/nomadik_mtu.c
@@ -22,25 +22,29 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <div64.h>
 #include <nomadik_mtu.h>
 
-/*
- * 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 */
+#define TIMER_CLOCK		CONFIG_NOMADIK_MTU_CLOCK
 #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)))
 
+static unsigned long usec_to_count(unsigned long long usec)
+{
+	unsigned long long count = usec * TIMER_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,
+	writel(MTU_CRn_ENA | CONFIG_NOMADIK_MTU_PRESCALE | MTU_CRn_32BITS,
 	       CONFIG_SYS_TIMERBASE + MTU_CR(0));
 	reset_timer();
 	return 0;
@@ -73,7 +77,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 8ba1e5e..d52f50c 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] 26+ messages in thread

* [U-Boot] [PATCH 5/8] ARM Cortex A8: ifdef code calling lowlevel init
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
                   ` (3 preceding siblings ...)
  2010-03-18  5:08 ` [U-Boot] [PATCH 4/8] nomadik_mtu: support configurable clock rates Rabin Vincent
@ 2010-03-18  5:10 ` Rabin Vincent
  2010-03-28 17:38   ` Tom
  2010-03-18  5:10 ` [U-Boot] [PATCH 6/8] ux500: add SoC-specific code Rabin Vincent
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  5:10 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_cortexa8/start.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/cpu/arm_cortexa8/start.S b/cpu/arm_cortexa8/start.S
index 29dae2f..70bfc5d 100644
--- a/cpu/arm_cortexa8/start.S
+++ b/cpu/arm_cortexa8/start.S
@@ -181,7 +181,7 @@ clbss_l:
 
 _start_armboot: .word start_armboot
 
-
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*************************************************************************
  *
  * CPU_init_critical registers
@@ -218,6 +218,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] 26+ messages in thread

* [U-Boot] [PATCH 6/8] ux500: add SoC-specific code
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
                   ` (4 preceding siblings ...)
  2010-03-18  5:10 ` [U-Boot] [PATCH 5/8] ARM Cortex A8: ifdef code calling lowlevel init Rabin Vincent
@ 2010-03-18  5:10 ` Rabin Vincent
  2010-03-28 17:42   ` Tom
  2010-03-18  5:10 ` [U-Boot] [PATCH 7/8] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  5:10 UTC (permalink / raw)
  To: u-boot

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

Even though this is a Cortex A9, we put it under Cortex A8 to avoid code
duplication, since the CPU specific code can be used unmodified across
the two CPUs.

Acked-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 cpu/arm_cortexa8/ux500/Makefile       |   45 +++++++++++++++++++
 cpu/arm_cortexa8/ux500/clock.c        |   56 +++++++++++++++++++++++
 cpu/arm_cortexa8/ux500/cpu.c          |   49 ++++++++++++++++++++
 include/asm-arm/arch-ux500/clock.h    |   72 ++++++++++++++++++++++++++++++
 include/asm-arm/arch-ux500/hardware.h |   78 +++++++++++++++++++++++++++++++++
 5 files changed, 300 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm_cortexa8/ux500/Makefile
 create mode 100644 cpu/arm_cortexa8/ux500/clock.c
 create mode 100644 cpu/arm_cortexa8/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_cortexa8/ux500/Makefile b/cpu/arm_cortexa8/ux500/Makefile
new file mode 100644
index 0000000..c671010
--- /dev/null
+++ b/cpu/arm_cortexa8/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_cortexa8/ux500/clock.c b/cpu/arm_cortexa8/ux500/clock.c
new file mode 100644
index 0000000..6b67fe8
--- /dev/null
+++ b/cpu/arm_cortexa8/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,
+	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_cortexa8/ux500/cpu.c b/cpu/arm_cortexa8/ux500/cpu.c
new file mode 100644
index 0000000..b3c66fa
--- /dev/null
+++ b/cpu/arm_cortexa8/ux500/cpu.c
@@ -0,0 +1,49 @@
+/*
+ * (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_gpio.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned long nmk_gpio_base[] = {
+	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
+};
+
+void reset_cpu(unsigned long ignored)
+{
+	struct prcmu *prcmu = (struct prcmu *) U8500_PRCMU_BASE;
+
+	writel(0x1, &prcmu->ape_softrst);
+	while (1);
+}
diff --git a/include/asm-arm/arch-ux500/clock.h b/include/asm-arm/arch-ux500/clock.h
new file mode 100644
index 0000000..b384f49
--- /dev/null
+++ b/include/asm-arm/arch-ux500/clock.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_CLOCK
+#define __ASM_ARCH_CLOCK
+
+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) | (1 << 8), 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..2d75538
--- /dev/null
+++ b/include/asm-arm/arch-ux500/hardware.h
@@ -0,0 +1,78 @@
+/*
+ * (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] 26+ messages in thread

* [U-Boot] [PATCH 7/8] pl01x: add support for Ux500 variant of pl011
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
                   ` (5 preceding siblings ...)
  2010-03-18  5:10 ` [U-Boot] [PATCH 6/8] ux500: add SoC-specific code Rabin Vincent
@ 2010-03-18  5:10 ` Rabin Vincent
  2010-03-28 17:45   ` Tom
  2010-03-18  5:33 ` [U-Boot] [PATCH 8/8] mop500: add board-specific files Rabin Vincent
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  5:10 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>
---
I have used the style of the surrounding code here.

 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] 26+ messages in thread

* [U-Boot] [PATCH 8/8] mop500: add board-specific files
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
                   ` (6 preceding siblings ...)
  2010-03-18  5:10 ` [U-Boot] [PATCH 7/8] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
@ 2010-03-18  5:33 ` Rabin Vincent
  2010-03-28 17:49   ` Tom
  2010-03-21 19:42 ` [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Wolfgang Denk
  2010-03-28 17:27 ` Tom
  9 siblings, 1 reply; 26+ messages in thread
From: Rabin Vincent @ 2010-03-18  5:33 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>
Tested-by: Michael Brandt <michael.brandt@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 MAINTAINERS                       |    4 ++
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/stericsson/mop500/Makefile  |   54 +++++++++++++++++++
 board/stericsson/mop500/config.mk |   23 ++++++++
 board/stericsson/mop500/mop500.c  |   72 +++++++++++++++++++++++++
 include/configs/mop500.h          |  107 +++++++++++++++++++++++++++++++++++++
 7 files changed, 264 insertions(+), 0 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 80057ce..4a9a371 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -759,6 +759,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 beacb5f..dd50cc4 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -633,6 +633,7 @@ LIST_ARM11="			\
 #########################################################################
 LIST_ARM_CORTEX_A8="		\
 	devkit8000		\
+	mop500			\
 	mx51evk			\
 	omap3_beagle		\
 	omap3_overo		\
diff --git a/Makefile b/Makefile
index d801e25..9e07de6 100644
--- a/Makefile
+++ b/Makefile
@@ -3163,6 +3163,9 @@ SMN42_config	:	unconfig
 devkit8000_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 devkit8000 timll omap3
 
+mop500_config:		unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mop500 stericsson ux500
+
 omap3_beagle_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 beagle ti omap3
 
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..d45477f
--- /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_gpio.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(1 << 17, &prcmu->tcr);
+
+	u8500_prcmu_enable(&prcmu->per3clk_mgt);
+	u8500_prcmu_enable(&prcmu->per7clk_mgt);
+	u8500_prcmu_enable(&prcmu->uartclk_mgt);
+
+	u8500_clock_enable(7, 2, -1);	/* MTU0 */
+	u8500_clock_enable(3, 6, 6);	/* 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..f94bda0
--- /dev/null
+++ b/include/configs/mop500.h
@@ -0,0 +1,107 @@
+/*
+ * (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
+
+/* 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] 26+ messages in thread

* [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
                   ` (7 preceding siblings ...)
  2010-03-18  5:33 ` [U-Boot] [PATCH 8/8] mop500: add board-specific files Rabin Vincent
@ 2010-03-21 19:42 ` Wolfgang Denk
  2010-03-28 17:27 ` Tom
  9 siblings, 0 replies; 26+ messages in thread
From: Wolfgang Denk @ 2010-03-21 19:42 UTC (permalink / raw)
  To: u-boot

Dear Tom,

In message <1268886061-6382-1-git-send-email-rabin.vincent@stericsson.com> Rabin Vincent wrote:
> 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.
> 
> Note: The series must be applied on top of the patch "[PATCH V4] Nomadik: fix
> reset_timer()" posted by Alessandro Rubini on 2009-11-25:
> http://lists.denx.de/pipermail/u-boot/2009-November/064800.html
> Cc: Alessandro Rubini <rubini@unipv.it>
> 
> Rabin Vincent (8):
>   Nomadik: move timer code to drivers/misc
>   Nomadik: move gpio driver to drivers/gpio
>   nomadik_gpio: get base address from platform code
>   nomadik_mtu: support configurable clock rates
>   ARM Cortex A8: ifdef code calling lowlevel init
>   ux500: add SoC-specific code
>   pl01x: add support for Ux500 variant of pl011
>   mop500: add board-specific files

Reviewed-by: Wolfgang Denk <wd@denx.de>

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
READ THIS BEFORE OPENING PACKAGE: According to Certain Suggested Ver-
sions of the Grand Unified Theory, the Primary Particles Constituting
this Product May Decay to Nothingness Within the  Next  Four  Hundred
Million Years.

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

* [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support
  2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
                   ` (8 preceding siblings ...)
  2010-03-21 19:42 ` [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Wolfgang Denk
@ 2010-03-28 17:27 ` Tom
  9 siblings, 0 replies; 26+ messages in thread
From: Tom @ 2010-03-28 17:27 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> This series adds base support for ST-Ericsson's Ux500 series of Cortex-A9 based

The big change I would like to see with this patchset is for
the arm_cortexa9 cpu be added.

> SoCs.  Several peripherals are shared with the Nomadik family, for which
> support already exists in U-Boot.
> 
> Note: The series must be applied on top of the patch "[PATCH V4] Nomadik: fix
> reset_timer()" posted by Alessandro Rubini on 2009-11-25:
> http://lists.denx.de/pipermail/u-boot/2009-November/064800.html
> Cc: Alessandro Rubini <rubini@unipv.it>

This patch has been applied to arm/next.
Thanks for explicilty calling it out here.

Tom

> 
> Rabin Vincent (8):
>   Nomadik: move timer code to drivers/misc
>   Nomadik: move gpio driver to drivers/gpio
>   nomadik_gpio: get base address from platform code
>   nomadik_mtu: support configurable clock rates
>   ARM Cortex A8: ifdef code calling lowlevel init
>   ux500: add SoC-specific code
>   pl01x: add support for Ux500 variant of pl011
>   mop500: add board-specific files
> 

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

* [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc
  2010-03-18  4:20 ` [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc Rabin Vincent
@ 2010-03-28 17:30   ` Tom
  2010-04-06 11:16     ` Rabin VINCENT
  2010-04-06 11:30     ` Alessandro Rubini
  0 siblings, 2 replies; 26+ messages in thread
From: Tom @ 2010-03-28 17:30 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> 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  |    2 +-
>  include/configs/nhk8815.h                          |    1 +
>  .../{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h}  |    0

Move the nomadik_gpio.h and nomadik_mtu.h into nomadik.h
Just to have 1 nomadik *.h

Tom


>  5 files changed, 4 insertions(+), 2 deletions(-)
>  rename cpu/arm926ejs/nomadik/timer.c => drivers/misc/nomadik_mtu.c (98%)
>  rename include/{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h} (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 98%
> rename from cpu/arm926ejs/nomadik/timer.c
> rename to drivers/misc/nomadik_mtu.c
> index 1d98ef3..b9c0fb1 100644
> --- a/cpu/arm926ejs/nomadik/timer.c
> +++ b/drivers/misc/nomadik_mtu.c
> @@ -22,7 +22,7 @@
>  
>  #include <common.h>
>  #include <asm/io.h>
> -#include <asm/arch/mtu.h>
> +#include <nomadik_mtu.h>
>  
>  /*
>   * The timer is a decrementer, we'll left it free running at 2.4MHz.
> diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
> index 2b640dc..4dd391e 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
> diff --git a/include/asm-arm/arch-nomadik/mtu.h b/include/nomadik_mtu.h
> similarity index 100%
> rename from include/asm-arm/arch-nomadik/mtu.h
> rename to include/nomadik_mtu.h

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

* [U-Boot] [PATCH 2/8] Nomadik: move gpio driver to drivers/gpio
  2010-03-18  4:28 ` [U-Boot] [PATCH 2/8] Nomadik: move gpio driver to drivers/gpio Rabin Vincent
@ 2010-03-28 17:32   ` Tom
  2010-04-06 11:25     ` Rabin VINCENT
  0 siblings, 1 reply; 26+ messages in thread
From: Tom @ 2010-03-28 17:32 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> 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 +++++--
>  .../arch-nomadik/gpio.h => nomadik_gpio.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_gpio.h} (100%)
> 
> diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c
> index faef810..4f5f94f 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_gpio.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..e8a7bca 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_gpio.h>
>  
>  static unsigned long gpio_base[4] = {
>  	NOMADIK_GPIO0_BASE,
> diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
> index 4dd391e..8ba1e5e 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 (uses drivers/gpio/nomadik_gpio.c) */

May want to just  strip the path '(uses ....)' from the comment
>  #ifndef __ASSEMBLY__
> -#include <asm/arch/gpio.h>
> +#include <nomadik_gpio.h>

It would be better if the #include was not in config file.
Can this be moved to the C files that need it ?

>  #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_gpio.h
> similarity index 100%
> rename from include/asm-arm/arch-nomadik/gpio.h
> rename to include/nomadik_gpio.h

Tom

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

* [U-Boot] [PATCH 3/8] nomadik_gpio: get base address from platform code
  2010-03-18  5:02 ` [U-Boot] [PATCH 3/8] nomadik_gpio: get base address from platform code Rabin Vincent
@ 2010-03-28 17:35   ` Tom
  0 siblings, 0 replies; 26+ messages in thread
From: Tom @ 2010-03-28 17:35 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> 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  |    7 +++++++
>  drivers/gpio/nomadik_gpio.c |    9 +--------
>  include/nomadik_gpio.h      |    2 ++
>  3 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c
> index 4f5f94f..79c91a7 100644
> --- a/board/st/nhk8815/nhk8815.c
> +++ b/board/st/nhk8815/nhk8815.c
> @@ -32,6 +32,13 @@
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> +unsigned long nmk_gpio_base[] = {
> +	NOMADIK_GPIO0_BASE,
> +	NOMADIK_GPIO1_BASE,
> +	NOMADIK_GPIO2_BASE,
> +	NOMADIK_GPIO3_BASE
> +};
> +

Should added #if-def CONFIG_NOMADIK_GPIO, to not include this global if
it is not used.

>  #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 e8a7bca..deb2beb 100644
> --- a/drivers/gpio/nomadik_gpio.c
> +++ b/drivers/gpio/nomadik_gpio.c
> @@ -24,13 +24,6 @@
>  #include <asm/io.h>
>  #include <nomadik_gpio.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,7 +38,7 @@ enum gpio_registers {
>  
>  static inline unsigned long gpio_to_base(int gpio)
>  {
> -	return gpio_base[gpio / 32];
> +	return nmk_gpio_base[gpio / 32];

Should a check on the input.
(gpio / 32) < NMK_GPIO_BASE_INDEX_MAX

Add
#define NMK_GPIO_BASE_INDEX_MAX 4
Different values per board

Ok to change the name NMK_GPIO_BASE_INDEX_MAX
to something you like.

>  }
>  
>  static inline u32 gpio_to_bit(int gpio)
> diff --git a/include/nomadik_gpio.h b/include/nomadik_gpio.h
> index 1d3c9ce..2822db4 100644
> --- a/include/nomadik_gpio.h
> +++ b/include/nomadik_gpio.h
> @@ -34,6 +34,8 @@ enum nmk_af { /* alternate function settings */
>  	GPIO_ALT_C
>  };
>  
> +extern unsigned long nmk_gpio_base[];
> +
>  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);


Tom

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

* [U-Boot] [PATCH 4/8] nomadik_mtu: support configurable clock rates
  2010-03-18  5:08 ` [U-Boot] [PATCH 4/8] nomadik_mtu: support configurable clock rates Rabin Vincent
@ 2010-03-28 17:36   ` Tom
  0 siblings, 0 replies; 26+ messages in thread
From: Tom @ 2010-03-28 17:36 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> 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 |   22 +++++++++++++---------
>  include/configs/nhk8815.h  |    3 +++
>  2 files changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/misc/nomadik_mtu.c b/drivers/misc/nomadik_mtu.c
> index b9c0fb1..4ec75ad 100644
> --- a/drivers/misc/nomadik_mtu.c
> +++ b/drivers/misc/nomadik_mtu.c
> @@ -22,25 +22,29 @@
>  
>  #include <common.h>
>  #include <asm/io.h>
> +#include <div64.h>
>  #include <nomadik_mtu.h>
>  
> -/*
> - * 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 */
> +#define TIMER_CLOCK		CONFIG_NOMADIK_MTU_CLOCK
>  #define TICKS_PER_HZ		(TIMER_CLOCK / CONFIG_SYS_HZ)
>  #define TICKS_TO_HZ(x)		((x) / TICKS_PER_HZ)

TICKS_TO_HZ is only used once.
This macro should be expanded in get_timer() and removed

TICKS_PER_HZ is only used in TICKS_PER_HZ, it should be expanded and removed

TIMER_CLOCK is a remapping of CONFIG_NOMADIK_MTU_CLOCK.
CONFIG_NOMADIK_MTU_CLOCK should just be used

>  
>  /* macro to read the decrementing 32 bit timer as an increasing count */
>  #define READ_TIMER() (0 - readl(CONFIG_SYS_TIMERBASE + MTU_VAL(0)))
>  
> +static unsigned long usec_to_count(unsigned long long usec)
> +{
> +	unsigned long long count = usec * TIMER_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,
> +	writel(MTU_CRn_ENA | CONFIG_NOMADIK_MTU_PRESCALE | MTU_CRn_32BITS,
>  	       CONFIG_SYS_TIMERBASE + MTU_CR(0));
>  	reset_timer();
>  	return 0;
> @@ -73,7 +77,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 8ba1e5e..d52f50c 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

Tom

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

* [U-Boot] [PATCH 5/8] ARM Cortex A8: ifdef code calling lowlevel init
  2010-03-18  5:10 ` [U-Boot] [PATCH 5/8] ARM Cortex A8: ifdef code calling lowlevel init Rabin Vincent
@ 2010-03-28 17:38   ` Tom
  0 siblings, 0 replies; 26+ messages in thread
From: Tom @ 2010-03-28 17:38 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> 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'

Move this change to the cpu/arm_cortexa9/start.S
That will be created from comment on 6/8

> 
> Acked-by: Michael Brandt <michael.brandt@stericsson.com>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> ---
>  cpu/arm_cortexa8/start.S |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/cpu/arm_cortexa8/start.S b/cpu/arm_cortexa8/start.S
> index 29dae2f..70bfc5d 100644
> --- a/cpu/arm_cortexa8/start.S
> +++ b/cpu/arm_cortexa8/start.S
> @@ -181,7 +181,7 @@ clbss_l:
>  
>  _start_armboot: .word start_armboot
>  
> -
> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
>  /*************************************************************************
>   *
>   * CPU_init_critical registers
> @@ -218,6 +218,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
> +
>  /*
>   *************************************************************************
>   *

Tom

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

* [U-Boot] [PATCH 6/8] ux500: add SoC-specific code
  2010-03-18  5:10 ` [U-Boot] [PATCH 6/8] ux500: add SoC-specific code Rabin Vincent
@ 2010-03-28 17:42   ` Tom
  2010-04-07  6:15     ` Rabin VINCENT
  0 siblings, 1 reply; 26+ messages in thread
From: Tom @ 2010-03-28 17:42 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> Add the base SoC code for ST-Ericsson's Ux500 series of Cortex A9 based
> SoCs.
> 
> Even though this is a Cortex A9, we put it under Cortex A8 to avoid code
> duplication, since the CPU specific code can be used unmodified across
> the two CPUs.
> 
I would rather have arm_cortexa9 be created.
Minimize the duplication by only copying the arm_cortexa8 files
that are needed.
Make this initial copying of a8->a9 its own patch

> Acked-by: Michael Brandt <michael.brandt@stericsson.com>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> ---
>  cpu/arm_cortexa8/ux500/Makefile       |   45 +++++++++++++++++++
>  cpu/arm_cortexa8/ux500/clock.c        |   56 +++++++++++++++++++++++
>  cpu/arm_cortexa8/ux500/cpu.c          |   49 ++++++++++++++++++++
>  include/asm-arm/arch-ux500/clock.h    |   72 ++++++++++++++++++++++++++++++
>  include/asm-arm/arch-ux500/hardware.h |   78 +++++++++++++++++++++++++++++++++
>  5 files changed, 300 insertions(+), 0 deletions(-)
>  create mode 100644 cpu/arm_cortexa8/ux500/Makefile
>  create mode 100644 cpu/arm_cortexa8/ux500/clock.c
>  create mode 100644 cpu/arm_cortexa8/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_cortexa8/ux500/Makefile b/cpu/arm_cortexa8/ux500/Makefile
> new file mode 100644
> index 0000000..c671010
> --- /dev/null
> +++ b/cpu/arm_cortexa8/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_cortexa8/ux500/clock.c b/cpu/arm_cortexa8/ux500/clock.c
> new file mode 100644
> index 0000000..6b67fe8
> --- /dev/null
> +++ b/cpu/arm_cortexa8/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,
0 ?
If this is an exception, it should be checked for.
Should also have a comment.

Expected to have U8500_CLKRSTR4_BASE.

> +	U8500_CLKRST5_BASE,
> +	U8500_CLKRST6_BASE,
> +	U8500_CLKRST7_BASE,
> +};

Could these structures be added to an arch or board *.h ?

> +
> +/* 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];

-1 on array access.
Convert to unsigned access

> +
> +	if (kern != -1)
> +		writel(1 << kern, &clkrst->kcken);
> +
> +	if (cluster != -1)
> +		writel(1 << cluster, &clkrst->pcken);

Checking that some of the parameters are expected to be bad.
This function should be split.

> +}
> diff --git a/cpu/arm_cortexa8/ux500/cpu.c b/cpu/arm_cortexa8/ux500/cpu.c
> new file mode 100644
> index 0000000..b3c66fa
> --- /dev/null
> +++ b/cpu/arm_cortexa8/ux500/cpu.c
> @@ -0,0 +1,49 @@
> +/*
> + * (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_gpio.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +unsigned long nmk_gpio_base[] = {
> +	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
> +};
> +

Could this be added to arch or board *.h ?

> +void reset_cpu(unsigned long ignored)
> +{
> +	struct prcmu *prcmu = (struct prcmu *) U8500_PRCMU_BASE;
> +
> +	writel(0x1, &prcmu->ape_softrst);
> +	while (1);

busy wait..
put ';' on next line
Add a comment that this really is an infinite loop

> +}
> diff --git a/include/asm-arm/arch-ux500/clock.h b/include/asm-arm/arch-ux500/clock.h
> new file mode 100644
> index 0000000..b384f49
> --- /dev/null
> +++ b/include/asm-arm/arch-ux500/clock.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., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#ifndef __ASM_ARCH_CLOCK
> +#define __ASM_ARCH_CLOCK
> +
> +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) | (1 << 8), 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..2d75538
> --- /dev/null
> +++ b/include/asm-arm/arch-ux500/hardware.h
> @@ -0,0 +1,78 @@
> +/*
> + * (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
> +

Extra line spaces should be removed.

> +/* 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)
> +

Extra line spaces should be removed.

> +/* 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 */

Tom

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

* [U-Boot] [PATCH 7/8] pl01x: add support for Ux500 variant of pl011
  2010-03-18  5:10 ` [U-Boot] [PATCH 7/8] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
@ 2010-03-28 17:45   ` Tom
  0 siblings, 0 replies; 26+ messages in thread
From: Tom @ 2010-03-28 17:45 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> 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>

This is serial and not ARM.
My opinion is that the board specific #if-def could be cleaner.

Tom

> ---
> I have used the style of the surrounding code here.
> 
>  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

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

* [U-Boot] [PATCH 8/8] mop500: add board-specific files
  2010-03-18  5:33 ` [U-Boot] [PATCH 8/8] mop500: add board-specific files Rabin Vincent
@ 2010-03-28 17:49   ` Tom
  2010-04-08 13:41     ` Rabin VINCENT
  0 siblings, 1 reply; 26+ messages in thread
From: Tom @ 2010-03-28 17:49 UTC (permalink / raw)
  To: u-boot

Rabin Vincent wrote:
> Add base board code for the MOP500 board, which uses the U8500 SoC.
> 
> Acked-by: Michael Brandt <michael.brandt@stericsson.com>
> Tested-by: Michael Brandt <michael.brandt@stericsson.com>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> ---
>  MAINTAINERS                       |    4 ++
>  MAKEALL                           |    1 +

MAINTAINERS and MAKEALL will need to be changed for change to arm_cortexa9

>  Makefile                          |    3 +
>  board/stericsson/mop500/Makefile  |   54 +++++++++++++++++++
>  board/stericsson/mop500/config.mk |   23 ++++++++
>  board/stericsson/mop500/mop500.c  |   72 +++++++++++++++++++++++++
>  include/configs/mop500.h          |  107 +++++++++++++++++++++++++++++++++++++
>  7 files changed, 264 insertions(+), 0 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 80057ce..4a9a371 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -759,6 +759,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 beacb5f..dd50cc4 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -633,6 +633,7 @@ LIST_ARM11="			\
>  #########################################################################
>  LIST_ARM_CORTEX_A8="		\
>  	devkit8000		\
> +	mop500			\
>  	mx51evk			\
>  	omap3_beagle		\
>  	omap3_overo		\
> diff --git a/Makefile b/Makefile
> index d801e25..9e07de6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3163,6 +3163,9 @@ SMN42_config	:	unconfig
>  devkit8000_config :	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 devkit8000 timll omap3
>  
> +mop500_config:		unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mop500 stericsson ux500
> +
>  omap3_beagle_config :	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 beagle ti omap3
>  
> 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..d45477f
> --- /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_gpio.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);

Change these to immediates to logical #define's

> +}
> +
> +static void clock_init(void)
> +{
> +	struct prcmu *prcmu = (struct prcmu *) U8500_PRCMU_BASE;
> +
> +	/* Enable timers */
> +	writel(1 << 17, &prcmu->tcr);

Change this immediate to a logical #define

> +
> +	u8500_prcmu_enable(&prcmu->per3clk_mgt);
> +	u8500_prcmu_enable(&prcmu->per7clk_mgt);
> +	u8500_prcmu_enable(&prcmu->uartclk_mgt);
> +
> +	u8500_clock_enable(7, 2, -1);	/* MTU0 */
> +	u8500_clock_enable(3, 6, 6);	/* UART2 */

Change these to immediates to logical #define's

> +}
> +
> +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..f94bda0
> --- /dev/null
> +++ b/include/configs/mop500.h
> @@ -0,0 +1,107 @@
> +/*
> + * (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
> +
> +/* 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 */

Tom

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

* [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc
  2010-03-28 17:30   ` Tom
@ 2010-04-06 11:16     ` Rabin VINCENT
  2010-04-06 11:30     ` Alessandro Rubini
  1 sibling, 0 replies; 26+ messages in thread
From: Rabin VINCENT @ 2010-04-06 11:16 UTC (permalink / raw)
  To: u-boot

On Sun, Mar 28, 2010 at 07:30:01PM +0200, Tom wrote:
> Rabin Vincent wrote:
> > 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  |    2 +-
> >  include/configs/nhk8815.h                          |    1 +
> >  .../{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h}  |    0
> 
> Move the nomadik_gpio.h and nomadik_mtu.h into nomadik.h
> Just to have 1 nomadik *.h

nomadik.h is currently used for 8815-specific addresses.  If Alessandro
has no objections, I will move it to, say, nmdk8815.h and then combine
the common peripheral headers into nomadik.h.

Rabin

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

* [U-Boot] [PATCH 2/8] Nomadik: move gpio driver to drivers/gpio
  2010-03-28 17:32   ` Tom
@ 2010-04-06 11:25     ` Rabin VINCENT
  0 siblings, 0 replies; 26+ messages in thread
From: Rabin VINCENT @ 2010-04-06 11:25 UTC (permalink / raw)
  To: u-boot

On Sun, Mar 28, 2010 at 07:32:17PM +0200, Tom wrote:
> Rabin Vincent wrote:
> > diff --git a/include/configs/nhk8815.h b/include/configs/nhk8815.h
[...]
> >  #ifndef __ASSEMBLY__
> > -#include <asm/arch/gpio.h>
> > +#include <nomadik_gpio.h>
> 
> It would be better if the #include was not in config file.
> Can this be moved to the C files that need it ?

I believe it's here because this is used by soft_i2c.c.  I'll leave it
to Alessandro to decide if he wants to move it out, because this is
8815-specific.

Rabin

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

* [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc
  2010-03-28 17:30   ` Tom
  2010-04-06 11:16     ` Rabin VINCENT
@ 2010-04-06 11:30     ` Alessandro Rubini
  1 sibling, 0 replies; 26+ messages in thread
From: Alessandro Rubini @ 2010-04-06 11:30 UTC (permalink / raw)
  To: u-boot

>> >  .../{asm-arm/arch-nomadik/mtu.h => nomadik_mtu.h}  |    0
>> 
>> Move the nomadik_gpio.h and nomadik_mtu.h into nomadik.h
>> Just to have 1 nomadik *.h
> 
> nomadik.h is currently used for 8815-specific addresses.  If Alessandro
> has no objections, I will move it to, say, nmdk8815.h and then combine
> the common peripheral headers into nomadik.h.

While I preferred the original patch (each peripheral has an header file,
usually), I have no problem with this approach.

Actually, now that "nomadik" is the name of common code (not the
individual cpu), it's correct for "nomadik.h" to have "8815" in the name.

/alessandro

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

* [U-Boot] [PATCH 6/8] ux500: add SoC-specific code
  2010-03-28 17:42   ` Tom
@ 2010-04-07  6:15     ` Rabin VINCENT
  0 siblings, 0 replies; 26+ messages in thread
From: Rabin VINCENT @ 2010-04-07  6:15 UTC (permalink / raw)
  To: u-boot

On Sun, Mar 28, 2010 at 07:42:27PM +0200, Tom wrote:
> Rabin Vincent wrote:
> > +/* 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];
> 
> -1 on array access.
> Convert to unsigned access

I'm not sure what you mean by this.  Periph numbering starts from 1.

> > +
> > +     if (kern != -1)
> > +             writel(1 << kern, &clkrst->kcken);
> > +
> > +     if (cluster != -1)
> > +             writel(1 << cluster, &clkrst->pcken);
> 
> Checking that some of the parameters are expected to be bad.
> This function should be split.

The three arguments to this function come from a table in the SoC
manual.  -1 corresponds to the "not used" cells in the table.  The
function is better unsplit since the majority of peripherals require
both the register writes to enable their clock.

Rabin

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

* [U-Boot] [PATCH 8/8] mop500: add board-specific files
  2010-03-28 17:49   ` Tom
@ 2010-04-08 13:41     ` Rabin VINCENT
  2010-04-09 22:28       ` Wolfgang Denk
  2010-04-17 21:46       ` Tom Rix
  0 siblings, 2 replies; 26+ messages in thread
From: Rabin VINCENT @ 2010-04-08 13:41 UTC (permalink / raw)
  To: u-boot

On Sun, Mar 28, 2010 at 07:49:15PM +0200, Tom wrote:
> Rabin Vincent wrote:
> > +	/* UART2 */
> > +	nmk_gpio_af(29, GPIO_ALT_C);
> > +	nmk_gpio_af(30, GPIO_ALT_C);
> 
> Change these to immediates to logical #define's

I've changed this in the other places you mentioned, but for these
GPIOs, I'd prefer to use the pin numbers directly.

Rabin

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

* [U-Boot] [PATCH 8/8] mop500: add board-specific files
  2010-04-08 13:41     ` Rabin VINCENT
@ 2010-04-09 22:28       ` Wolfgang Denk
  2010-04-17 21:46       ` Tom Rix
  1 sibling, 0 replies; 26+ messages in thread
From: Wolfgang Denk @ 2010-04-09 22:28 UTC (permalink / raw)
  To: u-boot

Dear Rabin VINCENT,

In message <20100408134135.GA4828@bnru02.bnr.st.com> you wrote:
> On Sun, Mar 28, 2010 at 07:49:15PM +0200, Tom wrote:
> > Rabin Vincent wrote:
> > > +	/* UART2 */
> > > +	nmk_gpio_af(29, GPIO_ALT_C);
> > > +	nmk_gpio_af(30, GPIO_ALT_C);
> > 
> > Change these to immediates to logical #define's
> 
> I've changed this in the other places you mentioned, but for these
> GPIOs, I'd prefer to use the pin numbers directly.

Maybe you do, but we don't. Please don't use magic numbers.

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
"Tell the truth and run."                          - Yugoslav proverb

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

* [U-Boot] [PATCH 8/8] mop500: add board-specific files
  2010-04-08 13:41     ` Rabin VINCENT
  2010-04-09 22:28       ` Wolfgang Denk
@ 2010-04-17 21:46       ` Tom Rix
  1 sibling, 0 replies; 26+ messages in thread
From: Tom Rix @ 2010-04-17 21:46 UTC (permalink / raw)
  To: u-boot

Rabin VINCENT wrote:
> On Sun, Mar 28, 2010 at 07:49:15PM +0200, Tom wrote:
>> Rabin Vincent wrote:
>>> +	/* UART2 */
>>> +	nmk_gpio_af(29, GPIO_ALT_C);
>>> +	nmk_gpio_af(30, GPIO_ALT_C);
>> Change these to immediates to logical #define's
> 
> I've changed this in the other places you mentioned, but for these
> GPIOs, I'd prefer to use the pin numbers directly.
> 
Then add a comment to what 29 and 30 are.
Tom


> Rabin
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 
> 

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

end of thread, other threads:[~2010-04-17 21:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-18  4:20 [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Rabin Vincent
2010-03-18  4:20 ` [U-Boot] [PATCH 1/8] Nomadik: move timer code to drivers/misc Rabin Vincent
2010-03-28 17:30   ` Tom
2010-04-06 11:16     ` Rabin VINCENT
2010-04-06 11:30     ` Alessandro Rubini
2010-03-18  4:28 ` [U-Boot] [PATCH 2/8] Nomadik: move gpio driver to drivers/gpio Rabin Vincent
2010-03-28 17:32   ` Tom
2010-04-06 11:25     ` Rabin VINCENT
2010-03-18  5:02 ` [U-Boot] [PATCH 3/8] nomadik_gpio: get base address from platform code Rabin Vincent
2010-03-28 17:35   ` Tom
2010-03-18  5:08 ` [U-Boot] [PATCH 4/8] nomadik_mtu: support configurable clock rates Rabin Vincent
2010-03-28 17:36   ` Tom
2010-03-18  5:10 ` [U-Boot] [PATCH 5/8] ARM Cortex A8: ifdef code calling lowlevel init Rabin Vincent
2010-03-28 17:38   ` Tom
2010-03-18  5:10 ` [U-Boot] [PATCH 6/8] ux500: add SoC-specific code Rabin Vincent
2010-03-28 17:42   ` Tom
2010-04-07  6:15     ` Rabin VINCENT
2010-03-18  5:10 ` [U-Boot] [PATCH 7/8] pl01x: add support for Ux500 variant of pl011 Rabin Vincent
2010-03-28 17:45   ` Tom
2010-03-18  5:33 ` [U-Boot] [PATCH 8/8] mop500: add board-specific files Rabin Vincent
2010-03-28 17:49   ` Tom
2010-04-08 13:41     ` Rabin VINCENT
2010-04-09 22:28       ` Wolfgang Denk
2010-04-17 21:46       ` Tom Rix
2010-03-21 19:42 ` [U-Boot] [PATCH 0/8] ST-Ericsson Ux500 support Wolfgang Denk
2010-03-28 17:27 ` Tom

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.