summaryrefslogtreecommitdiffstats
path: root/target/linux/oxnas/patches-5.15/500-oxnas-sata.patch
blob: d3ec2e2d4803bc5d6e2e060f3e1e98761b5b178a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -568,6 +568,14 @@ config SATA_VITESSE
 
 	  If unsure, say N.
 
+config SATA_OXNAS
+	tristate "PLXTECH NAS782X SATA support"
+	select SATA_HOST
+	help
+	  This option enables support for Nas782x Serial ATA controller.
+
+	  If unsure, say N.
+
 comment "PATA SFF controllers with BMDMA"
 
 config PATA_ALI
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_SATA_SVW)		+= sata_svw.o
 obj-$(CONFIG_SATA_ULI)		+= sata_uli.o
 obj-$(CONFIG_SATA_VIA)		+= sata_via.o
 obj-$(CONFIG_SATA_VITESSE)	+= sata_vsc.o
+obj-$(CONFIG_SATA_OXNAS)	+= sata_oxnas.o
 
 # SFF PATA w/ BMDMA
 obj-$(CONFIG_PATA_ALI)		+= pata_ali.o
--- a/arch/arm/boot/dts/ox820.dtsi
+++ b/arch/arm/boot/dts/ox820.dtsi
@@ -399,5 +399,20 @@
 			plxtech,pcie-outbound-offset = <0x174>;
 			status = "disabled";
 		};
+
+		sata: sata@45900000 {
+			compatible = "plxtech,nas782x-sata";
+				/*	ports		dmactl		sgdma	*/
+			reg = <0x45900000 0x20000>, <0x459A0000 0x40>, <0x459B0000 0x20>,
+				/*	core		phy		descriptors (optional)	*/
+				<0x459E0000 0x2000>, <0x44900000 0x0C>, <0x50000000 0x1000>;
+			interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&stdclk CLK_820_SATA>;
+			resets = <&reset RESET_SATA>, <&reset RESET_SATA_LINK>, <&reset RESET_SATA_PHY>;
+			reset-names = "sata", "link", "phy";
+			nr-ports = <1>;
+			status = "disabled";
+		};
+
 	};
 };
--- a/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts
+++ b/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts
@@ -111,3 +111,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_etha_mdio>;
 };
+
+&sata {
+	status = "okay";
+};