Commit d614cb0b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "A smaller set of fixes this week, and all regression fixes:
   - a handful of issues fixed on at91 with common clock conversion
   - a set of fixes for Marvell mvebu (SMP, coherency, PM)
   - a clock fix for i.MX6Q.
   - ... and a SMP/hotplug fix for Exynos"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: EXYNOS: Fix core ID used by platsmp and hotplug code
  ARM: at91/dt: add missing clocks property to pwm node in sam9x5.dtsi
  ARM: at91/dt: fix usb0 clocks definition in sam9n12 dtsi
  ARM: at91: at91sam9x5: correct typo error for ohci clock
  ARM: clk-imx6q: parent lvds_sel input from upstream clock gates
  ARM: mvebu: Fix coherency bus notifiers by using separate notifiers
  ARM: mvebu: Fix the operand list in the inline asm of armada_370_xp_pmsu_idle_enter
  ARM: mvebu: fix SMP boot for Armada 38x and Armada 375 Z1 in big endian
parents 1b9f0efd 9637f30e
...@@ -925,7 +925,7 @@ usb0: ohci@00500000 { ...@@ -925,7 +925,7 @@ usb0: ohci@00500000 {
compatible = "atmel,at91rm9200-ohci", "usb-ohci"; compatible = "atmel,at91rm9200-ohci", "usb-ohci";
reg = <0x00500000 0x00100000>; reg = <0x00500000 0x00100000>;
interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
clocks = <&usb>, <&uhphs_clk>, <&udphs_clk>, clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>,
<&uhpck>; <&uhpck>;
clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
status = "disabled"; status = "disabled";
......
...@@ -1124,6 +1124,7 @@ pwm0: pwm@f8034000 { ...@@ -1124,6 +1124,7 @@ pwm0: pwm@f8034000 {
compatible = "atmel,at91sam9rl-pwm"; compatible = "atmel,at91sam9rl-pwm";
reg = <0xf8034000 0x300>; reg = <0xf8034000 0x300>;
interrupts = <18 IRQ_TYPE_LEVEL_HIGH 4>; interrupts = <18 IRQ_TYPE_LEVEL_HIGH 4>;
clocks = <&pwm_clk>;
#pwm-cells = <3>; #pwm-cells = <3>;
status = "disabled"; status = "disabled";
}; };
...@@ -1155,8 +1156,7 @@ usb0: ohci@00600000 { ...@@ -1155,8 +1156,7 @@ usb0: ohci@00600000 {
compatible = "atmel,at91rm9200-ohci", "usb-ohci"; compatible = "atmel,at91rm9200-ohci", "usb-ohci";
reg = <0x00600000 0x100000>; reg = <0x00600000 0x100000>;
interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
clocks = <&usb>, <&uhphs_clk>, <&udphs_clk>, clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
<&uhpck>;
clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
status = "disabled"; status = "disabled";
}; };
......
...@@ -40,15 +40,17 @@ static inline void cpu_leave_lowpower(void) ...@@ -40,15 +40,17 @@ static inline void cpu_leave_lowpower(void)
static inline void platform_do_lowpower(unsigned int cpu, int *spurious) static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
{ {
u32 mpidr = cpu_logical_map(cpu);
u32 core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
for (;;) { for (;;) {
/* make cpu1 to be turned off at next WFI command */ /* Turn the CPU off on next WFI instruction. */
if (cpu == 1) exynos_cpu_power_down(core_id);
exynos_cpu_power_down(cpu);
wfi(); wfi();
if (pen_release == cpu_logical_map(cpu)) { if (pen_release == core_id) {
/* /*
* OK, proper wakeup, we're done * OK, proper wakeup, we're done
*/ */
......
...@@ -90,7 +90,8 @@ static void exynos_secondary_init(unsigned int cpu) ...@@ -90,7 +90,8 @@ static void exynos_secondary_init(unsigned int cpu)
static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
{ {
unsigned long timeout; unsigned long timeout;
unsigned long phys_cpu = cpu_logical_map(cpu); u32 mpidr = cpu_logical_map(cpu);
u32 core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
int ret = -ENOSYS; int ret = -ENOSYS;
/* /*
...@@ -104,17 +105,18 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) ...@@ -104,17 +105,18 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
* the holding pen - release it, then wait for it to flag * the holding pen - release it, then wait for it to flag
* that it has been released by resetting pen_release. * that it has been released by resetting pen_release.
* *
* Note that "pen_release" is the hardware CPU ID, whereas * Note that "pen_release" is the hardware CPU core ID, whereas
* "cpu" is Linux's internal ID. * "cpu" is Linux's internal ID.
*/ */
write_pen_release(phys_cpu); write_pen_release(core_id);
if (!exynos_cpu_power_state(cpu)) { if (!exynos_cpu_power_state(core_id)) {
exynos_cpu_power_up(cpu); exynos_cpu_power_up(core_id);
timeout = 10; timeout = 10;
/* wait max 10 ms until cpu1 is on */ /* wait max 10 ms until cpu1 is on */
while (exynos_cpu_power_state(cpu) != S5P_CORE_LOCAL_PWR_EN) { while (exynos_cpu_power_state(core_id)
!= S5P_CORE_LOCAL_PWR_EN) {
if (timeout-- == 0) if (timeout-- == 0)
break; break;
...@@ -145,20 +147,20 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) ...@@ -145,20 +147,20 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
* Try to set boot address using firmware first * Try to set boot address using firmware first
* and fall back to boot register if it fails. * and fall back to boot register if it fails.
*/ */
ret = call_firmware_op(set_cpu_boot_addr, phys_cpu, boot_addr); ret = call_firmware_op(set_cpu_boot_addr, core_id, boot_addr);
if (ret && ret != -ENOSYS) if (ret && ret != -ENOSYS)
goto fail; goto fail;
if (ret == -ENOSYS) { if (ret == -ENOSYS) {
void __iomem *boot_reg = cpu_boot_reg(phys_cpu); void __iomem *boot_reg = cpu_boot_reg(core_id);
if (IS_ERR(boot_reg)) { if (IS_ERR(boot_reg)) {
ret = PTR_ERR(boot_reg); ret = PTR_ERR(boot_reg);
goto fail; goto fail;
} }
__raw_writel(boot_addr, cpu_boot_reg(phys_cpu)); __raw_writel(boot_addr, cpu_boot_reg(core_id));
} }
call_firmware_op(cpu_boot, phys_cpu); call_firmware_op(cpu_boot, core_id);
arch_send_wakeup_ipi_mask(cpumask_of(cpu)); arch_send_wakeup_ipi_mask(cpumask_of(cpu));
...@@ -227,22 +229,24 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) ...@@ -227,22 +229,24 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
* boot register if it fails. * boot register if it fails.
*/ */
for (i = 1; i < max_cpus; ++i) { for (i = 1; i < max_cpus; ++i) {
unsigned long phys_cpu;
unsigned long boot_addr; unsigned long boot_addr;
u32 mpidr;
u32 core_id;
int ret; int ret;
phys_cpu = cpu_logical_map(i); mpidr = cpu_logical_map(i);
core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
boot_addr = virt_to_phys(exynos4_secondary_startup); boot_addr = virt_to_phys(exynos4_secondary_startup);
ret = call_firmware_op(set_cpu_boot_addr, phys_cpu, boot_addr); ret = call_firmware_op(set_cpu_boot_addr, core_id, boot_addr);
if (ret && ret != -ENOSYS) if (ret && ret != -ENOSYS)
break; break;
if (ret == -ENOSYS) { if (ret == -ENOSYS) {
void __iomem *boot_reg = cpu_boot_reg(phys_cpu); void __iomem *boot_reg = cpu_boot_reg(core_id);
if (IS_ERR(boot_reg)) if (IS_ERR(boot_reg))
break; break;
__raw_writel(boot_addr, cpu_boot_reg(phys_cpu)); __raw_writel(boot_addr, cpu_boot_reg(core_id));
} }
} }
} }
......
...@@ -70,7 +70,7 @@ static const char *cko_sels[] = { "cko1", "cko2", }; ...@@ -70,7 +70,7 @@ static const char *cko_sels[] = { "cko1", "cko2", };
static const char *lvds_sels[] = { static const char *lvds_sels[] = {
"dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy",
"pll4_audio", "pll5_video", "pll8_mlb", "enet_ref", "pll4_audio", "pll5_video", "pll8_mlb", "enet_ref",
"pcie_ref", "sata_ref", "pcie_ref_125m", "sata_ref_100m",
}; };
enum mx6q_clks { enum mx6q_clks {
...@@ -491,7 +491,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) ...@@ -491,7 +491,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
/* All existing boards with PCIe use LVDS1 */ /* All existing boards with PCIe use LVDS1 */
if (IS_ENABLED(CONFIG_PCI_IMX6)) if (IS_ENABLED(CONFIG_PCI_IMX6))
clk_set_parent(clk[lvds1_sel], clk[sata_ref]); clk_set_parent(clk[lvds1_sel], clk[sata_ref_100m]);
/* Set initial power mode */ /* Set initial power mode */
imx6q_set_lpm(WAIT_CLOCKED); imx6q_set_lpm(WAIT_CLOCKED);
......
...@@ -292,6 +292,10 @@ static struct notifier_block mvebu_hwcc_nb = { ...@@ -292,6 +292,10 @@ static struct notifier_block mvebu_hwcc_nb = {
.notifier_call = mvebu_hwcc_notifier, .notifier_call = mvebu_hwcc_notifier,
}; };
static struct notifier_block mvebu_hwcc_pci_nb = {
.notifier_call = mvebu_hwcc_notifier,
};
static void __init armada_370_coherency_init(struct device_node *np) static void __init armada_370_coherency_init(struct device_node *np)
{ {
struct resource res; struct resource res;
...@@ -427,7 +431,7 @@ static int __init coherency_pci_init(void) ...@@ -427,7 +431,7 @@ static int __init coherency_pci_init(void)
{ {
if (coherency_available()) if (coherency_available())
bus_register_notifier(&pci_bus_type, bus_register_notifier(&pci_bus_type,
&mvebu_hwcc_nb); &mvebu_hwcc_pci_nb);
return 0; return 0;
} }
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/assembler.h>
__CPUINIT __CPUINIT
#define CPU_RESUME_ADDR_REG 0xf10182d4 #define CPU_RESUME_ADDR_REG 0xf10182d4
...@@ -22,13 +24,18 @@ ...@@ -22,13 +24,18 @@
.global armada_375_smp_cpu1_enable_code_end .global armada_375_smp_cpu1_enable_code_end
armada_375_smp_cpu1_enable_code_start: armada_375_smp_cpu1_enable_code_start:
ldr r0, [pc, #4] ARM_BE8(setend be)
adr r0, 1f
ldr r0, [r0]
ldr r1, [r0] ldr r1, [r0]
ARM_BE8(rev r1, r1)
mov pc, r1 mov pc, r1
1:
.word CPU_RESUME_ADDR_REG .word CPU_RESUME_ADDR_REG
armada_375_smp_cpu1_enable_code_end: armada_375_smp_cpu1_enable_code_end:
ENTRY(mvebu_cortex_a9_secondary_startup) ENTRY(mvebu_cortex_a9_secondary_startup)
ARM_BE8(setend be)
bl v7_invalidate_l1 bl v7_invalidate_l1
b secondary_startup b secondary_startup
ENDPROC(mvebu_cortex_a9_secondary_startup) ENDPROC(mvebu_cortex_a9_secondary_startup)
...@@ -201,12 +201,12 @@ static noinline int do_armada_370_xp_cpu_suspend(unsigned long deepidle) ...@@ -201,12 +201,12 @@ static noinline int do_armada_370_xp_cpu_suspend(unsigned long deepidle)
/* Test the CR_C bit and set it if it was cleared */ /* Test the CR_C bit and set it if it was cleared */
asm volatile( asm volatile(
"mrc p15, 0, %0, c1, c0, 0 \n\t" "mrc p15, 0, r0, c1, c0, 0 \n\t"
"tst %0, #(1 << 2) \n\t" "tst r0, #(1 << 2) \n\t"
"orreq %0, %0, #(1 << 2) \n\t" "orreq r0, r0, #(1 << 2) \n\t"
"mcreq p15, 0, %0, c1, c0, 0 \n\t" "mcreq p15, 0, r0, c1, c0, 0 \n\t"
"isb " "isb "
: : "r" (0)); : : : "r0");
pr_warn("Failed to suspend the system\n"); pr_warn("Failed to suspend the system\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment