Commit Graph

23293 Commits (be3c8f8b2bf2893950b11ea7fa16cea074bc7903)

Author SHA1 Message Date
David Woodhouse be3c8f8b2b mediatek: fix Ethernet support on UniElec U7623
The definition of the switch in the device-tree was not correct. Make it
look more like the Banana Pi R2, which works.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
David Woodhouse 6eb63019af mediatek: mt7623: fix sysupgrade from vendor OpenWrt on UniElec U7623
This board ships with an ancient 14.07-based OpenWrt using block2mtd, and
the MBR partition table contains nonsense.

It is possible to sysupgrade to an upstream OpenWrt image, but the
legacy layout of the OpenWrt images start at 0xA00 in the eMMC, with
a raw uImage. The legacy OpenWrt image doesn't "own" the beginning
of the device, including the MBR and U-Boot.

This means that when a user upgrades to upstream OpenWrt, it doesn't
boot because it can't find the right partitions. So hard-code them on
the kernel's command line using CONFIG_CMDLINE_PARTITION (for block).

Additionally, the vendor firmware doesn't cope with images larger than
about 36MiB, because it only overwrites the contents of its "firmware"
MTD partition. The current layout of the legacy image wastes a lot of
space, allowing over 32MiB for the kernel and another 10MiB for the FAT
recovery file system which is only created as 3MiB. So pull those in
to allow 4¾ MiB for the kernel, 3MiB for recovery, and then we have over
20MiB for the root file system.

This doesn't affect the new images which ship with a full eMMC image
including a different MBR layout and a partition for U-Boot, because
our modern U-Boot can actually pass the command line to the kernel, and
the built-in one doesn't get used anyway.

Tested by upgrading from vendor OpenWrt to the current legacy image,
from legacy to itself, to the previous legacy layout, and then to
finally the full-system image.

This commit probably wants backporting to 19.07, which also doesn't
install over the vendor OpenWrt and doesn't even have a full-system
installation option.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
David Woodhouse ea9ef8c945 mediatek: mt7623: add explicit console= to U7623 kernel
The bootloader for legacy builds can't set it, so we end up unable to
log in on the serial port.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
4 years ago
Leon M. George 15f585afc5 ath79: add support for Compex WPJ563
Specifications:

SoC: QCA9563
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
2 Gigabit ethernet ports
3×3 2.4GHz on-board radio
miniPCIe slot that supports 5GHz radio
PoE 24V passive or 36V-56V passive with optional IEEE 802.3af/at
USB 3.0 header

Installation:

To install, either start tftp in bin/targets/ath79/generic/ and use
the u-boot prompt over UART:

tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj563-squashfs-sysupgrade.bin
erase 0x9f680000 +1
erase 0x9f030000 +$filesize
cp.b $fileaddr 0x9f030000 $filesize
boot

The cpximg file can be used with sysupgrade in the stock firmware (add
SSH key in luci for root access) or with the built-in cpximg loader.
The cpximg loader can be started either by holding the reset button
during power up or by entering the u-boot prompt and entering 'cpximg'.
Once it's running, a TFTP-server under 192.168.1.1 will accept the image
appropriate for the board revision that is etched on the board.

For example, if the board is labelled '7A02':

tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj563-squashfs-cpximg-7a02.bin

MAC addresses:

<&uboot 0x2e010>  *:71  (label)
<&uboot 0x2e018>  *:72
<&uboot 0x2e020>  *:73
<&uboot 0x2e028>  *:74

Only the first two are used (for ethernet), the WiFi modules have
separate (valid) addresses. The latter two addresses are not used.

Signed-off-by: Leon M. George <leon@georgemail.eu>
4 years ago
Aleksander Jan Bajkowski f8ea7c53fd lantiq: xrx200: disable unused switch and phy
xrx200 has a 6 port built-in switch with 2 integrated PHY. None of the
xrx200 router uses external switch. Most boards use integrated or Lantiq
(Intel) PEF7071 PHY. Only some FritzBox routers use AT803X PHY and
VGV7510KW22 use ICPLUS PHY. Other unused PHY drivers may be removed.

This patch enables these symbols only on xway and xway_legacy subtargets:
 - CONFIG_PSB6970_PHY (Driver for PHY in PSB6970 - 7 port FE Switch)
 - CONFIG_RTL8366RB_PHY (Driver for PHY in RTL8366 - 6 port GE Switch)
 - CONFIG_RTL8366_SMI (Driver for RTL8366 - 6 port GE Switch)

