Skip to contentSkip to conversation

Versatile Express DT support

PATCH Superseded Pawel Moll 3 participants 23 messages Dec 6, 2011 – Dec 8, 2011

Subsystems (4)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Pawel Moll

author
#0 lore raw

v4 cover Versatile Express DT support

Hello again,

Here goes the fourth version of the series, hopefully something that could be merged for 3.3 (all Revieved-by-s and Acked-by-s welcomed!)

Changes since v3:

* The "core tile" support has been renamed (no real code change) to support for "platforms based on a processor" and the DTBs now must be now compatible with "arm,vexpress-<tile-model>" and "arm,vexpress-<processor>", the latter being the important bit. Documentation has been updated accordingly (all language suggestions more then welcome).

* Added support code for Cortex-A7 and Cortex-A15 based platforms and DTS for V2P-CA15 tile with Test Chip 1.

* ARCH_VEXPRESS_RS1 has been dropped and the addresses in Makefile.boot are not modified, so the behaviour of the non-DT code is not changed at any time. ARCH_VEXPRESS_DT now enforces AUTO_ZRELADDR.

* Compact Flash is now compatible with "arm,vexpress-cf" as well as with "ata-generic".

* V2x_PERIPH macros are now (void _iomem *) pointers and the V2x_PERIPH_P2V macros were dropped.

* Wrong ARCH_VEXPRESS_DT->OF selection was fixed to ->USE_OF.

* PL310-related Kconfig options were aligned to Will's and Dave's changes.

* "make dtbs" compile all provided vexpress-*.dts files now.

Tested on:
- V2P-CA9 with ATAGs
- V2P-CA9 with DT
- V2P-CA5s with DT
- V2P-CA15 with DT
- V2F-2XV6 Cortex-A7 SMM with DT

Series v2 has been also tested by Ryan Harkin and provisionally acked by Rob Herring.

Thanks for all your help, especially to Dave and Arnd for their continuous support!

Pawel Moll (6):
ARM: versatile: Add missing ENDPROC to headsmp.S
ARM: vexpress: Get rid of MMIO_P2V
ARM: vexpress: Add DT support for the motherboard
ARM: vexpress: Motherboard RS1 memory map support
ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based
tiles
ARM: vexpress: DT-based support for Cortex-A7 and Cortex-A15 based
tiles

 Documentation/devicetree/bindings/arm/vexpress.txt |  118 +++++++++
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi            |  196 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi                |  195 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts        |  138 +++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts            |  131 ++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts             |  145 +++++++++++
 arch/arm/include/asm/hardware/arm_timer.h          |    5 +
 arch/arm/mach-realview/platsmp.c                   |    3 +-
 arch/arm/mach-vexpress/Kconfig                     |   68 +++++-
 arch/arm/mach-vexpress/Makefile                    |    2 +
 arch/arm/mach-vexpress/Makefile.boot               |    6 +
 arch/arm/mach-vexpress/core.h                      |   19 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                  |   52 +---
 arch/arm/mach-vexpress/dt-ca5_ca9.c                |  114 +++++++++
 arch/arm/mach-vexpress/dt-ca7_ca15.c               |   95 +++++++
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h     |   13 +-
 arch/arm/mach-vexpress/include/mach/debug-macro.S  |   37 +++-
 arch/arm/mach-vexpress/include/mach/irqs.h         |    2 +-
 arch/arm/mach-vexpress/include/mach/motherboard.h  |   58 +++--
 arch/arm/mach-vexpress/include/mach/uncompress.h   |   13 +-
 arch/arm/mach-vexpress/platsmp.c                   |    7 +-
 arch/arm/mach-vexpress/v2m.c                       |  259 ++++++++++++++++++--
 arch/arm/plat-versatile/headsmp.S                  |    1 +
 23 files changed, 1557 insertions(+), 120 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress.txt
 create mode 100644 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/dt-ca5_ca9.c
 create mode 100644 arch/arm/mach-vexpress/dt-ca7_ca15.c
author
#1 lore raw

PATCH v4 1/6 ARM: versatile: Add missing ENDPROC to headsmp.S

Once the ENDPROC is in place, BSYM() in not longer necessary to get correct pointer to versatile_secondary_startup().

---
 arch/arm/mach-realview/platsmp.c  |    3 +--
 arch/arm/mach-vexpress/platsmp.c  |    4 +---
 arch/arm/plat-versatile/headsmp.S |    1 +
 3 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-realview/platsmp.c +1 -2
index e83c654..17c878d 100644
@@ -17,7 +17,6 @@
 #include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/smp_scu.h>
-#include <asm/unified.h>
 
 #include <mach/board-eb.h>
 #include <mach/board-pb11mp.h>
@@ -75,6 +74,6 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * until it receives a soft interrupt, and then the
 	 * secondary CPU branches to this address.
 	 */
-	__raw_writel(BSYM(virt_to_phys(versatile_secondary_startup)),
+	__raw_writel(virt_to_phys(versatile_secondary_startup),
 		     __io_address(REALVIEW_SYS_FLAGSSET));
 }
arch/arm/mach-vexpress/platsmp.c +1 -3
index 2b5f7ac..124ffb1 100644
@@ -13,8 +13,6 @@
 #include <linux/smp.h>
 #include <linux/io.h>
 
-#include <asm/unified.h>
-
 #include <mach/motherboard.h>
 #define V2M_PA_CS7 0x10000000
 
@@ -46,6 +44,6 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * secondary CPU branches to this address.
 	 */
 	writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
-	writel(BSYM(virt_to_phys(versatile_secondary_startup)),
+	writel(virt_to_phys(versatile_secondary_startup),
 		MMIO_P2V(V2M_SYS_FLAGSSET));
 }
arch/arm/plat-versatile/headsmp.S +1 -0
index d397a1f..dd703ef 100644
@@ -38,3 +38,4 @@ pen:	ldr	r7, [r6]
 	.align
 1:	.long	.
 	.long	pen_release
+ENDPROC(versatile_secondary_startup)
Signature · 1 line
1.6.3.3
author
#3 lore raw

PATCH v4 2/6 ARM: vexpress: Get rid of MMIO_P2V

In reply to Pawel Moll

This patch gets rid of the MMIO_P2V and __MMIO_P2V macros, defining constant virtual base for motherboard and tile peripherals instead.

Additionally, in preparation for the new motherboard memory map, the motherboard peripherals are using base pointers calculated in runtime, instead of compile-time calculated values.

---
 arch/arm/include/asm/hardware/arm_timer.h         |    5 ++
 arch/arm/mach-vexpress/core.h                     |    9 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 ++++------------
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 ++---
 arch/arm/mach-vexpress/include/mach/motherboard.h |   52 ++++++++--------
 arch/arm/mach-vexpress/platsmp.c                  |    5 +-
 arch/arm/mach-vexpress/v2m.c                      |   68 ++++++++++++++-------
 7 files changed, 100 insertions(+), 104 deletions(-)
arch/arm/include/asm/hardware/arm_timer.h +5 -0
index c0f4e7b..d6030ff 100644
@@ -9,7 +9,12 @@
  *
  * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
  * can have 16-bit or 32-bit selectable via a bit in the control register.
+ *
+ * Every SP804 contains two identical timers.
  */
+#define TIMER_1_BASE	0x00
+#define TIMER_2_BASE	0x20
+
 #define TIMER_LOAD	0x00			/* ACVR rw */
 #define TIMER_VALUE	0x04			/* ACVR ro */
 #define TIMER_CTRL	0x08			/* ACVR rw */
