Skip to contentSkip to conversation

ST-Ericsson Ux500 support

PATCH Superseded Rabin Vincent 5 participants 26 messages Mar 18, 2010 – Apr 17, 2010

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ST-Ericsson Ux500 support

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 <[email protected]>

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%)
#1 lore raw

PATCH 1/8 Nomadik: move timer code to drivers/misc

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

---
 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%)
cpu/arm926ejs/nomadik/Makefile +1 -1
index 0fc9f2a..180db8b 100644
@@ -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)
drivers/misc/Makefile +1 -0
index f6df60f..5c0c6f3 100644
@@ -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
drivers/misc/nomadik_mtu.c renamed from cpu/arm926ejs/nomadik/timer.c +1 -1
similarity index 98%
rename from cpu/arm926ejs/nomadik/timer.c
rename to drivers/misc/nomadik_mtu.c
index 1d98ef3..b9c0fb1 100644
@@ -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.
include/configs/nhk8815.h +1 -0
index 2b640dc..4dd391e 100644
@@ -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
include/nomadik_mtu.h renamed from include/asm-arm/arch-nomadik/mtu.h +0 -0
similarity index 100%
rename from include/asm-arm/arch-nomadik/mtu.h
rename to include/nomadik_mtu.h
Signature · 1 line
1.7.0
#2 lore raw

PATCH 1/8 Nomadik: move timer code to drivers/misc

Quoted 6 lines · Rabin Vincent

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

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

Quoted 61 lines
 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%)
cpu/arm926ejs/nomadik/Makefile +1 -1
index 0fc9f2a..180db8b 100644
@@ -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)
drivers/misc/Makefile +1 -0
index f6df60f..5c0c6f3 100644
@@ -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
drivers/misc/nomadik_mtu.c renamed from cpu/arm926ejs/nomadik/timer.c +1 -1
similarity index 98%
rename from cpu/arm926ejs/nomadik/timer.c
rename to drivers/misc/nomadik_mtu.c
index 1d98ef3..b9c0fb1 100644
@@ -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.
include/configs/nhk8815.h +1 -0
index 2b640dc..4dd391e 100644
@@ -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
include/nomadik_mtu.h renamed from include/asm-arm/arch-nomadik/mtu.h +0 -0
similarity index 100%
rename from include/asm-arm/arch-nomadik/mtu.h
rename to include/nomadik_mtu.h
#3 lore raw

PATCH 1/8 Nomadik: move timer code to drivers/misc

Quoted 14 lines · Tom
Quoted 6 lines · Rabin Vincent

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

Quoted 6 lines
---
 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
Quoted 2 lines

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

#4 lore raw

PATCH 1/8 Nomadik: move timer code to drivers/misc

Quoted 8 lines
Quoted 4 lines
Quoted 1 line
 .../{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

#5 lore raw

PATCH 2/8 Nomadik: move gpio driver to drivers/gpio

In reply to Rabin Vincent

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

---
 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%)
board/st/nhk8815/nhk8815.c +1 -1
index faef810..4f5f94f 100644
@@ -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;
 
cpu/arm926ejs/nomadik/Makefile +0 -1
index 180db8b..35550d7 100644
@@ -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)
drivers/gpio/Makefile +1 -0
index d966082..d84f81e 100644
@@ -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)
drivers/gpio/nomadik_gpio.c renamed from cpu/arm926ejs/nomadik/gpio.c +1 -1
similarity index 98%
rename from cpu/arm926ejs/nomadik/gpio.c
rename to drivers/gpio/nomadik_gpio.c
index 62a375b..e8a7bca 100644
@@ -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,
include/configs/nhk8815.h +5 -2
index 4dd391e..8ba1e5e 100644
@@ -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
include/nomadik_gpio.h renamed from include/asm-arm/arch-nomadik/gpio.h +0 -0
similarity index 100%
rename from include/asm-arm/arch-nomadik/gpio.h
rename to include/nomadik_gpio.h
Signature · 1 line
1.7.0
#6 lore raw

PATCH 2/8 Nomadik: move gpio driver to drivers/gpio

Quoted 85 lines · Rabin Vincent

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

---
 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%)
board/st/nhk8815/nhk8815.c +1 -1
index faef810..4f5f94f 100644
@@ -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;
 