Reduces image size by 7.3kB.

Continuation of 58a6f06978 (PR: #2983)

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[fix sorting in config files, small fix in commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 739d282c2f mediatek: remove condition in Device/Default
The current condition with part of the variables set dependent on
the subtarget in Device/Default isn't really nice to read and also
defeats the purpose of having a default node.

This removes the special settings for mt7623 and moves them to the
individual devices, which is not much of a problem as there are
actually just two of them and they partly use different settings
anyway.

While at it, slightly adjust the order of variables and wrap some
long lines.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Bjoern Dobe d38d345c72 ath79: mikrotik: use base mac on lan for RBwAPG-5HacT2HnD
The Mikrotik RBwAPG-5HacT2HnD has only a single ethernet interface
(lan), and the vendor uses the base (label) MAC address for it.

Signed-off-by: Bjoern Dobe <bjoern@dobecom.de>
[commit title/message improvement]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo ab78694fe8 treewide: rename POWER_ON_STRIP register
AR8327 datasheet[1] calls the register at address 0x0010
"Power-on Strapping Register". As it has nothing to do with "strip",
let's rename it to "POWER_ON_STRAP" to make it easier to grasp.

[1] https://lafibre.info/images/doc/201106_spec_AR8327.pdf

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
John Thomson 8484d6da1e ramips: remove non-existant poe_passthrough for RouterBOARD 750Gr3
This 750gr3 GPIO17 switch was added based on vendor source,
but only the 760iGS (which shares the rbsysfs board identifier)
device has the physical wiring. The 750Gr3 actually does not
support PoE out.

Apart from that, note that the gpio base (480) would have required
this GPIO to be referenced as 497 if it was kept.

Fixes: 6ba58b7b02 ("ramips: cleanup the RB750Gr3 support")

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Davide Fioravanti 92780d80ab ramips: add support for Winstars WS-WN583A6
The Winstars WS-WN583A6 is a wireless repeater with 2 gigabit ethernet
ports. Even if mine is branded as "Gemeita AC2100", the sticker on the
back says WS-WN583A6. So I will refer to it as Winstars WS-WN583A6.
Probably the real product name is the Wavlink WL-WN583A6 because of
the many references to Wavlink in the OEM firmware and bootlog.

Hardware
--------
SoC:   Mediatek MT7621AT (880 MHz, 2 cores 4 threads)
RAM:   128MB
FLASH: 8MB NOR (GigaDevice GD25Q64B)
ETH:   2x 10/100/1000 Mbps Ethernet (MT7530)
WIFI:
  - 2.4GHz: 1x MT7603E (2x2:2)
  - 5GHz:   1x MT7615E (4x4:4)
  - 6 internal antennas
BTN:
  - 1x Reset button
  - 1x WPS button
  - 1x ON/OFF switch (working but unmodifiable)
  - 1x Auto/Schedule switch (working but unmodifiable. Read Note #3)
LEDS:
  - 1x White led
  - 1x Red led
  - 1x Amber led
  - 1x Blue led
  - 2x Blue leds (lan and wan port status: working but unmodifiable)
UART:
  - 57600-8-N-1

Everything works correctly.

Currently there is no firmware update available. Because of this, in
order to restore the OEM firmware, you must firstly dump the OEM
firmware from your router before you flash the OpenWrt image.

Backup the OEM Firmware
-----------------------
The following steps are to be intended for users having little to none
experience in linux. Obviously there are many ways to backup the OEM
firmware, but probably this is the easiest way for this router.
Procedure tested on M83A6.V5030.191210 firmware version.

1) Go to http://192.168.10.1/webcmd.shtml

2) Type the following line in the "Command" input box:
	mkdir /etc_ro/lighttpd/www/dev; for i in /dev/mtd*ro; do dd if=${i} of=/etc_ro/lighttpd/www${i}; done

3) Click "Apply"

