Skip to content

Commit f66e797

Browse files
committed
Merge tag 'riscv-for-linus-5.19-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull more RISC-V updates from Palmer Dabbelt: "This is mostly some DT updates, but also a handful of cleanups and some fixes. The most user-visible of those are: - A device tree for the Sundance Polarberry, along with a handful of fixes and clenups to the PolarFire SOC device trees and bindings. - The memfd_secret syscall number is now visible to userspace, - Some improvements to the vm layout dump, which really should have followed shortly after the sv48 patches but I missed" * tag 'riscv-for-linus-5.19-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Move alternative length validation into subsection riscv: mm: init: make pt_ops_set_[early|late|fixmap] static riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild RISC-V: Mark IORESOURCE_EXCLUSIVE for reserved mem instead of IORESOURCE_BUSY riscv: Wire up memfd_secret in UAPI header riscv: Fix irq_work when SMP is disabled riscv: Improve virtual kernel memory layout dump riscv: Initialize thread pointer before calling C functions Documentation: riscv: Add sv48 description to VM layout RISC-V: Only default to spinwait on SBI-0.1 and M-mode riscv: dts: icicle: sort nodes alphabetically riscv: microchip: icicle: readability fixes riscv: dts: microchip: add the sundance polarberry dt-bindings: riscv: microchip: add polarberry compatible string dt-bindings: vendor-prefixes: add Sundance DSP riscv: dts: microchip: make the fabric dtsi board specific dt-bindings: riscv: microchip: document icicle reference design riscv: dts: microchip: remove soc vendor from filenames riscv: dts: microchip: move sysctrlr out of soc bus riscv: dts: microchip: remove icicle memory clocks
2 parents 4ab6cfc + 61114e7 commit f66e797

File tree

19 files changed

+287
-87
lines changed

19 files changed

+287
-87
lines changed

Documentation/devicetree/bindings/riscv/microchip.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ properties:
2020
items:
2121
- enum:
2222
- microchip,mpfs-icicle-kit
23+
- microchip,mpfs-icicle-reference-rtlv2203
24+
- sundance,polarberry
2325
- const: microchip,mpfs
2426

2527
additionalProperties: true

Documentation/devicetree/bindings/vendor-prefixes.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,8 @@ patternProperties:
12071207
description: Summit microelectronics
12081208
"^sunchip,.*":
12091209
description: Shenzhen Sunchip Technology Co., Ltd
1210+
"^sundance,.*":
1211+
description: Sundance DSP Inc.
12101212
"^sunplus,.*":
12111213
description: Sunplus Technology Co., Ltd.
12121214
"^SUNW,.*":

Documentation/riscv/vm-layout.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,39 @@ RISC-V Linux Kernel SV39
6161
ffffffff00000000 | -4 GB | ffffffff7fffffff | 2 GB | modules, BPF
6262
ffffffff80000000 | -2 GB | ffffffffffffffff | 2 GB | kernel
6363
__________________|____________|__________________|_________|____________________________________________________________
64+
65+
66+
RISC-V Linux Kernel SV48
67+
------------------------
68+
69+
::
70+
71+
========================================================================================================================
72+
Start addr | Offset | End addr | Size | VM area description
73+
========================================================================================================================
74+
| | | |
75+
0000000000000000 | 0 | 00007fffffffffff | 128 TB | user-space virtual memory, different per mm
76+
__________________|____________|__________________|_________|___________________________________________________________
77+
| | | |
78+
0000800000000000 | +128 TB | ffff7fffffffffff | ~16M TB | ... huge, almost 64 bits wide hole of non-canonical
79+
| | | | virtual memory addresses up to the -128 TB
80+
| | | | starting offset of kernel mappings.
81+
__________________|____________|__________________|_________|___________________________________________________________
82+
|
83+
| Kernel-space virtual memory, shared between all processes:
84+
____________________________________________________________|___________________________________________________________
85+
| | | |
86+
ffff8d7ffee00000 | -114.5 TB | ffff8d7ffeffffff | 2 MB | fixmap
87+
ffff8d7fff000000 | -114.5 TB | ffff8d7fffffffff | 16 MB | PCI io
88+
ffff8d8000000000 | -114.5 TB | ffff8f7fffffffff | 2 TB | vmemmap
89+
ffff8f8000000000 | -112.5 TB | ffffaf7fffffffff | 32 TB | vmalloc/ioremap space
90+
ffffaf8000000000 | -80.5 TB | ffffef7fffffffff | 64 TB | direct mapping of all physical memory
91+
ffffef8000000000 | -16.5 TB | fffffffeffffffff | 16.5 TB | kasan
92+
__________________|____________|__________________|_________|____________________________________________________________
93+
|
94+
| Identical layout to the 39-bit one from here on:
95+
____________________________________________________________|____________________________________________________________
96+
| | | |
97+
ffffffff00000000 | -4 GB | ffffffff7fffffff | 2 GB | modules, BPF
98+
ffffffff80000000 | -2 GB | ffffffffffffffff | 2 GB | kernel
99+
__________________|____________|__________________|_________|____________________________________________________________

