Commit Graph

63 Commits (84cb0f7ace73fad15e29e1d74c469b37f90b334d)

Author SHA1 Message Date
Adrian Schmutzler 1de9cac2f9 ramips: move redundant console setup to mt7621 SoC DTSI
For mt7621, console is set up via DTS bootargs individually in
device DTS/DTSI files. However, 44 of 74 statements use the
following setting:

	chosen {
		bootargs = "console=ttyS0,57600";
	};

Therefore, don't repeat ourselves and move that definition to the SoC
DTSI file to serve as a default value.

This patch is cosmetic.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Chuanhong Guo 51c6b14092 ramips: mt7621: backport more pcie driver fixes
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
DENG Qingfang 10f27c6f00 ramips: mt7621: add new NAND driver
Add new NAND driver for MT7621

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 9ebb85c372 ramips: mt7621: update PCIe node in dtsi
Update PCIe node in dtsi to match the new driver

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 66984646c2 ramips: mt7621: update pinctrl nodes
Upstream GPIO driver uses "groups" "function" properties

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 783fc8e553 ramips: mt7621: replace gpio/eth nodes in mt7621.dtsi
There's different gpio and ethernet drivers upstream for mt7621.
Update these two nodes to match upstream dt bindings.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Adrian Schmutzler e816c50993 ramips: fix whitespace issues in DTS files
This is the result of grepping/searching for several common
whitespace issues like double empty lines, leading spaces, etc.

This patch fixes them for the ramips target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Chuanhong Guo 110daa16e4 ramips: mt7621: add IRQ for GPIO node
This makes interrupt-based gpio-keys working.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Deng Qingfang 0599cd90e1 ramips: fix MT7621 dtsi
Fix SysTick reg
Add uartlite2 and uartlite3 nodes

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
6 years ago
Mathias Kresin ffa55386f1 ramips: fix dtc compiler warnings
The latest dtc compiler considers nodes named i2c or spi as the
respective bus:

  /pinctrl/i2c: incorrect #address-cells for I2C bus
  /pinctrl/spi: incorrect #address-cells for SPI bus

Rename the node to fix the false positives.

Fix the spi node unit address for the DWR-512-B and UBNT-ER-e50 to get
rid of the following warning:

  SPI bus unit address format error, expected "n"

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Weijie Gao ed25e3ac02 ramips: fix some clocks in mt7621.dtsi
As the cpu clock calculation has been fixed, the clock for gic and spi
should be also fixed.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
6 years ago
Weijie Gao c7ca224299 ramips: fix cpu clock of mt7621 and add dt clk devices
For a long time the mt7621 uses a fixed cpu clock which causes a problem
if the cpu frequency is not 880MHz.

This patch fixes the cpu clock calculation and adds the cpu/bus clkdev
which will be used in dts.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
6 years ago
Weijie Gao f5af8be636 ramips: fix register range of memc node in mt7621.dtsi
The memc node from mt7621.dtsi has incorrect register resource.
Fix it according to the programming guide.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
6 years ago
Mathias Kresin a58535771f ramips: set usb led trigger via devicetree
Assign the usbdev trigger via devicetree for all subtargets and drop
the userspace handling of the usb leds.

With the change all usb ports are triggering the usb led instead of
only usb 1.1 XOR usb 2.0 XOR usb 3.0 as it was before.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 563a5b5f94 ramips: add mt7620/1 sdhci pinmux
Set the pins to the required mode via the pinmux driver. It allows to
get rid of the pinmux related code in the sd card driver.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Paul Wassi e348ccc4e6 treewide: fix some cosmetic glitches in dts files
- fix single spaces hidden by a tab
- replace indentation with spaces by tabs
- make empty lines empty
- drop trailing whitespace
- drop unnecessary blank lines

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
6 years ago
Alex Maclean 6031ab345d ramips: move partitions into partition table node
Starting with kernel 4.4, the use of partitions as direct subnodes of the
mtd device is discouraged and only supported for backward compatiblity
reasons.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Mathias Kresin bfd65fc4ab ramips: fix whitespace and comment issues in dts
Fix space vs. tabs issue and trainling whitespaces. Use C style
comments or drop the comments if they explain what is already to see in
the devicetree parameters.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 6384e0d16a ramips: fix hnat dtc warning
The hardware NAT node has the same reg/unit as the ethernet node. One
of them need to be a child of the other.

Make the hardware NAT node a child of the ethernet node since the it
"reference" the netdev in its properties.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin f9b8328d79 ramips: fix pci/pcie related dtc warnings
Add the ranges property to the PCI bridges where missing. Add the unit
address to PCI bridge where missing.

Rework the complete rt3883 pci node. Drop the PCI unit nodes from the
dtsi. They are not used by any dts file and should be rather in the dts
than in the SoC dtsi. Express the PCI-PCI bridge in a clean devicetree
syntax. The ralink,pci-slot isn't used by any driver, drop it. Move the
pci interrupt controller out of the pci node. It doesn't share the same
reg and therefore should be an independent/SoC child node.