4) After few seconds, in the textarea should appear this output:
		16384+0 records in
	16384+0 records out
	8388608 bytes (8.0MB) copied, 4.038820 seconds, 2.0MB/s
	384+0 records in
	384+0 records out
	196608 bytes (192.0KB) copied, 0.095180 seconds, 2.0MB/s
	128+0 records in
	128+0 records out
	65536 bytes (64.0KB) copied, 0.032020 seconds, 2.0MB/s
	128+0 records in
	128+0 records out
	65536 bytes (64.0KB) copied, 0.031760 seconds, 2.0MB/s
	15744+0 records in
	15744+0 records out
	8060928 bytes (7.7MB) copied, 3.885280 seconds, 2.0MB/s
	dd: can't open '/dev/mtd5ro': No such device
	dd: can't open '/dev/mtd6ro': No such device
	dd: can't open '/dev/mtd7ro': No such device

   Excluding the "X.XXXXXX seconds" part, you should get the same
   exact output. If your output doesn't match mine, stop reading
   and ask for help in the forum.

5) Open the following links to download the partitions of the OEM FW:
	http://192.168.10.1/dev/mtd0ro
	http://192.168.10.1/dev/mtd1ro
	http://192.168.10.1/dev/mtd2ro
	http://192.168.10.1/dev/mtd3ro
	http://192.168.10.1/dev/mtd4ro

   If one (or more) of these files weight 0 byte, stop reading and ask
   for help in the forum.

6) Store these downloaded files in a safe place.

7) Reboot your router to remove any temporary file from your router.

Installation
------------
Flash the initramfs image in the OEM firmware interface.
When openwrt boots, flash the sysupgrade image otherwise you won't be
able to keep configuration between reboots.

Restore OEM Firmware
--------------------
Flash the "mtd4ro" file you previously backed-up directly from LUCI.
Warning: Remember to not keep settings!
Warning2: Remember to force the flash.

Notes
-----
1) The "System Command" page allows to run every command as root.
   For example you can use "dd" and "nc" to backup the OEM firmware.
   PC (SERVER):
	nc -l 5555 > ./mtdXro
   ROUTER (CLIENT):
	dd if=/dev/mtdXro | nc PC_IP_ADDRESS 5555

2) The OEM web interface accepts only images containing the string
   "WN583A6" in the filename.
   Currently the OEM interface accepts only the initramfs image
   probably because it checks if the ih_size in the image header is
   equal to the whole image size (instead of the kernel size)
   Read more here:
   https://forum.openwrt.org/t/support-for-strong-1200/22768/19

3) The white led (namely "Smart Night Light") can be controller by the
   user only if the side switch is set to "Schedule" otherwise it will
   be activated by the light condition (there is a photodiode on the
   top side of the router)

4) Router mac addresses:

   LAN		XX:XX:XX:XX:XX:8F
   WAN		XX:XX:XX:XX:XX:90
   WIFI 2G	XX:XX:XX:XX:XX:91
   WIFI 5G	XX:XX:XX:XX:XX:92

   LABEL	XX:XX:XX:XX:XX:91

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
[remove chosen node, fix whitespace]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1e55df2e41 oxnas: use vendor_model scheme for ox810se
Most newer targets have been converted to consistently use
vendor_model scheme for device definitions/image names, ox820 is
using it as well, so let's just convert ox810se for consistency.

While at it, use generic setup for DEVICE_DTS and add SUPPORTED_DEVICES.
The latter have been introduced for ox820 already in
cf7896117b ("oxnas: enable image metadata by setting SUPPORTED_DEVICES")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 64de3076c3 lantiq: Fix warning in SPI driver
This fixes a warning in the SPI driver at bootup. This warning is seen
in kernel 5.4 on lantiq deives.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Phi Nguyen eda9751d86 ipq40xx: support reset button for WPJ419
Compex WPJ419 has a reset button on a GPIO pin.

Signed-off-by: Phi Nguyen <phind.uet@gmail.com>
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
Adrian Schmutzler 0a5d74fa68 arc770: use generic 02_sysinfo
Currently arc770 sets a board name from compatible for no apparent
reason. Just use the compatible directly instead.

This theoretically removes a board name "generic" when no compatible
was present, however, there is no case where this "generic" board
name was actually used.

This also fixes an issue where snps,axs101 would not have been
properly detected anyway, as its case was not set up syntactically
correct.

Fixes: 576621f1e3 ("linux: add support of Synopsys ARC770-based boards")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3c190ef112 archs38: use generic 02_sysinfo
Currently archs38 sets a board name from compatible for no apparent
reason. Just use the compatible directly instead.

This theoretically removes a board name "generic" when no compatible
was present, however, there is no case where this "generic" board
name was actually used.

This also fixes an issue where snps,axs103 would not have been
properly detected anyway, as its case was not set up syntactically
correct.

Fixes: 73015c4cb3 ("linux: add support of Synopsys ARCHS38-based boards")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 9662b9d688 ramips: switch MT7620 subtarget to 5.4
MT7620 seems to work fine with kernel 5.4. Set the default kernel
version to 5.4 to bring this to a broader audience.

Tested on Archer C2 v1 / Archer C20i

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 4cd5ce5a7f ramips: increase SPI frequency for MT7620 Archer
Increase the SPI frequency for the MT7620 based TP-Link Archer
series to 30MHz.

TP-Link uses different SPI flash chips for the same board
revision, so be conservative to not break boards with a
different chip. 30MHz should be well supported by all chips.

Tested on Archer C2 v1 (GD25Q64B) and Archer C20i (W25Q64FV).

Archer C20i (before)
====================
root@OpenWrt:~# time dd if=/dev/mtd1 of=/tmp/test.bin bs=64k
122+0 records in
122+0 records out
real	0m 15.30s
user	0m 0.00s
sys	0m 15.29s

Archer C20i (after)
===================
root@OpenWrt:~# time dd if=/dev/mtd1 of=/tmp/test.bin bs=64k
122+0 records in
122+0 records out
real	0m 5.99s
user	0m 0.00s
sys	0m 5.98s

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 9a9cdc65c4 ath79: re-enable image generation for GL-AR750S
The bootloader only writes the first 2MB of the image to the NOR flash
when installing the NAND factory image. The bootloader is capable of
booting larger kernels as it boots from the memory mapped SPI flash.

Disable the NAND factory image. The NAND can be bootstrapped by writing
the NAND initramfs image using the NOR upgrade method in the bootloader
web-recovery and sysupgrading from there. The NOR variant is not
affected.

Also refactor the partition definitions in the DTS to make them less
annoying to read.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 5e86877f36 ath79: correctly define WiFi switch for TL-WR841ND v8
The TL-WR841ND v8 feature a WiFi switch instead of a button.
This adds the corresponding input-type to prevent booting into
failsafe regularly.

This has been defined correctly in ar71xx, but was overlooked
when migrating to ath79. In contrast, the TL-WR842ND v2, which
has the key set up as switch in ar71xx, actually has a button.
The TL-MR3420 v2 has a button as well and is set up correctly
for both targets. (Information based on TP-Link user guide)

Note:

While looking into this, I found that support PR for TL-MR3420 v2
switched reset button to ACTIVE_HIGH. However, the other two
device still use ACTIVE_LOW. This seems strange, but I cannot
verify it lacking the affected devices.

Fixes: FS#2733
Fixes: 9601d94138 ("add support for TP-Link TL-WR841N/ND v8")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 42dc5c2a3f ramips: improve LED support for D-Link DIR-615 D series
This patch adds a trigger for the WAN LED and enhances support for
the WiFi LED by enabling activity indication.

This is based on bug report feedback (see reference below).

While at it, update the LED node names in DTS file.

Fixes: FS#732

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 05c74e4000 omap: derive DEVICE_DTS from device name
In most cases the DEVICE_DTS name can be derived easily from the
node name, so let's do this to enforce harmonized names where
possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler eff0a0e39e apm821xx: derive DEVICE_DTS from device name
The DEVICE_DTS variable always matches the device definition name,
just with "_" replaced by "-". Thus, create a DEVICE_DTS definition
in Device/Default and drop all the individual statements.

If necessary in the future, local DEVICE_DTS will still overwrite
that default.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a2fee73e27 bcm47xx: fix switch setup for Linksys WRT610N v2
WRT610N V2 is not detected by the initial network configuration script.
The switch remains unconfigured and wlan/lan vlans are not created.

This adds the correct setup for the device.

Fixes: FS#1869

Suggested-by: Alessandro Radicati
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 683193cfb7 layerscape: fix indent
Fix indent to be consistent with the rest of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Nelson Cai 6269f10ea4 ramips: fix network setup for Ubiquiti ER-X/ER-X-SFP
The function name ucidef_set_interface_lan_wan does not exist,
use the proper name by adding an "s" and thereby fix network
setup on these devices.

Fixes: 22468cc40c (ramips: erx and erx-sfp: fix missing WAN interface)