cpu/arm926ejs/nomadik/Makefile +0 -1
index 180db8b..35550d7 100644
@@ -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)
drivers/gpio/Makefile +1 -0
index d966082..d84f81e 100644
@@ -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)
drivers/gpio/nomadik_gpio.c renamed from cpu/arm926ejs/nomadik/gpio.c +1 -1
similarity index 98%
rename from cpu/arm926ejs/nomadik/gpio.c
rename to drivers/gpio/nomadik_gpio.c
index 62a375b..e8a7bca 100644
@@ -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,
include/configs/nhk8815.h +3 -0
index 4dd391e..8ba1e5e 100644
@@ -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

include/configs/nhk8815.h line 116

Quoted 5 lines
include/configs/nhk8815.h +1 -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

include/configs/nhk8815.h line 118

Quoted 3 lines
include/configs/nhk8815.h +1 -1
 #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 ?

include/nomadik_gpio.h

Quoted 7 lines
include/configs/nhk8815.h +0 -0
 #define CONFIG_CMD_I2C
 #define CONFIG_SOFT_I2C
 #define CONFIG_SYS_I2C_SPEED	400000
include/nomadik_gpio.h renamed from include/asm-arm/arch-nomadik/gpio.h +0 -0
similarity index 100%
rename from include/asm-arm/arch-nomadik/gpio.h
rename to include/nomadik_gpio.h

Tom

#7 lore raw

PATCH 2/8 Nomadik: move gpio driver to drivers/gpio

Quoted 2 lines · Tom
Quoted 1 line · Rabin Vincent
include/configs/nhk8815.h +0 -0

[...]

Quoted 6 lines

include/configs/nhk8815.h

Quoted 3 lines

#ifndef __ASSEMBLY__

include/configs/nhk8815.h +1 -1
-#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

#8 lore raw

PATCH 3/8 nomadik_gpio: get base address from platform code

In reply to Rabin Vincent

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.

---
 board/st/nhk8815/nhk8815.c  |    7 +++++++
 drivers/gpio/nomadik_gpio.c |    9 +--------
 include/nomadik_gpio.h      |    2 ++
 3 files changed, 10 insertions(+), 8 deletions(-)
board/st/nhk8815/nhk8815.c +7 -0
index 4f5f94f..79c91a7 100644
@@ -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)
 {
drivers/gpio/nomadik_gpio.c +1 -8
index e8a7bca..deb2beb 100644
@@ -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)
include/nomadik_gpio.h +2 -0
index 1d3c9ce..2822db4 100644
@@ -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);
Signature · 1 line
1.7.0
#9 lore raw

PATCH 3/8 nomadik_gpio: get base address from platform code

Quoted 18 lines · Rabin Vincent

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.

---
 board/st/nhk8815/nhk8815.c  |    7 +++++++
 drivers/gpio/nomadik_gpio.c |    9 +--------
 include/nomadik_gpio.h      |    2 ++
 3 files changed, 10 insertions(+), 8 deletions(-)
board/st/nhk8815/nhk8815.c +0 -0
index 4f5f94f..79c91a7 100644

board/st/nhk8815/nhk8815.c line 41

Quoted 10 lines
board/st/nhk8815/nhk8815.c +7 -0
@@ -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.

Quoted 22 lines
board/st/nhk8815/nhk8815.c +0 -0
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 void show_boot_progress(int progress)
 {
drivers/gpio/nomadik_gpio.c +0 -7
index e8a7bca..deb2beb 100644
@@ -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 */

drivers/gpio/nomadik_gpio.c enum gpio_registers { · line 41

Quoted 5 lines
drivers/gpio/nomadik_gpio.c +1 -1
@@ -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.

Quoted 8 lines
drivers/gpio/nomadik_gpio.c +0 -0
 }
 
 static inline u32 gpio_to_bit(int gpio)
include/nomadik_gpio.h +0 -0
index 1d3c9ce..2822db4 100644

include/nomadik_gpio.h enum nmk_af { /* alternate function settings */ · line 41

Quoted 8 lines
include/nomadik_gpio.h +2 -0
@@ -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

#10 lore raw

PATCH 4/8 nomadik_mtu: support configurable clock rates

In reply to Rabin Vincent

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.

---
 drivers/misc/nomadik_mtu.c |   22 +++++++++++++---------
 include/configs/nhk8815.h  |    3 +++
 2 files changed, 16 insertions(+), 9 deletions(-)
drivers/misc/nomadik_mtu.c +13 -9
index b9c0fb1..4ec75ad 100644
@@ -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)
 		;
 }
include/configs/nhk8815.h +3 -0
index 8ba1e5e..d52f50c 100644
@@ -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
Signature · 1 line
1.7.0
#11 lore raw

PATCH 4/8 nomadik_mtu: support configurable clock rates

Quoted 23 lines · Rabin Vincent

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.

---
 drivers/misc/nomadik_mtu.c |   22 +++++++++++++---------
 include/configs/nhk8815.h  |    3 +++
 2 files changed, 16 insertions(+), 9 deletions(-)
drivers/misc/nomadik_mtu.c +1 -0
index b9c0fb1..4ec75ad 100644
@@ -22,25 +22,29 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <div64.h>
 #include <nomadik_mtu.h>
 

drivers/misc/nomadik_mtu.c line 30

Quoted 10 lines
drivers/misc/nomadik_mtu.c +1 -7
-/*
- * 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

Quoted 35 lines
drivers/misc/nomadik_mtu.c +11 -2
 /* 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)
 		;
 }
include/configs/nhk8815.h +0 -0
index 8ba1e5e..d52f50c 100644

include/configs/nhk8815.h line 106

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

#12 lore raw

PATCH 5/8 ARM Cortex A8: ifdef code calling lowlevel init

In reply to Rabin Vincent

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'

---
 cpu/arm_cortexa8/start.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
cpu/arm_cortexa8/start.S +3 -1
index 29dae2f..70bfc5d 100644
@@ -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
+
 /*
  *************************************************************************
  *
Signature · 1 line
1.7.0
#13 lore raw

PATCH 5/8 ARM Cortex A8: ifdef code calling lowlevel init

Quoted 4 lines · Rabin Vincent

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

Quoted 21 lines
---
 cpu/arm_cortexa8/start.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
cpu/arm_cortexa8/start.S +1 -1
index 29dae2f..70bfc5d 100644
@@ -181,7 +181,7 @@ clbss_l:
 
 _start_armboot: .word start_armboot
 
-
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*************************************************************************
  *
  * CPU_init_critical registers

cpu/arm_cortexa8/start.S cpu_init_crit: · line 225

Quoted 8 lines
cpu/arm_cortexa8/start.S +2 -0
@@ -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

#14 lore raw

PATCH 6/8 ux500: add SoC-specific code

In reply to Rabin Vincent

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.

---
 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
cpu/arm_cortexa8/ux500/Makefile new file +45 -0
new file mode 100644
index 0000000..c671010
@@ -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
+
+#########################################################################
cpu/arm_cortexa8/ux500/clock.c new file +56 -0

56 lines not on this page · raw message

cpu/arm_cortexa8/ux500/cpu.c new file +49 -0

49 lines not on this page · raw message

include/asm-arm/arch-ux500/clock.h new file +72 -0

72 lines not on this page · raw message

include/asm-arm/arch-ux500/hardware.h new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
1.7.0
#15 lore raw

PATCH 6/8 ux500: add SoC-specific code

Quoted 7 lines · Rabin Vincent

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

Quoted 102 lines
---
 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
cpu/arm_cortexa8/ux500/Makefile new file +45 -0
new file mode 100644
index 0000000..c671010
@@ -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
+
+#########################################################################
cpu/arm_cortexa8/ux500/clock.c new file +30 -0
new file mode 100644
index 0000000..6b67fe8
@@ -0,0 +1,56 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ * Author: Rabin Vincent <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 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;

cpu/arm_cortexa8/ux500/clock.c line 40

Quoted 10 lines
cpu/arm_cortexa8/ux500/clock.c new file +10 -0
+	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.

cpu/arm_cortexa8/ux500/clock.c line 44

Quoted 4 lines
cpu/arm_cortexa8/ux500/clock.c new file +4 -0
+	U8500_CLKRST5_BASE,
+	U8500_CLKRST6_BASE,
+	U8500_CLKRST7_BASE,
+};

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

cpu/arm_cortexa8/ux500/clock.c line 49

Quoted 5 lines
cpu/arm_cortexa8/ux500/clock.c new file +5 -0
+
+/* 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

cpu/arm_cortexa8/ux500/clock.c line 55

Quoted 6 lines
cpu/arm_cortexa8/ux500/clock.c new file +6 -0
+
+	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.

Quoted 39 lines
cpu/arm_cortexa8/ux500/clock.c new file +1 -0
+}
cpu/arm_cortexa8/ux500/cpu.c new file +32 -0
new file mode 100644
index 0000000..b3c66fa
@@ -0,0 +1,49 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ * Author: Rabin Vincent <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 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,

cpu/arm_cortexa8/ux500/cpu.c line 42

Quoted 10 lines
cpu/arm_cortexa8/ux500/cpu.c new file +10 -0
+	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 ?

cpu/arm_cortexa8/ux500/cpu.c line 48

Quoted 6 lines
cpu/arm_cortexa8/ux500/cpu.c new file +6 -0
+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

Quoted 111 lines
cpu/arm_cortexa8/ux500/cpu.c new file +1 -0
+}
include/asm-arm/arch-ux500/clock.h new file +72 -0
new file mode 100644
index 0000000..b384f49
@@ -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 */
include/asm-arm/arch-ux500/hardware.h new file +26 -0
new file mode 100644
index 0000000..2d75538
@@ -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 */