arch/riscv/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
obj-y += kernel/ mm/ net/
44
obj-$(CONFIG_BUILTIN_DTB) += boot/dts/
5+
obj-y += errata/
6+
obj-$(CONFIG_KVM) += kvm/
57

68
obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += purgatory/
79

arch/riscv/Kconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ config RISCV_SBI_V01
396396
config RISCV_BOOT_SPINWAIT
397397
bool "Spinwait booting method"
398398
depends on SMP
399-
default y
399+
default y if RISCV_SBI_V01 || RISCV_M_MODE
400400
help
401401
This enables support for booting Linux via spinwait method. In the
402402
spinwait method, all cores randomly jump to Linux. One of the cores
@@ -407,6 +407,12 @@ config RISCV_BOOT_SPINWAIT
407407
rely on ordered booting via SBI HSM extension which gets chosen
408408
dynamically at runtime if the firmware supports it.
409409

410+
Since spinwait is incompatible with sparse hart IDs, it requires
411+
NR_CPUS be large enough to contain the physical hart ID of the first
412+
hart to enter Linux.
413+
414+
If unsure what to do here, say N.
415+
410416
config KEXEC
411417
bool "Kexec system call"
412418
select KEXEC_CORE

arch/riscv/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ endif
103103

104104
head-y := arch/riscv/kernel/head.o
105105

106-
core-y += arch/riscv/errata/
107-
core-$(CONFIG_KVM) += arch/riscv/kvm/
108-
109106
libs-y += arch/riscv/lib/
110107
libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
111108

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += microchip-mpfs-icicle-kit.dtb
2+
dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-icicle-kit.dtb
3+
dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-polarberry.dtb
34
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))

arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi renamed to arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/* Copyright (c) 2020-2021 Microchip Technology Inc */
33