arch/arm/mach-vexpress/core.h +6 -3
index f439715..75a640a 100644
@@ -1,6 +1,3 @@
-#define __MMIO_P2V(x)	(((x) & 0xfffff) | (((x) & 0x0f000000) >> 4) | 0xf8000000)
-#define MMIO_P2V(x)	((void __iomem *)__MMIO_P2V(x))
-
 #define AMBA_DEVICE(name,busid,base,plat)	\
 struct amba_device name##_device = {		\
 	.dev		= {			\
@@ -17,3 +14,9 @@ struct amba_device name##_device = {		\
 	.irq		= IRQ_##base,		\
 	/* .dma		= DMA_##base,*/		\
 }
+
+/* 2MB large area for motherboard's peripherals static mapping */
+#define V2M_PERIPH ((void __iomem *)0xf8000000)
+
+/* Tile's peripherals static mappings should start here */
+#define V2T_PERIPH ((void __iomem *)0xf8200000)
arch/arm/mach-vexpress/ct-ca9x4.c +12 -40

96 lines not on this page · raw message

arch/arm/mach-vexpress/include/mach/ct-ca9x4.h +5 -8
index a34d3d4..8f962fb 100644
@@ -22,14 +22,11 @@
 #define CT_CA9X4_SYSWDT		(0x1e007000)
 #define CT_CA9X4_L2CC		(0x1e00a000)
 
-#define CT_CA9X4_TIMER0		(CT_CA9X4_SP804_TIMER + 0x000)
-#define CT_CA9X4_TIMER1		(CT_CA9X4_SP804_TIMER + 0x020)
-
-#define A9_MPCORE_SCU		(CT_CA9X4_MPIC + 0x0000)
-#define A9_MPCORE_GIC_CPU	(CT_CA9X4_MPIC + 0x0100)
-#define A9_MPCORE_GIT		(CT_CA9X4_MPIC + 0x0200)
-#define A9_MPCORE_TWD		(CT_CA9X4_MPIC + 0x0600)
-#define A9_MPCORE_GIC_DIST	(CT_CA9X4_MPIC + 0x1000)
+#define A9_MPCORE_SCU		0x0000
+#define A9_MPCORE_GIC_CPU	0x0100
+#define A9_MPCORE_GIT		0x0200
+#define A9_MPCORE_TWD		0x0600
+#define A9_MPCORE_GIC_DIST	0x1000
 
 /*
  * Interrupts.  Those in {} are for AMBA devices
arch/arm/mach-vexpress/include/mach/motherboard.h +25 -27

64 lines not on this page · raw message

arch/arm/mach-vexpress/platsmp.c +1 -4
index 124ffb1..a1ed6d6 100644
@@ -14,7 +14,6 @@
 #include <linux/io.h>
 
 #include <mach/motherboard.h>
-#define V2M_PA_CS7 0x10000000
 
 #include "core.h"
 
@@ -43,7 +42,5 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * until it receives a soft interrupt, and then the
 	 * secondary CPU branches to this address.
 	 */
-	writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
-	writel(virt_to_phys(versatile_secondary_startup),
-		MMIO_P2V(V2M_SYS_FLAGSSET));
+	v2m_flags_set(virt_to_phys(versatile_secondary_startup));
 }
arch/arm/mach-vexpress/v2m.c +46 -22

145 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#4 lore raw

PATCH v4 2/6 ARM: vexpress: Get rid of MMIO_P2V

Quoted 10 lines · On Tuesday 06 December 2011 15:43:45 Pawel Moll wrote:

This patch gets rid of the MMIO_P2V and __MMIO_P2V macros, defining constant virtual base for motherboard and tile peripherals instead.

Additionally, in preparation for the new motherboard memory map, the motherboard peripherals are using base pointers calculated in runtime, instead of compile-time calculated values.

author
#5 lore raw

PATCH v4 3/6 ARM: vexpress: Add DT support for the motherboard

In reply to Pawel Moll

This patch provides hooks for DT-based tile machine implementations and adds Flattened Device Tree description for the motherboard.

---
 Documentation/devicetree/bindings/arm/vexpress.txt |  118 ++++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi                |  195 ++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig                     |   12 ++
 arch/arm/mach-vexpress/Makefile.boot               |    2 +
 arch/arm/mach-vexpress/core.h                      |   10 +
 arch/arm/mach-vexpress/include/mach/motherboard.h  |    6 +
 arch/arm/mach-vexpress/v2m.c                       |  129 +++++++++++++-
 7 files changed, 470 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress.txt
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
Documentation/devicetree/bindings/arm/vexpress.txt new file +118 -0
new file mode 100644
index 0000000..d82c36e
@@ -0,0 +1,118 @@
+ARM Versatile Express boards family
+-----------------------------------
+
+ARM's Versatile Express platform consists of a motherboard and one
+or more daughterboards (tiles). The motherboard provides a set of
+peripherals. Processor and RAM "live" on the tiles.
+
+The motherboard and each core tile should be described by a separate
+Device Tree source file, with the tile's description including
+the motherboard file using a /include/ directive. As the motherboard
+can be initialized in one of two different configurations ("memory
+maps"), care must be taken to include the correct one.
+
+Required properties in the root node:
+- compatible value:
+	compatible = "arm,vexpress-<model>", "arm,vexpress-<processor>";
+  where:
+  - <processor> is type of the tile's processor, one of:
+	- "arm,vexpress-cortex_a5" for Cortex-A5 based tile,
+	- "arm,vexpress-cortex_a7" for Cortex-A7 based tile,
+	- "arm,vexpress-cortex_a9" for Cortex-A9 based tile,
+	- "arm,vexpress-cortex_a15" for Cortex-A15 based tile.
+  - <model> is the full tile model name (as used in the tile's
+    Technical Reference Manual), eg.:
+    - for Coretile Express A5x2 (V2P-CA5s):
+	compatible = "arm,vexpress-v2p-ca5s", "arm,vexpress-cortex_a5";
+    - Coretile Express A9x4 (V2P-CA9):
+	compatible = "arm,vexpress-v2p-ca9", "arm,vexpress-cortex_a9";
+    - Coretile Express A15x2 (V2P-CA15):
+	compatible = "arm,vexpress-v2p-ca15", "arm,vexpress-cortex_a15";
+
+Current Linux implementation relies on the processor type value.
+
+Optional properties in the root node:
+- tile model name (use the same names as in the tile's Technical
+  Reference Manuals, eg. "V2P-CA5s")
+	model = "<model>";
+- tile's HBI number (unique ARM's board model ID, visible on the
+  PCB's silkscreen) in hexadecimal transcription:
+	arm,hbi = <0xhbi>
+  eg:
+  - for Coretile Express A5x2 (V2P-CA5s) HBI-0191:
+	arm,hbi = <0x191>;
+  - Coretile Express A9x4 (V2P-CA9) HBI-0225:
+	arm,hbi = <0x225>;
+
+The motherboard description file provides a single "motherboard" node
+using 2 address cells corresponding to the Static Memory Bus used
+between the motherboard and the tile. The first cell defines the Chip
+Select (CS) line number, the second cell address offset within the CS.
+All interrupt lines between the motherboard and the tile are active
+high and are described using single cell.
+
+Optional properties of the "motherboard" node:
+- motherboard's memory map variant:
+	arm,v2m-memory-map = "<name>";
+  where name is one of:
+  - "rs1" - for RS1 map (i.a. peripherals on CS3); this map is also
+            referred to as "ARM Cortex-A Series memory map":
+	arm,v2m-memory-map = "rs1";
+  When this property is missing, the motherboard is using the original
+  memory map (also known as the "Legacy memory map", primarily used
+  with the original CoreTile Express A9x4) with peripherals on CS7.
+
+Motherboard .dtsi files provide a set of labelled peripherals that
+can be used to obtain required phandle in the tile's "aliases" node:
+- UARTs, note that the numbers correspond to the physical connectors
+  on the motherboard's back panel:
+	v2m_serial0, v2m_serial1, v2m_serial2 and v2m_serial3
+- I2C controllers:
+	v2m_i2c_dvi and v2m_i2c_pcie
+- SP804 timers:
+	v2m_timer01 and v2m_timer23
+
+Current Linux implementation requires a "arm,v2m_timer" alias
+pointing at one of the motherboard's SP804 timers, if it is to be
+used as the system timer. This alias should be defined in the
+motherboard files.
+
+The tile description must define "ranges", "interrupt-map-mask" and
+"interrupt-map" properties to translate the motherboard's address
+and interrupt space into one used by the tile's processor.
+
+Abbreviated example:
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA5s";
+	arm,hbi = <0x225>;
+	compatible = "arm,vexpress-v2p-ca5s";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &v2m_serial0;
+	};
+
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0x2c001000 0x1000>,
+		      <0x2c000100 0x100>;
+	};
+
+	motherboard {
+		/* CS0 is visible at 0x08000000 */
+		ranges = <0 0 0x08000000 0x04000000>;
+		interrupt-map-mask = <0 0 63>;
+		/* Active high IRQ 0 is connected to GIC's SPI0 */
+		interrupt-map = <0 0 0 &gic 0 0 4>;
+	};
+};
+
+/include/ "vexpress-v2m-rs1.dtsi"
arch/arm/boot/dts/vexpress-v2m.dtsi new file +195 -0

