diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-12-11 05:01:53 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-12-11 05:01:53 -0500 |
| commit | 0fa5d3996dbda1ee9653c43d39b7ef159fb57ee7 (patch) | |
| tree | 70f0adc3b86bb1511be6607c959506f6365fc2a9 | |
| parent | 0b99cb73105f0527c1c4096960796b8772343a39 (diff) | |
| parent | 14318efb322e2fe1a034c69463d725209eb9d548 (diff) | |
Merge branch 'devel-stable' into for-linus
34 files changed, 981 insertions, 723 deletions
diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt new file mode 100644 index 00000000000..f32494dbfe1 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/cpus.txt | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | * ARM CPUs binding description | ||
| 2 | |||
| 3 | The device tree allows to describe the layout of CPUs in a system through | ||
| 4 | the "cpus" node, which in turn contains a number of subnodes (ie "cpu") | ||
| 5 | defining properties for every cpu. | ||
| 6 | |||
| 7 | Bindings for CPU nodes follow the ePAPR standard, available from: | ||
| 8 | |||
| 9 | http://devicetree.org | ||
| 10 | |||
| 11 | For the ARM architecture every CPU node must contain the following properties: | ||
| 12 | |||
| 13 | - device_type: must be "cpu" | ||
| 14 | - reg: property matching the CPU MPIDR[23:0] register bits | ||
| 15 | reg[31:24] bits must be set to 0 | ||
| 16 | - compatible: should be one of: | ||
| 17 | "arm,arm1020" | ||
| 18 | "arm,arm1020e" | ||
| 19 | "arm,arm1022" | ||
| 20 | "arm,arm1026" | ||
| 21 | "arm,arm720" | ||
| 22 | "arm,arm740" | ||
| 23 | "arm,arm7tdmi" | ||
| 24 | "arm,arm920" | ||
| 25 | "arm,arm922" | ||
| 26 | "arm,arm925" | ||
| 27 | "arm,arm926" | ||
| 28 | "arm,arm940" | ||
| 29 | "arm,arm946" | ||
| 30 | "arm,arm9tdmi" | ||
| 31 | "arm,cortex-a5" | ||
| 32 | "arm,cortex-a7" | ||
| 33 | "arm,cortex-a8" | ||
| 34 | "arm,cortex-a9" | ||
| 35 | "arm,cortex-a15" | ||
| 36 | "arm,arm1136" | ||
| 37 | "arm,arm1156" | ||
| 38 | "arm,arm1176" | ||
| 39 | "arm,arm11mpcore" | ||
| 40 | "faraday,fa526" | ||
| 41 | "intel,sa110" | ||
| 42 | "intel,sa1100" | ||
| 43 | "marvell,feroceon" | ||
| 44 | "marvell,mohawk" | ||
| 45 | "marvell,xsc3" | ||
| 46 | "marvell,xscale" | ||
| 47 | |||
| 48 | Example: | ||
| 49 | |||
| 50 | cpus { | ||
| 51 | #size-cells = <0>; | ||
| 52 | #address-cells = <1>; | ||
| 53 | |||
| 54 | CPU0: cpu@0 { | ||
| 55 | device_type = "cpu"; | ||
| 56 | compatible = "arm,cortex-a15"; | ||
| 57 | reg = <0x0>; | ||
| 58 | }; | ||
| 59 | |||
| 60 | CPU1: cpu@1 { | ||
| 61 | device_type = "cpu"; | ||
| 62 | compatible = "arm,cortex-a15"; | ||
| 63 | reg = <0x1>; | ||
| 64 | }; | ||
| 65 | |||
| 66 | CPU2: cpu@100 { | ||
| 67 | device_type = "cpu"; | ||
| 68 | compatible = "arm,cortex-a7"; | ||
| 69 | reg = <0x100>; | ||
| 70 | }; | ||
| 71 | |||
| 72 | CPU3: cpu@101 { | ||
| 73 | device_type = "cpu"; | ||
| 74 | compatible = "arm,cortex-a7"; | ||
| 75 | reg = <0x101>; | ||
| 76 | }; | ||
| 77 | }; | ||
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index aa526998418..36ae03a3f5d 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c | |||
| @@ -70,6 +70,14 @@ struct gic_chip_data { | |||
| 70 | static DEFINE_RAW_SPINLOCK(irq_controller_lock); | 70 | static DEFINE_RAW_SPINLOCK(irq_controller_lock); |
| 71 | 71 | ||
| 72 | /* | 72 | /* |
| 73 | * The GIC mapping of CPU interfaces does not necessarily match | ||
| 74 | * the logical CPU numbering. Let's use a mapping as returned | ||
| 75 | * by the GIC itself. | ||
| 76 | */ | ||
| 77 | #define NR_GIC_CPU_IF 8 | ||
| 78 | static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly; | ||
| 79 | |||
| 80 | /* | ||
| 73 | * Supported arch specific GIC irq extension. | 81 | * Supported arch specific GIC irq extension. |
| 74 | * Default make them NULL. | 82 | * Default make them NULL. |
| 75 | */ | 83 | */ |
| @@ -238,11 +246,11 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, | |||
| 238 | unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); | 246 | unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); |
| 239 | u32 val, mask, bit; | 247 | u32 val, mask, bit; |
| 240 | 248 | ||
| 241 | if (cpu >= 8 || cpu >= nr_cpu_ids) | 249 | if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids) |
| 242 | return -EINVAL; | 250 | return -EINVAL; |
| 243 | 251 | ||
| 244 | mask = 0xff << shift; | 252 | mask = 0xff << shift; |
| 245 | bit = 1 << (cpu_logical_map(cpu) + shift); | 253 | bit = gic_cpu_map[cpu] << shift; |
| 246 | 254 | ||
| 247 | raw_spin_lock(&irq_controller_lock); | 255 | raw_spin_lock(&irq_controller_lock); |
| 248 | val = readl_relaxed(reg) & ~mask; | 256 | val = readl_relaxed(reg) & ~mask; |
| @@ -349,11 +357,6 @@ static void __init gic_dist_init(struct gic_chip_data *gic) | |||
| 349 | u32 cpumask; | 357 | u32 cpumask; |
| 350 | unsigned int gic_irqs = gic->gic_irqs; | 358 | unsigned int gic_irqs = gic->gic_irqs; |
| 351 | void __iomem *base = gic_data_dist_base(gic); | 359 | void __iomem *base = gic_data_dist_base(gic); |
| 352 | u32 cpu = cpu_logical_map(smp_processor_id()); | ||
| 353 | |||
| 354 | cpumask = 1 << cpu; | ||
| 355 | cpumask |= cpumask << 8; | ||
| 356 | cpumask |= cpumask << 16; | ||
| 357 | 360 | ||
| 358 | writel_relaxed(0, base + GIC_DIST_CTRL); | 361 | writel_relaxed(0, base + GIC_DIST_CTRL); |
| 359 | 362 | ||
| @@ -366,6 +369,7 @@ static void __init gic_dist_init(struct gic_chip_data *gic) | |||
| 366 | /* | 369 | /* |
| 367 | * Set all global interrupts to this CPU only. | 370 | * Set all global interrupts to this CPU only. |
| 368 | */ | 371 | */ |
| 372 | cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0); | ||
| 369 | for (i = 32; i < gic_irqs; i += 4) | 373 | for (i = 32; i < gic_irqs; i += 4) |
| 370 | writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); | 374 | writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); |
| 371 | 375 | ||
| @@ -389,9 +393,25 @@ static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) | |||
| 389 | { | 393 | { |
| 390 | void __iomem *dist_base = gic_data_dist_base(gic); | 394 | void __iomem *dist_base = gic_data_dist_base(gic); |
| 391 | void __iomem *base = gic_data_cpu_base(gic); | 395 | void __iomem *base = gic_data_cpu_base(gic); |
| 396 | unsigned int cpu_mask, cpu = smp_processor_id(); | ||
| 392 | int i; | 397 | int i; |
| 393 | 398 | ||
| 394 | /* | 399 | /* |
| 400 | * Get what the GIC says our CPU mask is. | ||
| 401 | */ | ||
| 402 | BUG_ON(cpu >= NR_GIC_CPU_IF); | ||
| 403 | cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0); | ||
| 404 | gic_cpu_map[cpu] = cpu_mask; | ||
