Skip to contentSkip to conversation

ARM: U8500 core machine support

PATCH New srinidhi kasagar 2 participants 4 messages Nov 26, 2009 – Dec 20, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 3/6 ARM: U8500 core machine support

From: srinidhi kasagar <[email protected]>
Date: Fri, 27 Nov 2009 15:40:59 +0530

Adds core support for the ST-Ericsson U8500
platform. It supports memory mappings, binds to
the existing modules like GIC, SCU, TWD and
local timers and sets up the infrastructure for
the secondary core.

---
 arch/arm/mach-ux500/Kconfig                    |   15 ++
 arch/arm/mach-ux500/Makefile                   |    8 +
 arch/arm/mach-ux500/board-mop500.c             |  158 +++++++++++++++++++++
 arch/arm/mach-ux500/cpu-u8500.c                |   64 +++++++++
 arch/arm/mach-ux500/headsmp.S                  |   38 +++++
 arch/arm/mach-ux500/include/mach/debug-macro.S |   19 +++
 arch/arm/mach-ux500/include/mach/entry-macro.S |   89 ++++++++++++
 arch/arm/mach-ux500/include/mach/memory.h      |   18 +++
 arch/arm/mach-ux500/include/mach/setup.h       |   23 +++
 arch/arm/mach-ux500/include/mach/smp.h         |   32 +++++
 arch/arm/mach-ux500/include/mach/system.h      |   25 ++++
 arch/arm/mach-ux500/include/mach/timex.h       |    6 +
 arch/arm/mach-ux500/include/mach/uncompress.h  |   58 ++++++++
 arch/arm/mach-ux500/include/mach/vmalloc.h     |   18 +++
 arch/arm/mach-ux500/localtimer.c               |   28 ++++
 arch/arm/mach-ux500/platsmp.c                  |  177 ++++++++++++++++++++++++
 16 files changed, 776 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-ux500/Kconfig
 create mode 100644 arch/arm/mach-ux500/Makefile
 create mode 100644 arch/arm/mach-ux500/board-mop500.c
 create mode 100644 arch/arm/mach-ux500/cpu-u8500.c
 create mode 100644 arch/arm/mach-ux500/headsmp.S
 create mode 100644 arch/arm/mach-ux500/include/mach/debug-macro.S
 create mode 100644 arch/arm/mach-ux500/include/mach/entry-macro.S
 create mode 100644 arch/arm/mach-ux500/include/mach/memory.h
 create mode 100644 arch/arm/mach-ux500/include/mach/setup.h
 create mode 100644 arch/arm/mach-ux500/include/mach/smp.h
 create mode 100644 arch/arm/mach-ux500/include/mach/system.h
 create mode 100644 arch/arm/mach-ux500/include/mach/timex.h
 create mode 100644 arch/arm/mach-ux500/include/mach/uncompress.h
 create mode 100644 arch/arm/mach-ux500/include/mach/vmalloc.h
 create mode 100644 arch/arm/mach-ux500/localtimer.c
 create mode 100644 arch/arm/mach-ux500/platsmp.c
arch/arm/mach-ux500/Kconfig new file +15 -0
new file mode 100644
index 0000000..03625d7
@@ -0,0 +1,15 @@
+menu "ST-Ericsson platform type"
+	depends on ARCH_U8500
+
+comment "ST-Ericsson Multicore Mobile Platforms"
+
+config MACH_U8500_MOP
+	bool "U8500 Early Development platform"
+	default y
+	select ARM_GIC
+	select HAS_MTU
+	help
+	  Include support for mop500 development platform
+	  based on U8500 architecture. The platform is based
+	  on early drop silicon version of 8500.
+endmenu
arch/arm/mach-ux500/Makefile new file +8 -0
new file mode 100644
index 0000000..95e6e24
@@ -0,0 +1,8 @@
+#
+# Makefile for the linux kernel, U8500 machine.
+#
+
+obj-y				:= clock.o
+obj-$(CONFIG_ARCH_U8500)	+= cpu-u8500.o
+obj-$(CONFIG_MACH_U8500_MOP)	+= board-mop500.o
+obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o localtimer.o
arch/arm/mach-ux500/board-mop500.c new file +158 -0

158 lines not on this page · raw message

arch/arm/mach-ux500/cpu-u8500.c new file +64 -0

64 lines not on this page · raw message