195 lines not on this page · raw message

arch/arm/mach-vexpress/Kconfig +12 -0
index 9311484..56a61fb 100644
@@ -9,4 +9,16 @@ config ARCH_VEXPRESS_CA9X4
 	select ARM_ERRATA_751472
 	select ARM_ERRATA_753970
 
+config ARCH_VEXPRESS_DT
+	bool "Device Tree support for Versatile Express platforms"
+	select ARM_PATCH_PHYS_VIRT
+	select AUTO_ZRELADDR
+	select USE_OF
+	help
+	  New Versatile Express platforms require Flattened Device Tree to
+	  be passed to the kernel.
+
+	  If your bootloader supports Flattened Device Tree based booting,
+	  say Y here.
+
 endmenu
arch/arm/mach-vexpress/Makefile.boot +2 -0
index 8630b3d..c6dd891 100644
@@ -1,3 +1,5 @@
+# Those numbers are used only by the non-DT V2P-CA9 platform
+# The DT-enabled ones require CONFIG_AUTO_ZRELADDR=y
    zreladdr-y	+= 0x60008000
 params_phys-y	:= 0x60000100
 initrd_phys-y	:= 0x60800000
arch/arm/mach-vexpress/core.h +10 -0
index 75a640a..01eb8d0 100644
@@ -20,3 +20,13 @@ struct amba_device name##_device = {		\
 
 /* Tile's peripherals static mappings should start here */
 #define V2T_PERIPH ((void __iomem *)0xf8200000)
+
+#if defined(CONFIG_ARCH_VEXPRESS_DT)
+
+extern struct sys_timer v2m_dt_timer;
+
+void __init v2m_dt_map_io(void);
+void __init v2m_dt_init_early(void);
+struct of_dev_auxdata * __init v2m_dt_get_auxdata(void);
+
+#endif
arch/arm/mach-vexpress/include/mach/motherboard.h +6 -0
index b4c498c..31a9289 100644
@@ -117,6 +117,12 @@ int v2m_cfg_read(u32 devfn, u32 *data);
 void v2m_flags_set(u32 data);
 
 /*
+ * Miscellaneous
+ */
+#define SYS_MISC_MASTERSITE	(1 << 14)
+#define SYS_PROCIDx_HBI_MASK	0xfff
+
+/*
  * Core tile IDs
  */
 #define V2M_CT_ID_CA9		0x0c000191
arch/arm/mach-vexpress/v2m.c +127 -2

144 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#7 lore raw

PATCH v4 3/6 ARM: vexpress: Add DT support for the motherboard

In reply to Pawel Moll

arch/arm/mach-vexpress/v2m.c MACHINE_START(VEXPRESS, "ARM-Versatile Express") · line 594

Quoted 8 lines · On Tuesday 06 December 2011 15:43:46 Pawel Moll wrote:
arch/arm/mach-vexpress/v2m.c +7 -0
+
+static struct of_dev_auxdata v2m_dt_auxdata_lookup[] __initdata = {
+       OF_DEV_AUXDATA("arm,vexpress-flash", V2M_NOR0, "physmap-flash",
+                       &v2m_flash_data),
+       OF_DEV_AUXDATA("arm,primecell", V2M_MMCI, "mb:mmci", &v2m_mmci_data),
+       {}
+};

One more thing I noticed. While I'm not familiar with the progress on device driver conversion, I think you should be using the physmap_of driver instead of physmap, which will remove the need for the platform data.

For mmci, it should not be hard to do change the driver so it understands the device tree, too. The easiest implementation for that would be to add some code into mmci_probe and allocate an mmci_platform_data structure that gets filled with the required attributes.

Arnd

author
#8 lore raw

PATCH v4 3/6 ARM: vexpress: Add DT support for the motherboard

Quoted 11 lines · Arnd Bergmann

arch/arm/mach-vexpress/v2m.c MACHINE_START(VEXPRESS, "ARM-Versatile Express") · line 594

Quoted 7 lines · On Tuesday 06 December 2011 15:43:46 Pawel Moll wrote:
arch/arm/mach-vexpress/v2m.c +7 -0
+
+static struct of_dev_auxdata v2m_dt_auxdata_lookup[] __initdata = {
+       OF_DEV_AUXDATA("arm,vexpress-flash", V2M_NOR0, "physmap-flash",
+                       &v2m_flash_data),
+       OF_DEV_AUXDATA("arm,primecell", V2M_MMCI, "mb:mmci", &v2m_mmci_data),
+       {}
+};

One more thing I noticed. While I'm not familiar with the progress on device driver conversion,

