Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
75a6541
UPSTREAM: riscv: dts: sophgo: Add xtheadvector to the sg2042 devicetree
RevySR Jul 5, 2025
af1e2bc
UPSTREAM: riscv: dts: sophgo: add ziccrse for sg2042
RevySR Jul 5, 2025
afb462d
UPSTREAM: riscv: dts: sophgo: add zfh for sg2042
RevySR Jul 5, 2025
6d3c077
UPSTREAM: dt-bindings: net: sophgo,sg2044-dwmac: Add support for Soph…
inochisa Jul 8, 2025
50e28f9
UPSTREAM: net: stmmac: dwmac-sophgo: Add support for Sophgo SG2042 SoC
inochisa Jul 8, 2025
b875d4d
UPSTREAM: net: stmmac: platform: Add snps,dwmac-5.00a IP compatible s…
inochisa Jul 8, 2025
7a27d2e
UPSTREAM: riscv: dts: sophgo: add ethernet GMAC device for sg2042
inochisa Jul 8, 2025
c9090f0
UPSTREAM: dt-bindings: soc: sophgo: Move SoCs/boards from riscv into …
sverdlin Jun 12, 2025
6258c5d
UPSTREAM: dt-bindings: riscv: add Sophgo SG2042_EVB_V1.X/V2.0 bindings
RevySR Jul 5, 2025
53a7468
UPSTREAM: riscv: dts: sophgo: add Sophgo SG2042_EVB_V1.X board device…
RevySR Jul 5, 2025
bab005c
UPSTREAM: riscv: dts: sophgo: add Sophgo SG2042_EVB_V2.0 board device…
RevySR Jul 5, 2025
50b8526
UPSTREAM: spi: dt-bindings: spi-sg2044-nor: Change SOPHGO SG2042
sycamoremoon Jul 20, 2025
858ceda
UPSTREAM: spi: spi-sg2044-nor: Add configurable chip_info
sycamoremoon Jul 20, 2025
fdefcec
UPSTREAM: spi: spi-sg2044-nor: Add SPI-NOR controller for SG2042
sycamoremoon Jul 20, 2025
b87b392
FROMLIST: riscv: mmap(): use unsigned offset type in riscv_sys_mmap
Jul 7, 2025
76a8abc
FROMLIST: riscv: introduce ioremap_wc()
cuiyunhui Jul 22, 2025
1977efe
FROMLIST: drm/ttm: add pgprot handling for RISC-V
Icenowy Jul 22, 2025
740cdfe
FROMLIST: irqchip/sifive-plic: Respect mask state when setting affinity
inochisa Aug 11, 2025
00eee2a
FROMLIST: genirq: Add irq_chip_(startup/shutdown)_parent()
inochisa Aug 13, 2025
8a380ed
FROMLIST: PCI/MSI: Add startup/shutdown for per device domains
inochisa Aug 13, 2025
310f465
FROMLIST: irqchip/sg2042-msi: Fix broken affinity setting
inochisa Aug 13, 2025
5a3c0ff
FROMLIST: irqchip/sg2042-msi: Set MSI_FLAG_MULTI_PCI_MSI flags for SG…
inochisa Aug 13, 2025
bca3e4e
FROMLIST: riscv: Move vendor errata definitions to new header
guoren83 Jul 13, 2025
a86bc18
FROMLIST: riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup
guoren83 Jul 13, 2025
ab968b1
FROMLIST: riscv: dts: sophgo: Add SPI NOR node for SG2042
sycamoremoon Aug 13, 2025
2718fa0
FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for PioneerBox
sycamoremoon Aug 13, 2025
8692526
FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for SG2042_EVB_V1
sycamoremoon Aug 13, 2025
2f8b598
FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for SG2042_EVB_V2
sycamoremoon Aug 13, 2025
3a7d7ef
FROMLIST: dt-bindings: pci: Add Sophgo SG2042 PCIe host
unicornx Jun 4, 2025
277b9ff
FROMLIST: PCI: sg2042: Add Sophgo SG2042 PCIe driver
unicornx Jun 4, 2025
bcd50eb
FROMLIST: dt-bindings: mfd: syscon: Add sg2042 pcie ctrl compatible
unicornx Jun 4, 2025
cb61c9d
FROMLIST: riscv: sophgo: dts: add pcie controllers for SG2042
unicornx Jun 4, 2025
920e7dd
FROMLIST: riscv: sophgo: dts: enable pcie for PioneerBox
unicornx Jun 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/mfd/syscon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ select:
- rockchip,rk3576-qos
- rockchip,rk3588-qos
- rockchip,rv1126-qos
- sophgo,sg2042-pcie-ctrl
- st,spear1340-misc
- stericsson,nomadik-pmu
- starfive,jh7100-sysmain
Expand Down Expand Up @@ -222,6 +223,7 @@ properties:
- rockchip,rk3576-qos
- rockchip,rk3588-qos
- rockchip,rv1126-qos
- sophgo,sg2042-pcie-ctrl
- st,spear1340-misc
- stericsson,nomadik-pmu
- starfive,jh7100-sysmain
Expand Down
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/net/snps,dwmac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ select:
- snps,dwmac-4.00
- snps,dwmac-4.10a
- snps,dwmac-4.20a
- snps,dwmac-5.00a
- snps,dwmac-5.10a
- snps,dwmac-5.20
- snps,dwmac-5.30a
Expand Down Expand Up @@ -98,11 +99,13 @@ properties:
- snps,dwmac-4.00
- snps,dwmac-4.10a
- snps,dwmac-4.20a
- snps,dwmac-5.00a
- snps,dwmac-5.10a
- snps,dwmac-5.20
- snps,dwmac-5.30a
- snps,dwxgmac
- snps,dwxgmac-2.10
- sophgo,sg2042-dwmac
- sophgo,sg2044-dwmac
- starfive,jh7100-dwmac
- starfive,jh7110-dwmac
Expand Down Expand Up @@ -641,6 +644,7 @@ allOf:
- snps,dwmac-4.00
- snps,dwmac-4.10a
- snps,dwmac-4.20a
- snps,dwmac-5.00a
- snps,dwmac-5.10a
- snps,dwmac-5.20
- snps,dwmac-5.30a
Expand Down
11 changes: 8 additions & 3 deletions Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ select:
contains:
enum:
- sophgo,sg2044-dwmac
- sophgo,sg2042-dwmac
required:
- compatible