Move the pci related rt3883 pinctrl setting to the dtsi instead of
defining the very same for each rt3883 board.

If the device_type property is used for PCI units, the unit is treated
as pci bridge which it isn't. Drop it for PCI units.

Reference pci-bridges or the pci node defined in the dtsi instead of
recreating the whole node hierarchy. It allows to change the referenced
node in the dtsi without the need to touch all dts.

Fix the PCI(e) wireless unit addresses. All our PCI(e) wireless chips
are the first device on the bus. The unit address has to be the bus
address instead of the PCI vendor/device id.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin b9dbf3f3c8 ramips: fix cpu related dtc warnings
We need a reg property if we are using a unit address.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Rosen Penev 289b2f5e85 ramips: mt7621: Fix some cosmetic DTC warnings
Node /cpus/cpu@0 has a unit name, but no reg property
Node /cpus/cpu@1 has a unit name, but no reg property
Node /cpuintc@0 has a unit name, but no reg property
Node /cpuclock@0 has a unit name, but no reg property
Node /sysclock@0 has a unit name, but no reg property
Node /pcie@1e140000/pcie0 missing ranges for PCI bridge (or not a bridge)
Node /pcie@1e140000/pcie0 missing bus-range for PCI bridge
Node /pcie@1e140000/pcie1 missing ranges for PCI bridge (or not a bridge)
Node /pcie@1e140000/pcie1 missing bus-range for PCI bridge
Node /pcie@1e140000/pcie2 missing ranges for PCI bridge (or not a bridge)
Node /pcie@1e140000/pcie2 missing bus-range for PCI bridge

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
John Crispin 64878a5616 Revert "ramips: improve interrupt mapping"
This reverts commit 5f7396ebef.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
NeilBrown 5f7396ebef ramips: improve interrupt mapping
As the Interrupts for the PCI adapters are listed in
devicetree we shouldn't need to have them explicit in the code.

The simplest way to do this is to use of_irq_parse_and_map_pci()
and specify an interrupt-map which identifies the different
PCI hosts by bus/slot numbers.
This has the advantage that the hwirq number are mapped to virq
numbers for us, so the ugly hack can go.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years ago
John Crispin 424a9ae128 ramips: implement hardware NAT offload for MT7621
Supports IPv4 flow offloading on MT7621 for Routing, SNAT and DNAT

Supported are regular ethernet->ethernet connections, including one
802.1q VLAN and/or PPPoE encapsulation

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Roman Yeryomin 6b6dc2b3e3 ramips: mt7621: fix usb init
In 4.14 reg-names is required to identify resources.
Otherwise init fails with:

[    5.900501] xhci-mtk 1e1c0000.xhci: invalid resource
[    5.910499] xhci-mtk: probe of 1e1c0000.xhci failed with error -22

Signed-off-by: Roman Yeryomin <roman@advem.lv>
6 years ago
Kevin Darbyshire-Bryant 3fbf3ab44f ramips: fix missing mediatek wdt
mediatek MT7621 soc watchdog DTS id was renamed from "mtk,mt7621-wdt" to
"mediatek,mt7621-wdt" when driver upstreamed to kernel 4.5

Update mt7621.dtsi & mt7628an.dtsi definitions to match upstreamed
kernel.

Restores hardward watchdog functionality on mt7621 devices under linux
4.9

Tested on: MIR3G

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
John Crispin 6acb53c526 ralink: fix rcu_sched stalls on mt7621
there were 2 bugs
*) core1 came up with a bad bogo mips, looks like the clock needed time to stabilize
*) HPT frequency was not set making r4k timers not come up properly

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Mathias Kresin f1d0eba3ea ramips: cleanup dts files of mt7621 based boards
Fix a typo in mt7621.dtsi compatible string. Disable spi, sdhci and pci
in mt7621.dtsi and enable the nodes in the indiviual board dts files.
The nodes require further device specific configuration anyway.

Remove the m25p80@0 spi child node from mt7621.dtsi and add the
chunked-io parameter to the individual board dts files. Fix the spi
flash compatible string for the WNDR3700V5.

Drop the mt7621-eval-board compatible string for all boards which are
not the eval board.

Drop the linux,modalias parameter from spi flash node.

Remove the xhci node from board files, it is already enabled in dtsi.
Disable xhci for boards not having usb ports populated.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Michael Lee 921d782eb7 ramips: update i2s dtsi files
Signed-off-by: Michael Lee <igvtee@gmail.com>
8 years ago
Michael Lee 011ce1fad6 ramips: update i2c dtsi files
Signed-off-by: Michael Lee <igvtee@gmail.com>
8 years ago
Michael Lee f36d624d88 ramips: add gdma hsdma dts info
Signed-off-by: Michael Lee <igvtee@gmail.com>
8 years ago
Álvaro Fernández Rojas 021c893658 ramips: fix size-cells on spi nodes
size-cells should be 0 in order to avoid dummy values in reg properties.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Stanislav Galabov ffaaa6788a ramips: DTS modifications
This commit makes the following modifications to ramips dts files:
1. Add clkctrl node to all dtsi files (although not used for now)
2. Add clocks and clock-names properties to some nodes (usbphy, pci)
3. Add usbphy node for rt3050 (although not used for now)
4. Add clock-frequency to uart nodes in mt7621.dtsi and mt7628an.dtsi

