diff options
author | Pawel Moll <pawel.moll@arm.com> | 2011-12-09 13:47:39 -0500 |
---|---|---|
committer | Pawel Moll <pawel.moll@arm.com> | 2012-02-24 04:18:20 -0500 |
commit | 6a3719562b69ffdfc36e829e19b35fda6ab19ca6 (patch) | |
tree | 0eb75a57e5f7b54d51d14c315f15cbc1433e2ee7 /arch/arm/mach-vexpress | |
parent | 8deed1786a6479d0ccda51226582920ab1d6976c (diff) |
ARM: vexpress: Motherboard RS1 memory map support
This patch adds support for RS1 memory map based Versatile Express
motherboard.
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Diffstat (limited to 'arch/arm/mach-vexpress')
-rw-r--r-- | arch/arm/mach-vexpress/include/mach/debug-macro.S | 30 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/include/mach/uncompress.h | 22 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/v2m.c | 62 |
3 files changed, 108 insertions, 6 deletions
diff --git a/arch/arm/mach-vexpress/include/mach/debug-macro.S b/arch/arm/mach-vexpress/include/mach/debug-macro.S index fd9e6c7ea49f..fa8224794e0b 100644 --- a/arch/arm/mach-vexpress/include/mach/debug-macro.S +++ b/arch/arm/mach-vexpress/include/mach/debug-macro.S | |||
@@ -10,12 +10,34 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define DEBUG_LL_UART_OFFSET 0x00009000 | 13 | #define DEBUG_LL_PHYS_BASE 0x10000000 |
14 | #define DEBUG_LL_UART_OFFSET 0x00009000 | ||
15 | |||
16 | #define DEBUG_LL_PHYS_BASE_RS1 0x1c000000 | ||
17 | #define DEBUG_LL_UART_OFFSET_RS1 0x00090000 | ||
18 | |||
19 | #define DEBUG_LL_VIRT_BASE 0xf8000000 | ||
14 | 20 | ||
15 | .macro addruart,rp,rv,tmp | 21 | .macro addruart,rp,rv,tmp |
16 | mov \rp, #DEBUG_LL_UART_OFFSET | 22 | |
17 | orr \rv, \rp, #0xf8000000 @ virtual base | 23 | @ Make an educated guess regarding the memory map: |
18 | orr \rp, \rp, #0x10000000 @ physical base | 24 | @ - the original A9 core tile, which has MPCore peripherals |
25 | @ located at 0x1e000000, should use UART at 0x10009000 | ||
26 | @ - all other (RS1 complaint) tiles use UART mapped | ||
27 | @ at 0x1c090000 | ||
28 | mrc p15, 4, \tmp, c15, c0, 0 | ||
29 | cmp \tmp, #0x1e000000 | ||
30 | |||
31 | @ Original memory map | ||
32 | moveq \rp, #DEBUG_LL_UART_OFFSET | ||
33 | orreq \rv, \rp, #DEBUG_LL_VIRT_BASE | ||
34 | orreq \rp, \rp, #DEBUG_LL_PHYS_BASE | ||
35 | |||
36 | @ RS1 memory map | ||
37 | movne \rp, #DEBUG_LL_UART_OFFSET_RS1 | ||
38 | orrne \rv, \rp, #DEBUG_LL_VIRT_BASE | ||
39 | orrne \rp, \rp, #DEBUG_LL_PHYS_BASE_RS1 | ||
40 | |||
19 | .endm | 41 | .endm |
20 | 42 | ||
21 | #include <asm/hardware/debug-pl01x.S> | 43 | #include <asm/hardware/debug-pl01x.S> |
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h index 7972c5748d0e..7dab5596b868 100644 --- a/arch/arm/mach-vexpress/include/mach/uncompress.h +++ b/arch/arm/mach-vexpress/include/mach/uncompress.h | |||
@@ -22,7 +22,27 @@ | |||
22 | #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) | 22 | #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) |
23 | #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) | 23 | #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) |
24 | 24 | ||
25 | #define get_uart_base() (0x10000000 + 0x00009000) | 25 | #define UART_BASE 0x10009000 |
26 | #define UART_BASE_RS1 0x1c090000 | ||
27 | |||
28 | static unsigned long get_uart_base(void) | ||
29 | { | ||
30 | unsigned long mpcore_periph; | ||
31 | |||
32 | /* | ||
33 | * Make an educated guess regarding the memory map: | ||
34 | * - the original A9 core tile, which has MPCore peripherals | ||
35 | * located at 0x1e000000, should use UART at 0x10009000 | ||
36 | * - all other (RS1 complaint) tiles use UART mapped | ||
37 | * at 0x1c090000 | ||
38 | */ | ||
39 | asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (mpcore_periph)); | ||
40 | |||
41 | if (mpcore_periph == 0x1e000000) | ||
42 | return UART_BASE; | ||
43 | else | ||
44 | return UART_BASE_RS1; | ||
45 | } | ||
26 | 46 | ||
27 | /* | 47 | /* |
28 | * This does not append a newline | 48 | * This does not append a newline |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index dbf055103000..9cab5417e5df 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -486,9 +486,36 @@ MACHINE_END | |||
486 | 486 | ||
487 | #if defined(CONFIG_ARCH_VEXPRESS_DT) | 487 | #if defined(CONFIG_ARCH_VEXPRESS_DT) |
488 | 488 | ||
489 | static struct map_desc v2m_rs1_io_desc __initdata = { | ||
490 | .virtual = V2M_PERIPH, | ||
491 | .pfn = __phys_to_pfn(0x1c000000), | ||
492 | .length = SZ_2M, | ||
493 | .type = MT_DEVICE, | ||
494 | }; | ||
495 | |||
496 | static int __init v2m_dt_scan_memory_map(unsigned long node, const char *uname, | ||
497 | int depth, void *data) | ||
498 | { | ||
499 | const char **map = data; | ||
500 | |||
501 | if (strcmp(uname, "motherboard") != 0) | ||
502 | return 0; | ||
503 | |||
504 | *map = of_get_flat_dt_prop(node, "arm,v2m-memory-map", NULL); | ||
505 | |||
506 | return 1; | ||
507 | } | ||
508 | |||
489 | void __init v2m_dt_map_io(void) | 509 | void __init v2m_dt_map_io(void) |
490 | { | 510 | { |
491 | iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); | 511 | const char *map = NULL; |
512 | |||
513 | of_scan_flat_dt(v2m_dt_scan_memory_map, &map); | ||
514 | |||
515 | if (map && strcmp(map, "rs1") == 0) | ||
516 | iotable_init(&v2m_rs1_io_desc, 1); | ||
517 | else | ||
518 | iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); | ||
492 | 519 | ||
493 | #if defined(CONFIG_SMP) | 520 | #if defined(CONFIG_SMP) |
494 | vexpress_dt_smp_map_io(); | 521 | vexpress_dt_smp_map_io(); |
@@ -535,6 +562,35 @@ static struct clk_lookup v2m_dt_lookups[] = { | |||
535 | .dev_id = "1001f000.clcd", | 562 | .dev_id = "1001f000.clcd", |
536 | .clk = &osc1_clk, | 563 | .clk = &osc1_clk, |
537 | }, | 564 | }, |
565 | /* RS1 memory map */ | ||
566 | { /* PL180 MMCI */ | ||
567 | .dev_id = "mb:mmci", /* 1c050000.mmci */ | ||
568 | .clk = &osc2_clk, | ||
569 | }, { /* PL050 KMI0 */ | ||
570 | .dev_id = "1c060000.kmi", | ||
571 | .clk = &osc2_clk, | ||
572 | }, { /* PL050 KMI1 */ | ||
573 | .dev_id = "1c070000.kmi", | ||
574 | .clk = &osc2_clk, | ||
575 | }, { /* PL011 UART0 */ | ||
576 | .dev_id = "1c090000.uart", | ||
577 | .clk = &osc2_clk, | ||
578 | }, { /* PL011 UART1 */ | ||
579 | .dev_id = "1c0a0000.uart", | ||
580 | .clk = &osc2_clk, | ||
581 | }, { /* PL011 UART2 */ | ||
582 | .dev_id = "1c0b0000.uart", | ||
583 | .clk = &osc2_clk, | ||
584 | }, { /* PL011 UART3 */ | ||
585 | .dev_id = "1c0c0000.uart", | ||
586 | .clk = &osc2_clk, | ||
587 | }, { /* SP805 WDT */ | ||
588 | .dev_id = "1c0f0000.wdt", | ||
589 | .clk = &v2m_ref_clk, | ||
590 | }, { /* PL111 CLCD */ | ||
591 | .dev_id = "1c1f0000.clcd", | ||
592 | .clk = &osc1_clk, | ||
593 | }, | ||
538 | }; | 594 | }; |
539 | 595 | ||
540 | void __init v2m_dt_init_early(void) | 596 | void __init v2m_dt_init_early(void) |
@@ -597,6 +653,10 @@ static struct of_dev_auxdata v2m_dt_auxdata_lookup[] __initdata = { | |||
597 | OF_DEV_AUXDATA("arm,vexpress-flash", V2M_NOR0, "physmap-flash", | 653 | OF_DEV_AUXDATA("arm,vexpress-flash", V2M_NOR0, "physmap-flash", |
598 | &v2m_flash_data), | 654 | &v2m_flash_data), |
599 | OF_DEV_AUXDATA("arm,primecell", V2M_MMCI, "mb:mmci", &v2m_mmci_data), | 655 | OF_DEV_AUXDATA("arm,primecell", V2M_MMCI, "mb:mmci", &v2m_mmci_data), |
656 | /* RS1 memory map */ | ||
657 | OF_DEV_AUXDATA("arm,vexpress-flash", 0x08000000, "physmap-flash", | ||
658 | &v2m_flash_data), | ||
659 | OF_DEV_AUXDATA("arm,primecell", 0x1c050000, "mb:mmci", &v2m_mmci_data), | ||
600 | {} | 660 | {} |
601 | }; | 661 | }; |
602 | 662 | ||