aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/oxnas/patches-4.14/340-oxnas-pcie.patch
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2018-05-31 19:41:28 +0200
committerDaniel Golle <daniel@makrotopia.org>2018-06-01 15:45:06 +0200
commitdcc34574efba524cf75608c3b61bfa579bfb8aa4 (patch)
tree7ed7970952f1e9a705ae8819c3983844efd79d86 /target/linux/oxnas/patches-4.14/340-oxnas-pcie.patch
parentd44b7b7d312b1d4b920042cac35b86e4f089cd04 (diff)
downloadupstream-dcc34574efba524cf75608c3b61bfa579bfb8aa4.tar.gz
upstream-dcc34574efba524cf75608c3b61bfa579bfb8aa4.tar.bz2
upstream-dcc34574efba524cf75608c3b61bfa579bfb8aa4.zip
oxnas: bring in new oxnas target
Reboot the oxnas target based on Linux 4.14 by rebasing our support on top of the now-existing upstream kernel support. This commit brings oxnas support to the level of v4.17 having upstream drivers for Ethernet, Serial and NAND flash. Botch up OpenWrt's local drivers for EHCI, SATA and PCIe based on the new platform code and device-tree. Re-introduce base-files from old oxnas target which works for now but needs further clean-up towards generic board support. Functional issues: * PCIe won't come up (hence no USB3 on Shuttle KD20) * I2C bus of Akitio myCloud device is likely not to work (missing debounce support in new pinctrl driver) Code-style issues: * plla/pllb needs further cleanup -- currently their users or writing into the syscon regmap after acquireling the clk instead of using defined clk_*_*() functions to setup multipliers and dividors. * PCIe phy needs its own little driver. * SATA driver is a monster and should be split into an mfd having a raidctrl regmap, sata controller, sata ports and sata phy. Tested on MitraStar STG-212 aka. Medion Akoya MD86xxx and Shuttle KD20. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/oxnas/patches-4.14/340-oxnas-pcie.patch')
-rw-r--r--target/linux/oxnas/patches-4.14/340-oxnas-pcie.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/target/linux/oxnas/patches-4.14/340-oxnas-pcie.patch b/target/linux/oxnas/patches-4.14/340-oxnas-pcie.patch
new file mode 100644
index 0000000000..b1ae62b7af
--- /dev/null
+++ b/target/linux/oxnas/patches-4.14/340-oxnas-pcie.patch
@@ -0,0 +1,108 @@
+--- a/drivers/pci/host/Kconfig
++++ b/drivers/pci/host/Kconfig
+@@ -220,4 +220,9 @@ config VMD
+ To compile this driver as a module, choose M here: the
+ module will be called vmd.
+
++config PCIE_OXNAS
++ bool "PLX Oxnas PCIe controller"
++ depends on ARCH_OXNAS
++ select PCIEPORTBUS
++
+ endmenu
+--- a/drivers/pci/host/Makefile
++++ b/drivers/pci/host/Makefile
+@@ -20,6 +20,7 @@ obj-$(CONFIG_PCIE_ALTERA) += pcie-altera
+ obj-$(CONFIG_PCIE_ALTERA_MSI) += pcie-altera-msi.o
+ obj-$(CONFIG_PCIE_ROCKCHIP) += pcie-rockchip.o
+ obj-$(CONFIG_PCIE_MEDIATEK) += pcie-mediatek.o
++obj-$(CONFIG_PCIE_OXNAS) += pcie-oxnas.o
+ obj-$(CONFIG_PCIE_TANGO_SMP8759) += pcie-tango.o
+ obj-$(CONFIG_VMD) += vmd.o
+
+--- a/arch/arm/boot/dts/ox820.dtsi
++++ b/arch/arm/boot/dts/ox820.dtsi
+@@ -302,6 +302,83 @@
+ reg = <0x1000 0x1000>,
+ <0x100 0x500>;
+ };
++
++ pcie0: pcie-controller@c00000 {
++ compatible = "plxtech,nas782x-pcie";
++ device_type = "pci";
++ #address-cells = <3>;
++ #size-cells = <2>;
++
++ /* flag & space bus address host address size */
++ ranges = < 0x82000000 0 0x48000000 0x48000000 0 0x2000000
++ 0xC2000000 0 0x4A000000 0x4A000000 0 0x1E00000
++ 0x81000000 0 0x4BE00000 0x4BE00000 0 0x0100000
++ 0x80000000 0 0x4BF00000 0x4BF00000 0 0x0100000>;
++
++ bus-range = <0x00 0x7f>;
++
++ /* cfg inbound translator phy*/
++ reg = <0x47C00000 0x1000>, <0x47D00000 0x100>, <0x44A00000 0x10>;
++
++ #interrupt-cells = <1>;
++ /* wild card mask, match all bus address & interrupt specifier */
++ /* format: bus address mask, interrupt specifier mask */
++ /* each bit 1 means need match, 0 means ignored when match */
++ interrupt-map-mask = <0 0 0 0>;
++ /* format: a list of: bus address, interrupt specifier,
++ * parent interrupt controller & specifier */
++ interrupt-map = <0 0 0 0 &gic 0 19 0x304>;
++
++ gpios = <&gpio1 12 0>;
++ clocks = <&stdclk CLK_820_PCIEA>, <&pllb>;
++ clock-names = "pcie", "busclk";
++ resets = <&reset RESET_PCIEA>, <&reset RESET_PCIEPHY>;
++ reset-names = "pcie", "phy";
++
++ plxtech,pcie-hcsl-bit = <2>;
++ plxtech,pcie-ctrl-offset = <0x120>;
++ plxtech,pcie-outbound-offset = <0x138>;
++ status = "disabled";
++ };
++
++ pcie1: pcie-controller@e00000 {
++ compatible = "plxtech,nas782x-pcie";
++ device_type = "pci";
++ #address-cells = <3>;
++ #size-cells = <2>;
++
++ /* flag & space bus address host address size */
++ ranges = < 0x82000000 0 0x4C000000 0x4C000000 0 0x2000000
++ 0xC2000000 0 0x4E000000 0x4E000000 0 0x1E00000
++ 0x81000000 0 0x4FE00000 0x4FE00000 0 0x0100000
++ 0x80000000 0 0x4FF00000 0x4FF00000 0 0x0100000>;
++
++ bus-range = <0x80 0xff>;
++
++ /* cfg inbound translator phy*/
++ reg = <0x47E00000 0x1000>, <0x47F00000 0x100>, <0x44A00000 0x10>;
++
++ #interrupt-cells = <1>;
++ /* wild card mask, match all bus address & interrupt specifier */
++ /* format: bus address mask, interrupt specifier mask */
++ /* each bit 1 means need match, 0 means ignored when match */
++ interrupt-map-mask = <0 0 0 0>;
++ /* format: a list of: bus address, interrupt specifier,
++ * parent interrupt controller & specifier */
++ interrupt-map = <0 0 0 0 &gic 0 20 0x304>;
++
++ /* gpios = <&gpio1 12 0>; */
++ clocks = <&stdclk CLK_820_PCIEB>, <&pllb>;
++ clock-names = "pcie", "busclk";
++ resets = <&reset RESET_PCIEB>, <&reset RESET_PCIEPHY>;
++ reset-names = "pcie", "phy";
++
++ plxtech,pcie-hcsl-bit = <3>;
++ plxtech,pcie-ctrl-offset = <0x124>;
++ plxtech,pcie-outbound-offset = <0x174>;
++ status = "disabled";
++ };
++
+ };
+ };
+ };