arch/arm/mach-ux500/headsmp.S new file +38 -0
new file mode 100644
index 0000000..a6be2cd
@@ -0,0 +1,38 @@
+/*
+ *  Copyright (c) 2009 ST-Ericsson
+ *	This file is based  ARM Realview platform
+ *  Copyright (c) 2003 ARM Limited
+ *  All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/linkage.h>
+#include <linux/init.h>
+
+	__INIT
+
+/*
+ * U8500 specific entry point for secondary CPUs.
+ */
+ENTRY(u8500_secondary_startup)
+	mrc	p15, 0, r0, c0, c0, 5
+	and	r0, r0, #15
+	adr	r4, 1f
+	ldmia	r4, {r5, r6}
+	sub	r4, r4, r5
+	add	r6, r6, r4
+	dsb
+pen:	ldr	r7, [r6]
+	cmp	r7, r0
+	bne	pen
+
+	/*
+	 * we've been released from the holding pen: secondary_stack
+	 * should now contain the SVC stack for this core
+	 */
+	b	secondary_startup
+
+1:	.long	.
+	.long	pen_release
arch/arm/mach-ux500/include/mach/debug-macro.S new file +19 -0
new file mode 100644
index 0000000..8f21b6a
@@ -0,0 +1,19 @@
+/*
+ * Debugging macro include header
+ *
+ *  Copyright (C) 2009 ST-Ericsson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+	.macro	addruart,rx
+	mrc	p15, 0, \rx, c1, c0
+	tst	\rx, #1			@MMU enabled?
+	moveq	\rx, #0x80000000	@MMU off, Physical address
+	movne	\rx, #0xF0000000	@MMU on, Virtual address
+	orr	\rx, \rx, #0x7000
+	.endm
+
+#include <asm/hardware/debug-pl01x.S>
arch/arm/mach-ux500/include/mach/entry-macro.S new file +89 -0

89 lines not on this page · raw message

arch/arm/mach-ux500/include/mach/memory.h new file +18 -0
new file mode 100644
index 0000000..510571a
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2009 ST-Ericsson
+ *
+ * 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.
+ */
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+/*
+ * Physical DRAM offset.
+ */
+#define PHYS_OFFSET	UL(0x00000000)
+#define BUS_OFFSET	UL(0x00000000)
+
+#endif
arch/arm/mach-ux500/include/mach/setup.h new file +23 -0
new file mode 100644
index 0000000..cf0ce16
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2009 ST-Ericsson.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * These symbols are needed for board-specific files to call their
+ * own cpu-specific files
+ */
+#ifndef __ASM_ARCH_SETUP_H
+#define __ASM_ARCH_SETUP_H
+
+#include <asm/mach/time.h>
+#include <linux/init.h>
+
+extern void u8500_map_io(void);
+extern void u8500_init_devices(void);
+extern void u8500_init_irq(void);
+/* We re-use nomadik_timer for this platform */
+extern void nmdk_timer_init(void);
+
+#endif /*  __ASM_ARCH_SETUP_H */
arch/arm/mach-ux500/include/mach/smp.h new file +32 -0
new file mode 100644
index 0000000..b59f7bc
@@ -0,0 +1,32 @@
+/*
+ * This file is based ARM realview platform.
+ * Copyright (C) ARM Limited.
+ *
+ * This file is licensed under  the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+#ifndef ASMARM_ARCH_SMP_H
+#define ASMARM_ARCH_SMP_H
+
+#include <asm/hardware/gic.h>
+
+/* This is required to wakeup the secondary core */
+extern void u8500_secondary_startup(void);
+
+#define hard_smp_processor_id()				\
+	({						\
+		unsigned int cpunum;			\
+		__asm__("mrc p15, 0, %0, c0, c0, 5"	\
+			: "=r" (cpunum));		\
+		cpunum &= 0x0F;				\
+	})
+
+/*
+ * We use IRQ1 as the IPI
+ */
+static inline void smp_cross_call(const struct cpumask *mask)
+{
+	gic_raise_softirq(mask, 1);
+}
+#endif
arch/arm/mach-ux500/include/mach/system.h new file +25 -0
new file mode 100644
index 0000000..c0cd800
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2009 ST-Ericsson.
+ *
+ * This file is licensed under  the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+static inline void arch_idle(void)
+{
+	/*
+	 * This should do all the clock switching
+	 * and wait for interrupt tricks
+	 */
+	cpu_do_idle();
+}
+
+static inline void arch_reset(char mode, const char *cmd)
+{
+	/* yet to be implemented - TODO */
+}
+
+#endif
arch/arm/mach-ux500/include/mach/timex.h new file +6 -0
new file mode 100644
index 0000000..d0942c1
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARCH_TIMEX_H
+#define __ASM_ARCH_TIMEX_H
+
+#define CLOCK_TICK_RATE		110000000
+
+#endif
arch/arm/mach-ux500/include/mach/uncompress.h new file +58 -0

58 lines not on this page · raw message

