Skip to content

Commit bcd1739

Browse files
committed
Merge tag 'mips_5.2_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull a few more MIPS updates from Paul Burton: "Some SGI IP27 specific PCI rework and a batch of fixes: - A build fix for BMIPS5000 configurations with CONFIG_HW_PERF_EVENTS=y, which also neatly removes some #ifdefery. - A fix to report supported ISAs correctly on older Ingenic SoCs which incorrectly indicate MIPSr2 support in their cop0 Config register. - Some PCI modernization for SGI IP27 systems as part of ongoing work to support some other SGI systems. - A fix allowing use of appended DTB files with generic kernels. - DMA mask fixes for SGI IP22 & Alchemy systems" * tag 'mips_5.2_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Alchemy: add DMA masks for on-chip ethernet MIPS: SGI-IP22: provide missing dma_mask/coherent_dma_mask generic: fix appended dtb support MIPS: SGI-IP27: abstract chipset irq from bridge MIPS: SGI-IP27: use generic PCI driver MIPS: Fix Ingenic SoCs sometimes reporting wrong ISA MIPS: perf: Fix build with CONFIG_CPU_BMIPS5000 enabled
2 parents b0bb126 + b1e479e commit bcd1739

File tree

18 files changed

+831
-659
lines changed

18 files changed

+831
-659
lines changed

arch/mips/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,10 @@ config SGI_IP27
674674
select SYS_HAS_EARLY_PRINTK
675675
select HAVE_PCI
676676
select IRQ_MIPS_CPU
677+
select IRQ_DOMAIN_HIERARCHY
677678
select NR_CPUS_DEFAULT_64
679+
select PCI_DRIVERS_GENERIC
680+
select PCI_XTALK_BRIDGE
678681
select SYS_HAS_CPU_R10000
679682
select SYS_SUPPORTS_64BIT_KERNEL
680683
select SYS_SUPPORTS_BIG_ENDIAN
@@ -1241,6 +1244,9 @@ config IRQ_GT641XX
12411244
config PCI_GT64XXX_PCI0
12421245
bool
12431246

1247+
config PCI_XTALK_BRIDGE
1248+
bool
1249+
12441250
config NO_EXCEPT_FILL
12451251
bool
12461252

arch/mips/alchemy/common/platform.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ static void __init alchemy_setup_uarts(int ctype)
131131
}
132132

133133

134-
/* The dmamask must be set for OHCI/EHCI to work */
135-
static u64 alchemy_ohci_dmamask = DMA_BIT_MASK(32);
136-
static u64 __maybe_unused alchemy_ehci_dmamask = DMA_BIT_MASK(32);
134+
static u64 alchemy_all_dmamask = DMA_BIT_MASK(32);
137135

138136
/* Power on callback for the ehci platform driver */
139137
static int alchemy_ehci_power_on(struct platform_device *pdev)
@@ -231,7 +229,7 @@ static void __init alchemy_setup_usb(int ctype)
231229
res[1].flags = IORESOURCE_IRQ;
232230
pdev->name = "ohci-platform";
233231
pdev->id = 0;
234-
pdev->dev.dma_mask = &alchemy_ohci_dmamask;
232+
pdev->dev.dma_mask = &alchemy_all_dmamask;
235233
pdev->dev.platform_data = &alchemy_ohci_pdata;
236234

237235
if (platform_device_register(pdev))
@@ -251,7 +249,7 @@ static void __init alchemy_setup_usb(int ctype)
251249
res[1].flags = IORESOURCE_IRQ;
252250
pdev->name = "ehci-platform";
253251
pdev->id = 0;
254-
pdev->dev.dma_mask = &alchemy_ehci_dmamask;
252+
pdev->dev.dma_mask = &alchemy_all_dmamask;
255253
pdev->dev.platform_data = &alchemy_ehci_pdata;
256254

257255
if (platform_device_register(pdev))
@@ -271,7 +269,7 @@ static void __init alchemy_setup_usb(int ctype)
271269
res[1].flags = IORESOURCE_IRQ;
272270
pdev->name = "ohci-platform";
273271
pdev->id = 1;
274-
pdev->dev.dma_mask = &alchemy_ohci_dmamask;
272+
pdev->dev.dma_mask = &alchemy_all_dmamask;
275273
pdev->dev.platform_data = &alchemy_ohci_pdata;
276274

277275
if (platform_device_register(pdev))
@@ -338,7 +336,11 @@ static struct platform_device au1xxx_eth0_device = {
338336
.name = "au1000-eth",
339337
.id = 0,
340338
.num_resources = MAC_RES_COUNT,
341-
.dev.platform_data = &au1xxx_eth0_platform_data,
339+
.dev = {
340+
.dma_mask = &alchemy_all_dmamask,
341+
.coherent_dma_mask = DMA_BIT_MASK(32),
342+
.platform_data = &au1xxx_eth0_platform_data,
343+
},
342344
};
343345

