Commit Graph

11 Commits (a66449c60893a168fa0c13a29127d29314b2e348)

Author SHA1 Message Date
Adrian Schmutzler a66449c608 ramips: drop remaining m25p,chunked-io from DTS
This option was a spi nor hack which is dropped in commit bcf4a5f474
("ramips: remove chunked-io patch and set spi->max_transfer_size instead")

Most of it has already been removed in
be2b61e4f1 ("ramips: drop m25p,chunked-io from dts")

It seems all current usages were added after that. Remove them.

Cc: Chuanhong Guo <gch981213@gmail.com>
Reported-by: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b057862e24 Revert "ramips: fix flash layout for TP-Link TL-WR841N v14"
This reverts commit 1623defbdb.

As already stated in the reverted patch, the OEM firmware will
properly recreate the config partition if it is overwritten by
OpenWrt.

The main reason for adding the partition was the image size
restriction imposed by the 0x3d0000 limitation of the TFTP
flashing process. Addressing this by shrinking the firmware
partition is not a good solution to that problem, though:

1. For a working image, the size of the content has to be smaller
   than the available space, so empty erase blocks will remain.

2. Conceptually, the restriction is on the image, so it makes sense
   to implement it in the same way, and not via the partitioning.
   Users could e.g. do initial flash with TFTP restriction with
   an older image, and then sysupgrade into a newer one, so TFTP
   restriction does not apply.

3. The (content) size of the recovery image is enforced to 0x3d0000
   by the tplink-v2-image command in combination with
   TPLINK_FLASHLAYOUT (flash layout in mktplinkfw2.c) anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Alexander Müller 1623defbdb ramips: fix flash layout for TP-Link TL-WR841N v14
The config partition was missing from the flash layout of the device.

Although the stock firmware resets a corrupted config partition to the
default values, the TFTP flash with an image bigger than 0x3d0000 will
truncate the image as the bootloader only copies 0x3d0000 bytes to flash
during TFTP flashing.

Fixed by adding the config partition and shrinking the firmware
partition.

Fixes: 3fd97c522b ("ramips: add support for TP-Link TL-WR841n v14")

Signed-off-by: Alexander Müller <donothingloop@gmail.com>
4 years ago
Adrian Schmutzler 2e4626ae77 ramips: remove incorrect mtd-eeprom for TP-Link TL-WR841N v14
The factory partition on this device is only 64k in size, so having
mediatek,mtd-eeprom = <&factory 0x10000> would place the EEPROM data
after the end of the flash. As can be verified against the TP-Link
GPL sources, which contain the EEPROM data as binary blob, the actual
address for the EEPROM data is 0x0.

Since 0x0 is default for MT7628, the incorrect line is just removed.

This error is the reason for the abysmal Wifi performance that people
are complaining about for the WR841Nv14.

Fixes: 3fd97c522b ("ramips: add support for TP-Link TL-WR841n v14")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Chuanhong Guo b756ea2a90 ramips: replace pinctrl property names
Upstream pinctrl driver in drivers/staging uses
groups/function/ralink,num-gpios instead of
ralink,group/ralink,function/ralink,nr-gpio
Replace these properties in dts as well as the pinctrl driver in
patches-4.14.
This commit is created using:
sed -i 's/ralink,group/groups/g'
sed -i 's/ralink,function/function/g'
sed -i 's/ralink,nr-gpio/ralink,num-gpios/g'

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Chuanhong Guo 0b68d081eb ramips: mt7628: update dts for upstream gpio-mt7621 driver
upstream driver merged 3 separated gpio banks into one gpio node.
and gpioX Y in our local driver should be replaced with gpio X*32+Y.

This patch is created using the following sed command:
sed -i -r 's/(.*)gpio([0-9]) ([0-9]+)(.*)/echo "\1gpio $((\2*32+\3))\4"/ge'

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Sungbo Eo 7a387bf9a0 ramips: mt76x8: fix bogus mediatek,portmap
mt76x8 uses esw_rt3050 driver, which does not accept mediatek,portmap with
string values. Convert the strings to integers to make it work.

According to its switch setup, WRTnode 2P/2R have a WAN port at port 0,
so the correct value should be 0x3e.

tplink_8m.dtsi uses "llllw", but it does not match switch setups of any
device using the DTSI. Remove it from the DTSI and add correct value to DTS
for each device.

These devices have a WAN port at port 0. Set the value to 0x3e.
- tplink,archer-c20-v4
- tplink,archer-c50-v3
- tplink,tl-mr3420-v5
- tplink,tl-wr840n-v4
- tplink,tl-wr841n-v13
- tplink,tl-wr842n-v5

These devices have only one ethernet port. They don't need portmap setting.
- tplink,tl-wa801nd-v5
- tplink,tl-wr802n-v4
- tplink,tl-wr902ac-v3

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler e4ce3109f2 ramips: simplify state_default/pinctrl0 in device DTS files
The node pinctrl0 is already set up in the SOC DTSI files, but
defined again as member of pinctrl in most of the device DTS(I)
files. This patch removes this redundancy for the entire ramips
target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 556ff09875 ramips/mt762x: convert devices to interrupt-driven gpio-keys
This converts all remaining devices to use interrupt-driven
gpio-keys compatible instead of gpio-keys-polled.
The poll-interval is removed.

While at it, add/remove newlines in keys and leds node where
necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Chuanhong Guo a2c19f1d2f ramips: dts: drop memory nodes
mt7621 and mt7628 now have the ability to detect memory size
automatically.
Drop memory nodes and let kernel determine memory size.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler b97a99256f ramips/mt76x8: Name DTS files based on scheme
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago