Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'riscv-for-linus-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley:

- Correct the MIPS RISC-V/JEDEC vendor ID

- Fix the system shutdown behavior in the legacy case where
CONFIG_RISCV_SBI_V01 is set, but the firmware implementation
doesn't support the older v0.1 system shutdown method

- Align some tools/ macro definitions with the corresponding
kernel headers

* tag 'riscv-for-linus-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
tools: riscv: Fixed misalignment of CSR related definitions
riscv: sbi: Prefer SRST shutdown over legacy
riscv: Update MIPS vendor id to 0x127

+10 -5
+1 -1
arch/riscv/include/asm/vendorid_list.h
··· 7 7 8 8 #define ANDES_VENDOR_ID 0x31e 9 9 #define MICROCHIP_VENDOR_ID 0x029 10 + #define MIPS_VENDOR_ID 0x127 10 11 #define SIFIVE_VENDOR_ID 0x489 11 12 #define THEAD_VENDOR_ID 0x5b7 12 - #define MIPS_VENDOR_ID 0x722 13 13 14 14 #endif
+5 -1
arch/riscv/kernel/sbi.c
··· 648 648 649 649 void __init sbi_init(void) 650 650 { 651 + bool srst_power_off = false; 651 652 int ret; 652 653 653 - sbi_set_power_off(); 654 654 ret = sbi_get_spec_version(); 655 655 if (ret > 0) 656 656 sbi_spec_version = ret; ··· 683 683 sbi_probe_extension(SBI_EXT_SRST)) { 684 684 pr_info("SBI SRST extension detected\n"); 685 685 register_platform_power_off(sbi_srst_power_off); 686 + srst_power_off = true; 686 687 sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot; 687 688 sbi_srst_reboot_nb.priority = 192; 688 689 register_restart_handler(&sbi_srst_reboot_nb); ··· 703 702 __sbi_send_ipi = __sbi_send_ipi_v01; 704 703 __sbi_rfence = __sbi_rfence_v01; 705 704 } 705 + 706 + if (!srst_power_off) 707 + sbi_set_power_off(); 706 708 }
+1 -1
drivers/perf/riscv_pmu_sbi.c
··· 1109 1109 /* compute hardware counter index */ 1110 1110 hidx = info->csr - CSR_CYCLE; 1111 1111 1112 - /* check if the corresponding bit is set in sscountovf or overflow mask in shmem */ 1112 + /* check if the corresponding bit is set in scountovf or overflow mask in shmem */ 1113 1113 if (!(overflow & BIT(hidx))) 1114 1114 continue; 1115 1115
+3 -2
tools/arch/riscv/include/asm/csr.h
··· 167 167 #define VSIP_TO_HVIP_SHIFT (IRQ_VS_SOFT - IRQ_S_SOFT) 168 168 #define VSIP_VALID_MASK ((_AC(1, UL) << IRQ_S_SOFT) | \ 169 169 (_AC(1, UL) << IRQ_S_TIMER) | \ 170 - (_AC(1, UL) << IRQ_S_EXT)) 170 + (_AC(1, UL) << IRQ_S_EXT) | \ 171 + (_AC(1, UL) << IRQ_PMU_OVF)) 171 172 172 173 /* AIA CSR bits */ 173 174 #define TOPI_IID_SHIFT 16 ··· 281 280 #define CSR_HPMCOUNTER30H 0xc9e 282 281 #define CSR_HPMCOUNTER31H 0xc9f 283 282 284 - #define CSR_SSCOUNTOVF 0xda0 283 + #define CSR_SCOUNTOVF 0xda0 285 284 286 285 #define CSR_SSTATUS 0x100 287 286 #define CSR_SIE 0x104