platsmp.c 881 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2019 Lubomir Rintel <[email protected]>
  4. */
  5. #include <linux/io.h>
  6. #include <asm/smp_scu.h>
  7. #include <asm/smp.h>
  8. #include "addr-map.h"
  9. #define SW_BRANCH_VIRT_ADDR CIU_REG(0x24)
  10. static int mmp3_boot_secondary(unsigned int cpu, struct task_struct *idle)
  11. {
  12. /*
  13. * Apparently, the boot ROM on the second core spins on this
  14. * register becoming non-zero and then jumps to the address written
  15. * there. No IPIs involved.
  16. */
  17. __raw_writel(__pa_symbol(secondary_startup), SW_BRANCH_VIRT_ADDR);
  18. return 0;
  19. }
  20. static void mmp3_smp_prepare_cpus(unsigned int max_cpus)
  21. {
  22. scu_enable(SCU_VIRT_BASE);
  23. }
  24. static const struct smp_operations mmp3_smp_ops __initconst = {
  25. .smp_prepare_cpus = mmp3_smp_prepare_cpus,
  26. .smp_boot_secondary = mmp3_boot_secondary,
  27. };
  28. CPU_METHOD_OF_DECLARE(mmp3_smp, "marvell,mmp3-smp", &mmp3_smp_ops);