properties:
compatible:
items:
- const: sophgo,sg2044-dwmac
- const: snps,dwmac-5.30a
oneOf:
- items:
- const: sophgo,sg2042-dwmac
- const: snps,dwmac-5.00a
- items:
- const: sophgo,sg2044-dwmac
- const: snps,dwmac-5.30a

reg:
maxItems: 1
Expand Down
147 changes: 147 additions & 0 deletions Documentation/devicetree/bindings/pci/sophgo,sg2042-pcie-host.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pci/sophgo,sg2042-pcie-host.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sophgo SG2042 PCIe Host (Cadence PCIe Wrapper)

description:
Sophgo SG2042 PCIe host controller is based on the Cadence PCIe core.

maintainers:
- Chen Wang <[email protected]>

properties:
compatible:
const: sophgo,sg2042-pcie-host

reg:
maxItems: 2

reg-names:
items:
- const: reg
- const: cfg

vendor-id:
const: 0x1f1c

device-id:
const: 0x2042

msi:
type: object
$ref: /schemas/interrupt-controller/msi-controller.yaml#
unevaluatedProperties: false

properties:
compatible:
items:
- const: sophgo,sg2042-pcie-msi

interrupts:
maxItems: 1

interrupt-names:
const: msi

msi-parent: true

sophgo,link-id:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
SG2042 uses Cadence IP, every IP is composed of 2 cores (called link0
& link1 as Cadence's term). Each core corresponds to a host bridge,
and each host bridge has only one root port. Their configuration
registers are completely independent. SG2042 integrates two Cadence IPs,
so there can actually be up to four host bridges. "sophgo,link-id" is
used to identify which core/link the PCIe host bridge node corresponds to.

The Cadence IP has two modes of operation, selected by a strap pin.

In the single-link mode, the Cadence PCIe core instance associated
with Link0 is connected to all the lanes and the Cadence PCIe core
instance associated with Link1 is inactive.

In the dual-link mode, the Cadence PCIe core instance associated
with Link0 is connected to the lower half of the lanes and the
Cadence PCIe core instance associated with Link1 is connected to
the upper half of the lanes.

SG2042 contains 2 Cadence IPs and configures the Cores as below:

+-- Core (Link0) <---> pcie_rc0 +-----------------+
| | |
Cadence IP 1 --+ | cdns_pcie0_ctrl |
| | |
+-- Core (Link1) <---> disabled +-----------------+

+-- Core (Link0) <---> pcie_rc1 +-----------------+
| | |
Cadence IP 2 --+ | cdns_pcie1_ctrl |
| | |
+-- Core (Link1) <---> pcie_rc2 +-----------------+

pcie_rcX is PCIe node ("sophgo,sg2042-pcie-host") defined in DTS.

Sophgo defines some new register files to add support for their MSI
controller inside PCIe. These new register files are defined in DTS as
syscon node ("sophgo,sg2042-pcie-ctrl"), i.e. "cdns_pcie0_ctrl" /
"cdns_pcie1_ctrl". cdns_pcieX_ctrl contains some registers shared by
pcie_rcX, even two RC (Link)s may share different bits of the same
register. For example, cdns_pcie1_ctrl contains registers shared by
link0 & link1 for Cadence IP 2.

"sophgo,link-id" is defined to distinguish the two RC's in one Cadence IP,
so we can know what registers (bits) we should use.

sophgo,syscon-pcie-ctrl:
$ref: /schemas/types.yaml#/definitions/phandle
description:
Phandle to the PCIe System Controller DT node. It's required to
access some MSI operation registers shared by PCIe RCs.

allOf:
- $ref: cdns-pcie-host.yaml#

required:
- compatible
- reg
- reg-names
- vendor-id
- device-id
- sophgo,link-id
- sophgo,syscon-pcie-ctrl

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>

pcie@62000000 {
compatible = "sophgo,sg2042-pcie-host";
device_type = "pci";
reg = <0x62000000 0x00800000>,
<0x48000000 0x00001000>;
reg-names = "reg", "cfg";
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x81000000 0 0x00000000 0xde000000 0 0x00010000>,
<0x82000000 0 0xd0400000 0xd0400000 0 0x0d000000>;
bus-range = <0x00 0xff>;
vendor-id = <0x1f1c>;
device-id = <0x2042>;
cdns,no-bar-match-nbits = <48>;
sophgo,link-id = <0>;
sophgo,syscon-pcie-ctrl = <&cdns_pcie1_ctrl>;
msi-parent = <&msi_pcie>;
msi_pcie: msi {
compatible = "sophgo,sg2042-pcie-msi";
msi-controller;
interrupt-parent = <&intc>;
interrupts = <123 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi";
};
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/riscv/sophgo.yaml#
$id: http://devicetree.org/schemas/soc/sophgo/sophgo.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sophgo SoC-based boards
Expand All @@ -26,6 +26,11 @@ properties:
- enum:
- sophgo,huashan-pi
- const: sophgo,cv1812h
- items:
- enum:
- milkv,duo-module-01-evb
- const: milkv,duo-module-01
- const: sophgo,sg2000
- items:
- enum:
- sipeed,licheerv-nano-b
Expand All @@ -34,6 +39,8 @@ properties:
- items:
- enum:
- milkv,pioneer
- sophgo,sg2042-evb-v1
- sophgo,sg2042-evb-v2
- const: sophgo,sg2042
- items:
- enum:
Expand Down
9 changes: 3 additions & 6 deletions Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ allOf:

properties:
compatible:
oneOf:
- const: sophgo,sg2044-spifmc-nor
- items:
- enum:
- sophgo,sg2042-spifmc-nor
- const: sophgo,sg2044-spifmc-nor
enum:
- sophgo,sg2042-spifmc-nor
- sophgo,sg2044-spifmc-nor

reg:
maxItems: 1
Expand Down
17 changes: 17 additions & 0 deletions arch/riscv/Kconfig.errata
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,21 @@ config ERRATA_THEAD_GHOSTWRITE

If you don't know what to do here, say "Y".

config ERRATA_THEAD_WRITE_ONCE
bool "Apply T-Head WRITE_ONCE errata"
depends on ERRATA_THEAD
default y
help
The early version of T-Head C9xx cores of sg2042 & th1520 have a store
merge buffer delay problem. The store merge buffer could improve the
store queue performance by merging multi-store requests, but when there
are no continued store requests, the prior single store request would be
waiting in the store queue for a long time. That would cause signifi-
cant problems for communication between multi-cores. Appending a
fence w.o could immediately flush the store merge buffer and let other
cores see the write result.

This will apply the WRITE_ONCE errata to handle the non-standard beh-
avior via appending a fence w.o instruction for WRITE_ONCE().

endmenu # "CPU errata selection"
2 changes: 2 additions & 0 deletions arch/riscv/boot/dts/sophgo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ dtb-$(CONFIG_ARCH_SOPHGO) += cv1800b-milkv-duo.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += cv1812h-huashan-pi.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2002-licheerv-nano-b.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-milkv-pioneer.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v1.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2042-evb-v2.dtb
dtb-$(CONFIG_ARCH_SOPHGO) += sg2044-sophgo-srd3-10.dtb
Loading