Commit Graph

18480 Commits (c61a2395140d92cdd37d3d6ee43a765427e8e318)

Author SHA1 Message Date
Antony Black d44a6307c9 brcm47xx: fix switch port mapping on D-Link DIR-330
D-Link DIR-330 is clone of ASUS WL500GP2, by default conf the WAN port is
eth1, it's not working cus eth1 not soldered and wan port function
performs 5th port of the switch.

Signed-off-by: Antony Black <gtrtfm@gmail.com>
7 years ago
Felix Fietkau 00a8f349f7 kernel: backport a patch that allows drivers to tweak the TSQ logic
Currently local TCP performance on wifi devices can be limited because
the TSQ (TCP Small Queues) code is tuned for wired ethernet latencies.

With this patch drivers can increase the amount of local buffering to
allow TCP to trigger larger aggregation sizes

This commit is modified from the upstream version to allow #ifdef based
backport feature detection

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 9996480b0e ramips: add support for ZBT WE3526
This is a variant of the ZBT WG3526 with a few minor modifications.
The wifi chips are swapped, and there is no GPIO controllable status
LED. There is also no SATA port.

Specifications:

- MT7621AT (880 MHz)
- 512 MB RAM
- 16 MB Flash (SPI NOR)
- 5x 1Gbps Ethernet (built-in switch)
- MT7612E 802.11ac 5 GHz WLAN
- MT7603E 802.11n 2.4 GHz WLAN

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 3eb839b579 ramips: extract board name from device tree as a fallback
This makes it possible to avoid more duplication when adding support for
a new board

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Koen Vandeputte 0d5e024e09 cns3xxx: refresh kernel config
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
Felix Fietkau 31691f9649 mvebu: backport a kernel irq fix for setting IRQ affinity
The IRQ controller can only set the affinity to a single CPU. Update the
mask in the controller data.

Suggested-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Paul Wassi e3c55dbe30 ar71xx: merge mach-files for TP-Link TL-WR802N v1 and v2
TP-Link TL-WR802N v1 and v2 are set up with almost same configuration in
the mach-files. Merge the mach-files of these devices.

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
7 years ago
Tim Thorpe 673793d753 ar71xx: add support for TP-Link TL-WR1043N v5
TP-Link TL-WR1043N v5 appears to be identical to the TL-WR1043ND v4,
except that the USB port has been removed and there is no longer a
removable antenna option.

The software is more in line with the Archer series in that it uses a
nested bootloader scheme.

Specifications:

 - QCA9563 at 775 MHz
 - 64 MB RAM
 - 16 MB flash
 - 3 (non-detachable) Antennas / 450 Mbit
 - 1x/4x WAN/LAN Gbps Ethernet (QCA8337)
 - reset and Wi-Fi buttons

Signed-off-by: Tim Thorpe <tim@tfthorpe.net>
Signed-off-by: Ludwig Thomeczek <ledesrc@wxorx.net>
7 years ago
Paul Wassi e202a8b9f6 ar71xx: add support for TP-Link TL-WA901ND v5
The TL-WA901ND v5 has the same hardware as v4, although the PCB has
a different layout. Installation from factory is done via TFTP.
(rename -factory image to wa901ndv4_tp_recovery.bin for tftp)

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
7 years ago
Robert Marko ac4a52b5c8 ar71xx: complete support for RB mAP 2nD
This patch adds support for the MikroTik RouterBOARD mAP 2nD
https://mikrotik.com/product/RBmAP2nD

Specifications:

- SoC: Qualcomm QCA9531 (650 MHz)
- RAM: 64 MB
- Storage: 16 MB NOR SPI flash
- Wireless: builtin QCA9531, 2x2:2
- Ethernet: 2x100M (802.3af/at POE in and passive POE out on ETH2)
- USB: microUSB type AB port

This patch adds missing code to fully support mAP. Machfile already
contained configuration for mAP 2nD, but device specific configuration
like LEDs etc., was missing.

Note: The POE LED works but doesn't turn on when POE passthrough is
enabled, despite being configured with GPIO trigger.

Installation

1. Login to the Mikrotik WebUI to backup your licence keys
2. Setup a DHCP/BOOTP server with:
   - DHCP-Option 66 (TFTP server name) pointing to a local TFTP
     server within the same subnet of the DHCP range
   - DHCP-Option 67 (Bootfile-Name) matching the initramfs filename
     of the to be booted image
3. Connect the port labeled internet to your local network
4. Keep the reset button pushed down and power on the board

