diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm/include/debug/vexpress.S | 11 | ||||
| -rw-r--r-- | arch/arm/mach-cns3xxx/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/board-dm644x-evm.c | 5 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/devices-tnetv107x.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/include/mach/serial.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/include/mach/uncompress.h | 6 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/common.h | 4 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-headsmp.S | 38 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-mpuss-lowpower.c | 9 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-smp.c | 41 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap4-common.c | 42 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm.h | 9 |
12 files changed, 158 insertions, 12 deletions
diff --git a/arch/arm/include/debug/vexpress.S b/arch/arm/include/debug/vexpress.S index 9f509f55d078..dc8e882a6257 100644 --- a/arch/arm/include/debug/vexpress.S +++ b/arch/arm/include/debug/vexpress.S | |||
| @@ -21,14 +21,17 @@ | |||
| 21 | #if defined(CONFIG_DEBUG_VEXPRESS_UART0_DETECT) | 21 | #if defined(CONFIG_DEBUG_VEXPRESS_UART0_DETECT) |
| 22 | 22 | ||
| 23 | .macro addruart,rp,rv,tmp | 23 | .macro addruart,rp,rv,tmp |
| 24 | .arch armv7-a | ||
| 24 | 25 | ||
| 25 | @ Make an educated guess regarding the memory map: | 26 | @ Make an educated guess regarding the memory map: |
| 26 | @ - the original A9 core tile, which has MPCore peripherals | 27 | @ - the original A9 core tile (based on ARM Cortex-A9 r0p1) |
| 27 | @ located at 0x1e000000, should use UART at 0x10009000 | 28 | @ should use UART at 0x10009000 |
| 28 | @ - all other (RS1 complaint) tiles use UART mapped | 29 | @ - all other (RS1 complaint) tiles use UART mapped |
| 29 | @ at 0x1c090000 | 30 | @ at 0x1c090000 |
| 30 | mrc p15, 4, \tmp, c15, c0, 0 | 31 | mrc p15, 0, \rp, c0, c0, 0 |
| 31 | cmp \tmp, #0x1e000000 | 32 | movw \rv, #0xc091 |
| 33 | movt \rv, #0x410f | ||
| 34 | cmp \rp, \rv | ||
| 32 | 35 | ||
| 33 | @ Original memory map | 36 | @ Original memory map |
| 34 | moveq \rp, #DEBUG_LL_UART_OFFSET | 37 | moveq \rp, #DEBUG_LL_UART_OFFSET |
diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig index 29b13f249aa9..9ebfcc46feb1 100644 --- a/arch/arm/mach-cns3xxx/Kconfig +++ b/arch/arm/mach-cns3xxx/Kconfig | |||
| @@ -3,7 +3,6 @@ menu "CNS3XXX platform type" | |||
| 3 | 3 | ||
| 4 | config MACH_CNS3420VB | 4 | config MACH_CNS3420VB |
| 5 | bool "Support for CNS3420 Validation Board" | 5 | bool "Support for CNS3420 Validation Board" |
| 6 | select MIGHT_HAVE_PCI | ||
| 7 | help | 6 | help |
| 8 | Include support for the Cavium Networks CNS3420 MPCore Platform | 7 | Include support for the Cavium Networks CNS3420 MPCore Platform |
| 9 | Baseboard. | 8 | Baseboard. |
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index f22572cee49d..f8a99ee6bffc 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
| @@ -519,13 +519,11 @@ static int dm6444evm_msp430_get_pins(void) | |||
| 519 | char buf[4]; | 519 | char buf[4]; |
| 520 | struct i2c_msg msg[2] = { | 520 | struct i2c_msg msg[2] = { |
| 521 | { | 521 | { |
| 522 | .addr = dm6446evm_msp->addr, | ||
| 523 | .flags = 0, | 522 | .flags = 0, |
| 524 | .len = 2, | 523 | .len = 2, |
| 525 | .buf = (void __force *)txbuf, | 524 | .buf = (void __force *)txbuf, |
| 526 | }, | 525 | }, |
| 527 | { | 526 | { |
| 528 | .addr = dm6446evm_msp->addr, | ||
| 529 | .flags = I2C_M_RD, | 527 | .flags = I2C_M_RD, |
| 530 | .len = 4, | 528 | .len = 4, |
| 531 | .buf = buf, | 529 | .buf = buf, |
| @@ -536,6 +534,9 @@ static int dm6444evm_msp430_get_pins(void) | |||
| 536 | if (!dm6446evm_msp) | 534 | if (!dm6446evm_msp) |
| 537 | return -ENXIO; | 535 | return -ENXIO; |
| 538 | 536 | ||
| 537 | msg[0].addr = dm6446evm_msp->addr; | ||
| 538 | msg[1].addr = dm6446evm_msp->addr; | ||
| 539 | |||
| 539 | /* Command 4 == get input state, returns port 2 and port3 data | 540 | /* Command 4 == get input state, returns port 2 and port3 data |
| 540 | * S Addr W [A] len=2 [A] cmd=4 [A] | 541 | * S Addr W [A] len=2 [A] cmd=4 [A] |
| 541 | * RS Addr R [A] [len=4] A [cmd=4] A [port2] A [port3] N P | 542 | * RS Addr R [A] [len=4] A [cmd=4] A [port2] A [port3] N P |
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c index 29b17f7d3a5f..773ab07a71a0 100644 --- a/arch/arm/mach-davinci/devices-tnetv107x.c +++ b/arch/arm/mach-davinci/devices-tnetv107x.c | |||
| @@ -374,7 +374,7 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) | |||
| 374 | * complete sample conversion in time. | 374 | * complete sample conversion in time. |
| 375 | */ | 375 | */ |
| 376 | tsc_clk = clk_get(NULL, "sys_tsc_clk"); | 376 | tsc_clk = clk_get(NULL, "sys_tsc_clk"); |
| 377 | if (tsc_clk) { | 377 | if (!IS_ERR(tsc_clk)) { |
| 378 | error = clk_set_rate(tsc_clk, 5000000); | 378 | error = clk_set_rate(tsc_clk, 5000000); |
| 379 | WARN_ON(error < 0); | 379 | WARN_ON(error < 0); |
| 380 | clk_put(tsc_clk); | 380 | clk_put(tsc_clk); |
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index 46b3cd11c3c2..86a01fa6d3fe 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | #ifndef __ASSEMBLY__ | 39 | #ifndef __ASSEMBLY__ |
| 40 | struct davinci_uart_config { | 40 | struct davinci_uart_config { |
| 41 | /* Bit field of UARTs present; bit 0 --> UART1 */ | 41 | /* Bit field of UARTs present; bit 0 --> UART0 */ |
| 42 | unsigned int enabled_uarts; | 42 | unsigned int enabled_uarts; |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index 18cfd4977155..3a0ff905a69b 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h | |||
| @@ -32,6 +32,9 @@ u32 *uart; | |||
| 32 | /* PORT_16C550A, in polled non-fifo mode */ | 32 | /* PORT_16C550A, in polled non-fifo mode */ |
| 33 | static void putc(char c) | 33 | static void putc(char c) |
| 34 | { | 34 | { |
| 35 | if (!uart) | ||
| 36 | return; | ||
| 37 | |||
| 35 | while (!(uart[UART_LSR] & UART_LSR_THRE)) | 38 | while (!(uart[UART_LSR] & UART_LSR_THRE)) |
| 36 | barrier(); | 39 | barrier(); |
| 37 | uart[UART_TX] = c; | 40 | uart[UART_TX] = c; |
| @@ -39,6 +42,9 @@ static void putc(char c) | |||
| 39 | 42 | ||
| 40 | static inline void flush(void) | 43 | static inline void flush(void) |
| 41 | { | 44 | { |
| 45 | if (!uart) | ||
| 46 | return; | ||
| 47 | |||
| 42 | while (!(uart[UART_LSR] & UART_LSR_THRE)) | 48 | while (!(uart[UART_LSR] & UART_LSR_THRE)) |
| 43 | barrier(); | 49 | barrier(); |
| 44 | } | 50 | } |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 7045e4d61ac3..d29dbaa29621 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
| @@ -275,6 +275,9 @@ static inline void __iomem *omap4_get_scu_base(void) | |||
| 275 | #endif | 275 | #endif |
| 276 | 276 | ||
| 277 | extern void __init gic_init_irq(void); | 277 | extern void __init gic_init_irq(void); |
| 278 | extern void gic_dist_disable(void); | ||
| 279 | extern bool gic_dist_disabled(void); | ||
| 280 | extern void gic_timer_retrigger(void); | ||
| 278 | extern void omap_smc1(u32 fn, u32 arg); | 281 | extern void omap_smc1(u32 fn, u32 arg); |
| 279 | extern void __iomem *omap4_get_sar_ram_base(void); | 282 | extern void __iomem *omap4_get_sar_ram_base(void); |
| 280 | extern void omap_do_wfi(void); | 283 | extern void omap_do_wfi(void); |
| @@ -282,6 +285,7 @@ extern void omap_do_wfi(void); | |||
| 282 | #ifdef CONFIG_SMP | 285 | #ifdef CONFIG_SMP |
| 283 | /* Needed for secondary core boot */ | 286 | /* Needed for secondary core boot */ |
| 284 | extern void omap_secondary_startup(void); | 287 | extern void omap_secondary_startup(void); |
| 288 | extern void omap_secondary_startup_4460(void); | ||
| 285 | extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); | 289 | extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); |
| 286 | extern void omap_auxcoreboot_addr(u32 cpu_addr); | 290 | extern void omap_auxcoreboot_addr(u32 cpu_addr); |
| 287 | extern u32 omap_read_auxcoreboot0(void); | 291 | extern u32 omap_read_auxcoreboot0(void); |
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S index 502e3135aad3..0ea09faf327b 100644 --- a/arch/arm/mach-omap2/omap-headsmp.S +++ b/arch/arm/mach-omap2/omap-headsmp.S | |||
| @@ -18,6 +18,8 @@ | |||
| 18 | #include <linux/linkage.h> | 18 | #include <linux/linkage.h> |
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | 20 | ||
| 21 | #include "omap44xx.h" | ||
| 22 | |||
| 21 | __CPUINIT | 23 | __CPUINIT |
| 22 | 24 | ||
| 23 | /* Physical address needed since MMU not enabled yet on secondary core */ | 25 | /* Physical address needed since MMU not enabled yet on secondary core */ |
| @@ -64,3 +66,39 @@ hold: ldr r12,=0x103 | |||
| 64 | b secondary_startup | 66 | b secondary_startup |
| 65 | ENDPROC(omap_secondary_startup) | 67 | ENDPROC(omap_secondary_startup) |
| 66 | 68 | ||
| 69 | ENTRY(omap_secondary_startup_4460) | ||
| 70 | hold_2: ldr r12,=0x103 | ||
| 71 | dsb | ||
| 72 | smc #0 @ read from AuxCoreBoot0 | ||
| 73 | mov r0, r0, lsr #9 | ||
| 74 | mrc p15, 0, r4, c0, c0, 5 | ||
| 75 | and r4, r4, #0x0f | ||
| 76 | cmp r0, r4 | ||
| 77 | bne hold_2 | ||
| 78 | |||
| 79 | /* | ||
| 80 | * GIC distributor control register has changed between | ||
| 81 | * CortexA9 r1pX and r2pX. The Control Register secure | ||
| 82 | * banked version is now composed of 2 bits: | ||
| 83 | * bit 0 == Secure Enable | ||
| 84 | * bit 1 == Non-Secure Enable | ||
| 85 | * The Non-Secure banked register has not changed | ||
| 86 | * Because the ROM Code is based on the r1pX GIC, the CPU1 | ||
| 87 | * GIC restoration will cause a problem to CPU0 Non-Secure SW. | ||
| 88 | * The workaround must be: | ||
| 89 | * 1) Before doing the CPU1 wakeup, CPU0 must disable | ||
| 90 | * the GIC distributor | ||
| 91 | * 2) CPU1 must re-enable the GIC distributor on | ||
| 92 | * it's wakeup path. | ||
| 93 | */ | ||
| 94 | ldr r1, =OMAP44XX_GIC_DIST_BASE | ||
| 95 | ldr r0, [r1] | ||
| 96 | orr r0, #1 | ||
| 97 | str r0, [r1] | ||
| 98 | |||
| 99 | /* | ||
| 100 | * we've been released from the wait loop,secondary_stack | ||
| 101 | * should now contain the SVC stack for this core | ||
| 102 | */ | ||
| 103 | b secondary_startup | ||
| 104 | ENDPROC(omap_secondary_startup_4460) | ||
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c index ff4e6a0e9c7c..c8bc3ad85f68 100644 --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c | |||
| @@ -67,6 +67,7 @@ struct omap4_cpu_pm_info { | |||
| 67 | void __iomem *scu_sar_addr; | 67 | void __iomem *scu_sar_addr; |
| 68 | void __iomem *wkup_sar_addr; | 68 | void __iomem *wkup_sar_addr; |
| 69 | void __iomem *l2x0_sar_addr; | 69 | void __iomem *l2x0_sar_addr; |
| 70 | void (*secondary_startup)(void); | ||
| 70 | }; | 71 | }; |
| 71 | 72 | ||
| 72 | static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info); | 73 | static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info); |
| @@ -299,6 +300,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) | |||
| 299 | int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) | 300 | int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) |
| 300 | { | 301 | { |
| 301 | unsigned int cpu_state = 0; | 302 | unsigned int cpu_state = 0; |
| 303 | struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu); | ||
| 302 | 304 | ||
| 303 | if (omap_rev() == OMAP4430_REV_ES1_0) | 305 | if (omap_rev() == OMAP4430_REV_ES1_0) |
| 304 | return -ENXIO; | 306 | return -ENXIO; |
| @@ -308,7 +310,7 @@ int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) | |||
| 308 | 310 | ||
| 309 | clear_cpu_prev_pwrst(cpu); | 311 | clear_cpu_prev_pwrst(cpu); |
| 310 | set_cpu_next_pwrst(cpu, power_state); | 312 | set_cpu_next_pwrst(cpu, power_state); |
| 311 | set_cpu_wakeup_addr(cpu, virt_to_phys(omap_secondary_startup)); | 313 | set_cpu_wakeup_addr(cpu, virt_to_phys(pm_info->secondary_startup)); |
| 312 | scu_pwrst_prepare(cpu, power_state); | 314 | scu_pwrst_prepare(cpu, power_state); |
| 313 | 315 | ||
| 314 | /* | 316 | /* |
| @@ -359,6 +361,11 @@ int __init omap4_mpuss_init(void) | |||
| 359 | pm_info->scu_sar_addr = sar_base + SCU_OFFSET1; | 361 | pm_info->scu_sar_addr = sar_base + SCU_OFFSET1; |
| 360 | pm_info->wkup_sar_addr = sar_base + CPU1_WAKEUP_NS_PA_ADDR_OFFSET; | 362 | pm_info->wkup_sar_addr = sar_base + CPU1_WAKEUP_NS_PA_ADDR_OFFSET; |
| 361 | pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1; | 363 | pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1; |
| 364 | if (cpu_is_omap446x()) | ||
| 365 | pm_info->secondary_startup = omap_secondary_startup_4460; | ||
| 366 | else | ||
| 367 | pm_info->secondary_startup = omap_secondary_startup; | ||
| 368 | |||
| 362 | pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm"); | 369 | pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm"); |
| 363 | if (!pm_info->pwrdm) { | 370 | if (!pm_info->pwrdm) { |
| 364 | pr_err("Lookup failed for CPU1 pwrdm\n"); | 371 | pr_err("Lookup failed for CPU1 pwrdm\n"); |
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 4d05fa8a4e48..cd42d921940d 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include "iomap.h" | 32 | #include "iomap.h" |
| 33 | #include "common.h" | 33 | #include "common.h" |
| 34 | #include "clockdomain.h" | 34 | #include "clockdomain.h" |
| 35 | #include "pm.h" | ||
| 35 | 36 | ||
| 36 | #define CPU_MASK 0xff0ffff0 | 37 | #define CPU_MASK 0xff0ffff0 |
| 37 | #define CPU_CORTEX_A9 0x410FC090 | 38 | #define CPU_CORTEX_A9 0x410FC090 |
| @@ -39,6 +40,8 @@ | |||
| 39 | 40 | ||
| 40 | #define OMAP5_CORE_COUNT 0x2 | 41 | #define OMAP5_CORE_COUNT 0x2 |
| 41 | 42 | ||
| 43 | u16 pm44xx_errata; | ||
| 44 | |||
| 42 | /* SCU base address */ | 45 | /* SCU base address */ |
| 43 | static void __iomem *scu_base; | 46 | static void __iomem *scu_base; |
| 44 | 47 | ||
| @@ -118,8 +121,37 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct * | |||
| 118 | * 4.3.4.2 Power States of CPU0 and CPU1 | 121 | * 4.3.4.2 Power States of CPU0 and CPU1 |
| 119 | */ | 122 | */ |
| 120 | if (booted) { | 123 | if (booted) { |
| 124 | /* | ||
| 125 | * GIC distributor control register has changed between | ||
| 126 | * CortexA9 r1pX and r2pX. The Control Register secure | ||
| 127 | * banked version is now composed of 2 bits: | ||
| 128 | * bit 0 == Secure Enable | ||
| 129 | * bit 1 == Non-Secure Enable | ||
| 130 | * The Non-Secure banked register has not changed | ||
| 131 | * Because the ROM Code is based on the r1pX GIC, the CPU1 | ||
| 132 | * GIC restoration will cause a problem to CPU0 Non-Secure SW. | ||
| 133 | * The workaround must be: | ||
| 134 | * 1) Before doing the CPU1 wakeup, CPU0 must disable | ||
| 135 | * the GIC distributor | ||
| 136 | * 2) CPU1 must re-enable the GIC distributor on | ||
| 137 | * it's wakeup path. | ||
| 138 | */ | ||
| 139 | if (IS_PM44XX_ERRATUM(PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD)) { | ||
| 140 | local_irq_disable(); | ||
| 141 | gic_dist_disable(); | ||
| 142 | } | ||
| 143 | |||
| 121 | clkdm_wakeup(cpu1_clkdm); | 144 | clkdm_wakeup(cpu1_clkdm); |
| 122 | clkdm_allow_idle(cpu1_clkdm); | 145 | clkdm_allow_idle(cpu1_clkdm); |
| 146 | |||
| 147 | if (IS_PM44XX_ERRATUM(PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD)) { | ||
| 148 | while (gic_dist_disabled()) { | ||
| 149 | udelay(1); | ||
| 150 | cpu_relax(); | ||
| 151 | } | ||
| 152 | gic_timer_retrigger(); | ||
| 153 | local_irq_enable(); | ||
| 154 | } | ||
| 123 | } else { | 155 | } else { |
| 124 | dsb_sev(); | 156 | dsb_sev(); |
| 125 | booted = true; | 157 | booted = true; |
| @@ -138,7 +170,14 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct * | |||
| 138 | 170 | ||
| 139 | static void __init wakeup_secondary(void) | 171 | static void __init wakeup_secondary(void) |
| 140 | { | 172 | { |
| 173 | void *startup_addr = omap_secondary_startup; | ||
| 141 | void __iomem *base = omap_get_wakeupgen_base(); | 174 | void __iomem *base = omap_get_wakeupgen_base(); |
| 175 | |||
| 176 | if (cpu_is_omap446x()) { | ||
| 177 | startup_addr = omap_secondary_startup_4460; | ||
| 178 | pm44xx_errata |= PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD; | ||
| 179 | } | ||
| 180 | |||
| 142 | /* | 181 | /* |
| 143 | * Write the address of secondary startup routine into the | 182 | * Write the address of secondary startup routine into the |
| 144 | * AuxCoreBoot1 where ROM code will jump and start executing | 183 | * AuxCoreBoot1 where ROM code will jump and start executing |
| @@ -146,7 +185,7 @@ static void __init wakeup_secondary(void) | |||
| 146 | * A barrier is added to ensure that write buffer is drained | 185 | * A barrier is added to ensure that write buffer is drained |
| 147 | */ | 186 | */ |
| 148 | if (omap_secure_apis_support()) | 187 | if (omap_secure_apis_support()) |
| 149 | omap_auxcoreboot_addr(virt_to_phys(omap_secondary_startup)); | 188 | omap_auxcoreboot_addr(virt_to_phys(startup_addr)); |
| 150 | else | 189 | else |
| 151 | __raw_writel(virt_to_phys(omap5_secondary_startup), | 190 | __raw_writel(virt_to_phys(omap5_secondary_startup), |
| 152 | base + OMAP_AUX_CORE_BOOT_1); | 191 | base + OMAP_AUX_CORE_BOOT_1); |
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index e1f289748c5d..6f94b4e7b18d 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
| 17 | #include <linux/irq.h> | ||
| 17 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
| 18 | #include <linux/memblock.h> | 19 | #include <linux/memblock.h> |
| 19 | #include <linux/of_irq.h> | 20 | #include <linux/of_irq.h> |
| @@ -24,6 +25,7 @@ | |||
| 24 | #include <asm/hardware/cache-l2x0.h> | 25 | #include <asm/hardware/cache-l2x0.h> |
| 25 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
| 26 | #include <asm/memblock.h> | 27 | #include <asm/memblock.h> |
| 28 | #include <asm/smp_twd.h> | ||
| 27 | 29 | ||
| 28 | #include <plat/sram.h> | 30 | #include <plat/sram.h> |
| 29 | #include <plat/omap-secure.h> | 31 | #include <plat/omap-secure.h> |
| @@ -41,6 +43,10 @@ static void __iomem *l2cache_base; | |||
| 41 | #endif | 43 | #endif |
| 42 | 44 | ||
| 43 | static void __iomem *sar_ram_base; | 45 | static void __iomem *sar_ram_base; |
| 46 | static void __iomem *gic_dist_base_addr; | ||
| 47 | static void __iomem *twd_base; | ||
| 48 | |||
| 49 | #define IRQ_LOCALTIMER 29 | ||
| 44 | 50 | ||
| 45 | #ifdef CONFIG_OMAP4_ERRATA_I688 | 51 | #ifdef CONFIG_OMAP4_ERRATA_I688 |
| 46 | /* Used to implement memory barrier on DRAM path */ | 52 | /* Used to implement memory barrier on DRAM path */ |
| @@ -95,12 +101,14 @@ void __init omap_barriers_init(void) | |||
| 95 | void __init gic_init_irq(void) | 101 | void __init gic_init_irq(void) |
| 96 | { | 102 | { |
| 97 | void __iomem *omap_irq_base; | 103 | void __iomem *omap_irq_base; |
| 98 | void __iomem *gic_dist_base_addr; | ||
| 99 | 104 | ||
| 100 | /* Static mapping, never released */ | 105 | /* Static mapping, never released */ |
| 101 | gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); | 106 | gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); |
| 102 | BUG_ON(!gic_dist_base_addr); | 107 | BUG_ON(!gic_dist_base_addr); |
| 103 | 108 | ||
| 109 | twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_4K); | ||
| 110 | BUG_ON(!twd_base); | ||
| 111 | |||
| 104 | /* Static mapping, never released */ | 112 | /* Static mapping, never released */ |
| 105 | omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); | 113 | omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); |
| 106 | BUG_ON(!omap_irq_base); | 114 | BUG_ON(!omap_irq_base); |
| @@ -110,6 +118,38 @@ void __init gic_init_irq(void) | |||
| 110 | gic_init(0, 29, gic_dist_base_addr, omap_irq_base); | 118 | gic_init(0, 29, gic_dist_base_addr, omap_irq_base); |
| 111 | } | 119 | } |
| 112 | 120 | ||
| 121 | void gic_dist_disable(void) | ||
| 122 | { | ||
| 123 | if (gic_dist_base_addr) | ||
| 124 | __raw_writel(0x0, gic_dist_base_addr + GIC_DIST_CTRL); | ||
| 125 | } | ||
| 126 | |||
| 127 | bool gic_dist_disabled(void) | ||
| 128 | { | ||
| 129 | return !(__raw_readl(gic_dist_base_addr + GIC_DIST_CTRL) & 0x1); | ||
| 130 | } | ||
| 131 | |||
| 132 | void gic_timer_retrigger(void) | ||
| 133 | { | ||
| 134 | u32 twd_int = __raw_readl(twd_base + TWD_TIMER_INTSTAT); | ||
| 135 | u32 gic_int = __raw_readl(gic_dist_base_addr + GIC_DIST_PENDING_SET); | ||
| 136 | u32 twd_ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL); | ||
| 137 | |||
| 138 | if (twd_int && !(gic_int & BIT(IRQ_LOCALTIMER))) { | ||
| 139 | /* | ||
| 140 | * The local timer interrupt got lost while the distributor was | ||
| 141 | * disabled. Ack the pending interrupt, and retrigger it. | ||
| 142 | */ | ||
| 143 | pr_warn("%s: lost localtimer interrupt\n", __func__); | ||
| 144 | __raw_writel(1, twd_base + TWD_TIMER_INTSTAT); | ||
| 145 | if (!(twd_ctrl & TWD_TIMER_CONTROL_PERIODIC)) { | ||
| 146 | __raw_writel(1, twd_base + TWD_TIMER_COUNTER); | ||
| 147 | twd_ctrl |= TWD_TIMER_CONTROL_ENABLE; | ||
| 148 | __raw_writel(twd_ctrl, twd_base + TWD_TIMER_CONTROL); | ||
| 149 | } | ||
| 150 | } | ||
| 151 | } | ||
| 152 | |||
| 113 | #ifdef CONFIG_CACHE_L2X0 | 153 | #ifdef CONFIG_CACHE_L2X0 |
| 114 | 154 | ||
| 115 | void __iomem *omap4_get_l2cache_base(void) | 155 | void __iomem *omap4_get_l2cache_base(void) |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 67d66131cfa7..fc3c96d5e013 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
| @@ -102,6 +102,15 @@ extern void enable_omap3630_toggle_l2_on_restore(void); | |||
| 102 | static inline void enable_omap3630_toggle_l2_on_restore(void) { } | 102 | static inline void enable_omap3630_toggle_l2_on_restore(void) { } |
| 103 | #endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */ | 103 | #endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */ |
| 104 | 104 | ||
| 105 | #define PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD (1 << 0) | ||
| 106 | |||
| 107 | #if defined(CONFIG_ARCH_OMAP4) | ||
| 108 | extern u16 pm44xx_errata; | ||
| 109 | #define IS_PM44XX_ERRATUM(id) (pm44xx_errata & (id)) | ||
| 110 | #else | ||
| 111 | #define IS_PM44XX_ERRATUM(id) 0 | ||
| 112 | #endif | ||
| 113 | |||
| 105 | #ifdef CONFIG_POWER_AVS_OMAP | 114 | #ifdef CONFIG_POWER_AVS_OMAP |
| 106 | extern int omap_devinit_smartreflex(void); | 115 | extern int omap_devinit_smartreflex(void); |
| 107 | extern void omap_enable_smartreflex_on_init(void); | 116 | extern void omap_enable_smartreflex_on_init(void); |