These modifications, although not fully used at the moment, will make
it easier for FreeBSD to adopt and use LEDE ramips dts files with
minimal changes for easier maintenance.

Signed-off-by: Stanislav Galabov <sgalabov@gmail.com>
8 years ago
Stanislav Galabov 9195d8da35 ramips: DTS rework
Add node aliases to dtsi files.
Reword dts files so they're more in-line with upstream.
Fix some more warnings and errors reported by dtc

Signed-off-by: Stanislav Galabov <sgalabov@gmail.com>
8 years ago
Stanislav Galabov 600c224213 ramips: Add hex prefix (0x) to dtsi reg properties where needed.
Signed-off-by: Stanislav Galabov <sgalabov@gmail.com>
8 years ago
Stanislav Galabov b8f73d7f0a ramips: introduce serial0 aliases
This patch introduces serial0 aliases in the ramips DTS files, which can
then be used to denote the active console instead of relying on bootargs.

Signed-off-by: Stanislav Galabov <sgalabov@gmail.com>
8 years ago
Felix Fietkau d041e8b44b ramips: add linux 4.4 support, update mt7621 subtarget to 4.4
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48951
8 years ago
Felix Fietkau 3e807886d0 ramips: disable NAND device in mt7621.dtsi to fix boot errors on many devices
Enable it from .dts files that need it, also remove redundant properties

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 47936
9 years ago
John Crispin 651e620de5 ralink: fixup devicetree files to work with new ethernet driver
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 47900
9 years ago
John Crispin 8470e30a76 ramips: move partition definitions out of mt7621.dtsi file
Partitions defined in parent dtsi cannot be undefined in children.
This moves partitions defined in mt7621.dtsi into board's device tree.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

SVN-Revision: 47876
9 years ago
John Crispin e610cdfc8a ramips: use gic timer as clocksource for mt7621
* Switches clocksource to gic timer.
* Moves frequency definitions to dtsi since frequency was hardcoded anyway
  Will work on proper frequency detection later.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

SVN-Revision: 47875
9 years ago
Felix Fietkau 77bedbe80d Revert "ramips: use gic timer as clocksource for mt7621"
This reverts commit 270a2afcc544ca14e79198346e7e186033472ae7.

SVN-Revision: 47872
9 years ago
John Crispin abd11be13c ramips: use gic timer as clocksource for mt7621
* Switches clocksource to gic timer.
* Moves frequency definitions to dtsi since frequency was hardcoded anyway
  Will work on proper frequency detection later.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

SVN-Revision: 47843
9 years ago
John Crispin a87272ebfb ramips: enable CPS for mt7621
Enables CPS multiprocessing instead ob obsoleted CMP for mt7621.

This patch fixes a few issues currently existing on 4.3 kernel with at least ubnt-erx:
* iperf shows only 50Mbits on direct gigabit connection to desktop,
* ping times jump to 5-6ms to dorectly connected desktop
* /proc/interrupts shows spurious interrups (ERR)

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

SVN-Revision: 47842
9 years ago
John Crispin 81c999bbda ramips: mt7621: use symbolic names of gic interrupt settings
This also adds dts nodes for cpc and mc for documentation purposes

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

SVN-Revision: 47836
9 years ago
John Crispin 6df4426245 ralink: bump to the target to v4.3
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 47831
9 years ago
John Crispin 948e67cb16 ramips: fix size-cells for spi nodes
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

SVN-Revision: 47119
9 years ago
John Crispin f453508b3e ramips: Fix pinmux functions for MT7621
The pinctrl-rt2880 code doesn't support multiple functions with the same
name. This will result in a incorrect pinmux configuration.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>

SVN-Revision: 46963
9 years ago
John Crispin 553fea9f19 ramips: fix indentation and other mistakes in .dts{, i} files
The following patch fixes:
 * wrong indentations
 * doubled gpio-keys-polled nodes (DIR-300-B7, DIR-320-B1, DIR-610-A1)
 * duplicate spacings
 * empty lines at end of files and after last child nodes
 * trailing and leading whitespace
 * unnecessary and commented-out code
 * missing empty lines between nodes and between properties and nodes
 * unnecessary empty lines between nodes properties [1]

in .dts{,i} files, for ramips target.

[1] Some of empty lines in SOCs dtsi files were left untouched, because they seem to be there for a reason (readability?).

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>

SVN-Revision: 46613
9 years ago