include/asm-arm/arch-ux500/hardware.h line 36

Quoted 10 lines
include/asm-arm/arch-ux500/hardware.h new file +10 -0
+
+#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.

Quoted 5 lines
include/asm-arm/arch-ux500/hardware.h new file +5 -0
+/* GPIO */
+
+#define U8500_GPIO0_BASE	(U8500_PER1_BASE + 0xE000)
+#define U8500_GPIO1_BASE	(U8500_PER1_BASE + 0xE000 + 0x80)
+

include/asm-arm/arch-ux500/hardware.h line 51

Quoted 10 lines
include/asm-arm/arch-ux500/hardware.h new file +10 -0
+#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.

Quoted 17 lines
include/asm-arm/arch-ux500/hardware.h new file +17 -0
+/* 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)

include/asm-arm/arch-ux500/hardware.h line 78

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

#16 lore raw

PATCH 6/8 ux500: add SoC-specific code

Quoted 8 lines · Tom

cpu/arm_cortexa8/ux500/clock.c line 49

Quoted 4 lines · Rabin Vincent
cpu/arm_cortexa8/ux500/clock.c new file +4 -0
+/* 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.

Quoted 9 lines

cpu/arm_cortexa8/ux500/clock.c line 55

Quoted 6 lines
cpu/arm_cortexa8/ux500/clock.c new file +6 -0
+
+     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

#17 lore raw

PATCH 7/8 pl01x: add support for Ux500 variant of pl011

In reply to Rabin Vincent

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.

---
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(-)
drivers/serial/serial_pl01x.c +8 -0
index c645cef..c819f1d 100644
@@ -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
 	 */
drivers/serial/serial_pl01x.h +1 -0
index 5f20fdd..0ff6203 100644
@@ -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
Signature · 1 line
1.7.0
#18 lore raw

PATCH 7/8 pl01x: add support for Ux500 variant of pl011

Quoted 6 lines · Rabin Vincent

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.

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

Tom

Quoted 38 lines

---
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(-)
drivers/serial/serial_pl01x.c +8 -0
index c645cef..c819f1d 100644
@@ -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
 	 */
drivers/serial/serial_pl01x.h +1 -0
index 5f20fdd..0ff6203 100644
@@ -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
#19 lore raw

PATCH 8/8 mop500: add board-specific files

In reply to Rabin Vincent

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

---
 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
MAINTAINERS +4 -0
index 80057ce..4a9a371 100644
@@ -759,6 +759,10 @@ Hugo Villeneuve <[email protected]>
 
 	SFFSDR		ARM926EJS
 
+Rabin Vincent <[email protected]>
+
+	mop500		ARM CORTEX-A9 (U8500 SoC)
+
 Prafulla Wadaskar <[email protected]>
 
 	mv88f6281gtw_ge	ARM926EJS (Kirkwood SoC)
MAKEALL +1 -0
index beacb5f..dd50cc4 100755
@@ -633,6 +633,7 @@ LIST_ARM11="			\
 #########################################################################
 LIST_ARM_CORTEX_A8="		\
 	devkit8000		\
+	mop500			\
 	mx51evk			\
 	omap3_beagle		\
 	omap3_overo		\
Makefile +3 -0
index d801e25..9e07de6 100644
@@ -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
 
board/stericsson/mop500/Makefile new file +54 -0

