platsmp.c 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Keystone SOC SMP platform code
  4. *
  5. * Copyright 2013 Texas Instruments, Inc.
  6. * Cyril Chemparathy <[email protected]>
  7. * Santosh Shilimkar <[email protected]>
  8. *
  9. * Based on platsmp.c, Copyright (C) 2002 ARM Ltd.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/smp.h>
  13. #include <linux/io.h>
  14. #include <linux/pgtable.h>
  15. #include <asm/smp_plat.h>
  16. #include <asm/prom.h>
  17. #include <asm/tlbflush.h>
  18. #include "keystone.h"
  19. static int keystone_smp_boot_secondary(unsigned int cpu,
  20. struct task_struct *idle)
  21. {
  22. unsigned long start = virt_to_idmap(&secondary_startup);
  23. int error;
  24. pr_debug("keystone-smp: booting cpu %d, vector %08lx\n",
  25. cpu, start);
  26. error = keystone_cpu_smc(KEYSTONE_MON_CPU_UP_IDX, cpu, start);
  27. if (error)
  28. pr_err("CPU %d bringup failed with %d\n", cpu, error);
  29. return error;
  30. }
  31. const struct smp_operations keystone_smp_ops __initconst = {
  32. .smp_boot_secondary = keystone_smp_boot_secondary,
  33. };