I'm aware of these two last non-DT bits and actually already started working on them, but this won't happen this year (I'm on holiday starting next Friday without any access to Internet whatsoever :-)

Quoted 3 lines

I think you should be using the physmap_of
driver instead of physmap, which will remove the need for the platform data.

There's one bit missing in the physmap_of. The "set_vpp" handle which is used on VE:

static struct physmap_flash_data v2m_flash_data = {
.width = 4,
.set_vpp = v2m_flash_set_vpp,
};

My plan is to extend the physmap_of driver so it could operate VPP via gpio API and make the sysreg a gpio controller, having Flash VPP, CF & MMC card detects and DVI output control (that's for CLCD) as internal GPIO lines.

Quoted 5 lines

For mmci, it should not be hard to do change the driver so it understands the device tree, too. The easiest implementation for that would be to add some code into mmci_probe and allocate an mmci_platform_data structure that gets filled with the required attributes.

I've started the implementation already, but it turned out much trickier that I was hoping... One thing is the "status" handle (card detect line "virtual gpio" I mentioned above), the second problem is the fact that mmci platform data can take generic caps MMC_CAP_* from include/linux/mmc/host.h (now even caps2 as well)... This issue was already briefly mentioned here:
http://article.gmane.org/gmane.linux.kernel.samsung-soc/7639 and as there was no generic resolution my plan is to reuse as much properties from other MMC host controllers and forge the missing one (as a superset of ARM's and STE's cell implementations). But as I said, it's unlikely to happen this year...

Cheers!

Pawe?

#9 lore raw

PATCH v4 3/6 ARM: vexpress: Add DT support for the motherboard

Quoted 13 lines · Pawel Moll
Quoted 11 lines · Arnd Bergmann

arch/arm/mach-vexpress/v2m.c MACHINE_START(VEXPRESS, "ARM-Versatile Express") · line 594

Quoted 7 lines · On Tuesday 06 December 2011 15:43:46 Pawel Moll wrote:
arch/arm/mach-vexpress/v2m.c +7 -0
+
+static struct of_dev_auxdata v2m_dt_auxdata_lookup[] __initdata = {
+       OF_DEV_AUXDATA("arm,vexpress-flash", V2M_NOR0, "physmap-flash",
+                       &v2m_flash_data),
+       OF_DEV_AUXDATA("arm,primecell", V2M_MMCI, "mb:mmci", &v2m_mmci_data),
+       {}
+};

One more thing I noticed. While I'm not familiar with the progress on device driver conversion,

Quoted 3 lines

I'm aware of these two last non-DT bits and actually already started working on them, but this won't happen this year (I'm on holiday starting next Friday without any access to Internet whatsoever :-)

Ok, fine with me. Let's make sure we get everything else ready for 3.3 then.

Quoted 23 lines
Quoted 3 lines

I think you should be using the physmap_of
driver instead of physmap, which will remove the need for the platform data.

There's one bit missing in the physmap_of. The "set_vpp" handle which is used on VE:

static struct physmap_flash_data v2m_flash_data = {
.width = 4,
.set_vpp = v2m_flash_set_vpp,
};

My plan is to extend the physmap_of driver so it could operate VPP via gpio API and make the sysreg a gpio controller, having Flash VPP, CF & MMC card detects and DVI output control (that's for CLCD) as internal GPIO lines.

Quoted 5 lines

For mmci, it should not be hard to do change the driver so it understands the device tree, too. The easiest implementation for that would be to add some code into mmci_probe and allocate an mmci_platform_data structure that gets filled with the required attributes.

Quoted 11 lines

I've started the implementation already, but it turned out much trickier that I was hoping... One thing is the "status" handle (card detect line "virtual gpio" I mentioned above), the second problem is the fact that mmci platform data can take generic caps MMC_CAP_* from include/linux/mmc/host.h (now even caps2 as well)... This issue was already briefly mentioned here:
http://article.gmane.org/gmane.linux.kernel.samsung-soc/7639 and as there was no generic resolution my plan is to reuse as much properties from other MMC host controllers and forge the missing one (as a superset of ARM's and STE's cell implementations). But as I said, it's unlikely to happen this year...

I see. Thanks for the explanation.

Arnd

author
#10 lore raw

PATCH v4 4/6 ARM: vexpress: Motherboard RS1 memory map support

In reply to Pawel Moll

This patch adds support for RS1 memory map based Versatile Express motherboard.

---
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi           |  196 +++++++++++++++++++++
 arch/arm/mach-vexpress/include/mach/debug-macro.S |   37 ++++-
 arch/arm/mach-vexpress/include/mach/uncompress.h  |   13 ++-
 arch/arm/mach-vexpress/v2m.c                      |   64 +++++++-
 4 files changed, 304 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi new file +196 -0
new file mode 100644
index 0000000..a7d385f
@@ -0,0 +1,196 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * Motherboard Express uATX
+ * V2M-P1
+ *
+ * HBI-0190D
+ *
+ * RS1 memory map ("ARM Cortex-A Series memory map" in the board's
+ * Technical Reference Manual)
+ *
+ * WARNING! The hardware described in this file is independent from the
+ * original variant (vexpress-v2m.dtsi), but there is a strong
+ * correspondence between the two configurations.
+ *
+ * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
+ * CHANGES TO vexpress-v2m.dtsi!
+ */
+
+/ {
+	aliases {
+		arm,v2m_timer = &v2m_timer01;
+	};
+
+	motherboard {
+		compatible = "simple-bus";
+		arm,v2m-memory-map = "rs1";
+		#address-cells = <2>; /* SMB chipselect number and offset */
+		#size-cells = <1>;
+		#interrupt-cells = <1>;
+
+		flash at 0,00000000 {
+			compatible = "arm,vexpress-flash", "cfi-flash";
+			reg = <0 0x00000000 0x04000000>,
+			      <4 0x00000000 0x04000000>;
+			bank-width = <4>;
+		};
+
+		psram at 1,00000000 {
+			compatible = "mtd-ram";
+			reg = <1 0x00000000 0x02000000>;
+			bank-width = <4>;
+		};
+
+		ethernet at 2,02000000 {
+			compatible = "smsc,lan9118", "smsc,lan9115";
+			reg = <2 0x02000000 0x10000>;
+			interrupts = <15>;
+			phy-mode = "mii";
+			reg-io-width = <4>;
+			smsc,irq-active-high;
+			smsc,irq-push-pull;
+		};
+
+		usb at 2,03000000 {
+			compatible = "nxp,usb-isp1761";
+			reg = <2 0x03000000 0x20000>;
+			interrupts = <16>;
+			port1-otg;
+		};
+
+		iofpga at 3,00000000 {
+			compatible = "arm,amba-bus", "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 3 0 0x200000>;
+
+			sysreg at 010000 {
+				compatible = "arm,vexpress-sysreg";
+				reg = <0x010000 0x1000>;
+			};
+
+			sysctl at 020000 {
+				compatible = "arm,sp810", "arm,primecell";
+				reg = <0x020000 0x1000>;
+			};
+
+			/* PCI-E I2C bus */
+			v2m_i2c_pcie: i2c at 030000 {
+				compatible = "arm,versatile-i2c";
+				reg = <0x030000 0x1000>;
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				pcie-switch at 60 {
+					compatible = "idt,89hpes32h8";
+					reg = <0x60>;
+				};
+			};
+
+			aaci at 040000 {
+				compatible = "arm,pl041", "arm,primecell";
+				reg = <0x040000 0x1000>;
+				interrupts = <11>;
+			};
+
+			mmci at 050000 {
+				compatible = "arm,pl180", "arm,primecell";
+				reg = <0x050000 0x1000>;
+				interrupts = <9 10>;
+			};
+
+			kmi at 060000 {
+				compatible = "arm,pl050", "arm,primecell";
+				reg = <0x060000 0x1000>;
+				interrupts = <12>;
+			};
+
+			kmi at 070000 {
+				compatible = "arm,pl050", "arm,primecell";
+				reg = <0x070000 0x1000>;
+				interrupts = <13>;
+			};
+
+			v2m_serial0: uart at 090000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x090000 0x1000>;
+				interrupts = <5>;
+			};
+
+			v2m_serial1: uart at 0a0000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0a0000 0x1000>;
+				interrupts = <6>;
+			};
+
+			v2m_serial2: uart at 0b0000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0b0000 0x1000>;
+				interrupts = <7>;
+			};
+
+			v2m_serial3: uart at 0c0000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0c0000 0x1000>;
+				interrupts = <8>;
+			};
+
+			wdt at 0f0000 {
+				compatible = "arm,sp805", "arm,primecell";
+				reg = <0x0f0000 0x1000>;
+				interrupts = <0>;
+			};
+
+			v2m_timer01: timer at 110000 {
+				compatible = "arm,sp804", "arm,primecell";
+				reg = <0x110000 0x1000>;
+				interrupts = <2>;
+			};
+
+			v2m_timer23: timer at 120000 {
+				compatible = "arm,sp804", "arm,primecell";
+				reg = <0x120000 0x1000>;
+			};
+
+			/* DVI I2C bus */
+			v2m_i2c_dvi: i2c at 160000 {
+				compatible = "arm,versatile-i2c";
+				reg = <0x160000 0x1000>;
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				dvi-transmitter at 39 {
+					compatible = "sil,sii9022-tpi", "sil,sii9022";
+					reg = <0x39>;
+				};
+
+				dvi-transmitter at 60 {
+					compatible = "sil,sii9022-cpi", "sil,sii9022";
+					reg = <0x60>;
+				};
+			};
+
+			rtc at 170000 {
+				compatible = "arm,pl031", "arm,primecell";
+				reg = <0x170000 0x1000>;
+				interrupts = <4>;
+			};
+
+			compact-flash at 1a0000 {
+				compatible = "arm,vexpress-cf", "ata-generic";
+				reg = <0x1a0000 0x100
+				       0x1a0100 0xf00>;
+				reg-shift = <2>;
+			};
+
+			clcd at 1f0000 {
+				compatible = "arm,pl111", "arm,primecell";
+				reg = <0x1f0000 0x1000>;
+				interrupts = <14>;
+			};
+		};
+	};
+};
arch/arm/mach-vexpress/include/mach/debug-macro.S +33 -4
index fd9e6c7..8010ff9 100644
@@ -10,12 +10,41 @@
  * published by the Free Software Foundation.
  */
 
-#define DEBUG_LL_UART_OFFSET	0x00009000
+#define DEBUG_LL_PHYS_BASE		0x10000000
+#define DEBUG_LL_UART_OFFSET		0x00009000
+
+#define DEBUG_LL_PHYS_BASE_RS1		0x1c000000
+#define DEBUG_LL_UART_OFFSET_RS1	0x00090000
+
+#define DEBUG_LL_VIRT_BASE		0xf8000000
 
 		.macro	addruart,rp,rv,tmp
-		mov	\rp, #DEBUG_LL_UART_OFFSET
-		orr	\rv, \rp, #0xf8000000	@ virtual base
-		orr	\rp, \rp, #0x10000000	@ physical base
+
+		@ Check the MMU state
+#if defined(CONFIG_MMU)
+		mrc	p15, 0, \tmp, c1, c0	@ SCTRL
+		tst	\tmp, #1		@ MMU enabled?
+		moveq	\tmp, #DEBUG_LL_PHYS_BASE
+		movne	\tmp, #DEBUG_LL_VIRT_BASE
+#else
+		mov	\tmp, #DEBUG_LL_PHYS_BASE
+#endif
+
+		@ PL011 present in "original" place?
+		orr	\tmp, \tmp, #DEBUG_LL_UART_OFFSET
+		ldr	\tmp, [\tmp, #0xfe0]	@ PeriphID0
+		teq	\tmp, #0x11		@ PL011
+
+		@ Original memory map
+		moveq	\rp, #DEBUG_LL_UART_OFFSET
+		orreq	\rv, \rp, #DEBUG_LL_VIRT_BASE
+		orreq	\rp, \rp, #DEBUG_LL_PHYS_BASE
+
+		@ RS1 memory map
+		movne	\rp, #DEBUG_LL_UART_OFFSET_RS1
+		orrne	\rv, \rp, #DEBUG_LL_VIRT_BASE
+		orrne	\rp, \rp, #DEBUG_LL_PHYS_BASE_RS1
+
 		.endm
 
 #include <asm/hardware/debug-pl01x.S>
arch/arm/mach-vexpress/include/mach/uncompress.h +12 -1
index 7972c57..c491565 100644
@@ -22,7 +22,18 @@
 #define AMBA_UART_CR(base)	(*(volatile unsigned char *)((base) + 0x30))
 #define AMBA_UART_FR(base)	(*(volatile unsigned char *)((base) + 0x18))
 
-#define get_uart_base()	(0x10000000 + 0x00009000)
+#define AMBA_PERIPH_ID0(base)	(*(volatile unsigned char *)((base) + 0xfe0))
+
+#define UART_BASE	0x10009000
+#define UART_BASE_RS1	0x1c090000
+
+static unsigned long get_uart_base(void)
+{
+	if (AMBA_PERIPH_ID0(UART_BASE) == 0x11)
+		return UART_BASE;
+	else
+		return UART_BASE_RS1;
+}
 
 /*
  * This does not append a newline
arch/arm/mach-vexpress/v2m.c +63 -1

84 lines not on this page · raw message

Signature · 1 line
1.6.3.3
author
#12 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

In reply to Pawel Moll

This patch adds Flattened Device Trees based support for ARM Ltd. Versatile Express platforms based on Cortex-A5 and Cortex-A9 processors.

---
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts |  131 ++++++++++++++++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts  |  145 +++++++++++++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig          |   39 +++++++-
 arch/arm/mach-vexpress/Makefile         |    1 +
 arch/arm/mach-vexpress/Makefile.boot    |    3 +
 arch/arm/mach-vexpress/dt-ca5_ca9.c     |  114 ++++++++++++++++++++++++
 6 files changed, 428 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/dt-ca5_ca9.c
arch/arm/boot/dts/vexpress-v2p-ca5s.dts new file +131 -0
new file mode 100644
index 0000000..205d9a0
@@ -0,0 +1,131 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * CoreTile Express A5x2
+ * Cortex-A5 MPCore (V2P-CA5s)
+ *
+ * HBI-0225B
+ */
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA5s";
+	arm,hbi = <0x225>;
+	compatible = "arm,vexpress-v2p-ca5s", "arm,vexpress-cortex_a5";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &v2m_serial0;
+		serial1 = &v2m_serial1;
+		serial2 = &v2m_serial2;
+		serial3 = &v2m_serial3;
+		i2c0 = &v2m_i2c_dvi;
+		i2c1 = &v2m_i2c_pcie;
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>;
+	};
+
+	hdlcd at 2a110000 {
+		compatible = "arm,hdlcd";
+		reg = <0x2a110000 0x1000>;
+		interrupts = <0 85 4>;
+	};
+
+	memory-controller at 2a150000 {
+		compatible = "arm,pl341", "arm,primecell";
+		reg = <0x2a150000 0x1000>;
+	};
+
+	memory-controller at 2a190000 {
+		compatible = "arm,pl354", "arm,primecell";
+		reg = <0x2a190000 0x1000>;
+		interrupts = <0 86 4>,
+			     <0 87 4>;
+	};
+
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0x2c001000 0x1000>,
+		      <0x2c000100 0x100>;
+	};
+
+	L2: cache-controller at 2c0f0000 {
+		compatible = "arm,pl310-cache";
+		reg = <0x2c0f0000 0x1000>;
+		interrupts = <0 84 4>;
+		cache-level = <2>;
+		arm,data-latency = <0>;
+		arm,tag-latency = <0>;
+	};
+
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupts = <0 68 4>,
+			     <0 69 4>;
+	};
+
+	motherboard {
+		ranges = <0 0 0x08000000 0x04000000>,
+			 <1 0 0x14000000 0x04000000>,
+			 <2 0 0x18000000 0x04000000>,
+			 <3 0 0x1c000000 0x04000000>,
+			 <4 0 0x0c000000 0x04000000>,
+			 <5 0 0x10000000 0x04000000>;
+
+		interrupt-map-mask = <0 0 63>;
+		interrupt-map = <0 0  0 &gic 0  0 4>,
+				<0 0  1 &gic 0  1 4>,
+				<0 0  2 &gic 0  2 4>,
+				<0 0  3 &gic 0  3 4>,
+				<0 0  4 &gic 0  4 4>,
+				<0 0  5 &gic 0  5 4>,
+				<0 0  6 &gic 0  6 4>,
+				<0 0  7 &gic 0  7 4>,
+				<0 0  8 &gic 0  8 4>,
+				<0 0  9 &gic 0  9 4>,
+				<0 0 10 &gic 0 10 4>,
+				<0 0 11 &gic 0 11 4>,
+				<0 0 12 &gic 0 12 4>,
+				<0 0 13 &gic 0 13 4>,
+				<0 0 14 &gic 0 14 4>,
+				<0 0 15 &gic 0 15 4>,
+				<0 0 16 &gic 0 16 4>,
+				<0 0 17 &gic 0 17 4>,
+				<0 0 18 &gic 0 18 4>,
+				<0 0 19 &gic 0 19 4>,
+				<0 0 20 &gic 0 20 4>,
+				<0 0 21 &gic 0 21 4>,
+				<0 0 22 &gic 0 22 4>,
+				<0 0 23 &gic 0 23 4>,
+				<0 0 24 &gic 0 24 4>,
+				<0 0 25 &gic 0 25 4>,
+				<0 0 26 &gic 0 26 4>,
+				<0 0 27 &gic 0 27 4>,
+				<0 0 28 &gic 0 28 4>,
+				<0 0 29 &gic 0 29 4>,
+				<0 0 30 &gic 0 30 4>,
+				<0 0 31 &gic 0 31 4>,
+				<0 0 32 &gic 0 32 4>,
+				<0 0 33 &gic 0 33 4>,
+				<0 0 34 &gic 0 34 4>,
+				<0 0 35 &gic 0 35 4>,
+				<0 0 36 &gic 0 36 4>,
+				<0 0 37 &gic 0 37 4>,
+				<0 0 38 &gic 0 38 4>,
+				<0 0 39 &gic 0 39 4>,
+				<0 0 40 &gic 0 40 4>,
+				<0 0 41 &gic 0 41 4>,
+				<0 0 42 &gic 0 42 4>;
+	};
+};
+
+/include/ "vexpress-v2m-rs1.dtsi"
arch/arm/boot/dts/vexpress-v2p-ca9.dts new file +145 -0