The board should load and start the initramfs image from the TFTP
server. Login as root/without password to the started LEDE via SSH
listing on IPv4 address 192.168.1.1. Use sysupgrade to install LEDE.

Revert to RouterOS

Use the "rbcfg" package on in LEDE:
- rbcfg set boot_protocol bootp
- rbcfg set boot_device ethnand
- rbcfg apply

Open Netinstall and reboot routerboard. Now Netinstall sees RouterBOARD
and you can install RouterOS. If NetInstall gets stuck on Sending offer
just wait for it to timeout and then close and open Netinstall again.

Click on install again.

In order for RouterOS to function properly, you need to restore license
for the device. You can do that by including license in NetInstall.

Signed-off-by: Robert Marko <robimarko@gmail.com>
7 years ago
Paul Wassi d7adaceda3 ar71xx: fix network setup for UniFi
The Ubiquiti UniFi APs just have eth0. Until now, the setup script fell
through to the default case and configured the (not present) eth1 as
WAN with DHCP.

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
7 years ago
Robert Marko 3b15eb06c3 ar71xx: complete support for RB wAP 2nD
This patch adds support for the MikroTik RouterBOARD wAP
https://mikrotik.com/product/RBwAP2nD

Specifications:

- SoC: Qualcomm QCA9533 (650 MHz)
- RAM: 64 MB
- Storage: 16 MB NOR SPI flash
- Wireless: built-in QCA9533, 2x2:2
- Ethernet: 1x100M (802.3af/at POE in)

This patch adds missing code to fully support wAP. Machfile already
contained configuration for wAP 2nD but device specific configuration
like LEDs etc. was missing.

Installation:

1. Login to the Mikrotik WebUI to backup your licence keys
2. Setup a DHCP/BOOTP server with:
   - DHCP-Option 66 (TFTP server name) pointing to a local TFTP
     server within the same subnet of the DHCP range
   - DHCP-Option 67 (Bootfile-Name) matching the initramfs filename
     of the to be booted image
3. Connect the port labeled internet to your local network
4. Keep the reset button pushed down and power on the board

The board should load and start the initramfs image from the TFTP
server. Login as root/without password to the started LEDE via SSH
listing on IPv4 address 192.168.1.1. Use sysupgrade to install LEDE.

Revert to RouterOS

Use the "rbcfg" package on in LEDE:
- rbcfg set boot_protocol bootp
- rbcfg set boot_device ethnand
- rbcfg apply

Open Netinstall and reboot routerboard. Now Netinstall sees RouterBOARD
and you can install RouterOS. If NetInstall gets stuck on Sending offer
just wait for it to timeout and then close and open Netinstall again.

Click on install again.

In order for RouterOS to function properly, you need to restore license
for the device. You can do that by including license in NetInstall.

Signed-off-by: Robert Marko <robimarko@gmail.com>
7 years ago
Paul Wassi b23b0fb28b ar71xx: add support for TP-Link TL-WR810N v2
TP-Link TL-WR810N v2 is a compact Wi-Fi router with two Ethernet ports.

Specification:

- QCA9533 (650 MHz)
- 32 MB RAM
- 8 MB Flash
- 300 Mbps Wi-Fi 2.4 GHz
- 2x 10/100 Mbps Ethernet (eth0, eth1)
- UART on testpads on PCB
- 1x LED (GPIO-controlled)
- 1x reset/WPS button
- 1x slide-switch with 2 GPIO inputs

Flash instructions:

- Flash as regular firmware update in Web UI
- Default: 192.168.0.254 / admin / admin
- Select *-factory.bin

When holding reset button during power-up, U-Boot requests a file
'wr810nv1_tp_recovery.bin' from TFTP server at 192.168.0.66

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
7 years ago
Piotr Dymacz c83bdd094e ar71xx: add support for Wallys DR342
Wallys DR342 is a 5 GHz, 2T2R AP/CPE board based on Atheros AR9342.

Short specification:

- 560/450/225 MHz (CPU/DDR/AHB)
- 1x Gbps Ethernet (AR8035) with passive PoE support (24-56 V)
- 64 MB of RAM (DDR2)
- 16 MB of FLASH
- 2T2R 5 GHz with external FEM (SKY85728-11), up to 30 dBm
- 2x MMCX connectors
- miniPCIe connector with PCIe and USB 2.0 buses
- optional miniSIM slot
- 7x LED, 1x button
- UART, (E)JTAG and LED headers
- 1x DC jack for main power (12-56 V)