54 lines not on this page · raw message

board/stericsson/mop500/config.mk new file +23 -0
new file mode 100644
index 0000000..af246bd
@@ -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
board/stericsson/mop500/mop500.c new file +72 -0

72 lines not on this page · raw message

include/configs/mop500.h new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
1.7.0
#20 lore raw

PATCH 8/8 mop500: add board-specific files

Quoted 8 lines · Rabin Vincent

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

---
 MAINTAINERS                       |    4 ++
 MAKEALL                           |    1 +

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

Quoted 172 lines
 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
MAINTAINERS +4 -0
index 80057ce..4a9a371 100644
@@ -759,6 +759,10 @@ Hugo Villeneuve <[email protected]>
 
 	SFFSDR		ARM926EJS
 
+Rabin Vincent <[email protected]>
+
+	mop500		ARM CORTEX-A9 (U8500 SoC)
+
 Prafulla Wadaskar <[email protected]>
 
 	mv88f6281gtw_ge	ARM926EJS (Kirkwood SoC)
MAKEALL +1 -0
index beacb5f..dd50cc4 100755
@@ -633,6 +633,7 @@ LIST_ARM11="			\
 #########################################################################
 LIST_ARM_CORTEX_A8="		\
 	devkit8000		\
+	mop500			\
 	mx51evk			\
 	omap3_beagle		\
 	omap3_overo		\
Makefile +3 -0
index d801e25..9e07de6 100644
@@ -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
 
board/stericsson/mop500/Makefile new file +54 -0
new file mode 100644
index 0000000..218d572
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2004
+# ARM Ltd.
+# Philippe Robin, <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 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
+
+#########################################################################
board/stericsson/mop500/config.mk new file +23 -0
new file mode 100644
index 0000000..af246bd
@@ -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
board/stericsson/mop500/mop500.c new file +25 -0
new file mode 100644
index 0000000..d45477f
@@ -0,0 +1,72 @@
+/*
+ * (C) Copyright 2010 ST-Ericsson SA
+ * Author: Rabin Vincent <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>

board/stericsson/mop500/mop500.c line 35

Quoted 10 lines
board/stericsson/mop500/mop500.c new file +10 -0
+#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

board/stericsson/mop500/mop500.c line 43

Quoted 8 lines
board/stericsson/mop500/mop500.c new file +8 -0
+}
+
+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

board/stericsson/mop500/mop500.c line 50

Quoted 7 lines
board/stericsson/mop500/mop500.c new file +7 -0
+
+	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

Quoted 125 lines
board/stericsson/mop500/mop500.c new file +22 -0
+}
+
+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;
+}
include/configs/mop500.h new file +97 -0
new file mode 100644
index 0000000..f94bda0
@@ -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

include/configs/mop500.h line 107

Quoted 10 lines
include/configs/mop500.h new file +10 -0
+#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

#21 lore raw

PATCH 8/8 mop500: add board-specific files

Quoted 6 lines · Tom

board/stericsson/mop500/mop500.c line 35

Quoted 3 lines · Rabin Vincent
board/stericsson/mop500/mop500.c new file +3 -0
+	/* 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

#22 lore raw

PATCH 8/8 mop500: add board-specific files

Dear Rabin VINCENT,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 6 lines · Tom

board/stericsson/mop500/mop500.c line 35

Quoted 3 lines · Rabin Vincent
board/stericsson/mop500/mop500.c new file +3 -0
+	/* 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

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Tell the truth and run."                          - Yugoslav proverb
#23 lore raw

PATCH 8/8 mop500: add board-specific files

In reply to Rabin VINCENT
Quoted 10 lines · Rabin VINCENT
Quoted 5 lines · Tom

board/stericsson/mop500/mop500.c line 35

Quoted 3 lines · Rabin Vincent
board/stericsson/mop500/mop500.c new file +3 -0
+	/* 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

Quoted 7 lines

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

#24 lore raw

cover ST-Ericsson Ux500 support

In reply to Rabin Vincent

Dear Tom,

Quoted 9 lines · In message <[email protected]>…

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 <[email protected]>

Quoted 9 lines

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

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
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.
#25 lore raw

cover ST-Ericsson Ux500 support

In reply to Rabin Vincent
Quoted 1 line · Rabin Vincent

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.

Quoted 7 lines

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 <[email protected]>

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

Tom

Quoted 11 lines

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