145 lines not on this page · raw message

arch/arm/mach-vexpress/Kconfig +34 -5
index 56a61fb..c1cd08d 100644
@@ -1,13 +1,23 @@
 menu "Versatile Express platform type"
 	depends on ARCH_VEXPRESS
 
-config ARCH_VEXPRESS_CA9X4
-	bool "Versatile Express Cortex-A9x4 tile"
-	select CPU_V7
-	select ARM_GIC
+config ARCH_VEXPRESS_CORTEX_A5_A9
+	bool
 	select ARM_ERRATA_720789
 	select ARM_ERRATA_751472
-	select ARM_ERRATA_753970
+	select ARM_GIC
+	select CPU_V7
+	select HAVE_L2X0_L2CC
+	select PL310_ERRATA_753970 if CACHE_PL310
+	help
+	  Provides common dependencies for Versatile Express platforms
+	  based on Cortex-A5 and Cortex-A9 processors. In order to
+	  build a working kernel, you must also enable relevant core
+	  tile support or Flattened Device Tree based support options.
+
+config ARCH_VEXPRESS_CA9X4
+	bool "Versatile Express Cortex-A9x4 tile"
+	select ARCH_VEXPRESS_CORTEX_A5_A9
 
 config ARCH_VEXPRESS_DT
 	bool "Device Tree support for Versatile Express platforms"
@@ -21,4 +31,23 @@ config ARCH_VEXPRESS_DT
 	  If your bootloader supports Flattened Device Tree based booting,
 	  say Y here.
 
+config ARCH_VEXPRESS_DT_CORTEX_A5_A9
+	bool "Support for tiles based on Cortex-A5 and Cortex-A9 processors"
+	depends on ARCH_VEXPRESS_DT
+	select ARCH_VEXPRESS_CORTEX_A5_A9
+	help
+	  This option enables support for systems using Cortex-A5 and Cortex-A9
+	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
+	  for example:
+
+	  - CoreTile Express A5x2 (V2P-CA5s)
+	  - CoreTile Express A9x4 (V2P-CA9)
+	  - LogicTile Express 13MG (V2F-2XV6) with A5 SMM (Soft Macrocell Model)
+	  - LogicTile Express 13MG (V2F-2XV6) with A9 SMM (Soft Macrocell Model)
+	  - VE Cortex-A9 RTSM (Model)
+
+	  You must boot using a Flattened Device Tree in order to use these
+	  platforms. The traditional (ATAGs) boot method is not usable on
+	  these boards with this option.
+
 endmenu
arch/arm/mach-vexpress/Makefile +1 -0
index 90551b9..322e42d 100644
@@ -4,5 +4,6 @@
 
 obj-y					:= v2m.o
 obj-$(CONFIG_ARCH_VEXPRESS_CA9X4)	+= ct-ca9x4.o
+obj-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A5_A9)	+= dt-ca5_ca9.o
 obj-$(CONFIG_SMP)			+= platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
arch/arm/mach-vexpress/Makefile.boot +3 -0
index c6dd891..f0b0e60 100644
@@ -3,3 +3,6 @@
    zreladdr-y	+= 0x60008000
 params_phys-y	:= 0x60000100
 initrd_phys-y	:= 0x60800000
+
+dtb-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A5_A9)	+= vexpress-v2p-ca5s.dtb
+dtb-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A5_A9)	+= vexpress-v2p-ca9.dtb
arch/arm/mach-vexpress/dt-ca5_ca9.c new file +114 -0

114 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#14 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

Quoted 8 lines · On Tuesday 06 December 2011 23:53:46 Arnd Bergmann wrote:
Quoted 5 lines · On Tuesday 06 December 2011 15:43:48 Pawel Moll wrote:

This patch adds Flattened Device Trees based support for ARM Ltd. Versatile Express platforms based on Cortex-A5 and Cortex-A9 processors.

Actually, I have to take that back. Looking at both patch 5 and 6, the dt-ca*.c files are almost identical and all the differences are about stuff that you can find in the device tree:

* The iotable gets initialized from "mrc p15, 4, %0, c15, c0, 0", which would be fine if that worked on all machines, but in order to unify the two files, I would recommend searching the flat device tree for the respective node and only map it if present.

* You have two ways of finding out the number of cores, but looking in the device tree would just work either way.

* You set the twd_base unconditionally on a5/a9 but never on a7/a15. This looks correct, but you could just as well see if a twd node exists and use its base address.

* You only initialize the l2x0 on a5/a9. If a7/a15 don't have a matching l2x0 device, then calling the same function unconditionally should be harmless.

Arnd

author
#15 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

Quoted 3 lines · Arnd Bergmann

Actually, I have to take that back. Looking at both patch 5 and 6, the dt-ca*.c files are almost identical and all the differences are about stuff that you can find in the device tree:

You are obviously right - I was rushing with that. Less is better then more ;-) Will respin tomorrow.

Quoted 7 lines

* The iotable gets initialized from "mrc p15, 4, %0, c15, c0, 0", which would be fine if that worked on all machines, but in order to unify the two files, I would recommend searching the flat device tree for the respective node and only map it if present.

* You have two ways of finding out the number of cores, but looking in the device tree would just work either way.

Those two are actually related, as it's all about memory mapped SCU in case of A5/A9 and CP15-controlled on A7/15 (the *smp_enable() is different as well).

I'll probably just define a "scu" node compatible with "arm,cortex-a9-scu" and use the A5/A9 SMP callbacks if it's present (and create static mapping for it) or the A7/15 if it's missing.

Quoted 3 lines

* You set the twd_base unconditionally on a5/a9 but never on a7/a15. This looks correct, but you could just as well see if a twd node exists and use its base address.

I'll reuse Rob's Highbank solution and binding.

Quoted 2 lines

* You only initialize the l2x0 on a5/a9. If a7/a15 don't have a matching l2x0 device, then calling the same function unconditionally should be harmless.

Yep, that's not a problem.

Thanks for all the other ack-bys and review-bys!

Pawel

#16 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

Quoted 7 lines · On Wednesday 07 December 2011 19:06:28 Pawel Moll wrote:
Quoted 3 lines · Arnd Bergmann

Actually, I have to take that back. Looking at both patch 5 and 6, the dt-ca*.c files are almost identical and all the differences are about stuff that you can find in the device tree:

You are obviously right - I was rushing with that. Less is better then more Will respin tomorrow.

Ok, great!

Quoted 8 lines
Quoted 7 lines

* The iotable gets initialized from "mrc p15, 4, %0, c15, c0, 0", which would be fine if that worked on all machines, but in order to unify the two files, I would recommend searching the flat device tree for the respective node and only map it if present.

* You have two ways of finding out the number of cores, but looking in the device tree would just work either way.

Quoted 7 lines

Those two are actually related, as it's all about memory mapped SCU in case of A5/A9 and CP15-controlled on A7/15 (the *smp_enable() is different as well).

I'll probably just define a "scu" node compatible with "arm,cortex-a9-scu" and use the A5/A9 SMP callbacks if it's present (and create static mapping for it) or the A7/15 if it's missing.

Fair enough.

Arnd

#17 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

In reply to Pawel Moll

On Tue, Dec 06, 2011 at 03:43:48PM +0000, Pawel Moll wrote:

[...]

Quoted 47 lines
arch/arm/boot/dts/vexpress-v2p-ca9.dts new file +1 -0
+/include/ "vexpress-v2m.dtsi"
arch/arm/mach-vexpress/Kconfig +24 -5
index 56a61fb..c1cd08d 100644
@@ -1,13 +1,23 @@
 menu "Versatile Express platform type"
 	depends on ARCH_VEXPRESS
 
-config ARCH_VEXPRESS_CA9X4
-	bool "Versatile Express Cortex-A9x4 tile"
-	select CPU_V7
-	select ARM_GIC
+config ARCH_VEXPRESS_CORTEX_A5_A9
+	bool
 	select ARM_ERRATA_720789
 	select ARM_ERRATA_751472
-	select ARM_ERRATA_753970
+	select ARM_GIC
+	select CPU_V7
+	select HAVE_L2X0_L2CC
+	select PL310_ERRATA_753970 if CACHE_PL310
+	help
+	  Provides common dependencies for Versatile Express platforms
+	  based on Cortex-A5 and Cortex-A9 processors. In order to
+	  build a working kernel, you must also enable relevant core
+	  tile support or Flattened Device Tree based support options.
+
+config ARCH_VEXPRESS_CA9X4
+	bool "Versatile Express Cortex-A9x4 tile"
+	select ARCH_VEXPRESS_CORTEX_A5_A9
 
 config ARCH_VEXPRESS_DT
 	bool "Device Tree support for Versatile Express platforms"
@@ -21,4 +31,23 @@ config ARCH_VEXPRESS_DT
 	  If your bootloader supports Flattened Device Tree based booting,
 	  say Y here.
 
+config ARCH_VEXPRESS_DT_CORTEX_A5_A9
+	bool "Support for tiles based on Cortex-A5 and Cortex-A9 processors"
+	depends on ARCH_VEXPRESS_DT
+	select ARCH_VEXPRESS_CORTEX_A5_A9
+	help
+	  This option enables support for systems using Cortex-A5 and Cortex-A9
+	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
+	  for example:
+

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_DT · line 52

Quoted 10 lines
arch/arm/mach-vexpress/Kconfig +10 -0
+	  - CoreTile Express A5x2 (V2P-CA5s)
+	  - CoreTile Express A9x4 (V2P-CA9)
+	  - LogicTile Express 13MG (V2F-2XV6) with A5 SMM (Soft Macrocell Model)
+	  - LogicTile Express 13MG (V2F-2XV6) with A9 SMM (Soft Macrocell Model)
+	  - VE Cortex-A9 RTSM (Model)
+
+	  You must boot using a Flattened Device Tree in order to use these
+	  platforms. The traditional (ATAGs) boot method is not usable on
+	  these boards with this option.
+

Because of the way these options are renamed and the backwards dependency of CONFIG_SMP in arch/arm/Kconfig, it now seems to be impossible to build an SMP kernel with this series.

I will propose a patch similar to HAVE_L2X0_L2CC to see if this dependency can be factorised, but in the meantime, I suggest to fix the dependencies in arch/arm/Kconfig.

Cheers
---Dave

author
#18 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

Quoted 3 lines · Dave Martin

I will propose a patch similar to HAVE_L2X0_L2CC to see if this dependency can be factorised, but in the meantime, I suggest to fix the dependencies in arch/arm/Kconfig.

Sure, will do.

Cheers!

Pawel

#19 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

In reply to Pawel Moll

On Tue, Dec 06, 2011 at 03:43:48PM +0000, Pawel Moll wrote:

[...]

Quoted 34 lines
arch/arm/mach-vexpress/Kconfig +15 -5
index 56a61fb..c1cd08d 100644
@@ -1,13 +1,23 @@
 menu "Versatile Express platform type"
 	depends on ARCH_VEXPRESS
 
-config ARCH_VEXPRESS_CA9X4
-	bool "Versatile Express Cortex-A9x4 tile"
-	select CPU_V7
-	select ARM_GIC
+config ARCH_VEXPRESS_CORTEX_A5_A9
+	bool
 	select ARM_ERRATA_720789
 	select ARM_ERRATA_751472
-	select ARM_ERRATA_753970
+	select ARM_GIC
+	select CPU_V7
+	select HAVE_L2X0_L2CC
+	select PL310_ERRATA_753970 if CACHE_PL310
+	help
+	  Provides common dependencies for Versatile Express platforms
+	  based on Cortex-A5 and Cortex-A9 processors. In order to
+	  build a working kernel, you must also enable relevant core
+	  tile support or Flattened Device Tree based support options.
+
+config ARCH_VEXPRESS_CA9X4
+	bool "Versatile Express Cortex-A9x4 tile"
+	select ARCH_VEXPRESS_CORTEX_A5_A9
 
 config ARCH_VEXPRESS_DT
 	bool "Device Tree support for Versatile Express platforms"

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_DT · line 32

Quoted 2 lines
arch/arm/mach-vexpress/Kconfig +0 -0
@@ -21,4 +31,23 @@ config ARCH_VEXPRESS_DT
 	  If your bootloader supports Flattened Device Tree based booting,
 	  say Y here.

Oh, we should select HAVE_PATA_PLATFORM in here somewhere too. But that's not critical for this series.

Cheers
---Dave

author
#20 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

Quoted 2 lines · Dave Martin

Oh, we should select HAVE_PATA_PLATFORM in here somewhere too. But that's not critical for this series.

It's already selected in "arch/arm/Kconfig":

config ARCH_VEXPRESS
bool "ARM Ltd. Versatile Express family"
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARM_AMBA
select ARM_TIMER_SP804
select CLKDEV_LOOKUP
select HAVE_MACH_CLKDEV
select GENERIC_CLOCKEVENTS
select HAVE_CLK
select HAVE_PATA_PLATFORM
select ICST
select PLAT_VERSATILE
select PLAT_VERSATILE_CLCD
help
This enables support for the ARM Ltd Versatile Express boards.

Cheers!

Pawel

#21 lore raw

PATCH v4 5/6 ARM: vexpress: DT-based support for Cortex-A5 and Cortex-A9 based tiles

Quoted 6 lines · Pawel Moll
Quoted 2 lines · Dave Martin

Oh, we should select HAVE_PATA_PLATFORM in here somewhere too. But that's not critical for this series.

It's already selected in "arch/arm/Kconfig":

Quoted 15 lines

config ARCH_VEXPRESS
bool "ARM Ltd. Versatile Express family"
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARM_AMBA
select ARM_TIMER_SP804
select CLKDEV_LOOKUP
select HAVE_MACH_CLKDEV
select GENERIC_CLOCKEVENTS
select HAVE_CLK
select HAVE_PATA_PLATFORM
select ICST
select PLAT_VERSATILE
select PLAT_VERSATILE_CLCD
help
This enables support for the ARM Ltd Versatile Express boards.

Oh, OK. I was looking in mach-vexpress/Kconfig instead ...

Cheers
---Dave

author
#22 lore raw

PATCH v4 6/6 ARM: vexpress: DT-based support for Cortex-A7 and Cortex-A15 based tiles

In reply to Pawel Moll

This patch adds Flattened Device Trees based support for ARM Ltd. Versatile Express platforms based on Cortex-A7 and Cortex-A15 processors.

---
 arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts |  138 +++++++++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig              |   19 ++++
 arch/arm/mach-vexpress/Makefile             |    1 +
 arch/arm/mach-vexpress/Makefile.boot        |    1 +
 arch/arm/mach-vexpress/dt-ca7_ca15.c        |   95 ++++++++++++++++++
 arch/arm/mach-vexpress/include/mach/irqs.h  |    2 +-
 6 files changed, 255 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
 create mode 100644 arch/arm/mach-vexpress/dt-ca7_ca15.c
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts new file +138 -0
new file mode 100644
index 0000000..b19bb81
@@ -0,0 +1,138 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * CoreTile Express A15x2 (version with Test Chip 1)
+ * Cortex-A15 MPCore (V2P-CA15)
+ *
+ * HBI-0237A
+ */
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA15";
+	arm,hbi = <0x237>;
+	compatible = "arm,vexpress-v2p-ca15-tc1", "arm,vexpress-v2p-ca15", "arm,vexpress-cortex_a15";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &v2m_serial0;
+		serial1 = &v2m_serial1;
+		serial2 = &v2m_serial2;
+		serial3 = &v2m_serial3;
+		i2c0 = &v2m_i2c_dvi;
+		i2c1 = &v2m_i2c_pcie;
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>;
+	};
+
+	hdlcd at 2b000000 {
+		compatible = "arm,hdlcd";
+		reg = <0x2b000000 0x1000>;
+		interrupts = <0 85 4>;
+	};
+
+	memory-controller at 2b0a0000 {
+		compatible = "arm,pl341", "arm,primecell";
+		reg = <0x2b0a0000 0x1000>;
+	};
+
+	wdt at 2b060000 {
+		compatible = "arm,sp805", "arm,primecell";
+		reg = <0x2b060000 0x1000>;
+		interrupts = <98>;
+	};
+
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0x2c001000 0x1000>,
+		      <0x2c002000 0x100>;
+	};
+
+	memory-controller at 7ffd0000 {
+		compatible = "arm,pl354", "arm,primecell";
+		reg = <0x7ffd0000 0x1000>;
+		interrupts = <0 86 4>,
+			     <0 87 4>;
+	};
+
+	dma at 7ffb0000 {
+		compatible = "arm,pl330", "arm,primecell";
+		reg = <0x7ffb0000 0x1000>;
+		interrupts = <0 92 4>,
+			     <0 88 4>,
+			     <0 89 4>,
+			     <0 90 4>,
+			     <0 91 4>;
+	};
+
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupts = <0 68 4>,
+			     <0 69 4>;
+	};
+
+	motherboard {
+		ranges = <0 0 0x08000000 0x04000000>,
+			 <1 0 0x14000000 0x04000000>,
+			 <2 0 0x18000000 0x04000000>,
+			 <3 0 0x1c000000 0x04000000>,
+			 <4 0 0x0c000000 0x04000000>,
+			 <5 0 0x10000000 0x04000000>;
+
+		interrupt-map-mask = <0 0 63>;
+		interrupt-map = <0 0  0 &gic 0  0 4>,
+				<0 0  1 &gic 0  1 4>,
+				<0 0  2 &gic 0  2 4>,
+				<0 0  3 &gic 0  3 4>,
+				<0 0  4 &gic 0  4 4>,
+				<0 0  5 &gic 0  5 4>,
+				<0 0  6 &gic 0  6 4>,
+				<0 0  7 &gic 0  7 4>,
+				<0 0  8 &gic 0  8 4>,
+				<0 0  9 &gic 0  9 4>,
+				<0 0 10 &gic 0 10 4>,
+				<0 0 11 &gic 0 11 4>,
+				<0 0 12 &gic 0 12 4>,
+				<0 0 13 &gic 0 13 4>,
+				<0 0 14 &gic 0 14 4>,
+				<0 0 15 &gic 0 15 4>,
+				<0 0 16 &gic 0 16 4>,
+				<0 0 17 &gic 0 17 4>,
+				<0 0 18 &gic 0 18 4>,
+				<0 0 19 &gic 0 19 4>,
+				<0 0 20 &gic 0 20 4>,
+				<0 0 21 &gic 0 21 4>,
+				<0 0 22 &gic 0 22 4>,
+				<0 0 23 &gic 0 23 4>,
+				<0 0 24 &gic 0 24 4>,
+				<0 0 25 &gic 0 25 4>,
+				<0 0 26 &gic 0 26 4>,
+				<0 0 27 &gic 0 27 4>,
+				<0 0 28 &gic 0 28 4>,
+				<0 0 29 &gic 0 29 4>,
+				<0 0 30 &gic 0 30 4>,
+				<0 0 31 &gic 0 31 4>,
+				<0 0 32 &gic 0 32 4>,
+				<0 0 33 &gic 0 33 4>,
+				<0 0 34 &gic 0 34 4>,
+				<0 0 35 &gic 0 35 4>,
+				<0 0 36 &gic 0 36 4>,
+				<0 0 37 &gic 0 37 4>,
+				<0 0 38 &gic 0 38 4>,
+				<0 0 39 &gic 0 39 4>,
+				<0 0 40 &gic 0 40 4>,
+				<0 0 41 &gic 0 41 4>,
+				<0 0 42 &gic 0 42 4>;
+	};
+};
+
+/include/ "vexpress-v2m-rs1.dtsi"
arch/arm/mach-vexpress/Kconfig +19 -0
index c1cd08d..e73c780 100644
@@ -50,4 +50,23 @@ config ARCH_VEXPRESS_DT_CORTEX_A5_A9
 	  platforms. The traditional (ATAGs) boot method is not usable on
 	  these boards with this option.
 
+config ARCH_VEXPRESS_DT_CORTEX_A7_A15
+	bool "Support for tiles based on Cortex-A7 and Cortex-A15 processors"
+	depends on ARCH_VEXPRESS_DT
+	select ARM_GIC
+	select CPU_V7
+	help
+	  This option enables support for systems using Cortex-A5 and Cortex-A9
+	  ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
+	  for example:
+
+	  - CoreTile Express A15x2 (V2P-CA15)
+	  - LogicTile Express 13MG (V2F-2XV6) with A15 SMM (Soft Macrocell Model)
+	  - LogicTile Express 13MG (V2F-2XV6) with A7 SMM (Soft Macrocell Model)
+	  - VE Cortex-A15 RTSM (Model)
+
+	  You must boot using a Flattened Device Tree in order to use these
+	  platforms. The traditional (ATAGs) boot method is not usable on
+	  these boards with this option.
+
 endmenu
arch/arm/mach-vexpress/Makefile +1 -0
index 322e42d..70a5692 100644
@@ -5,5 +5,6 @@
 obj-y					:= v2m.o
 obj-$(CONFIG_ARCH_VEXPRESS_CA9X4)	+= ct-ca9x4.o
 obj-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A5_A9)	+= dt-ca5_ca9.o
+obj-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A7_A15)	+= dt-ca7_ca15.o
 obj-$(CONFIG_SMP)			+= platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
arch/arm/mach-vexpress/Makefile.boot +1 -0
index f0b0e60..376403c 100644
@@ -6,3 +6,4 @@ initrd_phys-y	:= 0x60800000
 
 dtb-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A5_A9)	+= vexpress-v2p-ca5s.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A5_A9)	+= vexpress-v2p-ca9.dtb
+dtb-$(CONFIG_ARCH_VEXPRESS_DT_CORTEX_A7_A15)	+= vexpress-v2p-ca15-tc1.dtb
arch/arm/mach-vexpress/dt-ca7_ca15.c new file +95 -0

95 lines not on this page · raw message

arch/arm/mach-vexpress/include/mach/irqs.h +1 -1
index 7054cbf..4b10ee7 100644
@@ -1,4 +1,4 @@
 #define IRQ_LOCALTIMER		29
 #define IRQ_LOCALWDOG		30
 
-#define NR_IRQS	128
+#define NR_IRQS	256
Signature · 1 line
1.6.3.3