Compare commits
34 Commits
debian/6.1
...
debian/6.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7511e969db | ||
|
|
976719aa19 | ||
|
|
d635b991c9 | ||
|
|
0058b6e54f | ||
|
|
1c82dc3707 | ||
|
|
32e4b7e5de | ||
|
|
60da8f9adf | ||
|
|
fabf96dc31 | ||
|
|
29b43247d8 | ||
|
|
2456e83d9e | ||
|
|
a0a4993d57 | ||
|
|
a0936f8e6c | ||
|
|
b50707145e | ||
|
|
b0fd11e572 | ||
|
|
ddfcc372ac | ||
| f6819b4343 | |||
| fc5d914ad1 | |||
|
|
a687990d16 | ||
|
|
d30ef862ea | ||
|
|
0d94e08ccd | ||
| 4584bdc055 | |||
|
|
e10701958c | ||
|
|
c1a77b7c98 | ||
|
|
bb71965e04 | ||
|
|
8f84ccc4a0 | ||
|
|
cbae1415e4 | ||
|
|
4075edbaf6 | ||
|
|
ae8312b68b | ||
|
|
f363d8ceb6 | ||
|
|
47d5f72bdd | ||
|
|
cadb2c992c | ||
|
|
293f6e7522 | ||
|
|
e3f9a37335 | ||
|
|
ae5ada48b7 |
@@ -70,6 +70,25 @@ required:
|
||||
|
||||
allOf:
|
||||
- $ref: snps,dwmac.yaml#
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: sophgo,sg2042-dwmac
|
||||
then:
|
||||
properties:
|
||||
phy-mode:
|
||||
enum:
|
||||
- rgmii-txid
|
||||
- rgmii-id
|
||||
else:
|
||||
properties:
|
||||
phy-mode:
|
||||
enum:
|
||||
- rgmii
|
||||
- rgmii-rxid
|
||||
- rgmii-txid
|
||||
- rgmii-id
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
|
||||
61
Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
Normal file
61
Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/nvmem/sophgo,efuse.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Sophgo SoC eFuse-based NVMEM
|
||||
|
||||
description:
|
||||
Sophgo SoCs contain factory-programmed eFuses used to store ROM patch,
|
||||
public key and other factory information.
|
||||
|
||||
maintainers:
|
||||
- Inochi Amaoto <inochiama@gmail.com>
|
||||
|
||||
allOf:
|
||||
- $ref: nvmem.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- sophgo,sg2044-efuse
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
minItems: 1
|
||||
items:
|
||||
- description: Core clock
|
||||
- description: APB clock
|
||||
|
||||
clock-names:
|
||||
minItems: 1
|
||||
items:
|
||||
- const: core
|
||||
- const: apb
|
||||
|
||||
resets:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
efuse@40000000 {
|
||||
compatible = "sophgo,sg2044-efuse";
|
||||
reg = <0x40000000 0x1000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
clocks = <&clk 0>,
|
||||
<&clk 1>;
|
||||
clock-names = "core", "apb";
|
||||
};
|
||||
|
||||
...
|
||||
@@ -0,0 +1,64 @@
|
||||
# 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 <unicorn_wang@outlook.com>
|
||||
|
||||
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-parent: true
|
||||
|
||||
allOf:
|
||||
- $ref: cdns-pcie-host.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- reg-names
|
||||
|
||||
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>;
|
||||
msi-parent = <&msi>;
|
||||
};
|
||||
@@ -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"
|
||||
|
||||
@@ -272,6 +272,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache0>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu0_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -299,6 +300,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache0>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu1_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -326,6 +328,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache0>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu2_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -353,6 +356,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache0>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu3_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -380,6 +384,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache1>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu4_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -407,6 +412,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache1>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu5_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -434,6 +440,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache1>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu6_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -461,6 +468,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache1>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu7_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -488,6 +496,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache4>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu8_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -515,6 +524,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache4>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu9_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -542,6 +552,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache4>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu10_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -569,6 +580,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache4>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu11_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -596,6 +608,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache5>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu12_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -623,6 +636,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache5>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu13_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -650,6 +664,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache5>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu14_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -677,6 +692,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache5>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu15_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -704,6 +720,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache2>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu16_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -731,6 +748,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache2>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu17_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -758,6 +776,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache2>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu18_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -785,6 +804,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache2>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu19_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -812,6 +832,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache3>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu20_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -839,6 +860,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache3>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu21_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -866,6 +888,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache3>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu22_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -893,6 +916,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache3>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <0>;
|
||||
|
||||
cpu23_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -920,6 +944,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache6>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu24_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -947,6 +972,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache6>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu25_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -974,6 +1000,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache6>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu26_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1001,6 +1028,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache6>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu27_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1028,6 +1056,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache7>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu28_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1055,6 +1084,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache7>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu29_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1082,6 +1112,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache7>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu30_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1109,6 +1140,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache7>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <1>;
|
||||
|
||||
cpu31_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1136,6 +1168,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache8>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu32_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1163,6 +1196,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache8>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu33_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1190,6 +1224,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache8>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu34_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1217,6 +1252,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache8>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu35_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1244,6 +1280,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache9>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu36_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1271,6 +1308,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache9>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu37_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1298,6 +1336,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache9>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu38_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1325,6 +1364,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache9>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu39_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1352,6 +1392,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache12>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu40_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1379,6 +1420,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache12>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu41_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1406,6 +1448,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache12>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu42_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1433,6 +1476,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache12>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu43_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1460,6 +1504,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache13>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu44_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1487,6 +1532,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache13>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu45_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1514,6 +1560,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache13>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu46_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1541,6 +1588,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache13>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu47_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1568,6 +1616,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache10>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu48_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1595,6 +1644,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache10>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu49_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1622,6 +1672,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache10>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu50_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1649,6 +1700,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache10>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu51_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1676,6 +1728,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache11>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu52_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1703,6 +1756,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache11>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu53_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1730,6 +1784,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache11>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu54_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1757,6 +1812,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache11>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <2>;
|
||||
|
||||
cpu55_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1784,6 +1840,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache14>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu56_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1811,6 +1868,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache14>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu57_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1838,6 +1896,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache14>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu58_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1865,6 +1924,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache14>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu59_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1892,6 +1952,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache15>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu60_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1919,6 +1980,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache15>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu61_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1946,6 +2008,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache15>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu62_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
@@ -1973,6 +2036,7 @@
|
||||
d-cache-sets = <512>;
|
||||
next-level-cache = <&l2_cache15>;
|
||||
mmu-type = "riscv,sv39";
|
||||
numa-node-id = <3>;
|
||||
|
||||
cpu63_intc: interrupt-controller {
|
||||
compatible = "riscv,cpu-intc";
|
||||
|
||||
@@ -164,6 +164,18 @@
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_rc0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie_rc1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie_rc2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
emmc_cfg: sdhci-emmc-cfg {
|
||||
sdhci-emmc-wp-pins {
|
||||
@@ -238,6 +250,30 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spifmc0 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
spi-tx-bus-width = <1>;
|
||||
spi-rx-bus-width = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&spifmc1 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
spi-tx-bus-width = <1>;
|
||||
spi-rx-bus-width = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
pinctrl-0 = <&uart0_cfg>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
@@ -152,6 +152,18 @@
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_rc0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie_rc1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie_rc2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
emmc_cfg: sdhci-emmc-cfg {
|
||||
sdhci-emmc-wp-pins {
|
||||
@@ -226,6 +238,18 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spifmc1 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
spi-tx-bus-width = <1>;
|
||||
spi-rx-bus-width = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
pinctrl-0 = <&uart0_cfg>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
@@ -128,6 +128,18 @@
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_rc0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie_rc2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie_rc3 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sd {
|
||||
pinctrl-0 = <&sd_cfg>;
|
||||
pinctrl-names = "default";
|
||||
@@ -138,6 +150,30 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spifmc0 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
spi-tx-bus-width = <1>;
|
||||
spi-rx-bus-width = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&spifmc1 {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
spi-tx-bus-width = <1>;
|
||||
spi-rx-bus-width = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
pinctrl-0 = <&uart0_cfg>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
@@ -19,6 +19,26 @@
|
||||
#size-cells = <2>;
|
||||
dma-noncoherent;
|
||||
|
||||
distance-map {
|
||||
compatible = "numa-distance-map-v1";
|
||||
distance-matrix = <0 0 10>,
|
||||
<0 1 15>,
|
||||
<0 2 25>,
|
||||
<0 3 30>,
|
||||
<1 0 15>,
|
||||
<1 1 10>,
|
||||
<1 2 30>,
|
||||
<1 3 25>,
|
||||
<2 0 25>,
|
||||
<2 1 30>,
|
||||
<2 2 10>,
|
||||
<2 3 15>,
|
||||
<3 0 30>,
|
||||
<3 1 25>,
|
||||
<3 2 15>,
|
||||
<3 3 10>;
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
};
|
||||
@@ -48,6 +68,30 @@
|
||||
interrupt-parent = <&intc>;
|
||||
ranges;
|
||||
|
||||
spifmc0: spi@7000180000 {
|
||||
compatible = "sophgo,sg2042-spifmc-nor";
|
||||
reg = <0x70 0x00180000 0x0 0x1000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
clocks = <&clkgen GATE_CLK_AHB_SF>;
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <108 IRQ_TYPE_LEVEL_HIGH>;
|
||||
resets = <&rstgen RST_SF0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
spifmc1: spi@7002180000 {
|
||||
compatible = "sophgo,sg2042-spifmc-nor";
|
||||
reg = <0x70 0x02180000 0x0 0x1000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
clocks = <&clkgen GATE_CLK_AHB_SF>;
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
resets = <&rstgen RST_SF1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2c0: i2c@7030005000 {
|
||||
compatible = "snps,designware-i2c";
|
||||
reg = <0x70 0x30005000 0x0 0x1000>;
|
||||
@@ -190,7 +234,7 @@
|
||||
reg-names = "clr", "doorbell";
|
||||
msi-controller;
|
||||
#msi-cells = <0>;
|
||||
msi-ranges = <&intc 64 IRQ_TYPE_LEVEL_HIGH 32>;
|
||||
msi-ranges = <&intc 64 IRQ_TYPE_EDGE_RISING 32>;
|
||||
};
|
||||
|
||||
rpgate: clock-controller@7030010368 {
|
||||
@@ -220,6 +264,94 @@
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
pcie_rc0: pcie@7060000000 {
|
||||
compatible = "sophgo,sg2042-pcie-host";
|
||||
device_type = "pci";
|
||||
reg = <0x70 0x60000000 0x0 0x00800000>,
|
||||
<0x40 0x00000000 0x0 0x00001000>;
|
||||
reg-names = "reg", "cfg";
|
||||
linux,pci-domain = <0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x40 0xc0000000 0x0 0x00400000>,
|
||||
<0x42000000 0x0 0xd0000000 0x40 0xd0000000 0x0 0x10000000>,
|
||||
<0x02000000 0x0 0xe0000000 0x40 0xe0000000 0x0 0x20000000>,
|
||||
<0x43000000 0x42 0x00000000 0x42 0x00000000 0x2 0x00000000>,
|
||||
<0x03000000 0x41 0x00000000 0x41 0x00000000 0x1 0x00000000>;
|
||||
bus-range = <0x0 0xff>;
|
||||
vendor-id = <0x1f1c>;
|
||||
device-id = <0x2042>;
|
||||
cdns,no-bar-match-nbits = <48>;
|
||||
msi-parent = <&msi>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcie_rc1: pcie@7060800000 {
|
||||
compatible = "sophgo,sg2042-pcie-host";
|
||||
device_type = "pci";
|
||||
reg = <0x70 0x60800000 0x0 0x00800000>,
|
||||
<0x44 0x00000000 0x0 0x00001000>;
|
||||
reg-names = "reg", "cfg";
|
||||
linux,pci-domain = <1>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x44 0xc0400000 0x0 0x00400000>,
|
||||
<0x42000000 0x0 0xd0000000 0x44 0xd0000000 0x0 0x10000000>,
|
||||
<0x02000000 0x0 0xe0000000 0x44 0xe0000000 0x0 0x20000000>,
|
||||
<0x43000000 0x46 0x00000000 0x46 0x00000000 0x2 0x00000000>,
|
||||
<0x03000000 0x45 0x00000000 0x45 0x00000000 0x1 0x00000000>;
|
||||
bus-range = <0x0 0xff>;
|
||||
vendor-id = <0x1f1c>;
|
||||
device-id = <0x2042>;
|
||||
cdns,no-bar-match-nbits = <48>;
|
||||
msi-parent = <&msi>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcie_rc2: pcie@7062000000 {
|
||||
compatible = "sophgo,sg2042-pcie-host";
|
||||
device_type = "pci";
|
||||
reg = <0x70 0x62000000 0x0 0x00800000>,
|
||||
<0x48 0x00000000 0x0 0x00001000>;
|
||||
reg-names = "reg", "cfg";
|
||||
linux,pci-domain = <2>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x48 0xc0800000 0x0 0x00400000>,
|
||||
<0x42000000 0x0 0xd0000000 0x48 0xd0000000 0x0 0x10000000>,
|
||||
<0x02000000 0x0 0xe0000000 0x48 0xe0000000 0x0 0x20000000>,
|
||||
<0x03000000 0x49 0x00000000 0x49 0x00000000 0x1 0x00000000>,
|
||||
<0x43000000 0x4a 0x00000000 0x4a 0x00000000 0x2 0x00000000>;
|
||||
bus-range = <0x0 0xff>;
|
||||
vendor-id = <0x1f1c>;
|
||||
device-id = <0x2042>;
|
||||
cdns,no-bar-match-nbits = <48>;
|
||||
msi-parent = <&msi>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcie_rc3: pcie@7062800000 {
|
||||
compatible = "sophgo,sg2042-pcie-host";
|
||||
device_type = "pci";
|
||||
reg = <0x70 0x62800000 0x0 0x00800000>,
|
||||
<0x4c 0x00000000 0x0 0x00001000>;
|
||||
reg-names = "reg", "cfg";
|
||||
linux,pci-domain = <3>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x4c 0xc0c00000 0x0 0x00400000>,
|
||||
<0x42000000 0x0 0xf8000000 0x4c 0xf8000000 0x0 0x04000000>,
|
||||
<0x02000000 0x0 0xfc000000 0x4c 0xfc000000 0x0 0x04000000>,
|
||||
<0x43000000 0x4e 0x00000000 0x4e 0x00000000 0x2 0x00000000>,
|
||||
<0x03000000 0x4d 0x00000000 0x4d 0x00000000 0x1 0x00000000>;
|
||||
bus-range = <0x0 0xff>;
|
||||
vendor-id = <0x1f1c>;
|
||||
device-id = <0x2042>;
|
||||
cdns,no-bar-match-nbits = <48>;
|
||||
msi-parent = <&msi>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
clint_mswi: interrupt-controller@7094000000 {
|
||||
compatible = "sophgo,sg2042-aclint-mswi", "thead,c900-aclint-mswi";
|
||||
reg = <0x00000070 0x94000000 0x00000000 0x00004000>;
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&efuse0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gmac0 {
|
||||
phy-handle = <&phy0>;
|
||||
phy-mode = "rgmii-id";
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
reg-names = "clr", "doorbell";
|
||||
#msi-cells = <0>;
|
||||
msi-controller;
|
||||
msi-ranges = <&intc 352 IRQ_TYPE_LEVEL_HIGH 512>;
|
||||
msi-ranges = <&intc 352 IRQ_TYPE_EDGE_RISING 512>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -408,6 +408,18 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
efuse0: efuse@7040000000 {
|
||||
compatible = "sophgo,sg2044-efuse";
|
||||
reg = <0x70 0x40000000 0x0 0x1000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
clocks = <&clk CLK_GATE_EFUSE>,
|
||||
<&clk CLK_GATE_APB_EFUSE>;
|
||||
clock-names = "core", "apb";
|
||||
resets = <&rst RST_EFUSE0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2c0: i2c@7040005000 {
|
||||
compatible = "sophgo,sg2044-i2c", "snps,designware-i2c";
|
||||
reg = <0x70 0x40005000 0x0 0x1000>;
|
||||
|
||||
@@ -168,6 +168,23 @@ static bool errata_probe_ghostwrite(unsigned int stage,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool errata_probe_write_once(unsigned int stage,
|
||||
unsigned long arch_id, unsigned long impid)
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_ERRATA_THEAD_WRITE_ONCE))
|
||||
return false;
|
||||
|
||||
/* target-c9xx cores report arch_id and impid as 0 */
|
||||
if (arch_id != 0 || impid != 0)
|
||||
return false;
|
||||
|
||||
if (stage == RISCV_ALTERNATIVES_BOOT ||
|
||||
stage == RISCV_ALTERNATIVES_MODULE)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static u32 thead_errata_probe(unsigned int stage,
|
||||
unsigned long archid, unsigned long impid)
|
||||
{
|
||||
@@ -183,6 +200,9 @@ static u32 thead_errata_probe(unsigned int stage,
|
||||
|
||||
errata_probe_ghostwrite(stage, archid, impid);
|
||||
|
||||
if (errata_probe_write_once(stage, archid, impid))
|
||||
cpu_req_errata |= BIT(ERRATA_THEAD_WRITE_ONCE);
|
||||
|
||||
return cpu_req_errata;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,24 +10,7 @@
|
||||
#include <asm/insn-def.h>
|
||||
#include <asm/hwcap.h>
|
||||
#include <asm/vendorid_list.h>
|
||||
|
||||
#ifdef CONFIG_ERRATA_ANDES
|
||||
#define ERRATA_ANDES_NO_IOCP 0
|
||||
#define ERRATA_ANDES_NUMBER 1
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ERRATA_SIFIVE
|
||||
#define ERRATA_SIFIVE_CIP_453 0
|
||||
#define ERRATA_SIFIVE_CIP_1200 1
|
||||
#define ERRATA_SIFIVE_NUMBER 2
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ERRATA_THEAD
|
||||
#define ERRATA_THEAD_MAE 0
|
||||
#define ERRATA_THEAD_PMU 1
|
||||
#define ERRATA_THEAD_GHOSTWRITE 2
|
||||
#define ERRATA_THEAD_NUMBER 3
|
||||
#endif
|
||||
#include <asm/errata_list_vendors.h>
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
|
||||
25
arch/riscv/include/asm/errata_list_vendors.h
Normal file
25
arch/riscv/include/asm/errata_list_vendors.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef ASM_ERRATA_LIST_VENDORS_H
|
||||
#define ASM_ERRATA_LIST_VENDORS_H
|
||||
|
||||
#ifdef CONFIG_ERRATA_ANDES
|
||||
#define ERRATA_ANDES_NO_IOCP 0
|
||||
#define ERRATA_ANDES_NUMBER 1
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ERRATA_SIFIVE
|
||||
#define ERRATA_SIFIVE_CIP_453 0
|
||||
#define ERRATA_SIFIVE_CIP_1200 1
|
||||
#define ERRATA_SIFIVE_NUMBER 2
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ERRATA_THEAD
|
||||
#define ERRATA_THEAD_MAE 0
|
||||
#define ERRATA_THEAD_PMU 1
|
||||
#define ERRATA_THEAD_GHOSTWRITE 2
|
||||
#define ERRATA_THEAD_WRITE_ONCE 3
|
||||
#define ERRATA_THEAD_NUMBER 4
|
||||
#endif
|
||||
|
||||
#endif /* ASM_ERRATA_LIST_VENDORS_H */
|
||||
@@ -28,6 +28,10 @@
|
||||
#ifdef CONFIG_MMU
|
||||
#define IO_SPACE_LIMIT (PCI_IO_SIZE - 1)
|
||||
#define PCI_IOBASE ((void __iomem *)PCI_IO_START)
|
||||
|
||||
#define ioremap_wc(addr, size) \
|
||||
ioremap_prot((addr), (size), __pgprot(_PAGE_KERNEL_NC))
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
/*
|
||||
|
||||
@@ -203,6 +203,7 @@ extern struct pt_alloc_ops pt_ops __meminitdata;
|
||||
|
||||
#define PAGE_TABLE __pgprot(_PAGE_TABLE)
|
||||
|
||||
#define _PAGE_KERNEL_NC ((_PAGE_KERNEL & ~_PAGE_MTMASK) | _PAGE_NOCACHE)
|
||||
#define _PAGE_IOREMAP ((_PAGE_KERNEL & ~_PAGE_MTMASK) | _PAGE_IO)
|
||||
#define PAGE_KERNEL_IO __pgprot(_PAGE_IOREMAP)
|
||||
|
||||
|
||||
34
arch/riscv/include/asm/rwonce.h
Normal file
34
arch/riscv/include/asm/rwonce.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
#ifndef __ASM_RWONCE_H
|
||||
#define __ASM_RWONCE_H
|
||||
|
||||
#include <linux/compiler_types.h>
|
||||
#include <asm/alternative-macros.h>
|
||||
#include <asm/vendorid_list.h>
|
||||
#include <asm/errata_list_vendors.h>
|
||||
|
||||
#if defined(CONFIG_ERRATA_THEAD_WRITE_ONCE) && !defined(NO_ALTERNATIVE)
|
||||
|
||||
#define write_once_fence() \
|
||||
do { \
|
||||
asm volatile(ALTERNATIVE( \
|
||||
"nop", \
|
||||
"fence w, o", \
|
||||
THEAD_VENDOR_ID, \
|
||||
ERRATA_THEAD_WRITE_ONCE, \
|
||||
CONFIG_ERRATA_THEAD_WRITE_ONCE) \
|
||||
: : : "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define __WRITE_ONCE(x, val) \
|
||||
do { \
|
||||
*(volatile typeof(x) *)&(x) = (val); \
|
||||
write_once_fence(); \
|
||||
} while (0)
|
||||
|
||||
#endif /* defined(CONFIG_ERRATA_THEAD_WRITE_ONCE) && !defined(NO_ALTERNATIVE) */
|
||||
|
||||
#include <asm-generic/rwonce.h>
|
||||
|
||||
#endif /* __ASM_RWONCE_H */
|
||||
@@ -330,11 +330,14 @@ void __init setup_arch(char **cmdline_p)
|
||||
/* Parse the ACPI tables for possible boot-time configuration */
|
||||
acpi_boot_table_init();
|
||||
|
||||
if (acpi_disabled) {
|
||||
#if IS_ENABLED(CONFIG_BUILTIN_DTB)
|
||||
unflatten_and_copy_device_tree();
|
||||
unflatten_and_copy_device_tree();
|
||||
#else
|
||||
unflatten_device_tree();
|
||||
unflatten_device_tree();
|
||||
#endif
|
||||
}
|
||||
|
||||
misc_mem_init();
|
||||
|
||||
init_resources();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
static long riscv_sys_mmap(unsigned long addr, unsigned long len,
|
||||
unsigned long prot, unsigned long flags,
|
||||
unsigned long fd, off_t offset,
|
||||
unsigned long fd, unsigned long offset,
|
||||
unsigned long page_shift_offset)
|
||||
{
|
||||
if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))
|
||||
|
||||
@@ -307,6 +307,14 @@ pgprot_t ttm_io_prot(struct ttm_buffer_object *bo, struct ttm_resource *res,
|
||||
caching = res->bus.caching;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
|
||||
/* Downgrade cached mapping for non-snooping devices */
|
||||
if (!bo->bdev->dma_coherent && caching == ttm_cached)
|
||||
caching = ttm_write_combined;
|
||||
#endif
|
||||
|
||||
return ttm_prot_from_caching(caching, tmp);
|
||||
}
|
||||
EXPORT_SYMBOL(ttm_io_prot);
|
||||
|
||||
@@ -246,6 +246,12 @@ int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *func
|
||||
list_add_tail(&bdev->device_list, &glob->device_list);
|
||||
mutex_unlock(&ttm_global_mutex);
|
||||
|
||||
#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
|
||||
bdev->dma_coherent = dev->dma_coherent;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ttm_device_init);
|
||||
|
||||
@@ -74,7 +74,8 @@ pgprot_t ttm_prot_from_caching(enum ttm_caching caching, pgprot_t tmp)
|
||||
#endif /* CONFIG_UML */
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
#if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \
|
||||
defined(__powerpc__) || defined(__mips__) || defined(__loongarch__)
|
||||
defined(__powerpc__) || defined(__mips__) || defined(__loongarch__) || \
|
||||
defined(__riscv)
|
||||
if (caching == ttm_write_combined)
|
||||
tmp = pgprot_writecombine(tmp);
|
||||
else
|
||||
|
||||
@@ -154,6 +154,14 @@ static void ttm_tt_init_fields(struct ttm_tt *ttm,
|
||||
enum ttm_caching caching,
|
||||
unsigned long extra_pages)
|
||||
{
|
||||
#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
|
||||
/* Downgrade cached mapping for non-snooping devices */
|
||||
if (!bo->bdev->dma_coherent && caching == ttm_cached)
|
||||
caching = ttm_write_combined;
|
||||
#endif
|
||||
|
||||
ttm->num_pages = (PAGE_ALIGN(bo->base.size) >> PAGE_SHIFT) + extra_pages;
|
||||
ttm->page_flags = page_flags;
|
||||
ttm->dma_address = NULL;
|
||||
|
||||
@@ -242,7 +242,7 @@ static const struct xe_device_desc dg1_desc = {
|
||||
.has_gsc_nvm = 1,
|
||||
.has_heci_gscfi = 1,
|
||||
.max_gt_per_tile = 1,
|
||||
.require_force_probe = true,
|
||||
.require_force_probe = false,
|
||||
};
|
||||
|
||||
static const u16 dg2_g10_ids[] = { INTEL_DG2_G10_IDS(NOP), INTEL_ATS_M150_IDS(NOP), 0 };
|
||||
@@ -266,7 +266,7 @@ static const struct xe_device_desc ats_m_desc = {
|
||||
.pre_gmdid_media_ip = &media_ip_xehpm,
|
||||
.dma_mask_size = 46,
|
||||
.max_gt_per_tile = 1,
|
||||
.require_force_probe = true,
|
||||
.require_force_probe = false,
|
||||
|
||||
DG2_FEATURES,
|
||||
.has_display = false,
|
||||
@@ -277,7 +277,7 @@ static const struct xe_device_desc dg2_desc = {
|
||||
.pre_gmdid_media_ip = &media_ip_xehpm,
|
||||
.dma_mask_size = 46,
|
||||
.max_gt_per_tile = 1,
|
||||
.require_force_probe = true,
|
||||
.require_force_probe = false,
|
||||
|
||||
DG2_FEATURES,
|
||||
.has_display = true,
|
||||
@@ -295,7 +295,7 @@ static const __maybe_unused struct xe_device_desc pvc_desc = {
|
||||
.has_heci_gscfi = 1,
|
||||
.max_gt_per_tile = 1,
|
||||
.max_remote_tiles = 1,
|
||||
.require_force_probe = true,
|
||||
.require_force_probe = false,
|
||||
.has_mbx_power_limits = false,
|
||||
};
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ struct sg204x_msi_chip_info {
|
||||
* @doorbell_addr: see TRM, 10.1.32, GP_INTR0_SET
|
||||
* @irq_first: First vectors number that MSIs starts
|
||||
* @num_irqs: Number of vectors for MSIs
|
||||
* @irq_type: IRQ type for MSIs
|
||||
* @msi_map: mapping for allocated MSI vectors.
|
||||
* @msi_map_lock: Lock for msi_map
|
||||
* @chip_info: chip specific infomations
|
||||
@@ -41,6 +42,7 @@ struct sg204x_msi_chipdata {
|
||||
|
||||
u32 irq_first;
|
||||
u32 num_irqs;
|
||||
unsigned int irq_type;
|
||||
|
||||
unsigned long *msi_map;
|
||||
struct mutex msi_map_lock;
|
||||
@@ -137,14 +139,14 @@ static int sg204x_msi_parent_domain_alloc(struct irq_domain *domain, unsigned in
|
||||
fwspec.fwnode = domain->parent->fwnode;
|
||||
fwspec.param_count = 2;
|
||||
fwspec.param[0] = data->irq_first + hwirq;
|
||||
fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
|
||||
fwspec.param[1] = data->irq_type;
|
||||
|
||||
ret = irq_domain_alloc_irqs_parent(domain, virq, 1, &fwspec);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
d = irq_domain_get_irq_data(domain->parent, virq);
|
||||
return d->chip->irq_set_type(d, IRQ_TYPE_EDGE_RISING);
|
||||
return d->chip->irq_set_type(d, data->irq_type);
|
||||
}
|
||||
|
||||
static int sg204x_msi_middle_domain_alloc(struct irq_domain *domain, unsigned int virq,
|
||||
@@ -212,6 +214,7 @@ static const struct msi_parent_ops sg2042_msi_parent_ops = {
|
||||
MSI_FLAG_PCI_MSI_STARTUP_PARENT)
|
||||
|
||||
#define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
|
||||
MSI_FLAG_MULTI_PCI_MSI | \
|
||||
MSI_FLAG_PCI_MSIX)
|
||||
|
||||
static const struct msi_parent_ops sg2044_msi_parent_ops = {
|
||||
@@ -297,6 +300,7 @@ static int sg2042_msi_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
data->irq_first = (u32)args.args[0];
|
||||
data->irq_type = (unsigned int)args.args[1];
|
||||
data->num_irqs = (u32)args.args[args.nargs - 1];
|
||||
|
||||
mutex_init(&data->msi_map_lock);
|
||||
|
||||
@@ -179,12 +179,14 @@ static int plic_set_affinity(struct irq_data *d,
|
||||
if (cpu >= nr_cpu_ids)
|
||||
return -EINVAL;
|
||||
|
||||
plic_irq_disable(d);
|
||||
/* Invalidate the original routing entry */
|
||||
plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 0);
|
||||
|
||||
irq_data_update_effective_affinity(d, cpumask_of(cpu));
|
||||
|
||||
/* Setting the new routing entry if irq is enabled */
|
||||
if (!irqd_irq_disabled(d))
|
||||
plic_irq_enable(d);
|
||||
plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 1);
|
||||
|
||||
return IRQ_SET_MASK_OK_DONE;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,16 @@
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include "stmmac_platform.h"
|
||||
|
||||
struct sophgo_dwmac_data {
|
||||
bool has_internal_rx_delay;
|
||||
};
|
||||
|
||||
static int sophgo_sg2044_dwmac_init(struct platform_device *pdev,
|
||||
struct plat_stmmacenet_data *plat_dat,
|
||||
struct stmmac_resources *stmmac_res)
|
||||
@@ -32,6 +37,7 @@ static int sophgo_sg2044_dwmac_init(struct platform_device *pdev,
|
||||
static int sophgo_dwmac_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct plat_stmmacenet_data *plat_dat;
|
||||
const struct sophgo_dwmac_data *data;
|
||||
struct stmmac_resources stmmac_res;
|
||||
struct device *dev = &pdev->dev;
|
||||
int ret;
|
||||
@@ -50,11 +56,23 @@ static int sophgo_dwmac_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
data = device_get_match_data(&pdev->dev);
|
||||
if (data && data->has_internal_rx_delay) {
|
||||
plat_dat->phy_interface = phy_fix_phy_mode_for_mac_delays(plat_dat->phy_interface,
|
||||
false, true);
|
||||
if (plat_dat->phy_interface == PHY_INTERFACE_MODE_NA)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return stmmac_dvr_probe(dev, plat_dat, &stmmac_res);
|
||||
}
|
||||
|
||||
static const struct sophgo_dwmac_data sg2042_dwmac_data = {
|
||||
.has_internal_rx_delay = true,
|
||||
};
|
||||
|
||||
static const struct of_device_id sophgo_dwmac_match[] = {
|
||||
{ .compatible = "sophgo,sg2042-dwmac" },
|
||||
{ .compatible = "sophgo,sg2042-dwmac", .data = &sg2042_dwmac_data },
|
||||
{ .compatible = "sophgo,sg2044-dwmac" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
@@ -101,6 +101,49 @@ const char *phy_rate_matching_to_str(int rate_matching)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(phy_rate_matching_to_str);
|
||||
|
||||
/**
|
||||
* phy_fix_phy_mode_for_mac_delays - Convenience function for fixing PHY
|
||||
* mode based on whether mac adds internal delay
|
||||
*
|
||||
* @interface: The current interface mode of the port
|
||||
* @mac_txid: True if the mac adds internal tx delay
|
||||
* @mac_rxid: True if the mac adds internal rx delay
|
||||
*
|
||||
* Return fixed PHY mode, or PHY_INTERFACE_MODE_NA if the interface can
|
||||
* not apply the internal delay
|
||||
*/
|
||||
phy_interface_t phy_fix_phy_mode_for_mac_delays(phy_interface_t interface,
|
||||
bool mac_txid, bool mac_rxid)
|
||||
{
|
||||
if (!phy_interface_mode_is_rgmii(interface))
|
||||
return interface;
|
||||
|
||||
if (mac_txid && mac_rxid) {
|
||||
if (interface == PHY_INTERFACE_MODE_RGMII_ID)
|
||||
return PHY_INTERFACE_MODE_RGMII;
|
||||
return PHY_INTERFACE_MODE_NA;
|
||||
}
|
||||
|
||||
if (mac_txid) {
|
||||
if (interface == PHY_INTERFACE_MODE_RGMII_ID)
|
||||
return PHY_INTERFACE_MODE_RGMII_RXID;
|
||||
if (interface == PHY_INTERFACE_MODE_RGMII_TXID)
|
||||
return PHY_INTERFACE_MODE_RGMII;
|
||||
return PHY_INTERFACE_MODE_NA;
|
||||
}
|
||||
|
||||
if (mac_rxid) {
|
||||
if (interface == PHY_INTERFACE_MODE_RGMII_ID)
|
||||
return PHY_INTERFACE_MODE_RGMII_TXID;
|
||||
if (interface == PHY_INTERFACE_MODE_RGMII_RXID)
|
||||
return PHY_INTERFACE_MODE_RGMII;
|
||||
return PHY_INTERFACE_MODE_NA;
|
||||
}
|
||||
|
||||
return interface;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(phy_fix_phy_mode_for_mac_delays);
|
||||
|
||||
/**
|
||||
* phy_interface_num_ports - Return the number of links that can be carried by
|
||||
* a given MAC-PHY physical link. Returns 0 if this is
|
||||
|
||||
@@ -335,6 +335,18 @@ config NVMEM_SNVS_LPGPR
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called nvmem-snvs-lpgpr.
|
||||
|
||||
config NVMEM_SOPHGO_EFUSE
|
||||
tristate "Sophgo eFuse support"
|
||||
depends on ARCH_SOPHGO || COMPILE_TEST
|
||||
default ARCH_SOPHGO
|
||||
help
|
||||
Say y here to enable support for reading eFuses on Sophgo SoCs
|
||||
such as the CV1800B. These are e.g. used to store factory programmed
|
||||
calibration data required for the builtin ethernet PHY.
|
||||
|
||||
This driver can also be built as a module. If so, the module will
|
||||
be called nvmem-sophgo-efuse.
|
||||
|
||||
config NVMEM_SPMI_SDAM
|
||||
tristate "SPMI SDAM Support"
|
||||
depends on SPMI
|
||||
|
||||
@@ -68,6 +68,8 @@ obj-$(CONFIG_NVMEM_SC27XX_EFUSE) += nvmem-sc27xx-efuse.o
|
||||
nvmem-sc27xx-efuse-y := sc27xx-efuse.o
|
||||
obj-$(CONFIG_NVMEM_SNVS_LPGPR) += nvmem_snvs_lpgpr.o
|
||||
nvmem_snvs_lpgpr-y := snvs_lpgpr.o
|
||||
obj-$(CONFIG_NVMEM_SOPHGO_EFUSE) += nvmem-sophgo-efuse.o
|
||||
nvmem-sophgo-efuse-y := sophgo-efuse.o
|
||||
obj-$(CONFIG_NVMEM_SPMI_SDAM) += nvmem_qcom-spmi-sdam.o
|
||||
nvmem_qcom-spmi-sdam-y += qcom-spmi-sdam.o
|
||||
obj-$(CONFIG_NVMEM_SPRD_EFUSE) += nvmem_sprd_efuse.o
|
||||
|
||||
176
drivers/nvmem/sophgo-efuse.c
Normal file
176
drivers/nvmem/sophgo-efuse.c
Normal file
@@ -0,0 +1,176 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Sophgo SoC eFuse driver
|
||||
*/
|
||||
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/bits.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/math.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/nvmem-provider.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#define SG2044_EFUSE_CONTENT_SIZE 0x400
|
||||
|
||||
#define SG2044_EFUSE_MD 0x000
|
||||
#define SG2044_EFUSE_ADR 0x004
|
||||
#define SG2044_EFUSE_RD_DATA 0x00c
|
||||
|
||||
#define SG2044_EFUSE_MODE GENMASK(1, 0)
|
||||
#define SG2044_EFUSE_MODE_READ 2
|
||||
|
||||
#define SG2044_EFUSE_BOOT_DONE BIT(7)
|
||||
#define SG2044_BOOT_TIMEOUT 10000
|
||||
|
||||
#define SG2044_EFUSE_ADR_ADDR GENMASK(7, 0)
|
||||
|
||||
#define SG2044_EFUSE_ALIGN 4
|
||||
|
||||
struct sophgo_efuses {
|
||||
void __iomem *base;
|
||||
struct clk_bulk_data *clks;
|
||||
int num_clks;
|
||||
struct mutex mutex;
|
||||
};
|
||||
|
||||
static int sg2044_efuse_wait_mode(struct sophgo_efuses *efuse)
|
||||
{
|
||||
u32 value;
|
||||
|
||||
return readl_poll_timeout(efuse->base + SG2044_EFUSE_MD, value,
|
||||
FIELD_GET(SG2044_EFUSE_MODE, value) == 0,
|
||||
1, SG2044_BOOT_TIMEOUT);
|
||||
}
|
||||
|
||||
static int sg2044_efuse_set_mode(struct sophgo_efuses *efuse, int mode)
|
||||
{
|
||||
u32 val = readl(efuse->base + SG2044_EFUSE_MD);
|
||||
|
||||
val &= ~SG2044_EFUSE_MODE;
|
||||
val |= FIELD_PREP(SG2044_EFUSE_MODE, mode);
|
||||
|
||||
writel(val, efuse->base + SG2044_EFUSE_MD);
|
||||
|
||||
return sg2044_efuse_wait_mode(efuse);
|
||||
}
|
||||
|
||||
static u32 sg2044_efuses_read_strip(struct sophgo_efuses *efuse,
|
||||
unsigned int offset, u32 *strip)
|
||||
{
|
||||
u32 val = FIELD_PREP(SG2044_EFUSE_ADR_ADDR, offset);
|
||||
int ret;
|
||||
|
||||
guard(mutex)(&efuse->mutex);
|
||||
|
||||
writel(val, efuse->base + SG2044_EFUSE_ADR);
|
||||
|
||||
ret = sg2044_efuse_set_mode(efuse, SG2044_EFUSE_MODE_READ);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
*strip = readl(efuse->base + SG2044_EFUSE_RD_DATA);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sg2044_efuses_read(void *context, unsigned int offset, void *val,
|
||||
size_t bytes)
|
||||
{
|
||||
struct sophgo_efuses *efuse = context;
|
||||
unsigned int start, start_offset, end, i;
|
||||
u32 value;
|
||||
u8 *buf;
|
||||
int ret;
|
||||
|
||||
start = rounddown(offset, SG2044_EFUSE_ALIGN);
|
||||
end = roundup(offset + bytes, SG2044_EFUSE_ALIGN);
|
||||
start_offset = offset - start;
|
||||
|
||||
start /= SG2044_EFUSE_ALIGN;
|
||||
end /= SG2044_EFUSE_ALIGN;
|
||||
|
||||
ret = readl_poll_timeout(efuse->base + SG2044_EFUSE_MD, value,
|
||||
(value & SG2044_EFUSE_BOOT_DONE),
|
||||
1, SG2044_BOOT_TIMEOUT);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
buf = kzalloc(end - start, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = start; i < end; i++) {
|
||||
ret = sg2044_efuses_read_strip(efuse, i, &value);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
memcpy(&buf[(i - start) * 4], &value, SG2044_EFUSE_ALIGN);
|
||||
}
|
||||
|
||||
memcpy(val, buf + start_offset, bytes);
|
||||
|
||||
failed:
|
||||
kfree(buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sophgo_efuses_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct sophgo_efuses *efuse;
|
||||
struct nvmem_config config = {
|
||||
.dev = &pdev->dev,
|
||||
.add_legacy_fixed_of_cells = true,
|
||||
.read_only = true,
|
||||
.reg_read = sg2044_efuses_read,
|
||||
.stride = 1,
|
||||
.word_size = 1,
|
||||
.name = "sophgo-efuse",
|
||||
.id = NVMEM_DEVID_AUTO,
|
||||
.root_only = true,
|
||||
};
|
||||
|
||||
efuse = devm_kzalloc(dev, sizeof(*efuse), GFP_KERNEL);
|
||||
if (!efuse)
|
||||
return -ENOMEM;
|
||||
|
||||
efuse->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(efuse->base))
|
||||
return PTR_ERR(efuse->base);
|
||||
|
||||
efuse->num_clks = devm_clk_bulk_get_all_enabled(&pdev->dev, &efuse->clks);
|
||||
if (efuse->num_clks < 0)
|
||||
return dev_err_probe(dev, efuse->num_clks, "failed to get clocks\n");
|
||||
|
||||
config.priv = efuse;
|
||||
config.size = SG2044_EFUSE_CONTENT_SIZE;
|
||||
|
||||
return PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, &config));
|
||||
}
|
||||
|
||||
static const struct of_device_id sophgo_efuses_of_match[] = {
|
||||
{ .compatible = "sophgo,sg2044-efuse", },
|
||||
{}
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, sophgo_efuses_of_match);
|
||||
|
||||
static struct platform_driver sophgo_efuses_driver = {
|
||||
.driver = {
|
||||
.name = "sophgo_efuse",
|
||||
.of_match_table = sophgo_efuses_of_match,
|
||||
},
|
||||
.probe = sophgo_efuses_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(sophgo_efuses_driver);
|
||||
|
||||
MODULE_AUTHOR("Inochi Amaoto <inochiama@gmail.com>");
|
||||
MODULE_DESCRIPTION("Sophgo efuse driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -42,6 +42,15 @@ config PCIE_CADENCE_PLAT_EP
|
||||
endpoint mode. This PCIe controller may be embedded into many
|
||||
different vendors SoCs.
|
||||
|
||||
config PCIE_SG2042_HOST
|
||||
tristate "Sophgo SG2042 PCIe controller (host mode)"
|
||||
depends on OF && (ARCH_SOPHGO || COMPILE_TEST)
|
||||
select PCIE_CADENCE_HOST
|
||||
help
|
||||
Say Y here if you want to support the Sophgo SG2042 PCIe platform
|
||||
controller in host mode. Sophgo SG2042 PCIe controller uses Cadence
|
||||
PCIe core.
|
||||
|
||||
config PCI_J721E
|
||||
tristate
|
||||
select PCIE_CADENCE_HOST if PCI_J721E_HOST != n
|
||||
@@ -67,4 +76,5 @@ config PCI_J721E_EP
|
||||
Say Y here if you want to support the TI J721E PCIe platform
|
||||
controller in endpoint mode. TI J721E PCIe controller uses Cadence PCIe
|
||||
core.
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -4,3 +4,4 @@ obj-$(CONFIG_PCIE_CADENCE_HOST) += pcie-cadence-host.o
|
||||
obj-$(CONFIG_PCIE_CADENCE_EP) += pcie-cadence-ep.o
|
||||
obj-$(CONFIG_PCIE_CADENCE_PLAT) += pcie-cadence-plat.o
|
||||
obj-$(CONFIG_PCI_J721E) += pci-j721e.o
|
||||
obj-$(CONFIG_PCIE_SG2042_HOST) += pcie-sg2042.o
|
||||
|
||||
@@ -531,7 +531,7 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc)
|
||||
cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR1(0), addr1);
|
||||
cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(0), desc1);
|
||||
|
||||
if (pcie->ops->cpu_addr_fixup)
|
||||
if (pcie->ops && pcie->ops->cpu_addr_fixup)
|
||||
cpu_addr = pcie->ops->cpu_addr_fixup(pcie, cpu_addr);
|
||||
|
||||
addr0 = CDNS_PCIE_AT_OB_REGION_CPU_ADDR0_NBITS(12) |
|
||||
|
||||
@@ -92,7 +92,7 @@ void cdns_pcie_set_outbound_region(struct cdns_pcie *pcie, u8 busnr, u8 fn,
|
||||
cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(r), desc1);
|
||||
|
||||
/* Set the CPU address */
|
||||
if (pcie->ops->cpu_addr_fixup)
|
||||
if (pcie->ops && pcie->ops->cpu_addr_fixup)
|
||||
cpu_addr = pcie->ops->cpu_addr_fixup(pcie, cpu_addr);
|
||||
|
||||
addr0 = CDNS_PCIE_AT_OB_REGION_CPU_ADDR0_NBITS(nbits) |
|
||||
@@ -123,7 +123,7 @@ void cdns_pcie_set_outbound_region_for_normal_msg(struct cdns_pcie *pcie,
|
||||
}
|
||||
|
||||
/* Set the CPU address */
|
||||
if (pcie->ops->cpu_addr_fixup)
|
||||
if (pcie->ops && pcie->ops->cpu_addr_fixup)
|
||||
cpu_addr = pcie->ops->cpu_addr_fixup(pcie, cpu_addr);
|
||||
|
||||
addr0 = CDNS_PCIE_AT_OB_REGION_CPU_ADDR0_NBITS(17) |
|
||||
|
||||
@@ -468,7 +468,7 @@ static inline u32 cdns_pcie_ep_fn_readl(struct cdns_pcie *pcie, u8 fn, u32 reg)
|
||||
|
||||
static inline int cdns_pcie_start_link(struct cdns_pcie *pcie)
|
||||
{
|
||||
if (pcie->ops->start_link)
|
||||
if (pcie->ops && pcie->ops->start_link)
|
||||
return pcie->ops->start_link(pcie);
|
||||
|
||||
return 0;
|
||||
@@ -476,13 +476,13 @@ static inline int cdns_pcie_start_link(struct cdns_pcie *pcie)
|
||||
|
||||
static inline void cdns_pcie_stop_link(struct cdns_pcie *pcie)
|
||||
{
|
||||
if (pcie->ops->stop_link)
|
||||
if (pcie->ops && pcie->ops->stop_link)
|
||||
pcie->ops->stop_link(pcie);
|
||||
}
|
||||
|
||||
static inline bool cdns_pcie_link_up(struct cdns_pcie *pcie)
|
||||
{
|
||||
if (pcie->ops->link_up)
|
||||
if (pcie->ops && pcie->ops->link_up)
|
||||
return pcie->ops->link_up(pcie);
|
||||
|
||||
return true;
|
||||
|
||||
134
drivers/pci/controller/cadence/pcie-sg2042.c
Normal file
134
drivers/pci/controller/cadence/pcie-sg2042.c
Normal file
@@ -0,0 +1,134 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* pcie-sg2042 - PCIe controller driver for Sophgo SG2042 SoC
|
||||
*
|
||||
* Copyright (C) 2025 Sophgo Technology Inc.
|
||||
* Copyright (C) 2025 Chen Wang <unicorn_wang@outlook.com>
|
||||
*/
|
||||
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
#include "pcie-cadence.h"
|
||||
|
||||
/*
|
||||
* SG2042 only supports 4-byte aligned access, so for the rootbus (i.e. to
|
||||
* read/write the Root Port itself, read32/write32 is required. For
|
||||
* non-rootbus (i.e. to read/write the PCIe peripheral registers, supports
|
||||
* 1/2/4 byte aligned access, so directly using read/write should be fine.
|
||||
*/
|
||||
|
||||
static struct pci_ops sg2042_pcie_root_ops = {
|
||||
.map_bus = cdns_pci_map_bus,
|
||||
.read = pci_generic_config_read32,
|
||||
.write = pci_generic_config_write32,
|
||||
};
|
||||
|
||||
static struct pci_ops sg2042_pcie_child_ops = {
|
||||
.map_bus = cdns_pci_map_bus,
|
||||
.read = pci_generic_config_read,
|
||||
.write = pci_generic_config_write,
|
||||
};
|
||||
|
||||
static int sg2042_pcie_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct pci_host_bridge *bridge;
|
||||
struct cdns_pcie *pcie;
|
||||
struct cdns_pcie_rc *rc;
|
||||
int ret;
|
||||
|
||||
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*rc));
|
||||
if (!bridge)
|
||||
return dev_err_probe(dev, -ENOMEM, "Failed to alloc host bridge!\n");
|
||||
|
||||
bridge->ops = &sg2042_pcie_root_ops;
|
||||
bridge->child_ops = &sg2042_pcie_child_ops;
|
||||
|
||||
rc = pci_host_bridge_priv(bridge);
|
||||
pcie = &rc->pcie;
|
||||
pcie->dev = dev;
|
||||
|
||||
platform_set_drvdata(pdev, pcie);
|
||||
|
||||
pm_runtime_set_active(dev);
|
||||
pm_runtime_no_callbacks(dev);
|
||||
devm_pm_runtime_enable(dev);
|
||||
|
||||
ret = cdns_pcie_init_phy(dev, pcie);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to init phy!\n");
|
||||
|
||||
ret = cdns_pcie_host_setup(rc);
|
||||
if (ret) {
|
||||
dev_err_probe(dev, ret, "Failed to setup host!\n");
|
||||
cdns_pcie_disable_phy(pcie);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sg2042_pcie_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct cdns_pcie *pcie = platform_get_drvdata(pdev);
|
||||
struct device *dev = &pdev->dev;
|
||||
struct cdns_pcie_rc *rc;
|
||||
|
||||
rc = container_of(pcie, struct cdns_pcie_rc, pcie);
|
||||
cdns_pcie_host_disable(rc);
|
||||
|
||||
cdns_pcie_disable_phy(pcie);
|
||||
|
||||
pm_runtime_disable(dev);
|
||||
}
|
||||
|
||||
static int sg2042_pcie_suspend_noirq(struct device *dev)
|
||||
{
|
||||
struct cdns_pcie *pcie = dev_get_drvdata(dev);
|
||||
|
||||
cdns_pcie_disable_phy(pcie);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sg2042_pcie_resume_noirq(struct device *dev)
|
||||
{
|
||||
struct cdns_pcie *pcie = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
ret = cdns_pcie_enable_phy(pcie);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to enable PHY\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DEFINE_NOIRQ_DEV_PM_OPS(sg2042_pcie_pm_ops,
|
||||
sg2042_pcie_suspend_noirq,
|
||||
sg2042_pcie_resume_noirq);
|
||||
|
||||
static const struct of_device_id sg2042_pcie_of_match[] = {
|
||||
{ .compatible = "sophgo,sg2042-pcie-host" },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, sg2042_pcie_of_match);
|
||||
|
||||
static struct platform_driver sg2042_pcie_driver = {
|
||||
.driver = {
|
||||
.name = "sg2042-pcie",
|
||||
.of_match_table = sg2042_pcie_of_match,
|
||||
.pm = pm_sleep_ptr(&sg2042_pcie_pm_ops),
|
||||
},
|
||||
.probe = sg2042_pcie_probe,
|
||||
.remove = sg2042_pcie_remove,
|
||||
};
|
||||
module_platform_driver(sg2042_pcie_driver);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("PCIe controller driver for SG2042 SoCs");
|
||||
MODULE_AUTHOR("Chen Wang <unicorn_wang@outlook.com>");
|
||||
@@ -6338,3 +6338,26 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PCI switches integrated into Intel Arc GPUs have BAR0 that prevents
|
||||
* resizing the BARs of the GPU device due to that bridge BAR0 pinning the
|
||||
* bridge window it's under in place. Nothing in pcieport requires that
|
||||
* BAR0.
|
||||
*
|
||||
* Release and disable BAR0 permanently by clearing its flags to prevent
|
||||
* anything from assigning it again.
|
||||
*/
|
||||
static void pci_release_bar0(struct pci_dev *pdev)
|
||||
{
|
||||
struct resource *res = pci_resource_n(pdev, 0);
|
||||
|
||||
if (!res->parent)
|
||||
return;
|
||||
|
||||
pci_release_resource(pdev, 0);
|
||||
res->flags = 0;
|
||||
}
|
||||
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, 0x4fa0, pci_release_bar0);
|
||||
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, 0x4fa1, pci_release_bar0);
|
||||
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, 0xe2ff, pci_release_bar0);
|
||||
|
||||
@@ -50,10 +50,12 @@
|
||||
__READ_ONCE(x); \
|
||||
})
|
||||
|
||||
#ifndef __WRITE_ONCE
|
||||
#define __WRITE_ONCE(x, val) \
|
||||
do { \
|
||||
*(volatile typeof(x) *)&(x) = (val); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define WRITE_ONCE(x, val) \
|
||||
do { \
|
||||
|
||||
@@ -47,7 +47,8 @@ enum ttm_caching {
|
||||
|
||||
/**
|
||||
* @ttm_cached: Fully cached like normal system memory, requires that
|
||||
* devices snoop the CPU cache on accesses.
|
||||
* devices snoop the CPU cache on accesses. Downgraded to
|
||||
* ttm_write_combined when the snooping capaiblity is missing.
|
||||
*/
|
||||
ttm_cached
|
||||
};
|
||||
|
||||
@@ -225,6 +225,15 @@ struct ttm_device {
|
||||
*/
|
||||
const struct ttm_device_funcs *funcs;
|
||||
|
||||
#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
|
||||
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
|
||||
/**
|
||||
* @dma_coherent: if the device backed is dma-coherent.
|
||||
*/
|
||||
bool dma_coherent;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @sysman: Resource manager for the system domain.
|
||||
* Access via ttm_manager_type.
|
||||
|
||||
@@ -1795,6 +1795,9 @@ static inline bool phy_is_pseudo_fixed_link(struct phy_device *phydev)
|
||||
return phydev->is_pseudo_fixed_link;
|
||||
}
|
||||
|
||||
phy_interface_t phy_fix_phy_mode_for_mac_delays(phy_interface_t interface,
|
||||
bool mac_txid, bool mac_rxid);
|
||||
|
||||
int phy_save_page(struct phy_device *phydev);
|
||||
int phy_select_page(struct phy_device *phydev, int page);
|
||||
int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
0x489-0x8000000000000008-0x[[:xdigit:]]+,v1,sifive/p550,core
|
||||
0x489-0x8000000000000[1-6]08-0x[9b][[:xdigit:]]+,v1,sifive/p650,core
|
||||
0x5b7-0x0-0x0,v1,thead/c900-legacy,core
|
||||
0x5b7-0x80000000090c0d00-0x2047000,v1,thead/c900-legacy,core
|
||||
0x67e-0x80000000db0000[89]0-0x[[:xdigit:]]+,v1,starfive/dubhe-80,core
|
||||
0x31e-0x8000000000008a45-0x[[:xdigit:]]+,v1,andes/ax45,core
|
||||
|
||||
|
Reference in New Issue
Block a user