344346
static struct resource au1xxx_eth1_resources[][MAC_RES_COUNT] __initdata = {
@@ -370,7 +372,11 @@ static struct platform_device au1xxx_eth1_device = {
370372
.name = "au1000-eth",
371373
.id = 1,
372374
.num_resources = MAC_RES_COUNT,
373-
.dev.platform_data = &au1xxx_eth1_platform_data,
375+
.dev = {
376+
.dma_mask = &alchemy_all_dmamask,
377+
.coherent_dma_mask = DMA_BIT_MASK(32),
378+
.platform_data = &au1xxx_eth1_platform_data,
379+
},
374380
};
375381

376382
void __init au1xxx_override_eth_cfg(unsigned int port,

arch/mips/generic/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ void __init *plat_get_fdt(void)
4343
/* Already set up */
4444
return (void *)fdt;
4545

46-
if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_arg1)) {
46+
if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_passed_dtb)) {
4747
/*
4848
* We booted using the UHI boot protocol, so we have been
4949
* provided with the appropriate device tree for the board.
5050
* Make use of it & search for any machine struct based upon
5151
* the root compatible string.
5252
*/
53-
fdt = (void *)fw_arg1;
53+
fdt = (void *)fw_passed_dtb;
5454

5555
for_each_mips_machine(check_mach) {
5656
match = mips_machine_is_compatible(check_mach, fdt);

arch/mips/include/asm/mach-ip27/topology.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,9 @@
77
#include <asm/mmzone.h>
88

99
struct cpuinfo_ip27 {
10-
// cpuid_t p_cpuid; /* PROM assigned cpuid */
1110
cnodeid_t p_nodeid; /* my node ID in compact-id-space */
1211
nasid_t p_nasid; /* my node ID in numa-as-id-space */
1312
unsigned char p_slice; /* Physical position on node board */
14-
#if 0
15-
unsigned long loops_per_sec;
16-
unsigned long ipi_count;
17-
unsigned long irq_attempt[NR_IRQS];
18-
unsigned long smp_local_irq_count;
19-
unsigned long prof_multiplier;
20-
unsigned long prof_counter;
21-
#endif
2213
};
2314

2415
extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
@@ -30,7 +21,7 @@ extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
3021
struct pci_bus;
3122
extern int pcibus_to_node(struct pci_bus *);
3223

33-
#define cpumask_of_pcibus(bus) (cpu_online_mask)
24+
#define cpumask_of_pcibus(bus) (cpumask_of_node(pcibus_to_node(bus)))
3425

3526
extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
3627

arch/mips/include/asm/pci/bridge.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -801,15 +801,13 @@ struct bridge_err_cmdword {
801801
#define PCI64_ATTR_RMF_SHFT 48
802802

803803
struct bridge_controller {
804-
struct pci_controller pc;
805-
struct resource mem;
806-
struct resource io;
807804
struct resource busn;
808805
struct bridge_regs *base;
809-
nasid_t nasid;
810-
unsigned int widget_id;
811-
u64 baddr;
806+
unsigned long baddr;
807+
unsigned long intr_addr;
808+
struct irq_domain *domain;
812809
unsigned int pci_int[8];
810+
nasid_t nasid;
813811
};
814812

815813
#define BRIDGE_CONTROLLER(bus) \
@@ -822,8 +820,4 @@ struct bridge_controller {
822820
#define bridge_clr(bc, reg, val) \
823821
__raw_writel(__raw_readl(&bc->base->reg) & ~(val), &bc->base->reg)
824822

825-
extern int request_bridge_irq(struct bridge_controller *bc, int pin);
826-
827-
extern struct pci_ops bridge_pci_ops;
828-
829823
#endif /* _ASM_PCI_BRIDGE_H */

arch/mips/include/asm/sn/irq_alloc.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __ASM_SN_IRQ_ALLOC_H
3+
#define __ASM_SN_IRQ_ALLOC_H
4+
5+
struct irq_alloc_info {
6+
void *ctrl;
7+
nasid_t nasid;
8+
int pin;
9+
};
10+
11+
#endif /* __ASM_SN_IRQ_ALLOC_H */

arch/mips/include/asm/xtalk/xtalk.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ typedef struct xtalk_piomap_s *xtalk_piomap_t;
4747
#define XIO_PORT(x) ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT))
4848
#define XIO_PACK(p, o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS))
4949

50-
#ifdef CONFIG_PCI
51-
extern int bridge_probe(nasid_t nasid, int widget, int masterwid);
52-
#else
53-
static inline int bridge_probe(nasid_t nasid, int widget, int masterwid)
54-
{
55-
return 0;
56-
}
57-
#endif
58-
5950
#endif /* !__ASSEMBLY__ */
6051

6152
#endif /* _ASM_XTALK_XTALK_H */

arch/mips/kernel/cpu-probe.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,6 +1973,14 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
19731973
panic("Unknown Ingenic Processor ID!");
19741974
break;
19751975
}
1976+
1977+
/*
1978+
* The config0 register in the Xburst CPUs with a processor ID of
1979+
* PRID_COMP_INGENIC_D0 report themselves as MIPS32r2 compatible,
1980+
* but they don't actually support this ISA.
1981+
*/
1982+
if ((c->processor_id & PRID_COMP_MASK) == PRID_COMP_INGENIC_D0)
1983+
c->isa_level &= ~MIPS_CPU_ISA_M32R2;
19761984
}
19771985

19781986
static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu)

arch/mips/kernel/perf_event_mipsxx.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,11 @@ struct mips_perf_event {
6464
#define CNTR_EVEN 0x55555555
6565
#define CNTR_ODD 0xaaaaaaaa
6666
#define CNTR_ALL 0xffffffff
67-
#ifdef CONFIG_MIPS_MT_SMP
6867
enum {
6968
T = 0,
7069
V = 1,
7170
P = 2,
7271
} range;
73-
#else
74-
#define T
75-
#define V
76-
#define P
77-
#endif
7872
};
7973

8074
static struct mips_perf_event raw_event;
@@ -325,9 +319,7 @@ static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx)
325319
{
326320
struct perf_event *event = container_of(evt, struct perf_event, hw);
327321
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
328-
#ifdef CONFIG_MIPS_MT_SMP
329322
unsigned int range = evt->event_base >> 24;
330-
#endif /* CONFIG_MIPS_MT_SMP */
331323

332324
WARN_ON(idx < 0 || idx >= mipspmu.num_counters);
333325

@@ -336,21 +328,15 @@ static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx)
336328
/* Make sure interrupt enabled. */
337329
MIPS_PERFCTRL_IE;
338330

