Release 4.14 arch/blackfin/mach-bf561/smp.c
/*
* Copyright 2007-2009 Analog Devices Inc.
* Philippe Gerum <rpm@xenomai.org>
*
* Licensed under the GPL-2 or later.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <asm/smp.h>
#include <asm/dma.h>
#include <asm/time.h>
static DEFINE_SPINLOCK(boot_lock);
/*
* platform_init_cpus() - Tell the world about how many cores we
* have. This is called while setting up the architecture support
* (setup_arch()), so don't be too demanding here with respect to
* available kernel services.
*/
void __init platform_init_cpus(void)
{
struct cpumask mask;
cpumask_set_cpu(0, &mask); /* CoreA */
cpumask_set_cpu(1, &mask); /* CoreB */
init_cpu_possible(&mask);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 20 | 55.56% | 1 | 50.00% |
Motohiro Kosaki | 16 | 44.44% | 1 | 50.00% |
Total | 36 | 100.00% | 2 | 100.00% |
void __init platform_prepare_cpus(unsigned int max_cpus)
{
struct cpumask mask;
bfin_relocate_coreb_l1_mem();
/* Both cores ought to be present on a bf561! */
cpumask_set_cpu(0, &mask); /* CoreA */
cpumask_set_cpu(1, &mask); /* CoreB */
init_cpu_present(&mask);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 24 | 57.14% | 1 | 33.33% |
Motohiro Kosaki | 16 | 38.10% | 1 | 33.33% |
Sonic Zhang | 2 | 4.76% | 1 | 33.33% |
Total | 42 | 100.00% | 3 | 100.00% |
int __init setup_profiling_timer(unsigned int multiplier) /* not supported */
{
return -EINVAL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
void platform_secondary_init(unsigned int cpu)
{
/* Clone setup for peripheral interrupt sources from CoreA. */
bfin_write_SICB_IMASK0(bfin_read_SIC_IMASK0());
bfin_write_SICB_IMASK1(bfin_read_SIC_IMASK1());
SSYNC();
/* Clone setup for IARs from CoreA. */
bfin_write_SICB_IAR0(bfin_read_SIC_IAR0());
bfin_write_SICB_IAR1(bfin_read_SIC_IAR1());
bfin_write_SICB_IAR2(bfin_read_SIC_IAR2());
bfin_write_SICB_IAR3(bfin_read_SIC_IAR3());
bfin_write_SICB_IAR4(bfin_read_SIC_IAR4());
bfin_write_SICB_IAR5(bfin_read_SIC_IAR5());
bfin_write_SICB_IAR6(bfin_read_SIC_IAR6());
bfin_write_SICB_IAR7(bfin_read_SIC_IAR7());
bfin_write_SICB_IWR0(IWR_DISABLE_ALL);
bfin_write_SICB_IWR1(IWR_DISABLE_ALL);
SSYNC();
/* We are done with local CPU inits, unblock the boot CPU. */
spin_lock(&boot_lock);
spin_unlock(&boot_lock);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 90 | 90.00% | 2 | 66.67% |
Mike Frysinger | 10 | 10.00% | 1 | 33.33% |
Total | 100 | 100.00% | 3 | 100.00% |
int platform_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
unsigned long timeout;
printk(KERN_INFO "Booting Core B.\n");
spin_lock(&boot_lock);
if ((bfin_read_SYSCR() & COREB_SRAM_INIT) == 0) {
/* CoreB already running, sending ipi to wakeup it */
smp_send_reschedule(cpu);
} else {
/* Kick CoreB, which should start execution from CORE_SRAM_BASE. */
bfin_write_SYSCR(bfin_read_SYSCR() & ~COREB_SRAM_INIT);
SSYNC();
}
timeout = jiffies + HZ;
/* release the lock and let coreb run */
spin_unlock(&boot_lock);
while (time_before(jiffies, timeout)) {
if (cpu_online(cpu))
break;
udelay(100);
barrier();
}
if (cpu_online(cpu)) {
return 0;
} else
panic("CPU%u: processor failed to boot\n", cpu);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 99 | 79.20% | 3 | 42.86% |
Yi Li | 15 | 12.00% | 1 | 14.29% |
Steven Miao | 7 | 5.60% | 1 | 14.29% |
Mike Frysinger | 3 | 2.40% | 1 | 14.29% |
Bob Liu | 1 | 0.80% | 1 | 14.29% |
Total | 125 | 100.00% | 7 | 100.00% |
static const char supple0[] = "IRQ_SUPPLE_0";
static const char supple1[] = "IRQ_SUPPLE_1";
void __init platform_request_ipi(int irq, void *handler)
{
int ret;
const char *name = (irq == IRQ_SUPPLE_0) ? supple0 : supple1;
ret = request_irq(irq, handler, IRQF_PERCPU | IRQF_NO_SUSPEND |
IRQF_FORCE_RESUME, name, handler);
if (ret)
panic("Cannot request %s for IPI service", name);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 33 | 54.10% | 2 | 50.00% |
Yi Li | 24 | 39.34% | 1 | 25.00% |
Bob Liu | 4 | 6.56% | 1 | 25.00% |
Total | 61 | 100.00% | 4 | 100.00% |
void platform_send_ipi(cpumask_t callmap, int irq)
{
unsigned int cpu;
int offset = (irq == IRQ_SUPPLE_0) ? 6 : 8;
for_each_cpu(cpu, &callmap) {
BUG_ON(cpu >= 2);
SSYNC();
bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (offset + cpu)));
SSYNC();
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 46 | 70.77% | 1 | 33.33% |
Yi Li | 17 | 26.15% | 1 | 33.33% |
Rusty Russell | 2 | 3.08% | 1 | 33.33% |
Total | 65 | 100.00% | 3 | 100.00% |
void platform_send_ipi_cpu(unsigned int cpu, int irq)
{
int offset = (irq == IRQ_SUPPLE_0) ? 6 : 8;
BUG_ON(cpu >= 2);
SSYNC();
bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (offset + cpu)));
SSYNC();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 37 | 68.52% | 1 | 50.00% |
Yi Li | 17 | 31.48% | 1 | 50.00% |
Total | 54 | 100.00% | 2 | 100.00% |
void platform_clear_ipi(unsigned int cpu, int irq)
{
int offset = (irq == IRQ_SUPPLE_0) ? 10 : 12;
BUG_ON(cpu >= 2);
SSYNC();
bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (offset + cpu)));
SSYNC();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 37 | 68.52% | 1 | 50.00% |
Yi Li | 17 | 31.48% | 1 | 50.00% |
Total | 54 | 100.00% | 2 | 100.00% |
/*
* Setup core B's local core timer.
* In SMP, core timer is used for clock event device.
*/
void bfin_local_timer_setup(void)
{
#if defined(CONFIG_TICKSOURCE_CORETMR)
struct irq_data *data = irq_get_irq_data(IRQ_CORETMR);
struct irq_chip *chip = irq_data_get_irq_chip(data);
bfin_coretmr_init();
bfin_coretmr_clockevent_init();
chip->irq_unmask(data);
#else
/* Power down the core timer, just to play safe. */
bfin_write_TCNTL(0);
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yi Li | 33 | 58.93% | 1 | 33.33% |
Mike Frysinger | 15 | 26.79% | 1 | 33.33% |
Thomas Gleixner | 8 | 14.29% | 1 | 33.33% |
Total | 56 | 100.00% | 3 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Graf Yang | 426 | 65.14% | 4 | 22.22% |
Yi Li | 143 | 21.87% | 3 | 16.67% |
Motohiro Kosaki | 32 | 4.89% | 1 | 5.56% |
Mike Frysinger | 28 | 4.28% | 3 | 16.67% |
Thomas Gleixner | 8 | 1.22% | 1 | 5.56% |
Steven Miao | 7 | 1.07% | 1 | 5.56% |
Bob Liu | 5 | 0.76% | 2 | 11.11% |
Rusty Russell | 2 | 0.31% | 1 | 5.56% |
Sonic Zhang | 2 | 0.31% | 1 | 5.56% |
Robin Getz | 1 | 0.15% | 1 | 5.56% |
Total | 654 | 100.00% | 18 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.