44
/ {
5+
compatible = "microchip,mpfs-icicle-reference-rtlv2203", "microchip,mpfs";
6+
57
core_pwm0: pwm@41000000 {
68
compatible = "microchip,corepwm-rtl-v4";
79
reg = <0x0 0x41000000 0x0 0xF0>;

arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts renamed to arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
/dts-v1/;
55

6-
#include "microchip-mpfs.dtsi"
6+
#include "mpfs.dtsi"
7+
#include "mpfs-icicle-kit-fabric.dtsi"
78

89
/* Clock frequency (in Hz) of the rtcclk */
910
#define RTCCLK_FREQ 1000000
@@ -32,41 +33,71 @@
3233
ddrc_cache_lo: memory@80000000 {
3334
device_type = "memory";
3435
reg = <0x0 0x80000000 0x0 0x2e000000>;
35-
clocks = <&clkcfg CLK_DDRC>;
3636
status = "okay";
3737
};
3838

3939
ddrc_cache_hi: memory@1000000000 {
4040
device_type = "memory";
4141
reg = <0x10 0x0 0x0 0x40000000>;
42-
clocks = <&clkcfg CLK_DDRC>;
4342
status = "okay";
4443
};
4544
};
4645

47-
&refclk {
48-
clock-frequency = <125000000>;
46+
&core_pwm0 {
47+
status = "okay";
4948
};
5049

51-
&mmuart1 {
50+
&gpio2 {
51+
interrupts = <53>, <53>, <53>, <53>,
52+
<53>, <53>, <53>, <53>,
53+
<53>, <53>, <53>, <53>,
54+
<53>, <53>, <53>, <53>,
55+
<53>, <53>, <53>, <53>,
56+
<53>, <53>, <53>, <53>,
57+
<53>, <53>, <53>, <53>,
58+
<53>, <53>, <53>, <53>;
5259
status = "okay";
5360
};
5461

55-
&mmuart2 {
62+
&i2c0 {
5663
status = "okay";
5764
};
5865

59-
&mmuart3 {
66+
&i2c1 {
6067
status = "okay";
6168
};
6269

63-
&mmuart4 {
70+
&i2c2 {
6471
status = "okay";
6572
};
6673

67-
&mmc {
74+
&mac0 {
75+
phy-mode = "sgmii";
76+
phy-handle = <&phy0>;
77+
status = "okay";
78+
};
79+
80+
&mac1 {
81+
phy-mode = "sgmii";
82+
phy-handle = <&phy1>;
6883
status = "okay";
6984

85+
phy1: ethernet-phy@9 {
86+
reg = <9>;
87+
ti,fifo-depth = <0x1>;
88+
};
89+
90+
phy0: ethernet-phy@8 {
91+
reg = <8>;
92+
ti,fifo-depth = <0x1>;
93+
};
94+
};
95+
96+
&mbox {
97+
status = "okay";
98+
};
99+
100+
&mmc {
70101
bus-width = <4>;
71102
disable-wp;
72103
cap-sd-highspeed;
@@ -78,84 +109,54 @@
78109
sd-uhs-sdr25;
79110
sd-uhs-sdr50;
80111
sd-uhs-sdr104;
81-
};
82-
83-
&spi0 {
84112
status = "okay";
85113
};
86114

87-
&spi1 {
115+
&mmuart1 {
88116
status = "okay";
89117
};
90118

91-
&qspi {
119+
&mmuart2 {
92120
status = "okay";
93121
};
94122

95-
&i2c0 {
123+
&mmuart3 {
96124
status = "okay";
97125
};
98126

99-
&i2c1 {
127+
&mmuart4 {
100128
status = "okay";
101129
};
102130

103-
&i2c2 {
131+
&pcie {
104132
status = "okay";
105133
};
106134

107-
&mac0 {
108-
phy-mode = "sgmii";
109-
phy-handle = <&phy0>;
110-
};
111-
112-
&mac1 {
135+
&qspi {
113136
status = "okay";
114-
phy-mode = "sgmii";
115-
phy-handle = <&phy1>;
116-
phy1: ethernet-phy@9 {
117-
reg = <9>;
118-
ti,fifo-depth = <0x1>;
119-
};
120-
phy0: ethernet-phy@8 {
121-
reg = <8>;
122-
ti,fifo-depth = <0x1>;
123-
};
124137
};
125138

126-
&gpio2 {
127-
interrupts = <53>, <53>, <53>, <53>,
128-
<53>, <53>, <53>, <53>,
129-
<53>, <53>, <53>, <53>,
130-
<53>, <53>, <53>, <53>,
131-
<53>, <53>, <53>, <53>,
132-
<53>, <53>, <53>, <53>,
133-
<53>, <53>, <53>, <53>,
134-
<53>, <53>, <53>, <53>;
135-
status = "okay";
139+
&refclk {
140+
clock-frequency = <125000000>;
136141
};
137142

138143
&rtc {
139144
status = "okay";
140145
};
141146

142-
&usb {
147+
&spi0 {
143148
status = "okay";
144-
dr_mode = "host";
145149
};
146150

147-
&mbox {
151+
&spi1 {
148152
status = "okay";
149153
};
150154

151155
&syscontroller {
152156
status = "okay";
153157
};
154158

155-
&pcie {
156-
status = "okay";
157-
};
158-
159-
&core_pwm0 {
159+
&usb {
160160
status = "okay";
161+
dr_mode = "host";
161162
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
/* Copyright (c) 2020-2022 Microchip Technology Inc */
3+
4+
/ {
5+
fabric_clk3: fabric-clk3 {
6+
compatible = "fixed-clock";
7+
#clock-cells = <0>;
8+
clock-frequency = <62500000>;
9+
};
10+
11+
fabric_clk1: fabric-clk1 {
12+
compatible = "fixed-clock";
13+
#clock-cells = <0>;
14+
clock-frequency = <125000000>;
15+
};
16+
};

0 commit comments

Comments
 (0)