339-
#ifdef CONFIG_CPU_BMIPS5000
340-
{
331+
if (IS_ENABLED(CONFIG_CPU_BMIPS5000)) {
341332
/* enable the counter for the calling thread */
342333
cpuc->saved_ctrl[idx] |=
343334
(1 << (12 + vpe_id())) | BRCM_PERFCTRL_TC;
344-
}
345-
#else
346-
#ifdef CONFIG_MIPS_MT_SMP
347-
if (range > V) {
335+
} else if (IS_ENABLED(CONFIG_MIPS_MT_SMP) && range > V) {
348336
/* The counter is processor wide. Set it up to count all TCs. */
349337
pr_debug("Enabling perf counter for all TCs\n");
350338
cpuc->saved_ctrl[idx] |= M_TC_EN_ALL;
351-
} else
352-
#endif /* CONFIG_MIPS_MT_SMP */
353-
{
339+
} else {
354340
unsigned int cpu, ctrl;
355341

356342
/*
@@ -365,7 +351,6 @@ static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx)
365351
cpuc->saved_ctrl[idx] |= ctrl;
366352
pr_debug("Enabling perf counter for CPU%d\n", cpu);
367353
}
368-
#endif /* CONFIG_CPU_BMIPS5000 */
369354
/*
370355
* We do not actually let the counter run. Leave it until start().
371356
*/

arch/mips/pci/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ obj-$(CONFIG_PCI_AR2315) += pci-ar2315.o
2626
obj-$(CONFIG_SOC_AR71XX) += pci-ar71xx.o
2727
obj-$(CONFIG_PCI_AR724X) += pci-ar724x.o
2828
obj-$(CONFIG_MIPS_PCI_VIRTIO) += pci-virtio-guest.o
29+
obj-$(CONFIG_PCI_XTALK_BRIDGE) += pci-xtalk-bridge.o
2930
#
3031
# These are still pretty much in the old state, watch, go blind.
3132
#
@@ -39,7 +40,7 @@ obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o pci-malta.o
3940
obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o
4041
obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o
4142
obj-$(CONFIG_PMC_MSP7120_FPGA) += fixup-pmcmsp.o ops-pmcmsp.o
42-
obj-$(CONFIG_SGI_IP27) += ops-bridge.o pci-ip27.o
43+
obj-$(CONFIG_SGI_IP27) += pci-ip27.o
4344
obj-$(CONFIG_SGI_IP32) += fixup-ip32.o ops-mace.o pci-ip32.o
4445
obj-$(CONFIG_SIBYTE_SB1250) += fixup-sb1250.o pci-sb1250.o
4546
obj-$(CONFIG_SIBYTE_BCM112X) += fixup-sb1250.o pci-sb1250.o

0 commit comments

Comments
 (0)