Signed-off-by: Nelson Cai <niphor@gmail.com>
[commit message/title facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Dustin Gathmann d5a148f5c8 lantiq/xrx200: make WLAN button responsive on Fritzbox 7360 & 7362
Pressing the 'WLAN' button should enable/disable wireless activity.
Currently, the button is mapped to the KEY_WLAN, which will not
have this effect.
This patch changes the mapping of the WLAN button, so a button
press will emit an action for the 'rfkill' key instead of 'wlan'.
Apparently, this is what stock OpenWRT expects.

This fix is analogous to the preceding patch for Fritzbox 3370.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
4 years ago
Dustin Gathmann 0ee30adb46 lantiq/xrx200: fix WLAN button actions for Fritzbox 3370
The WLAN button actions are reversed, i.e. pressing the button emits a
'released' action, and vice versa.
This can easily be checked by adding
logger -t button_action "$BUTTON $ACTION"
as the second line of /etc/rc.button/rfkill, and using logread to read
the events (assuming the preceding patch has been applied).
Defining the GPIO as ACTIVE_LOW corrects this behavior.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
4 years ago
Dustin Gathmann a53bf63756 lantiq/xrx200: make WLAN button responsive on Fritzbox 3370
Pressing the 'WLAN' button should enable/disable wireless activity.
However, on the Fritzbox 3370 this doesn't have an effect.
This patch changes the mapping of the physical WLAN button, so a button
press will emit an action for the 'rfkill' key instead of 'wlan'.
Apparently, this is what stock OpenWRT expects, and also what is
implemented for most other devices.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
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
David Bauer 612d5282b5 ramips: don't create switch config for VIXMINI
Don't create UCI switch config for the GL.iNet microuter-N300 and
VIXMINI. These devices only have a single LAN port.
Creating the switch config makes usage of VLANs more complicated,
as they would have to be configured on the MAC as well as the "switch".

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler b78a266888 lantiq: move 01_led_migration script to subtargets
Split the /etc/uci-defaults/01_led_migration scripts into subtargets
as already done for most of the other base-files.

While this introduces a minor amount of code duplication, it still
is considered an improvement, as device-specific settings are kept
together in the subtargets' base-files and the script at hand can be
removed entirely for two of the subtargets not needing it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Martin Schiller 4d8552c265 lantiq: move dsl related base-files into own package
It does not make sense to install this components on lantiq systems
where the dsl subsystem is not needed/used.

This also makes it possible to use the files also on other targets.
(hopefully ipq401x / FritzBox 7530 in the near future)

Signed-off-by: Martin Schiller <ms.3headeddevs@gmail.com>
4 years ago
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
John Audia b6443367d8 kernel: bump 5.4 to 5.4.52
update_kernel.sh refreshed all patches, no human interaction was needed

Build system: x86_64
Run-tested: Netgear R7800 (ipq806x)

Signed-off-by: John Audia <graysky@archlinux.us>
4 years ago
Salvatore Mesoraca 2a43ab4a18 ramips: add arl_table support for MT7530
Use switch.h API to expose MT7530's ARL table to
user space.

Signed-off-by: Salvatore Mesoraca <salvatore@samknows.com>
4 years ago
Alberto Bursi 480003e9eb mvebu: add Kobol Helios 4 device
The Helios 4 is a NAS from Kobol
that is powered by an Armada 38x
MicroSOM from Solidrun, similarly
to Clearfog.

This device has:
-Armada 38x CPU
 (dual core ARMv7 1.6 Ghz)
-2 GB of ECC RAM
-Gigabit ethernet (Marvell)
-2x USB 3.0 ports
-4x Sata 3.0 ports
-i2c header (J9 |>GND|SDA|SCL|VCC)
-2x 3-pin fan headers with PWM
-micro-usb port is a TTL/UART to
 USB converter connected to TTL
-MicroSD card slot
-System, 4xSata and 1xUSB LEDs

NOT WORKING: fan control

Fan Control requires a kernel patch
that is available in the Armbian
project (the "default firmware"
of this device) and named
mvebu-gpio-remove-hardcoded
-timer-assignment
This patch isn't acceptable
by OpenWrt, it should be upstreamed.
I also have that patch in my own
local OpenWrt builds,
in case you want a more
clean and less confusing patch
for upstreaming.

To install, write the disk image
on a micro SD card with dd or
win32 disk imager, insert the
card in the slot.
Check that the dip switch battery
for boot selection is as follows
Switch 1 and 2 down/off, switches
3, 4, 5 up/on.

Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
4 years ago
Mateus B. Cassiano 73e8f23579 ramips: add support for D-Link DIR-867/DIR-882 A1
This patch adds support for D-Link DIR-867 A1 and D-Link DIR-882 A1. Given
the similarity of these devices, this patch also introduces a common DTS
shared between DIR-867 A1, DIR-878 A1 and DIR-882 A1.

Specifications:
* Board: AP-MTKH7-0002
* SoC: MediaTek MT7621AT
* RAM: 128 MB (DDR3)
* Flash: 16 MB (SPI NOR)
* WiFi: MediaTek MT7615N (x2)
* Switch: 1 WAN, 4 LAN (Gigabit)
* Ports: 1 USB 2.0, 1 USB 3.0
* Buttons: Reset, WiFi Toggle, WPS
* LEDs: Power (green/orange), Internet (green/orange), WiFi 2.4G (green),
        WiFi 5G (green), USB 2.0 (green), USB 3.0 (green)

Notes:
* WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips
* DIR-867 wireless chips are limited to 3x3 streams at hardware level
* USB ports and related LEDs available only on DIR-882

Serial port:
* Parameters: 57600, 8N1
* Location: J1 header (close to the Reset, WiFi and WPS buttons)
* Pinout: 1 - VCC
          2 - RXD
          3 - TXD
          4 - GND

Installation:
* D-Link Recovery GUI: power down the router, press and hold the reset
  button, then re-plug it. Keep the reset button pressed until the power
  LED starts flashing orange, manually assign a static IP address under
  the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1

* Some modern browsers may have problems flashing via the Recovery GUI,
  if that occurs consider uploading the firmware through cURL:

    curl -v -i -F "firmware=@file.bin" 192.168.0.1

Signed-off-by: Mateus B. Cassiano <mbc07@live.com>
[move DEVICE_VARIANT to individual definitions]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Santiago Rodriguez-Papa ed087cba8a ramips: add support for Linksys EA7300 v1
Specifications:

* SoC:      MediaTek MT7621A              (880 MHz 2c/4t)
* RAM:      Nanya NT5CC128M16IP-DIT       (256M DDR3-1600)
* Flash:    Macronix MX30LF1G18AC-TI      (128M NAND)
* Eth:      MediaTek MT7621A              (10/100/1000 Mbps x5)
* Radio:    MT7615N                       (2.4 GHz & 5 GHz)
            4 antennae: 1 internal and 3 non-deatachable
* USB:      3.0 (x1)
* LEDs:
    White   (x1 logo)
    Green   (x6 eth + wps)
    Orange  (x5, hardware-bound)
* Buttons:
    Reset   (x1)
    WPS     (x1)

Everything works! Been running it for a couple weeks now and haven't had
any problems. Please let me know if you run into any.

Installation:

Flash factory image through GUI.

This might fail due to the A/B nature of this device. When flashing, OEM
firmware writes over the non-booted partition. If booted from 'A',
flashing over 'B' won't work. To get around this, you should flash the
OEM image over itself. This will then boot the router from 'B' and
allow you to flash OpenWRT without problems.

Reverting to factory firmware:

Hard-reset the router three times to force it to boot from 'B.' This is
where the stock firmware resides. To remove any traces of OpenWRT from
your router simply flash the OEM image at this point.

Signed-off-by: Santiago Rodriguez-Papa <contact@rodsan.dev>
[use v1 only, minor DTS adjustments, use LINKSYS_HWNAME and add it to
DEVICE_VARS, wrap DEVICE_PACKAGES, adjust commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 95a05b12d7 ramips: provide common definition for ELECOM WRC GS devices
Add a common definition for ELECOM WRC "GS" devices to mt7621.mk
to not repeat the same assignments five times.

To keep the naming consistent, slightly rename the DTSI and the
factory image recipe as well.

Note that elecom_wrc-1167ghbk2-s uses a slightly different build
recipe for the factory image, so we keep it separate.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com> [WRC-1750GSV]
4 years ago
INAGAKI Hiroshi a79f55e7e0 ramips: add support for ELECOM WRC-1750GS/GSV
ELECOM WRC-1750GS is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on
MT7621A.

WRC-1750GSV has the same hardware with WRC-1750GS.

Specification:

- SoC		: MediaTek MT7621A
- RAM		: DDR3 128 MiB
- Flash		: SPI-NOR 16 MiB
- WLAN		: 2.4/5 GHz 3T3R (2x MediaTek MT7615)
- Ethernet	: 10/100/1000 Mbps x5
  - Switch	: MediaTek MT7530 (SoC)
- LED/keys	: 4x/6x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J4: 3.3V, GND, TX, RX from ethernet port side
  - 57600n8
- Power		: 12VDC, 1.5A

Flash instruction using factory image:

1. Boot WRC-1750GS (or WRC-1750GSV) normally
2. Access to "http://192.168.2.1/" and open firmware update page
   ("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
   for WRC-1750GS : wrc-1750gs-squashfs-factory.bin
   for WRC-1750GSV: wrc-1750gsv-squashfs-factory.bin
4. Wait ~120 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
4 years ago
John Crispin eff87b8f93 mediatek: backport latest pci/e driver from upstream
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin 5a5031e70b mediatek: generate UBI images for the rev board
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin ea2884e018 mediatek: minor fix to eip97 driver
This patch makes the driver work on the newer v2.3 core.

Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Adrian Schmutzler 9f3415d30b ath79: harmonize model names for Ubiquiti devices
This harmonizes the model names for the ath79 Ubiquiti devices by
applying a few minor cosmetic adjustments:

- Removes hyphens where they are not found in the product names
  (Ubiquiti uses hyphens only for the abbreviated version names
  like UAP-AC-PRO which we don't use anyway.)

- Add (XM) suffix for DTS model strings to help with distinguishing
  them from their XW counterparts.

- Remove DEVICE_VARIANT for LAP-120 which actually was an alternate
  device name.

- Generally make DTS model names and those from generic-ubnt.mk
  more consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Vieno Hakkerinen 8c7e9cc6b5 ath79: add support for Ubiquiti PowerBridge M
This adds support for the Ubiquiti PowerBridge M, which has the same
board/LEDs as the Bullet M XM, but different case and antennas.

Specifications:
- AR7241 SoC @ 400 MHz
- 64 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- Internal antenna: 25 dBi
- POWER/LAN green LEDs
- 4x RSSI LEDs (red, orange, green, green)
- UART (115200 8N1) on PCB

Flashing via WebUI:
Upload the factory image via the stock firmware web UI.

Attention: airOS firmware versions >= 5.6 have a new bootloader with
an incompatible partition table!

Please downgrade to <= 5.5 _before_ flashing OpenWrt!
Refer to the device's Wiki page for further information.

Flashing via TFTP:
Same procedure as other Bullet M (XM) boards.

- Use a pointy tool (e.g., pen cap, paper clip) and keep the reset
button on the device or on the PoE supply pressed
- Power on the device via PoE (keep reset button pressed)
- Keep pressing until LEDs flash alternatively LED1+LED3 =>
LED2+LED4 => LED1+LED3, etc.
- Release reset button
- The device starts a TFTP server at 192.168.1.20
- Set a static IP on the computer (e.g., 192.168.1.21/24)
- Upload via tftp the factory image:
$ tftp 192.168.1.20
  tftp> bin
  tftp> trace
  tftp> put openwrt-ath79-generic-xxxxx-ubnt_powerbridge-m-squashfs-factory.bin

Signed-off-by: Vieno Hakkerinen <vieno@hakkerinen.eu>
4 years ago
John Crispin 9da2b56760 ipq40xx: fix ethernet vlan double tagging
As the the SoC uses implicit vlan tagging for dual MAC support, the
offload feature breaks when using double tagging.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin 2557d2eb4c ipq40xx: merge all ar40xx patches into one single patch
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Adrian Schmutzler 3635f7efc1 ipq806x: really fix aliases node for Qualcomm IPQ8064/DB149
Having looked at this again, it appears that only gsbi2_serial
is actually enabled for this device, so the entry in the broken
aliases node was correct.

Therefore, this needs to set its own serial0 instead of inheriting
"serial0 = &gsbi4_serial;" from DTSI. Do this with the correctly
named aliases node now.

Fixes: c83f7b6d21 ("ipq806x: fix aliases node name for Qualcomm
IPQ8064/DB149")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago