|
@@ -28,8 +28,14 @@
|
|
#include <linux/io.h>
|
|
#include <linux/io.h>
|
|
#include <linux/reboot.h>
|
|
#include <linux/reboot.h>
|
|
#include "common.h"
|
|
#include "common.h"
|
|
|
|
+#include "mvebu-soc-id.h"
|
|
|
|
+#include "pmsu.h"
|
|
|
|
+
|
|
|
|
+#define ARMADA_375_CRYPT0_ENG_TARGET 41
|
|
|
|
+#define ARMADA_375_CRYPT0_ENG_ATTR 1
|
|
|
|
|
|
static void __iomem *system_controller_base;
|
|
static void __iomem *system_controller_base;
|
|
|
|
+static phys_addr_t system_controller_phys_base;
|
|
|
|
|
|
struct mvebu_system_controller {
|
|
struct mvebu_system_controller {
|
|
u32 rstoutn_mask_offset;
|
|
u32 rstoutn_mask_offset;
|
|
@@ -121,10 +127,32 @@ int mvebu_system_controller_get_soc_id(u32 *dev, u32 *rev)
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
#ifdef CONFIG_SMP
|
|
|
|
+void mvebu_armada375_smp_wa_init(void)
|
|
|
|
+{
|
|
|
|
+ u32 dev, rev;
|
|
|
|
+ phys_addr_t resume_addr_reg;
|
|
|
|
+
|
|
|
|
+ if (mvebu_get_soc_id(&dev, &rev) != 0)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ if (rev != ARMADA_375_Z1_REV)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ resume_addr_reg = system_controller_phys_base +
|
|
|
|
+ mvebu_sc->resume_boot_addr;
|
|
|
|
+ mvebu_setup_boot_addr_wa(ARMADA_375_CRYPT0_ENG_TARGET,
|
|
|
|
+ ARMADA_375_CRYPT0_ENG_ATTR,
|
|
|
|
+ resume_addr_reg);
|
|
|
|
+}
|
|
|
|
+
|
|
void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr)
|
|
void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr)
|
|
{
|
|
{
|
|
BUG_ON(system_controller_base == NULL);
|
|
BUG_ON(system_controller_base == NULL);
|
|
BUG_ON(mvebu_sc->resume_boot_addr == 0);
|
|
BUG_ON(mvebu_sc->resume_boot_addr == 0);
|
|
|
|
+
|
|
|
|
+ if (of_machine_is_compatible("marvell,armada375"))
|
|
|
|
+ mvebu_armada375_smp_wa_init();
|
|
|
|
+
|
|
writel(virt_to_phys(boot_addr), system_controller_base +
|
|
writel(virt_to_phys(boot_addr), system_controller_base +
|
|
mvebu_sc->resume_boot_addr);
|
|
mvebu_sc->resume_boot_addr);
|
|
}
|
|
}
|
|
@@ -138,7 +166,10 @@ static int __init mvebu_system_controller_init(void)
|
|
np = of_find_matching_node_and_match(NULL, of_system_controller_table,
|
|
np = of_find_matching_node_and_match(NULL, of_system_controller_table,
|
|
&match);
|
|
&match);
|
|
if (np) {
|
|
if (np) {
|
|
|
|
+ struct resource res;
|
|
system_controller_base = of_iomap(np, 0);
|
|
system_controller_base = of_iomap(np, 0);
|
|
|
|
+ of_address_to_resource(np, 0, &res);
|
|
|
|
+ system_controller_phys_base = res.start;
|
|
mvebu_sc = (struct mvebu_system_controller *)match->data;
|
|
mvebu_sc = (struct mvebu_system_controller *)match->data;
|
|
of_node_put(np);
|
|
of_node_put(np);
|
|
}
|
|
}
|