Flash instruction (do it under U-Boot, using UART):

1. tftp 0x82000000 lede-ar71xx-generic-dr342-squashfs-sysupgrade.bin
2. erase 0x9f050000 +$filesize
3. cp.b $fileaddr 0x9f050000 $filesize
4. setenv bootcmd "bootm 0x9f050000"
5. saveenv && reset

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz fa36bea470 ramips: add support for UniElec U7628-01
UniElec U7628-01 is a router platform board based on MediaTek MT7628AN.
The device has the following specifications:

- MT7628AN (580MHz)
- 64/128/256 MB of RAM (DDR2)
- 8/16 MB of flash (SPI NOR)
- 5x 10/100 Mbps Ethernet (MT7628 built-in switch)
- 1x 2T2R 2.4 GHz Wi-Fi (MT7628)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses)
- 1x miniSIM slot
- 1x microSD slot
- 1x USB 2.0 port
- 7x single-color LEDs (GPIO-controlled)
- 1x bi-color LED (green GPIO-controlled, red -> LED_WLAN# in miniPCIe)
- 1x reset button
- 1x UART header (4-pins)
- 1x SDXC/GPIO header (10-pins, connected with microSD slot)
- 1x DC jack for main power (12 V)

The following has been tested and is working:

- Ethernet switch
- miniPCIe slot (tested with modem and Wi-Fi card)
- miniSIM slot
- sysupgrade
- reset button
- USB 2.0 port*

Due to a missing driver (MMC over GPIO) this is not supported:

- microSD card reader

* Warning:
USB buses in miniPCIe and regular A-type socket are connected together,
without any proper analog switch or USB HUB.

Installation:

This board might come with a different firmware versions (MediaTek SDK,
PandoraBox, Padavan, etc.). If your board comes with PandoraBox, you can
install LEDE using sysupgrade. Just SSH to the router and perform forced
sysupgrade (due to a board name mismatch). The default IP of this board
should be: 192.168.1.1 and username/password: root/admin. In case of a
different firmware, you can use web based recovery described below.

Use the following command to perform the sysupgrade (for the 128MB
RAM/16MB flash version):

sysupgrade -n -F lede-ramips-mt76x8-u7628-01-128M-16M-squashfs-sysupgrade.bin

Recovery:

This board contains a Chinese, closed-source bootloader called Breed
(Boot and Recovery Environment for Embedded Devices). Breed supports web
recovery and to enter it, you keep the reset button pressed for around
5 seconds during boot. Your machine will be assigned an IP through DHCP
and the router will use IP address 192.168.1.1. The recovery website is
in Chinese, but is easy to use. Click on the second item in the list to
access the recovery page, then the second item on the next page is where
you select the firmware. In order to start the recovery, you click the
button at the bottom.

SDXC/GPIO header (J3):

 1. SDXC_D3  / I2C_SCLK
 2. SDXC_D2  / I2C_SD
 3. SDXC_D1  / I2S_DI
 4. SDXC_D0  / I2S_WS
 5. SDXC_CMD / I2S_CLK
 6. SDXC_CLK / GPIO0
 7. SDXC_CD  / UART_RXD1
 8. UART_TXD1
 9. 3V3
10. GND

Other notes:

1. The board is available with different amounts of RAM and flash. We
have only added support for the 128/16 MB configuration, as that seems
to be the default. However, all the required infrastructure is in place
for making support for the other configurations easy.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
Piotr Dymacz 46ab81e405 ramips: add support for UniElec U7621-06
UniElec U7621-06 is a router platform board based on MediaTek MT7621AT.
The device has the following specifications:

- MT7621AT (880 MHz)
- 256/512 MB of RAM (DDR3)
- 8/16/32/64 MB of FLASH (SPI NOR)
- 5x 1 Gbps Ethernet (MT7621 built-in switch)
- 1x ASMedia ASM1061 (for mSATA and SATA)
- 2x miniPCIe slots (PCIe bus only)
- 1x mSATA slot (with USB 2.0 bus for modem)
- 1x SATA
- 1x miniSIM slot
- 1x microSD slot
- 1x USB 3.0
- 12x LEDs (3 GPIO-controlled)
- 1x reset button
- 1x UART header (4-pins)
- 1x GPIO header (30-pins)
- 1x FPC connector for LEDs (20-pin, 0.5 mm pitch)
- 1x DC jack for main power (12 V)

The following has been tested and is working:

- Ethernet switch
- miniPCIe slots (tested with Wi-Fi cards)
- mSATA slot (tested with modem and mSATA drive)
- miniSIM slot
- sysupgrade
- reset button
- microSD slot

Installation:

This board might come with a different firmware versions (MediaTek SDK,
PandoraBox, Padavan, etc.). If your board comes with PandoraBox, you can
install LEDE using sysupgrade. Just SSH to the router and perform forced
sysupgrade (due to a board name mismatch). The default IP of this board
should be: 192.168.1.1 and username/password: root/admin. In case of a
different firmware, you can use web based recovery described below.

Use the following command to perform the sysupgrade (for the 256MB
RAM/16MB flash version):

sysupgrade -n -F lede-ramips-mt7621-u7621-06-256M-16M-squashfs-sysupgrade.bin

Recovery:

This board contains a Chinese, closed-source bootloader called Breed
(Boot and Recovery Environment for Embedded Devices). Breed supports web
recovery and to enter it, you keep the reset button pressed for around
5 seconds during boot. Your machine will be assigned an IP through DHCP
and the router will use IP address 192.168.1.1. The recovery website is
in Chinese, but is easy to use. Click on the second item in the list to
access the recovery page, then the second item on the next page is where
you select the firmware. In order to start the recovery, you click the
button at the bottom.

LEDs list (top row, left to right):

- LED_WWAN# (connected with pin 42 in LTE/mSATA slot)
- Power (connected directly to 3V3)
- CTS2_N (GPIO10, configured as "status" LED)
- TXD2 (GPIO11, configured as "led4", without default trigger)
- RXD2 (GPIO12, configured as "led5", without default trigger)
- LED_WLAN# (connected with pin 44 in wifi0 slot)

LEDs list (bottom row, left to right):

- ESW_P0_LED_0
- ESW_P1_LED_0
- ESW_P2_LED_0
- ESW_P3_LED_0
- ESW_P4_LED_0
- LED_WLAN# (connected with pin 44 in wifi1 slot)

Other notes:

1. The board is available with different amounts of RAM and flash. We
have only added support for the 256/16 MB configuration, as that seems
to be the default. However, all the required infrastructure is in place
for making support for the other configurations easy.

2. The manufacturer offers five different wireless cards with MediaTek
chipsets, based on MT76x2, MT7603 and MT7615. Images of the board all
show that the miniPCIe slots are dedicated to specific Wi-Fi cards.
However, the slots are generic.

3. All boards we got access to had the same EEPROM content. The default
firmware reads the Ethernet MAC from offset 0xe000 in factory partition.
This offset only contains 0xffs, so a random MAC will be generated on
every boot of the router. There is a valid MAC stored at offset 0xe006
and this MAC is shown as the WAN MAC in the bootloader. However, it is
the same on all boards we have checked. Based on information provided
by the vendor, all boards sold in small quantities are considered more
as samples for development purposes.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
Piotr Dymacz 55c77b3d3c ar71xx: increase kernel partition size for TP-Link RE450 v1
This increases kernel partition size and fixes rootfs (file-system)
partition size on TP-Link RE450 v1. Also, while we are at it, switch
from statically defined kernel and rootfs partitions in kernel cmdline
to "tplink-fw" mtd splitter.

Fixes: FS#1072.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz a4bb13e720 ar71xx: fix typo in Kconfig.openwrt
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 2eeb8ac271 ar71xx: image: fix typo in tp-link.mk
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Henryk Heisig ca6002c0ef ar71xx: increase kernel partition size for some TP-Link boards
This patch increases kernel partition size and re-enables image
generation for below TP-Link boards:

- archer-c58-v1
- archer-c60-v1
- tl-wr902ac-v1
- tl-wr942n-v1

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
[commit message and title reworded]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Yangbo Lu 769e1bac7b layerscape: enable CONFIG_CRYPTO_ARC4 in kernel 4.9
This patch is to enable CONFIG_CRYPTO_ARC4 in kernel 4.9
which is a dependency for mac80211 package.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu ff56bb0dfb layerscape: fix pfe module autoload issue
There was a typo in module.mk for pfe module autoload.
This patch is to fix this and remove useless rc.local
which was for loading pfe module.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu d96d0eb28f layerscape: add a README for build and deployment
Added a README for layerscape targets build and deployment.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 2b1ec44dbd layerscape: add ls1012afrdm device support
The QorIQ FRDM-LS1012A Board is an ultra-low-cost
development platform for QorIQ LS1012A Series Network
Processors built on ARM Cortex-A53 processor.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 9e7b166704 layerscape: enlarge ext4 rootfs size to 30MB
This patch is to enlarge ext4 rootfs size to 30MB.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 5b8639f02e layerscape: add ppa firmware package
This patch is to add PPA (The Primary Protected Application)
package and also enable it for all layerscape devices.
LSDK github provides ppa source code git tree, but it
only could be compiled with 64-bit toolchain. For 32-bit
devices, there was no method to use it.
https://github.com/qoriq-open-source/ppa-generic

This patch is to directly use a private ppa binary tree for
both 32-bit and 64-bit devices.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 82fbca8aaa layerscape: support LSDK ppfe
This patch is to use ppfe git tree on LSDK github
instead of private git tree, and support the latest
ppfe on ls1012ardb.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 669c02d46d layerscape: fix ls1046ardb 32-bit call trace
Enabled CONFIG_ARCH_DMA_ADDR_T_64BIT in kernel to
resolve below call trace when ls1046ardb 32-bit
started up kernel.

[    0.142141] Bman ver:0a02,02,01
[    0.145326] ------------[ cut here ]------------
[    0.149969] WARNING: CPU: 0 PID: 1 at arch/arm/mm/ioremap.c:303 __arm_ioremap_pfn_caller+0x1ac/0x1d8
[    0.159152] Modules linked in:
[    0.162216] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.51-g9c76e024 #2
[    0.169036] Hardware name: Generic DT based system
[    0.173853] [<c02236a4>] (unwind_backtrace) from [<c021ed94>] (show_stack+0x10/0x14)
[    0.181638] [<c021ed94>] (show_stack) from [<c04d2d38>] (dump_stack+0x98/0xac)
[    0.188899] [<c04d2d38>] (dump_stack) from [<c0245bcc>] (__warn+0xe4/0x100)
[    0.195896] [<c0245bcc>] (__warn) from [<c0245c98>] (warn_slowpath_null+0x20/0x28)
[    0.203504] [<c0245c98>] (warn_slowpath_null) from [<c0229e24>] (__arm_ioremap_pfn_caller+0x1ac/0x1d8)
[    0.212861] [<c0229e24>] (__arm_ioremap_pfn_caller) from [<c0229f0c>] (ioremap_cache+0x20/0x28)
[    0.221608] [<c0229f0c>] (ioremap_cache) from [<c105e390>] (parse_mem_property.part.3+0x18/0x50)
[    0.230441] [<c105e390>] (parse_mem_property.part.3) from [<c105e6dc>] (qman_init_early+0x314/0x334)
[    0.239623] [<c105e6dc>] (qman_init_early) from [<c0201a24>] (do_one_initcall+0xb4/0x168)
[    0.247844] [<c0201a24>] (do_one_initcall) from [<c1000e84>] (kernel_init_freeable+0x1d8/0x280)
[    0.256590] [<c1000e84>] (kernel_init_freeable) from [<c0adbcfc>] (kernel_init+0x8/0x114)
[    0.264812] [<c0adbcfc>] (kernel_init) from [<c021bb28>] (ret_from_fork+0x14/0x2c)
[    0.272423] ---[ end trace 39aaeef329e2a0a2 ]---
[    0.277058] qman-fqd addr 0xfb000000 size 0x800000

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 110c9e9034 layerscape: update config-4.9
Some new options were introduced by kernel patches.
And some options should be removed/added.
The config-4.9 should be updated accordingly.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu ce6311d283 layerscape: update kernel patches
Updated kernel patches to align layerscape kernel
with latest LSDK linux (LSDK-17.09-update-103017-V4.9 tag).

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 47cff4cf5f layerscape: support all-in-one firmware for ls1088ardb/ls2088ardb
Suppport all-in-one firmware for ls1088ardb/ls2088ardb by
integrating u-boot/rcw/mc/dpl/restool.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu e47c93bb19 layerscape: remove default profile
Default profile had to enable many packages for all devices
support. This made these packages still enabled when built
for single device. This patch is to remove default profile.
For multiple devices build, it's proper to build with multiple
devices profile.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 4e209e07f7 layerscape: clean up kernel patches
A previous patch disaggregated kernel patch 601 intending to
reverse the ndo_get_stats64 change, but it also dropped
many other changes without a reason. This caused build issue
for layerscape. This patch is to fix that with below steps.
1. Reversed patch "1c4415a layerscape: reverse changes to ndo_get_stats64",
   but kept kernel patch 701 which was a proper fix.
2. Reversed the ndo_get_stats64 change in kernel patch 601.
3. Renamed patch 601 (net patch) to 202 (core-linux patch). Maybe it's
   more proper.

Fixes: 1c4415a679 ("layerscape: reverse changes to ndo_get_stats64")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Tim Thorpe bddffc5e7b brcm47xx: fix switch port mapping on Asus RT-N16
On the Asus RT-N16, the ports are not mapped the in the same way as
the RT-N12.  It is, however, the same as the Linksys E3000v1.

Signed-off-by: Tim Thorpe <timfthorpe@gmail.com>
7 years ago
Felix Fietkau 645b163cfc ar71xx: fix regression in 74x164 initialization with 4.9
The memcpy of the init data relies on chip->registers to be initialized,
which only happens later in the code. Move this initialization further
down to make it work.
This was breaking PCIe/USB on some MikroTik RouterBoard devices.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Daniel Gimpelevich a6e9d146f2 lantiq: add missing macaddr retrieval for Netgear DGN3500
The MAC addresses were not being set for LAN and WAN. This will now use the
same MAC mechanism as the rest of the target.

Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
7 years ago
Robert Marko d0ef27594a ramips: add support for TP-Link TL-WR840N v5
TP-Link TL-WR840N v5 is simple N300 router with 5-port FE switch and
non-detachable antennas, based on MediaTek MT7628NN (aka MT7628N) WiSoC.

Specification:

- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- 1x LED (GPIO-controlled), 1x button

* LED in TL-WR840N v5 is a dual-color, dual-leads type which isn't
  (fully) supported by gpio-leds driver. This type of LED requires both
  GPIOs state change at the same time to select color or turn it off.
  For now, we support/use only the green part of the LED.
  Orange LED is registered so you can later use it for your own purposes.

  Flash instruction:

  Unlike TL-WR840N v4 flashing through WEB UI works in v5.
  1. Download lede-ramips-mt76x8-tl-wr840n-v5-squashfs-sysupgrade.bin image.
  2. Go to 192.168.0.1
  3. Flash the sysupgrade image through Firmware upgrade section of WEB UI.
  4. Wait until green LED stops flashing and use the router.

Notes:
TFTP recovery is broken since TP-Link reused bootloader code for v4 and
that does not take into account only 4 MB of flash and bricks the device.
So do not use TFTP Recovery or you will have to rewrite SPI flash.
They fixed it in later GPL code,but it is unknown which version of
bootloader you have.

After manually compiling and flashing bootloader from GPL sources TFTP
recovery works properly.

Signed-off-by: Robert Marko <robimarko@gmail.com>
7 years ago
Thibaut VARÈNE 74f891752b generic: make mtdsplit-tplink.c honor rootfs offset
The splitter ignored the rootfs offset from the header, probably
because until c1e6e61 it was invalid.

This patch fixes the splitter to use the now correct header data.

Regarding target/linux/ar71xx/files/drivers/mtd/tplinkpart.c,
this particular splitter "falls back" to the correct rootfs offset
reading and as such it doesn't need to be updated, although it will
report a kernel partition length that can be larger than the actual
length as it assumes that partition fills the entire segment up to
the rootfs partition.

Tested-by: Mathias Kresin <dev@kresin.me>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Tested-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
Tested-by: Henryk Heisig <hyniu@o2.pl>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
7 years ago
Zoltan HERPAI f9ecb0d562 sunxi: add Orange Pi 2 support
- H3 @ 1.3 GHz
- 1GiB DDR3
- 10/100Mbps Ethernet
- Realtek RTL8189ETV wifi
- 4 USB 2.0

Difference to the "Orange Pi Plus" is the lack of Gbit ethernet
and lack of onboard flash.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
7 years ago
Rosen Penev e555153807 ag71xx: Switch from driver to kernel macro for NAPI_WEIGHT.
NAPI_POLL_WEIGHT was introduced in the kernel for exactly this purpose 5 years ago.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
7 years ago
Sergey Ryazanov 890e668273 ixp4xx: drop the jumbo frame support
Current jumbo frame support code allocates rxbuffers of the maximum size
supported by the hardware (~14KB). This happens at the device open time
even if the configured MTU is lower (e.g. if it configured to standard
1500 bytes). Such behavior effectivly prevents interface start on boards
with a low ammount of RAM (e.g. WRT300N v2), since the kernel simly can
not allocates of ~0.8MB (14KB x 64).

So remove jumbo frame support for now.

Reported-by: Nerijus Baliunas <nerijus@users.sourceforge.net>
Tested-by: Nerijus Baliunas <nerijus@users.sourceforge.net>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
7 years ago
Sergey Ryazanov 204f3f5987 ixp4xx: fix non-standard phy support
The patch, which adds multiphy support, adds new path for non-standard
PHYs (e.g. MV88E6060 switch IC) to avoid using kernel phy framework. All
work well except the link status traking (Duplex and Speed), which is
reseted as soon as PHY connection procedure is done. This leads to lost
of the link status of non-standard PHY, which is configured exactly in
the ixp4xx_phy_connect() function.

Move the generic reset of a link state to the ixp4xx_phy_connect()
function to the code path, which is intended for handling of a normal
PHY.

Reported-by: Nerijus Baliunas <nerijus@users.sourceforge.net>
Tested-by: Nerijus Baliunas <nerijus@users.sourceforge.net>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
7 years ago
Kayo Phoenix 6a3565985f sunxi: Added profile for HAOYU Electronics Marsboard A10
The MarsBoard was a short-lived credit-card sized, extendable board with an Allwinner A10 SoC.
http://linux-sunxi.org/MarsBoard_A10

Signed-off-by: Kayo Phoenix <kayo@illumium.org>
[Forward-ported to new target layout:]
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
7 years ago
Felix Fietkau c078386ae3 ar71xx: only use SPI NOR 4K sectors on smaller flash chips for mikrotik devices
On NOR based Mikrotik devices, 4K sectors significantly slow down
firmware flashing and jffs2 usage. On NAND based devices they may be
necessary to run rbcfg (the boot loader config is often on SPI NOR).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau c08293893a kernel: add support for limiting 4K erase sector support based on flash chip size
Some targets need 4K sectors for small flash chips (e.g. some
routerboards, where the entire chip is just one "erase block"), whereas
on other devices 4K sectors lead to horrible flash erase/write
performance.

Set the default limit in the generic kernel configuration to 4 MiB to
ensure that all new platforms don't use 4K sectors for bigger flash
chips. On all existing targets use 16 MiB for now to avoid regressions.
They will be changed individually in follow-up commits.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Stefan Lippers-Hollmann 9a221c6d69 ip806x: nbg6817: sysupgrade support both targets for kernel/ rootfs partitions
With this commit and the previous "nbg6817: don't hardcode the rootfs location
by using append-rootblock instead" applied, it is possible to boot- and
sysupgrade from both dual-boot sets (the primary mmcblk0p4+mmcblk0p5 or the
alternative mmcblk0p7+mmcblk0p8). However the sysupgrade support does not
toggle between both dual-boot sets between firmware upgrades so far.

The partition map of the eMMC used in the nbg6817 is:

Found valid GPT with protective MBR; using GPT.
Disk /dev/mmcblk0: 7471104 sectors, 3.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): XXX
Partition table holds up to 12 entries
First usable sector is 34, last usable sector is 7471070
Partitions will be aligned on 2-sector boundaries
Total free space is 1 sectors (512 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34            8225   4.0 MiB     FFFF  rootfs_data
   2            8226           16417   4.0 MiB     FFFF  romd
   3           16418           18465   1024.0 KiB  FFFF  header
   4           18466           26657   4.0 MiB     FFFF  kernel
   5           26658          157729   64.0 MiB    FFFF  rootfs
   6          157730          159777   1024.0 KiB  FFFF  header_1
   7          159778          167969   4.0 MiB     FFFF  kernel_1
   8          167970          299041   64.0 MiB    FFFF  rootfs_1
   9          299042          823329   256.0 MiB   FFFF  bu1
  10          823330         7471069   3.2 GiB     FFFF  bu2

rootfs_data is the ext4 formatted overlay of the OEM firmware, LEDE
ignores it due to its (too) small size.

romd/ bu1 are initialized with zeroes (0x00) and unused.

bu2 is formatted with ext4 and used for streamboost and other optional
functionality by the OEM firmware, it is reformatted during factory
resets of the OEM firmware.

header/ header_1 contains version information for the corresponding
vendor firmwares installed to kernel/rootfs or kernel_1/ rootfs_1, the
format hasn't been completely reverse engineered so far and remains
left untouched by LEDE:

V1.00(ABCS.2)C0:
 00000000  00 00 a7 74 01 32 f0 00  56 31 2e 30 30 28 41 42  |...t.2..V1.00(AB|
 00000010  43 53 2e 32 29 43 30 00  ff ff ff ff ff ff ff ff  |CS.2)C0.........|
 00000020  ff ff ff ff ff ff ff ff  00 00 d5 dc 4e 42 47 36  |............NBG6|
 00000030  38 31 37 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |817.............|
 00000040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00000060  ff ff ff ff ff ff ff ff  ff ff ff ff 00 00 22 a3  |..............".|
 00000070  00 1c 70 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |..p.............|
 00000080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00000800  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00100000

V1.00(ABCS.5)C0:
 00000000  00 00 bf 94 01 46 d8 00  56 31 2e 30 30 28 41 42  |.....F..V1.00(AB|
 00000010  43 53 2e 35 29 43 30 00  ff ff ff ff ff ff ff ff  |CS.5)C0.........|
 00000020  ff ff ff ff ff ff ff ff  00 00 d6 5a 4e 42 47 36  |...........ZNBG6|
 00000030  38 31 37 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |817.............|
 00000040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00000060  ff ff ff ff ff ff ff ff  ff ff ff ff 00 00 c0 2c  |...............,|
 00000070  00 1c 58 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |..X.............|
 00000080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00010000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00100000

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
7 years ago
Stefan Lippers-Hollmann b583aaf5aa ip806x: nbg6817: don't hardcode the rootfs location by using append-rootblock instead
This changes the cmdline from:

Kernel command line: root=/dev/mmcblk0p5 rootfstype=squashfs,ext4 rootwait noinitrd
Bootloader command line (ignored): board=NBG6817 root=/dev/mmcblk0p5 rootwait zld_ver=2.04 console=ttyHSL1,115200n8 mtdparts=m25p80:0xC0000(SBL)ro,0x40000(TZ)ro,0x40000(RPM)ro,0x80000(u-boot)ro,0x10000(env)ro,0x10000(ART)ro,0x10000(dualflag),0x210000(reserved)

to

Kernel command line: rootfstype=squashfs,ext4 rootwait noinitrd root=/dev/mmcblk0p5
Bootloader command line (ignored): board=NBG6817 root=/dev/mmcblk0p5 rootwait zld_ver=2.04 console=ttyHSL1,115200n8 mtdparts=m25p80:0xC0000(SBL)ro,0x40000(TZ)ro,0x40000(RPM)ro,0x80000(u-boot)ro,0x10000(env)ro,0x10000(ART)ro,0x10000(dualflag),0x210000(reserved)

As a consequence booting from the alternative dual-boot partition set
(root=/dev/mmcblk0p8) becomes possible.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
7 years ago
Roman Yeryomin 156f2df879 ipq806x: ipq4019: add ap-dk01.1-c1 board support
AP-DK01.1-C1 is QCA dev board with:
- ipq4018 quad core ARM @716.8MHz, 2x2 dual (11n+11ac) radio
- 256MB RAM
- 32MB SPI flash
- QCA8075 multiport ethernet phy (WAN port, 4x LAN ports)

First installation via u-boot:
sf probe
sf erase 0x180000 0x1a00000
tftpboot 0x84000000 lede-ipq806x-AP-DK01.1-C1-squashfs-sysupgrade.bin
sf write 0x84000000 0x180000 $filesize

Further upgrades via sysupgrade.

Changes:
- add partitions
- set memory size to 256MB
- add reserved memory mapping
- add correct compatible string
- add image generation
- extract pre-cal data from ART partition

Compile and run tested.
Wirespeed NAT can be achieved with spreading rx interrupts over different
cores. Wifi speed is ~550Mbps @5GHz in open air.

Note:
AP-DK01.1-C1 is fully compatible with AP-DK01.2-C1, which has
ipq4028 instead of ipq4018 on board.

Changes since v2:
- based on dts(i) rework/cleanup submitted:
  http://lists.infradead.org/pipermail/lede-dev/2017-October/009596.html
- precise reserved memory mapping
- more precise description
- compatible string

Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago
Roman Yeryomin a22e2bd37d ipq806x: ipq4019: dts: fix maximum cpu speed
Supported frequencies of all ipq40xx chips are 48, 200, 500 and 716.8 MHz.
Previous 666MHz setting was most likely related to instability of early
chips/boards made before mass production.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago
Roman Yeryomin 21802ce3ab ipq806x: ipq4019: dts: remove spi chip node from ap-dk01 dtsi
All ap-dk01 boards have different spi chips, thus no point in keeping it in dtsi.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago