diff options
author | Mattias Wallin <mattias.wallin@stericsson.com> | 2010-12-02 10:20:42 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@stericsson.com> | 2010-12-08 07:14:13 -0500 |
commit | fcbd458e95316fe5031f1b8eaf5e66ce8f3c3146 (patch) | |
tree | 504699aded7b00e11de6019af68381fcdf0beecf /arch | |
parent | fbf1eadf950da1f5f5ed2e454d2f191f90fe1ebe (diff) |
ARM: ux500: prcmu db8500 v2 support
This patch adds support for db8500 chip version 2.
The TCDM memory address of the PRCMU is changed and
dynamic detection of that is added.
Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ux500/cpu-db8500.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-ux500/cpu.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/db8500-regs.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/prcmu.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-ux500/prcmu.c | 25 |
5 files changed, 37 insertions, 12 deletions
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 5966f353890f..b78970c08ebc 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -40,7 +40,6 @@ static struct platform_device *platform_devs[] __initdata = { | |||
40 | /* minimum static i/o mapping required to boot U8500 platforms */ | 40 | /* minimum static i/o mapping required to boot U8500 platforms */ |
41 | static struct map_desc u8500_io_desc[] __initdata = { | 41 | static struct map_desc u8500_io_desc[] __initdata = { |
42 | __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), | 42 | __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), |
43 | __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE, SZ_4K), | ||
44 | __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), | 43 | __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), |
45 | __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), | 44 | __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), |
46 | __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K), | 45 | __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K), |
@@ -48,13 +47,18 @@ static struct map_desc u8500_io_desc[] __initdata = { | |||
48 | __MEM_DEV_DESC(U8500_BOOT_ROM_BASE, SZ_1M), | 47 | __MEM_DEV_DESC(U8500_BOOT_ROM_BASE, SZ_1M), |
49 | }; | 48 | }; |
50 | 49 | ||
51 | static struct map_desc u8500ed_io_desc[] __initdata = { | 50 | static struct map_desc u8500_ed_io_desc[] __initdata = { |
52 | __IO_DEV_DESC(U8500_MTU0_BASE_ED, SZ_4K), | 51 | __IO_DEV_DESC(U8500_MTU0_BASE_ED, SZ_4K), |
53 | __IO_DEV_DESC(U8500_CLKRST7_BASE_ED, SZ_8K), | 52 | __IO_DEV_DESC(U8500_CLKRST7_BASE_ED, SZ_8K), |
54 | }; | 53 | }; |
55 | 54 | ||
56 | static struct map_desc u8500v1_io_desc[] __initdata = { | 55 | static struct map_desc u8500_v1_io_desc[] __initdata = { |
57 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), | 56 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), |
57 | __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE_V1, SZ_4K), | ||
58 | }; | ||
59 | |||
60 | static struct map_desc u8500_v2_io_desc[] __initdata = { | ||
61 | __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE, SZ_4K), | ||
58 | }; | 62 | }; |
59 | 63 | ||
60 | /* | 64 | /* |
@@ -127,9 +131,11 @@ void __init u8500_map_io(void) | |||
127 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); | 131 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); |
128 | 132 | ||
129 | if (cpu_is_u8500ed()) | 133 | if (cpu_is_u8500ed()) |
130 | iotable_init(u8500ed_io_desc, ARRAY_SIZE(u8500ed_io_desc)); | 134 | iotable_init(u8500_ed_io_desc, ARRAY_SIZE(u8500_ed_io_desc)); |
131 | else | 135 | else if (cpu_is_u8500v1()) |
132 | iotable_init(u8500v1_io_desc, ARRAY_SIZE(u8500v1_io_desc)); | 136 | iotable_init(u8500_v1_io_desc, ARRAY_SIZE(u8500_v1_io_desc)); |
137 | else if (cpu_is_u8500v2()) | ||
138 | iotable_init(u8500_v2_io_desc, ARRAY_SIZE(u8500_v2_io_desc)); | ||
133 | 139 | ||
134 | /* Read out the ASIC ID as early as we can */ | 140 | /* Read out the ASIC ID as early as we can */ |
135 | get_db8500_asic_id(); | 141 | get_db8500_asic_id(); |
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index 2bc0efbac584..46c372fb806d 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
20 | #include <mach/setup.h> | 20 | #include <mach/setup.h> |
21 | #include <mach/devices.h> | 21 | #include <mach/devices.h> |
22 | #include <mach/prcmu.h> | ||
22 | 23 | ||
23 | #include "clock.h" | 24 | #include "clock.h" |
24 | 25 | ||
@@ -58,6 +59,7 @@ void __init ux500_init_irq(void) | |||
58 | * Init clocks here so that they are available for system timer | 59 | * Init clocks here so that they are available for system timer |
59 | * initialization. | 60 | * initialization. |
60 | */ | 61 | */ |
62 | prcmu_early_init(); | ||
61 | clk_init(); | 63 | clk_init(); |
62 | } | 64 | } |
63 | 65 | ||
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h index f07d0986409d..0fefb34c11e4 100644 --- a/arch/arm/mach-ux500/include/mach/db8500-regs.h +++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h | |||
@@ -92,7 +92,8 @@ | |||
92 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) | 92 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) |
93 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) | 93 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) |
94 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) | 94 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) |
95 | #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x0f000) | 95 | #define U8500_PRCMU_TCDM_BASE_V1 (U8500_PER4_BASE + 0x0f000) |
96 | #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) | ||
96 | 97 | ||
97 | /* per3 base addresses */ | 98 | /* per3 base addresses */ |
98 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) | 99 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) |
diff --git a/arch/arm/mach-ux500/include/mach/prcmu.h b/arch/arm/mach-ux500/include/mach/prcmu.h index 549843ff6dbe..daa9d3ab7e0c 100644 --- a/arch/arm/mach-ux500/include/mach/prcmu.h +++ b/arch/arm/mach-ux500/include/mach/prcmu.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #ifndef __MACH_PRCMU_H | 9 | #ifndef __MACH_PRCMU_H |
10 | #define __MACH_PRCMU_H | 10 | #define __MACH_PRCMU_H |
11 | 11 | ||
12 | void __init prcmu_early_init(void); | ||
12 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | 13 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); |
13 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | 14 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); |
14 | 15 | ||
diff --git a/arch/arm/mach-ux500/prcmu.c b/arch/arm/mach-ux500/prcmu.c index 293274d1342a..3ba3e3298b89 100644 --- a/arch/arm/mach-ux500/prcmu.c +++ b/arch/arm/mach-ux500/prcmu.c | |||
@@ -20,10 +20,11 @@ | |||
20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
21 | #include <mach/prcmu-regs.h> | 21 | #include <mach/prcmu-regs.h> |
22 | 22 | ||
23 | #define PRCMU_TCDM_BASE __io_address(U8500_PRCMU_TCDM_BASE) | 23 | /* Global var to runtime determine TCDM base for v2 or v1 */ |
24 | static __iomem void *tcdm_base; | ||
24 | 25 | ||
25 | #define REQ_MB5 (PRCMU_TCDM_BASE + 0xE44) | 26 | #define REQ_MB5 (tcdm_base + 0xE44) |
26 | #define ACK_MB5 (PRCMU_TCDM_BASE + 0xDF4) | 27 | #define ACK_MB5 (tcdm_base + 0xDF4) |
27 | 28 | ||
28 | #define REQ_MB5_I2C_SLAVE_OP (REQ_MB5) | 29 | #define REQ_MB5_I2C_SLAVE_OP (REQ_MB5) |
29 | #define REQ_MB5_I2C_HW_BITS (REQ_MB5 + 1) | 30 | #define REQ_MB5_I2C_HW_BITS (REQ_MB5 + 1) |
@@ -33,8 +34,10 @@ | |||
33 | #define ACK_MB5_I2C_STATUS (ACK_MB5 + 1) | 34 | #define ACK_MB5_I2C_STATUS (ACK_MB5 + 1) |
34 | #define ACK_MB5_I2C_VAL (ACK_MB5 + 3) | 35 | #define ACK_MB5_I2C_VAL (ACK_MB5 + 3) |
35 | 36 | ||
36 | #define I2C_WRITE(slave) ((slave) << 1) | 37 | #define I2C_WRITE(slave) \ |
37 | #define I2C_READ(slave) (((slave) << 1) | BIT(0)) | 38 | (((slave) << 1) | (cpu_is_u8500v2() ? BIT(6) : 0)) |
39 | #define I2C_READ(slave) \ | ||
40 | (((slave) << 1) | (cpu_is_u8500v2() ? BIT(6) : 0) | BIT(0)) | ||
38 | #define I2C_STOP_EN BIT(3) | 41 | #define I2C_STOP_EN BIT(3) |
39 | 42 | ||
40 | enum ack_mb5_status { | 43 | enum ack_mb5_status { |
@@ -217,6 +220,18 @@ static irqreturn_t prcmu_irq_handler(int irq, void *data) | |||
217 | return IRQ_HANDLED; | 220 | return IRQ_HANDLED; |
218 | } | 221 | } |
219 | 222 | ||
223 | void __init prcmu_early_init(void) | ||
224 | { | ||
225 | if (cpu_is_u8500v11() || cpu_is_u8500ed()) { | ||
226 | tcdm_base = __io_address(U8500_PRCMU_TCDM_BASE_V1); | ||
227 | } else if (cpu_is_u8500v2()) { | ||
228 | tcdm_base = __io_address(U8500_PRCMU_TCDM_BASE); | ||
229 | } else { | ||
230 | pr_err("prcmu: Unsupported chip version\n"); | ||
231 | BUG(); | ||
232 | } | ||
233 | } | ||
234 | |||
220 | static int __init prcmu_init(void) | 235 | static int __init prcmu_init(void) |
221 | { | 236 | { |
222 | mutex_init(&mb5_transfer.lock); | 237 | mutex_init(&mb5_transfer.lock); |