arch/arm/mach-ux500/include/mach/vmalloc.h new file +18 -0
new file mode 100644
index 0000000..86cdbbc
@@ -0,0 +1,18 @@
+/*
+ *  Copyright (C) 2009 ST-Ericsson
+ *
+ * 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
+ */
+#define VMALLOC_END	0xf0000000
arch/arm/mach-ux500/localtimer.c new file +28 -0
new file mode 100644
index 0000000..2288f6a
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2008-2009 ST-Ericsson
+ * Srinidhi Kasagar <[email protected]>
+ *
+ * This file is heavily based on relaview platform, almost a copy.
+ *
+ * Copyright (C) 2002 ARM Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/clockchips.h>
+
+#include <asm/irq.h>
+#include <asm/smp_twd.h>
+#include <asm/localtimer.h>
+
+/*
+ * Setup the local clock events for a CPU.
+ */
+void __cpuinit local_timer_setup(struct clock_event_device *evt)
+{
+	evt->irq = IRQ_LOCALTIMER;
+	twd_timer_setup(evt);
+}
arch/arm/mach-ux500/platsmp.c new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
1.6.3.GIT
#1 lore raw

PATCH v4 3/6 ARM: U8500 core machine support

... going back to this patch...

arch/arm/mach-ux500/headsmp.S line 26

Quoted 11 lines · srinidhi kasagar
arch/arm/mach-ux500/headsmp.S new file +11 -0
+/*
+ * U8500 specific entry point for secondary CPUs.
+ */
+ENTRY(u8500_secondary_startup)
+	mrc	p15, 0, r0, c0, c0, 5
+	and	r0, r0, #15
+	adr	r4, 1f
+	ldmia	r4, {r5, r6}
+	sub	r4, r4, r5
+	add	r6, r6, r4
+	dsb

Can you please explain why you added a dsb here, whereas most other platforms don't require it?

Quoted 12 lines
arch/arm/mach-ux500/headsmp.S new file +12 -0
+pen:	ldr	r7, [r6]
+	cmp	r7, r0
+	bne	pen
+
+	/*
+	 * we've been released from the holding pen: secondary_stack
+	 * should now contain the SVC stack for this core
+	 */
+	b	secondary_startup
+
+1:	.long	.
+	.long	pen_release
#2 lore raw

PATCH v4 3/6 ARM: U8500 core machine support

Quoted 11 lines

-----Original Message-----
From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
Sent: Sunday, December 19, 2010 4:39 PM
To: Srinidhi KASAGAR
Cc: linux-arm-kernel at lists.infradead.org; STEricsson_nomadik_linux; Andrea GALLO; rubini at unipv.it
Subject: Re: [PATCH v4 3/6] ARM: U8500 core machine support

... going back to this patch...

On Fri, Nov 27, 2009 at 05:25:56AM +0530, srinidhi kasagar wrote:

Quoted 14 lines

arch/arm/mach-ux500/headsmp.S line 26

Quoted 11 lines
arch/arm/mach-ux500/headsmp.S new file +11 -0
+/*
+ * U8500 specific entry point for secondary CPUs.
+ */
+ENTRY(u8500_secondary_startup)
+	mrc	p15, 0, r0, c0, c0, 5
+	and	r0, r0, #15
+	adr	r4, 1f
+	ldmia	r4, {r5, r6}
+	sub	r4, r4, r5
+	add	r6, r6, r4
+	dsb

Can you please explain why you added a dsb here, whereas most other platforms don't require it?

No reason, you can safely ignore this. I can send a patch to remove this if you need.

srinidhi

#3 lore raw

PATCH v4 3/6 ARM: U8500 core machine support

Quoted 26 lines · Srinidhi KASAGAR
Quoted 11 lines

-----Original Message-----
From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
Sent: Sunday, December 19, 2010 4:39 PM
To: Srinidhi KASAGAR
Cc: linux-arm-kernel at lists.infradead.org; STEricsson_nomadik_linux; Andrea GALLO; rubini at unipv.it
Subject: Re: [PATCH v4 3/6] ARM: U8500 core machine support

... going back to this patch...

On Fri, Nov 27, 2009 at 05:25:56AM +0530, srinidhi kasagar wrote:

Quoted 14 lines

arch/arm/mach-ux500/headsmp.S line 26

Quoted 11 lines
arch/arm/mach-ux500/headsmp.S new file +11 -0
+/*
+ * U8500 specific entry point for secondary CPUs.
+ */
+ENTRY(u8500_secondary_startup)
+	mrc	p15, 0, r0, c0, c0, 5
+	and	r0, r0, #15
+	adr	r4, 1f
+	ldmia	r4, {r5, r6}
+	sub	r4, r4, r5
+	add	r6, r6, r4
+	dsb

Can you please explain why you added a dsb here, whereas most other platforms don't require it?

Quoted 2 lines

No reason, you can safely ignore this. I can send a patch to remove this if you need.

It would be better to have all the pen_release implementations without spurious differences when the differences aren't necessary.

So, yes please.