Skip to content

Commit 28e7241

Browse files
committed
Merge tag 'mips_6.11_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS updates from Thomas Bogendoerfer: - Use improved timer sync for Loongson64 - Fix address of GCR_ACCESS register - Add missing MODULE_DESCRIPTION * tag 'mips_6.11_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: mips: sibyte: add missing MODULE_DESCRIPTION() macro MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later MIPS: Loongson64: Switch to SYNC_R4K
2 parents f646429 + 2c716cf commit 28e7241

File tree

6 files changed

+12
-35
lines changed

6 files changed

+12
-35
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ config MACH_LOONGSON64
478478
select BOARD_SCACHE
479479
select CSRC_R4K
480480
select CEVT_R4K
481+
select SYNC_R4K
481482
select FORCE_PCI
482483
select ISA
483484
select I8259

arch/mips/include/asm/mips-cm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ GCR_ACCESSOR_RO(32, 0x0d0, gic_status)
240240
GCR_ACCESSOR_RO(32, 0x0f0, cpc_status)
241241
#define CM_GCR_CPC_STATUS_EX BIT(0)
242242

243+
/* GCR_ACCESS - Controls core/IOCU access to GCRs */
244+
GCR_ACCESSOR_RW(32, 0x120, access_cm3)
245+
#define CM_GCR_ACCESS_ACCESSEN GENMASK(7, 0)
246+
243247
/* GCR_L2_CONFIG - Indicates L2 cache configuration when Config5.L2C=1 */
244248
GCR_ACCESSOR_RW(32, 0x130, l2_config)
245249
#define CM_GCR_L2_CONFIG_BYPASS BIT(20)

arch/mips/include/asm/smp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ extern int __cpu_logical_map[NR_CPUS];
5050
#define SMP_CALL_FUNCTION 0x2
5151
/* Octeon - Tell another core to flush its icache */
5252
#define SMP_ICACHE_FLUSH 0x4
53-
#define SMP_ASK_C0COUNT 0x8
5453

5554
/* Mask of CPUs which are currently definitely operating coherently */
5655
extern cpumask_t cpu_coherent_mask;

arch/mips/kernel/smp-cps.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ static void boot_core(unsigned int core, unsigned int vpe_id)
317317
write_gcr_co_reset_ext_base(CM_GCR_Cx_RESET_EXT_BASE_UEB);
318318

319319
/* Ensure the core can access the GCRs */
320-
set_gcr_access(1 << core);
320+
if (mips_cm_revision() < CM_REV_CM3)
321+
set_gcr_access(1 << core);
322+
else
323+
set_gcr_access_cm3(1 << core);
321324

322325
if (mips_cpc_present()) {
323326
/* Reset the core */

arch/mips/loongson64/smp.c

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ static void __iomem *ipi_clear0_regs[16];
3333
static void __iomem *ipi_status0_regs[16];
3434
static void __iomem *ipi_en0_regs[16];
3535
static void __iomem *ipi_mailbox_buf[16];
36-
static uint32_t core0_c0count[NR_CPUS];
3736

3837
static u32 (*ipi_read_clear)(int cpu);
3938
static void (*ipi_write_action)(int cpu, u32 action);
@@ -382,11 +381,10 @@ loongson3_send_ipi_mask(const struct cpumask *mask, unsigned int action)
382381
ipi_write_action(cpu_logical_map(i), (u32)action);
383382
}
384383

385-
386384
static irqreturn_t loongson3_ipi_interrupt(int irq, void *dev_id)
387385
{
388-
int i, cpu = smp_processor_id();
389-
unsigned int action, c0count;
386+
int cpu = smp_processor_id();
387+
unsigned int action;
390388

391389
action = ipi_read_clear(cpu);
392390

@@ -399,26 +397,14 @@ static irqreturn_t loongson3_ipi_interrupt(int irq, void *dev_id)
399397
irq_exit();
400398
}
401399

402-
if (action & SMP_ASK_C0COUNT) {
403-
BUG_ON(cpu != 0);
404-
c0count = read_c0_count();
405-
c0count = c0count ? c0count : 1;
406-
for (i = 1; i < nr_cpu_ids; i++)
407-
core0_c0count[i] = c0count;
408-
nudge_writes(); /* Let others see the result ASAP */
409-
}
410-
411400
return IRQ_HANDLED;
412401
}
413402

414-
#define MAX_LOOPS 800
415403
/*
416404
* SMP init and finish on secondary CPUs
417405
*/
418406
static void loongson3_init_secondary(void)
419407
{
420-
int i;
421-
uint32_t initcount;
422408
unsigned int cpu = smp_processor_id();
423409
unsigned int imask = STATUSF_IP7 | STATUSF_IP6 |
424410
STATUSF_IP3 | STATUSF_IP2;
@@ -432,23 +418,6 @@ static void loongson3_init_secondary(void)
432418
cpu_logical_map(cpu) % loongson_sysconf.cores_per_package);
433419
cpu_data[cpu].package =
434420
cpu_logical_map(cpu) / loongson_sysconf.cores_per_package;
435-
436-
i = 0;
437-
core0_c0count[cpu] = 0;
438-
loongson3_send_ipi_single(0, SMP_ASK_C0COUNT);
439-
while (!core0_c0count[cpu]) {
440-
i++;
441-
cpu_relax();
442-
}
443-
444-
if (i > MAX_LOOPS)
445-
i = MAX_LOOPS;
446-
if (cpu_data[cpu].package)
447-
initcount = core0_c0count[cpu] + i;
448-
else /* Local access is faster for loops */
449-
initcount = core0_c0count[cpu] + i/2;
450-
451-
write_c0_count(initcount);
452421
}
453422

454423
static void loongson3_smp_finish(void)

arch/mips/sibyte/common/sb_tbprof.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,4 +589,5 @@ module_exit(sbprof_tb_cleanup);
589589

590590
MODULE_ALIAS_CHARDEV_MAJOR(SBPROF_TB_MAJOR);
591591
MODULE_AUTHOR("Ralf Baechle <[email protected]>");
592+
MODULE_DESCRIPTION("Support for ZBbus profiling");
592593
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)