Commit Graph

19288 Commits (21ee8ce9b52f8ae4a6babf4032f71e2d4d56392b)

Author SHA1 Message Date
Matthias Badaire 6ea0807f18 ramips: fix network config for ravpower wd03
This device has only one ethernet port.

Signed-off-by: Matthias Badaire <mbadaire@gmail.com>
[add the existing eth0 as lan block, shorten commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
David Bauer daeab36c1b ar71xx: use Power-LED as Diag-LED on FRITZBox 4020
This commit makes use of the Power-LED as Diag-LED, allowing the LED to
work as a status indicator.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
David Bauer 9ec117c5be ar71xx: fix AVM package selection
The AVM package selection partially broke with the addition of the
FRITZ!Box 4020. This commit restores the intended behavior.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Lucian Cristian c8677ca89e ath79: add tl-mr3020-v1 support
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Karl Palsson 8c15fb5240 ath79: wr1043: fix DTC warnings
Use the "correct" unit name to avoid DTC warnings.

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson 5e69dce0e7 ath79: glinet ar150: fix DTC warnings
Supply a unit name to match other .dts files and avoid DTC warnings.

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson 9dad82c5d6 ath79: ubnt: fix DTC warnings
Use explicit labels instead of units with no reg's to avoid DTC
warnings.

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson 93ff973c97 ath79: wdr4300: avoid DTC warnings
Use direct button labels to avoid dtc warnings

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson 29b2804c6b ath79: buffalo_wzr-hp-g450h: fix dtc warnings
Just name buttons directly, rather than abstract and then also a label.
Likewise for leds.  Avoids DTC warnings about unit address with no reg
parameter.

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson 97326e5131 ath79: avm_fritz300e: avoid dtc warnings
Use number formats preferred by the device tree compiler

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson d25d847e78 ath79: mdio: add address-cells and size-cells defaults
Eliminates warnings about relying on defaults from the device tree
compiler.

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson 35aae0735c ath79: ar9330.dtsi: fix typo in USB unit name
Make the unitname match the reg address.  This fixes a DTC warning.

Tested that USB is still functional on an ar9331 device including this
dtsi.

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
Karl Palsson 1588114cf2 ath79: add etactica-eg200 support
Based on original ar71xx eg200 board files

Tested working:
* usb hub, storage and serial port
* ethernet
* wifi
* leds
* button

sysupgrade from self->self passes validity checks.
sysupgrade from old ar71xx->ath79 passes. (however this doesn't migrate
wireless driver configs)

Only unknown issue is the existance of a /sys/class/leds/ath9k-phy0,
which doesn't "exist"

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
INAGAKI Hiroshi a32c06f44d ramips: add support for I-O DATA WN-GX300GR
I-O DATA WN-GX300GR is a 2.4 GHz band 11n router, based on MediaTek
MT7621S.

Specification:

- MT7621S (1-Core, 2-Threads)
- 64 MB of RAM
- 8 MB of Flash (SPI)
- 2T2R 2.4 GHz
- 5x 10/100/1000 Mbps Ethernet
- 2x LEDs, 4x keys (2x buttons, 1x slide switch)
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - baudrate: 115200 bps (U-Boot, OpenWrt)

Flash instruction using initramfs image:

1. Connect serial cable to UART header
2. Rename OpenWrt initramfs image for WN-GX300GR to "uImageWN-GX300GR"
and place it in the TFTP directory
3. Set the IP address of the computer to 192.168.99.8, connect to the
LAN port of WN-GX300GR, and start the TFTP server on the computer
4. Connect power cable to WN-GX300GR and turn on the router
5. Press "1" key on the serial console to interrupt boot process on
U-Boot, press Enter key 3 times and start firmware download via TFTP
6. WN-GX300GR downloads initramfs image and boot with it
7. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with sysupgrade image for WN-GX300GR
8. Wait ~150 seconds to complete flasing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Adoal Xu a51078f735 ath79: add TP-Link TL-MR10U port
Signed-off-by: Adoal Xu <adoalxu@gmail.com>
6 years ago
Sven Eckelmann 4f6320704f ar71xx: Fix offset to WMAC address for 8devices Lima
The ART partition of the Lima board stores exactly three mac addresses:

* 0x0: eth0
* 0x6: eth1
* 0x1002: wmac

The first two are correctly assigned in the mach file but the latter points
to 0x800. But this position is set to ff:ff:ff:ff:ff:ff. Luckily, the
driver falls back in ath9k_hw_init_macaddr to the EEPROM mac address when
it doesn't find a valid mac address in the platform_data.

Remove this bogus offset to the ART partition to directly load the wmac via
the EEPROM data in the ART partition.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
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
Rosen Penev 66cc6dd6c4 ramips: mmc: Add back some non-mt7621 code that staging removed
This reverts commit 8a570921b5.

This seems to have been accidentally reverted. This fixes mt7620 and
mt7628.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Kevin Darbyshire-Bryant 8110bf18f4 ramips: mir3g dts define usb port Vcc volt regulator GPIO
Define USB port power on/off GPO as voltage regulator type instead of
exposing as a normal GPIO.

The GPO is now controlled by the USB driver via the voltage regulator
definition.  The regulator is of fixed output type (5V for USB) hence the
GPO switches power on/off to USB pin 1 (Vcc)

USB port power is enabled on driver load and disabled on driver unload.

Enable kernel support for fixed voltage regulator types on mt7621.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Christian Lamparter 4363b5362f ipq40xx: flesh out MR33's pcie dts definitions
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 146fbeb81c ipq40xx: fix OpenMesh A62 dtc warnings
Warning (pci_bridge): Node /soc/pci@40000000/pcie@0 missing ranges for PCI bridge (or not a bridge)
Warning (pci_bridge): Node /soc/pci@40000000/pcie@0 missing bus-range for PCI bridge
Warning (pci_bridge): Node /soc/pci@40000000/pcie@0/ath10k@0,0 node name is not "pci" or "pcie"
Warning (pci_bridge): Node /soc/pci@40000000/pcie@0/ath10k@0,0 missing ranges for PCI bridge (or not a bridge)
Warning (pci_bridge): Node /soc/pci@40000000/pcie@0/ath10k@0,0 incorrect #address-cells for PCI bridge
Warning (pci_bridge): Node /soc/pci@40000000/pcie@0/ath10k@0,0 incorrect #size-cells for PCI bridge
Warning (pci_bridge): Node /soc/pci@40000000/pcie@0/ath10k@0,0 missing bus-range for PCI bridge
Warning (unit_address_format): Failed prerequisite 'pci_bridge'
Warning (pci_device_reg): Failed prerequisite 'pci_bridge'
Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge'

Cc: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Tested-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
6 years ago
Christian Lamparter 2f1fa04587 ipq40xx: fix dtc warning about /soc/ad-hoc-bus missing a unit name
This patch fixes a dtc warning that shows up for every device
Warning (unit_address_vs_reg): Node /soc/ad-hoc-bus has a reg or ranges property, but no unit name

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter b22e37528b ipq40xx: set #size-cells to 0 to fix warning
qcom-ipq4018-ex6100v2.dtb: Warning (reg_format): "reg" property in
	/led_spi/led_gpio@0 has invalid length (4 bytes)
qcom-ipq4018-ex6100v2.dtb: Warning (avoid_default_addr_size):
	Relying on default #size-cells value for /led_spi/led_gpio@0

Cc: Thomas Hebb <tommyhebb@gmail.com>
Cc: David Bauer <mail@david-bauer.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Koen Vandeputte 55b4b1eba0 ar71xx: fix USB switch to mPCIE for Mikrotik rb91x boards
Some devices like the Mikrotik RB912 only have 1 USB port
which is shared between an USB A type port, and the mini PCIe socket.

Toggling a gpio selects the output to which USB is connected.

Since kernel 4.9, gpio base is rounded up to a value of 32.

Commit 65da6f9ca1 ("ar71xx: fix secondary gpio controller base values") accounts correctly for that.
In this commit, rb912 sees it's value changed from AR934X_GPIO_COUNT (23) to 32
This means that the USB toggle gpio number actually also changes from 52 to 61.

But ..
Some of these GPIO numbers are also used in other locations, like the boardfile.
The author forgot to also change them over there.

Switching the USB port to mPCIe now shows my modem is correctly discovered again:

[ 2863.864471] usb 1-1: new high-speed USB device number 4 using ehci-platform
[ 2864.055303] usb 1-1: config 1 has an invalid interface number: 8 but max is 3
[ 2864.062728] usb 1-1: config 1 has no interface number 1
[ 2864.074567] qcserial 1-1:1.0: Qualcomm USB modem converter detected
[ 2864.081474] usb 1-1: Qualcomm USB modem converter now attached to ttyUSB0
[ 2864.111960] qcserial 1-1:1.2: Qualcomm USB modem converter detected
[ 2864.118976] usb 1-1: Qualcomm USB modem converter now attached to ttyUSB1
[ 2864.139808] qcserial 1-1:1.3: Qualcomm USB modem converter detected
[ 2864.146777] usb 1-1: Qualcomm USB modem converter now attached to ttyUSB2
[ 2864.165276] qmi_wwan 1-1:1.8: cdc-wdm0: USB WDM device
[ 2864.171879] qmi_wwan 1-1:1.8 wwan0: register 'qmi_wwan' at usb-ehci-platform-1, WWAN/QMI device, 02:00:44:ed:3b:11

Fixes: 65da6f9ca1 ("ar71xx: fix secondary gpio controller base values")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Cc: Robin Leblon <robin.leblon@ncentric.com>
Cc: Felix Fietkau <nbd@nbd.name>
6 years ago
Lucian Cristian a0a616e1b8 ath79: fix qca956x SoC boot
based on old ar71xx irq.c driver

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
David Bauer e36f8b3f39 ar71xx: add support for OCEDO Koala
This commit adds support for the OCEDO Koala

SOC:	Qualcomm QCA9558 (Scorpion)
RAM:    128MB
FLASH:  16MiB
WLAN1:  QCA9558 2.4 GHz 802.11bgn 3x3
WLAN2:  QCA9880 5 GHz 802.11nac 3x3
INPUT:  RESET button
LED:    Power, LAN, WiFi 2.4, WiFi 5, SYS
Serial: Header Next to Black metal shield
        Pinout is 3.3V - GND - TX - RX (Arrow Pad is 3.3V)
        The Serial setting is 115200-8-N-1.

Tested and working:
 - Ethernet
 - 2.4 GHz WiFi
 - 5 GHz WiFi
 - TFTP boot from ramdisk image
 - Installation via ramdisk image
 - OpenWRT sysupgrade
 - Buttons
 - LEDs

Installation seems to be possible only through booting an OpenWRT
ramdisk image.

Hold down the reset button while powering on the device. It will load a
ramdisk image named 'koala-uImage-initramfs-lzma.bin' from 192.168.100.8.

Note: depending on the present software, the device might also try to
pull a file called 'koala-uimage-factory'. Only the name differs, it
is still used as a ramdisk image.

Wait for the ramdisk image to boot. OpenWRT can be written to the flash
via sysupgrade or mtd.

Due to the flip-flop bootloader which we not (yet) support, you need to
set the partition the bootloader is selecting. It is possible from the
initramfs image with

 > fw_setenv bootcmd run bootcmd_1

Afterwards you can reboot the device.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Hannu Nyman fb8a578aa7 ipq806x: Enlarge R7800 flash - use netgear partition
Increase the available flash memory size in Netgear R7800
by taking into the use the unused "netgear" partition
that is located after the firmware partition.

Available flash space for kernel+rootfs+overlay increases
by 68 MB from 32 MB to 100 MB.

In a typical build, overlay space increases from 15 to 85,
increasing the package installation possibilities greatly.

Reverting to the OEM firmware is still possible, as the OEM
firmware contains logic to initialise the "netgear" partition
if its contents do not match expectations. In OEM firmware,
"netgear" contains 6 UBI sub-partitions that are defined in
/etc/netgear.cfg and initialisation is done by /etc/preinit

Tested with Openwrt master r7093-4fdc6ca31b and OEM V1.0.2.52

Reference to forum discussion in Netgear R7800 exploration thread:
https://forum.lede-project.org/t/netgear-r7800-exploration-ipq8065-qca9984/285/1118
(messages 1118-1158)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Rosen Penev fff65dbe24 ipq806x: Limit NR_CPUS to 2
ipq806x is all dual core processors. ipq807x is quad core. Removes this
from dmesg:

RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Koen Vandeputte 2792ef55ab kernel: bump 4.9 to 4.9.106
Refreshed all patches

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Catrinel Catrinescu dc1268cb11 ath79: add WLAN, Ethernet-Switch with LAN/WAN and Status LED to Dorin
Signed-off-by: Catrinel Catrinescu <cc@80211.de>
6 years ago
Luis Araneda 32ab2e16b1 zynq: remove support for kernel 4.4
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 88f7e2386a zynq: switch to kernel 4.14
Also, remove the source-only qualifier

Run-tested: ZedBoard

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 19c3dc60e4 zynq: refresh kernel 4.14 configuration
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 74dffd592b zynq: copy config to kernel 4.14
The file will be used as a base configuration
for kernel 4.14

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 61b977fa2c zynq: fix detection of the zybo board
The board_name was being tested for "xlnx,zynq-zybo",
but the .dts compatible string is "digilent,zynq-zybo"

Also, sorted the boards alphabetically, and added an
error message for unsupported boards

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 7967e6c067 zynq: remove hard-coded network configuration
This is no longer necessary since commit 57776e6
(base-files: remove default /etc/config/network,
generate it via board.d instead)

Run-tested: ZedBoard

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda dfac3ffd07 zynq: reworked image creation process
After commit a1248da (zynq: convert to new image build code),
all boards, became unbootable, entering into a boot loop.

Replace the compressed kernel zImage by an uncompressed Image,
which is compressed after with gzip. Also, enable the creation
of an initramfs image by default.

Change images' filename to match the compatible string from the
respective .dts file (<vendor>_<model>). Also, use the shared
mkits.sh script and remove the target specific one.

Fixes: FS#1204

Run-tested: ZedBoard

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Daniel Golle 8796680277 ramips: fix reboot with W25Q256 with 4-address-mode enabled
Some board vendors actually changed the loader to expect the chip
to come up in 4-address-mode and flipped the ADP bit in the flash
chip's configuration register which makes it come up in 4-address-mode.
Hence it doesn't make sense to avoid switching to 4-address-mode on
those boards but the opposite as otherwise reboot hangs eg. on the
WrtNode2 boards. Fix this by checking the ADP register and only using
SPI_NOR_4B_READ_OP on chips which have ADP==0 (come up in 3-byte mode).

See also datasheet section 7.1.11 Power Up Address Mode (ADP)

Fixes: 22d982ea0 ("ramips: add support for switching between 3-byte and 4-byte addressing on w25q256 flash")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Matthias Schiffer 0c0bb62999
ar71xx: switch CPE/WBS 210/510 to okli-loader
We recently increased the kernel partition size of the CPE/WBS 210/510.
This works fine for new installations of the factory image, but on
sysupgrades, the partition table read by the bootloader is not adjusted.
This limits the maximum size of the kernel loaded by the bootloader to the
old partition size.

While adjusting the partition table would be a cleanest solution, such a
migration would have to happen before an upgrade to a new version with a
newer kernel. This is error-prone and would require a two-step upgrade, as
we mark the partition table partition read-only.

Instead, switch from the lzma-loader with embedded kernel to the
okli-loader, so only the tiny lzma-loader is loaded by the bootloader as
"kernel", and the lzma-loader will then load the rest of the kernel by
itself.

Fixes: e39847ea2f ("ar71xx: increase kernel partition size for CPE/WBS 210/510")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer c57e182b56
ath79: lzma-loader: sync with ar71xx target
Import all improvements made in the lzma-loader since development on the
ath79 target started.

This also reverts fe594bf90d ("ath79: fix loader-okli, lzma-loader"), as
is obsoleted by 2ad60168b6af ("ar71xx: lzma-loader: move padding workaround
to gzip step").

Likely, many of the changes should be ported to the ramips lzma-loader as
well, but I don't have a device to test this.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer 108a6f6792
ar71xx: make loader-okli build step more generic
Add support for different loader types.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer 9968dcedb4
ar71xx: lzma-loader: constify kernel argv array
By making the kernel argv array const, the .data section can always be
omitted from the laoder binary.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer 8d851a95b7
ar71xx: lzma-loader: set page size to 4KB
The text section in the ELF loader is aligned to the maximum page size,
which defaults to 64KB. Reduce it to the actual page size to avoid wasting
flash space for this alignment.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer a28e46b7cc
ar71xx: lzma-loader: move padding workaround to gzip step
Some devices (TP-Link TL-WR1043ND v1) don't boot reliably when the
uncompressed loader is too small. This was workarounded in the loader by
adding 512KB of padding to the .data section of the loader binary.

This approach had two issues:

- The padding was only working when .data was non-empty (otherwise the
  section would become NOBITS, omitting it in the binary). .data was only
  empty when no CMDLINE was set, leading to further workarounds like
  fe594bf90d ("ath79: fix loader-okli, lzma-loader"), and this
  workaround was only effective because a missing "const" led to the kernel
  argv being stored in .data instead of .rodata
- The padding was not only added to the compressed .gz loader, but also
  uncompressed .bin and .elf loaders. The prevented embedding the kernel
  cmdline in the loader for non-gz loader types.

To fix both issues, move the creation of the padding from the linker script
to the gzip step.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Stijn Tintel e52f3e9b13 kernel: bump 4.14 to 4.14.48
Remove upstreamed patches:
generic/pending/101-clocksource-mips-gic-timer-fix-clocksource-counter-w.patch
generic/pending/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch
generic/pending/182-net-qmi_wwan-add-BroadMobi-BM806U-2020-2033.patch
lantiq/0025-MIPS-lantiq-gphy-Remove-reboot-remove-reset-asserts.patch
Update patches that no longer apply:
generic/pending/811-pci_disable_usb_common_quirks.patch
ath79/0009-MIPS-ath79-add-lots-of-missing-registers.patch

Fixes CVE-2018-6412.

Compile-tested: octeon, x86/64.
Runtime-tested: octeon, x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Daniel Golle 187da94808 kernel: modules: package module for Exar 8250 UARTs
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Felix Fietkau 2f3b1dddea kernel: backport patch to fix dst handling for offloaded connections
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Michael Gray 4fdc6ca31b mvebu: fix broken console on WRT32X (venom)
The console bootarg is being corrupted on boot, causing various issues
including broken sysupgrade.
Utilising the bootargs mangle patch from other targets, hardcode the console
arguments and fetch the rootfs from the bootloader.

Kernel command line: console=ttyS0,115200 root=/dev/mtdblock8

Bootloader command line (ignored): console= root=/dev/mtdblock8

Please cherry pick to 18.06 too

Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
6 years ago
Daniel Golle dcc34574ef 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>
6 years ago
Daniel Golle 17511a7ea8 oxnas: kill old oxnas target
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Hans Dedecker 0777a3e773 kernel: re-add export ipv6_push_frag_opts for tunneling now patch
The patch got removed by commit 7dca1bae82 (kernel: bump to 4.9.105)
but is still required as ipv6_push_frag_opts needs to be exported.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
John Crispin 7197744cd6 Revert "ramips: Move PCI driver to files directory"
This reverts commit a098a78a33.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 69929dac89 Revert "ramips: Remove redundant owner assignment"
This reverts commit 2ad4daf579.

Signed-off-by: John Crispin <john@phrozen.org>
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
John Crispin 7577f32c8a Revert "ramips: remove conditional compilation."
This reverts commit 1f78625714.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin b8569427eb Revert "ramips: remove unnecessary resource details."
This reverts commit edea934799.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 784943e3f2 Revert "ramips: pci: sync with staging driver"
This reverts commit e07baec9fa.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 8a570921b5 Revert "ramips: Add back some non-mt7621 code that staging removed"
This reverts commit 048e41f649.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 1d3c286381 Revert "ramips: Fix WiFi after 5f7396ebef09b224edf08b0bda113613a42f0928"
This reverts commit 02f815d190.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Kevin Darbyshire-Bryant 7dca1bae82 kernel: bump to 4.9.105
Refresh patches.

Drop patches that have been upstreamed:
target/linux/ar71xx/patches-4.9/106-01-MIPS-ath79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch
target/linux/generic/backport-4.9/095-v4.12-ipv6-Need-to-export-ipv6_push_frag_opts-for-tunnelin.patch
target/linux/generic/pending-4.9/180-net-phy-at803x-add-support-for-AT8032.patch
target/linux/generic/pending-4.9/181-net-usb-add-lte-modem-wistron-neweb-d18q1.patch
target/linux/generic/pending-4.9/182-net-qmi_wwan-add-BroadMobi-BM806U-2020-2033.patch

Compile & run tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Alex Maclean 5b0c899bfd ath79: correct wmac names in dts
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Alex Maclean ba5b6c619b ath79: add TP-Link TL-WR703N port
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Alex Maclean d215d0f9ae ath79: add TP-Link TL-WR740N/ND v2 port
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Alex Maclean fab3254b32 ath79: add pinmux node to ar724x.dtsi
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Alex Maclean 34f874b872 ath79: add AR7240 dtsi
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Alex Maclean fc8360aa16 ath79: add tiny subtarget
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
John Crispin c57c3f2c22 ath79: fix glinet ar150 lan/wan ordering
LAN and WAN were swapped

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Daniel Golle 2087df1c6d Revert "kernel: backport export ipv6_push_frag_opts for tunneling now"
This reverts commit daa73b63d5.
The fix has already been imported by
commit b7735d8113 ("kernel: import follow-up fix for previous backport").
The patch won't apply twice.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Hans Dedecker daa73b63d5 kernel: backport export ipv6_push_frag_opts for tunneling now
Patch is required on top of commit 6c81c27efa as ipv6_push_frag_opts needs to
be exported for usage in ip6_tunnel.c

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Daniel Golle b7735d8113 kernel: import follow-up fix for previous backport
Buildbots complaining made me wonder what's going on...
ERROR: "ipv6_push_frag_opts" [net/ipv6/ip6_tunnel.ko] undefined!

Fixes: 6c81c27efa ("kernel: backport fix for missing tunnel encapsulation limit option")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Hans Dedecker 6c81c27efa kernel: backport fix for missing tunnel encapsulation limit option
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Rosen Penev 9685f39787 ramips: Use generic board detect for GnuBee devices
This is a port of an old commit from mkresin's tree:

09260cdf3e9332978c2a474a58e93a6f2b55f4a8

This has the potential to break sysupgrade but it should be fine as
there is no stable release of LEDE or OpenWrt that support these devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Rosen Penev 976c27f2dd ramips: Fix a few other GnuBee DTS differences
I was carrying a local commit that added the sdhci stuff and missed it
as a result.

Also fix the rgmii3 thing in the PC2 DTS file as that's bogus and causes
a dmesg warning that it's bogus.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Rosen Penev 02f815d190 ramips: Fix WiFi after 5f7396ebef
That commit exposed a bug in the DTS files used by mt7621 where the wrong
reg value for pcie1 (and potentially pcie2) was being used. This was
causing WiFi failures for interfaces in pcie1.

eg. 2.4GHz working but not 5GHz.

As all of these dts entries are already specified in mt7621.dtsi, remove
them.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Stijn Tintel 64b53247c4 kernel: bump 4.14 to 4.14.44
Refresh patches.

Remove upstreamed patch:
generic/pending/181-net-usb-add-lte-modem-wistron-neweb-d18q1.patch
Update patches that no longer applies:
generic/hack/901-debloat_sock_diag.patch

Compile-tested on: x86/64.
Runtime-tested on: x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
John Crispin 55f3731002 mediatek: add missing symbols for mt7622
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin de6162e832 mediatek: add missing symbols
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Luo chongjun 312d7a4a5a ar71xx: add support for GL.iNet GL-AR750S
This patch adds supports for GL-AR750S.

Specification:
- SOC: QCA9563 (775MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 2x 1Gbps LAN + 1x 1Gbps WAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x switch button, 1x reset button
- LED: 3x LEDS (green)

Flash instruction:
Apply factory image via web-gui.

Signed-off-by: Luo chongjun <luochongjun@gl-inet.com>
6 years ago
Jo-Philipp Wich 3b749d4acc ar71xx: fix bad "proto" references in default network configuration
This change was originally meant to go along with the ucidef_set_interface()
fixup.

Fixes: 7e664b7c2d ("base-files: fix ucidef_set_interface() protocol selection")
Fixes: 85048a9c1f ("base-files: rework _ucidef_set_interface to be more generic")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
John Crispin 51740777fb mediatek: add mt7622 subtarget
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 050da2107a mediatek: backport upstream mediatek patches
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Lucian Cristian 253095131d ath79: initial tl-wr1043nd v1 support
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin f7aa08595d kernel: add reset control support to rtl8366 driver
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 5a6a32ad9b ath79: fix adjust_link callback for ar9130
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 83fb9ec5e0 ath79: make ahb wifi work
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Roman Yeryomin 85048a9c1f base-files: rework _ucidef_set_interface to be more generic
This is a rework of previously submitted patch reworking
ucidef_set_interface_raw [1]. Here, keep the idea but instead
make _ucidef_set_interface more generic and use it instead of
ucidef_set_interface_raw.
Also change the users like ucidef_set_interface_lan and others.

[1] https://patchwork.ozlabs.org/patch/844961/

Signed-off-by: Roman Yeryomin <roman@advem.lv>
6 years ago
Koen Vandeputte 467b07e00c kernel: bump 4.14 to 4.14.43
Refreshed all patches

Compile-tested on: cns3xxx, imx6, x86_64
Runtime-tested on: cns3xxx, imx6, x86_64

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Michael Yartys <michael.yartys@protonmail.com>
6 years ago
Rosen Penev 8c818fa1f0 ramips: Fix up GnuBee PC1 DTS file a little
There's nothing connected to i2c on this board, so remove it.

Also edited the gpio group to match the PC2 as they're the same.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Rosen Penev 048e41f649 ramips: Add back some non-mt7621 code that staging removed
Staging is meant only for mt7621 but for OpenWrt more is needed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Mirko Parthey 7ac238fc98 brcm47xx: add switch port mapping to Asus WL-500W
Switch ports 0..3 are connected to external ports LAN{1..4} in sequence,
switch port 4 is not used, and switch port 5 is connected to the CPU.
The WAN port is attached to the CPU's second network interface; it has no
connection to the internal switch.

Reuse the "Dell TrueMobile 2300" entry, which describes the same mapping.

Signed-off-by: Mirko Parthey <mirko.parthey@web.de>
6 years ago
John Crispin f6a067a699 kernel: mark all v3.18 and v4.4 kernels are source-only
These will be removed if not updated to v4.4

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Matthias Badaire 52809db544 ramips: fix to mt7620a and add support for i2c on WD03
There was an error on initial commit, the proper soc is mt7620n (which is
more limited than mt7620a). Moreover, there is a battery management
controller connected to the i2c port of the mt7620n. I have a small piece
of i2c code to get battery level coming.

Signed-off-by: Matthias Badaire <mbadaire@gmail.com>
6 years ago
Johann Neuhauser a7e1e919af ath79: preliminary support for TP-Link WDR3600 / WDR4300 (AR9344)
working:
 - leds
 - buttons
 - lan / wan
 - usb (hub port 1 + 2)
 - wifi 5g
 - sysupgrade
 - ...

not working:
 - wifi 2g

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
6 years ago
Koen Vandeputte faf0a460c4 kernel: bump 4.14 to 4.14.42
Refreshed all patches

Compile-tested on: cns3xxx, imx6, x86_64
Runtime-tested on: cns3xxx, imx6, x86_64

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte 6c5f2d73e9 kernel: bump 4.9 to 4.9.101
Refreshed all patches

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Stefan Lippers-Hollmann a436ef992d ipq806x: drop "mtd: nand: add Winbond manufacturer and chip"
The W25N01GV NAND is currently not used in any ipq806x device.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann 2819732219 ipq806x: drop linux 4.9 support
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann 18e9ed2482 ipq806x: switch to linux 4.14
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun 8c1c1c4874 ipq806x: remove spi-nor from r7800 dts
There's no spi-nor in R7800, so disable unequipped interfaces.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun 96cd31655d ipq806x: remove rpm pinctrl from board dts
These pins seem to be used by hw exclusively, so claiming it in
kernel causes an error in syslog in k4.14+.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun 7f694ef3d9 ipq806x: fix EA8500 switch control
EA8500 has pcie2 slot unequipped.
By EA8500 hw design default pcie2 reset gpio (gpio63) is used to
reset the switch. That's why enabling pcie2 brings the switch into
a working state.

So let's just control the gpio63 without enabling the pcie2 slot.

We have to remove the pcie2_pins node so the gpio63 is not defined
twice. Because pcie2 node has a reference to pcie2_pins we have to
remove it as well.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun 7a4f9c5993 ipq806x: move mmc specific nodes into v1.0 dtsi
These nodes are common for all revisions so put it into SoC v1.0
dtsi file.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun fbedc2213c ipq806x: fix pcie tx termination offset
According to GPL tarballs and QSDK related branch tx termination
offset for ipq8064 SoC version >= 2.0 should be equal to 0 and
not 7.

https://github.com/paul-chambers/netgear-r7800/blob/master/git_home/linux.git/sourcecode/arch/arm/mach-msm/board-ipq806x.c#L1682-L1685

Fix this.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun d4b98c38c6 ipq806x: apply updated USB PHY settings to v2.0 SoC
USB PHY power settings introduced for ipq8065 SoC with commit
644a0d5 "ipq8065: adjust SS USB PHY power settings"

According to that commit msg and in correspondence to GPL tarballs
and related QSDK branch those settings are applied to ipq8064
SoCs of version >= 2.0.

https://github.com/paul-chambers/netgear-r7800/blob/master/git_home/linux.git/sourcecode/arch/arm/mach-msm/board-ipq806x.c#L2507-L2514

Now as we have clarified that mass market boards are of SoC v2.0
move those USB PHY settings from ipq8065 (v3.0 SoC) dtsi to
ipq8064 v2.0 dtsi.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun e16f9abf6b ipq806x: reference ipq8065 as ipq8064 v3.0
ipq8065 is ipq8064 v3.0
> socinfo_init: v6, id=280, ver=3.0, raw_id=17, raw_ver=17, hw_plat=0,  hw_plat_ver=65536

Include dtsi accordingly and remove the unneeded qcom-ipq8065-v1.0.dtsi

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun 067036e875 ipq806x: move mass market ipq8064 to v2 dtsi
According to OEM bootlog entry mass market devices are ipq8064 SoC
v2.0:
> socinfo_init: v6, id=202, ver=2.0, raw_id=2064, raw_ver=2064, hw_plat=0,  hw_plat_ver=65536

I've checked C2600, EA8500 and VR2600v but couldn't find other
boards bootlog. I think it's safe to assume that other boards are
also v2.0. R7500 may be an exception because it was the first
device to hit the market.

So switch to v2.0 dtsi.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Pavel Kubelun adbdf78049 ipq806x: introduce ipq8064 SoC v2 dtsi
According to QCA internal numbering there are 3 versions of
ipq8064/5 SoC:
ipq8064 v1.0 - probably ipq8064 evaluation boards only
ipq8064 v2.0 - probably ipq8064 mass market boards only
ipq8064 v3.0 - aka ipq8065, boards based on ipq8065.

Each next revision includes configuration differences from
previous revision and adds something new.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Marc Benoit e40db2907e kernel: iqp806x low latency kernel does not boot
It keeps failing (R7800) with the stack trace below

BUG: scheduling while atomic: kworker/0:1/26/0x00000002

(unwind_backtrace) from [<c02121d0>] (show_stack+0x10/0x14)
(show_stack) from [<c03932e4>] (dump_stack+0x7c/0x9c)
(dump_stack) from [<c0239b90>] (__schedule_bug+0x5c/0x80)
(__schedule_bug) from [<c05b7260>] (__schedule+0x50/0x3f4)
(__schedule) from [<c05b76a8>] (schedule+0xa4/0xd4)
(schedule) from [<c05ba430>] (schedule_hrtimeout_range_clock+0xc8/0x100)
(schedule_hrtimeout_range_clock) from [<c05ba480>]
       (schedule_hrtimeout_range+0x18/0x20)
(schedule_hrtimeout_range) from [<c05b9f78>] (usleep_range+0x48/0x50)
(usleep_range) from [<c03f333c>] (__clk_hfpll_enable+0x44/0xd0)
(__clk_hfpll_enable) from [<c03f3474>] (clk_hfpll_set_rate+0xac/0xc4)
(clk_hfpll_set_rate) from [<c03ec390>] (clk_change_rate+0xf4/0x1fc)
(clk_change_rate) from [<c03ec510>] (clk_core_set_rate_nolock+0x78/0x94)
(clk_core_set_rate_nolock) from [<c03ec54c>] (clk_set_rate+0x20/0x30)
(clk_set_rate) from [<c0424168>] (dev_pm_opp_set_rate+0x190/0x26c)
(dev_pm_opp_set_rate) from [<c04a8548>] (set_target+0x40/0x108)
(set_target) from [<c04a4.140>] (__cpufreq_driver_target+0x3f4/0x488)
(__cpufreq_driver_target) from [<c04a7494>] (od_dbs_timer+0xcc/0x154)
(od_dbs_timer) from [<c04a7998>] (dbs_work_handler+0x2c/0x54)
(dbs_work_handler) from [<c02309e8>] (process_one_work+0x1c0/0x2f0)
(process_one_work) from [<c02319a8>] (worker_thread+0x2a4/0x404)
(worker_thread) from [<c0235944>] (kthread+0xd8/0xe8)
(kthread) from [<c020eef0>] (ret_from_fork+0x14/0x24)

Signed-off-by: Marc Benoit <marcb62185@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann 05f53eecca ipq806x: define KERNEL_SIZE in KB instead of byte for the image generation
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann c3af761e47 ipq806x: increase kernel partition size for the Netgear Nighthawk X4 R7500v2
Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This change follows the functional example of the Netgear r7800, but
has not been runtime tested on a Netgear Nighthawk X4 R7500v2.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann c228bbe616 ipq806x: increase kernel partition size for the Netgear Nighthawk X4 R7500
Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This change follows the functional example of the Netgear r7800, but
has not been runtime tested on a Netgear Nighthawk X4 R7500

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Jonas Gorski <jonas.gorski@gmail.com>
6 years ago
Stefan Lippers-Hollmann 45b8a7c1a6 ipq806x: increase kernel partition size for the Netgear Nighthawk X4 D7800
Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This change follows the functional example of the Netgear r7800, but
has not been runtime tested on a Netgear Nighthawk X4 D7800.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Tathagata Das <tathagata@alumnux.com>
6 years ago
Stefan Lippers-Hollmann 0c967d92b3 ipq806x: increase kernel partition size for the TP-Link Archer VR2600v
The default image does not fit 2 MB anymore, expand kernel partition
to 3 MB.

Upgrading should work transparently via sysupgrade in both directions.
Another option would be to merge "kernel" and "rootfs" into a single
"firmware" partition using MTD_SPLIT_TPLINK_FW, but just changing the
sizes of the existing partitioning has been deemed safer in the absence
of an actual runtime test on an affected device; the maximum for rootfs
changes from 10.4 MB to 9.4 MB.

This change follows the example for the TP-Link Archer C2600, but has
not been runtime tested on a TP-Link Archer VR2600v.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Sebastian Quilitz <zeraphim@x-pantion.de>
6 years ago
Stefan Lippers-Hollmann b72b36653a ipq806x: increase kernel partition size for the TP-Link Archer C2600
The default image does not fit 2 MB anymore, expand os-image partition
to 4 MB.

Upgrading works transparently via sysupgrade in both directions.
Another option would have been to merge "os-image" and "rootfs" into a
single "firmware" partition using MTD_SPLIT_TPLINK_FW, but just
changing the sizes of the existing partitioning has been deemed safer
and actually tested on an affected device; the maximum for rootfs
changes from 27 MB to 25 MB.

Run-tested on TP-Link Archer C2600.

Signed-off-by: Joris de Vries <joris@apptrician.nl>
[slh: extend comments and commit message, rename rootfs]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann dc50694bd1 ipq806x: increase kernel partition size for the Netgear r7800
Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This patch is based on a corresponding change by Pavel Kubelun
<be.dissent@gmail.com> and has been tested by Michael Yartys
<michael.yartys@protonmail.com>

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Ram Chandra Jangir 7ac6697fe2 ipq806x: cleanup kernel config
Disable MSM8960, MSM8974 and APQ8084
 - since these are different SoC's than IPQ806x
Removed unrequired serial configs
 - since ipq806x uses SERIAL_MSM only

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Ram Chandra Jangir 93dd2f7211 ipq806x: add kernel 4.14 support
- Rebased the patches for 4.14
 - Dropped spi-qup and 0027, 0028, 0029
   clk patches since it's already included
   in upstream.

 Tested on IPQ AP148 Board:
  1) NOR boot and NAND boot
  2) Tested USB and PCIe interfaces
  3) WDOG test
  4) cpu frequency scaling
  5) ethernet, 2G and 5G WiFi
  6) ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
David Bauer 70e6ea319d ipq40xx: add eva-image for FRITZ!Box 4040
This commit adds an EVA flashable image for the FRITZ!Box 4040.

The image contains the U-Boot with OpenWRT appended to it. This way we
remove the need to use UART for initial flashing.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
David Bauer ce91c85e01 ramips: change wifi led trigger for Archer C50v3
This commit alters the TP-Link Archer C50v3 LED settings to use the phy
trigger instead of the netdev one. This way the WiFi status is displayed
even if the wifi interface name is altered.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
David Bauer 35d00d9a41 ramips: fix Archer C50v3 LED mapping
This commit fixes the wrong LED mapping of the Archer C50 v3.
Commit was tested with an EU device.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Lucian Cristian 71cec0b194 ath79: enable rtl8366rb phy
is needed for at least tplink wr1043nd-v1

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Lucian Cristian fe594bf90d ath79: fix loader-okli, lzma-loader
booting will hang most of the times on tl-wr1043nd-v1 without a KERNEL_CMDLINE value
add anything as a placeholder as kernel command line is taken from DTS

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Chuanhong Guo a789c0f491 ar71xx: Add support for PISEN TS-D084
PISEN TS-D084 is an wireless router with a battery and integrated power supply based on Atheros AR9331.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 1T1R 2.4 GHz (AR9331)
- 1x USB 2.0

Flash instruction:
The manufacturer are using exactly the same firmware header as TP-LINK TL-WR703N (including device ID!). Simply upload the factory firmware into WebUI and flashing is done.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Sergey Ryazanov 67a3cdcbb0 kernel: enable THIN_ARCHIVES by default
THIN_ARCHIVES option is enabled by default in the kernel configuration
and no one target config disables it. So enable it by default and remove
this symbol from target specific configs to keep them light.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov bdc2b58c4b kernel: enable FUTEX_PI by default
New FUTEX_PI configuration symbol enabled if FUTEX and RT_MUTEX symbols
are enabled. Both of these symbols are enabled by default in the
generic config, so enable FUTEX_PI by default too to keep platform
specific configs minimal.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov a08b0d0c31 kernel: enable EXPORTFS by default
OVERLAY_FS config symbol selects EXPORTFS since 4.12 kernel, we have
OVERLAY_FS enabled by default, so enable EXPORTFS in the generic config
of 4.14 and remove this option from platform specific configs.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov 978543a246 kernel: disable DRM_LIB_RANDOM by default
DRM_LIB_RANDOM config symbol selected only by DRM_DEBUG_MM_SELFTEST
which is disable by default, so disable DRM_LIB_RANDOM by default too.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov ead26e9db6 kernel: disable DMA_{NOOP|VIRT}_OPS by default
These options do not used by any supported arch, so disable them by
default to make arch configs a bit more clean.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov f928c338ad kernel: disable ARCH_WANTS_THP_SWAP by default
Only one arch (x86_64) enables this option. So disable
ARCH_WANTS_THP_SWAP by default and remove referencies to it from all
configs (except x86_64) to make them clean.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Evgeniy Didin a2418dba02 arc770: remove source-only
In commit 8b9cdebc9c ("arc770: mark as source-only") arc770 was marked
as source-only because of iproute2 compile issues.
With uClibc-ng version 1.0.30 issues with iproute2 were fixed.
Lets remove "source-only" for arc770 as soon as uClibc-ng version
will be updated to 1.0.30. Patch for uClibc-ng is here:
https://patchwork.ozlabs.org/patch/917547/

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: John Crispin <john@phrozen.org>
6 years ago
Hauke Mehrtens ae8ff1c65c ar71xx: Fix build for dap-1330-a1 board
Using a version number of 16 character causes a buffer overflow in the
version number overwriting the first bit of the signature in the
mkdapimg2 tool.
I am not sure if the version number should be null terminated or not.
This patch reduces the size of the version number by removing the number
of private commits from it.

This was the original version number which caused problems:
OpenWrt-r6727+10
Now it uses this version number:
OpenWrt-r6727

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Sergey Ryazanov 06116473cc ath25: drop 4.9 kernel support
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov 5191ea5621 ath25: switch to 4.14 kernel
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov 3d69857ac1 ath25: add kernel 4.14 support
Copy and refresh patches and config from 4.9, no more work is need.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Damir Samardzic 5b7b0c68c7 mvebu: initial support for Marvell Armada 7k and 8k DB boards
Add initial support for cortex-a72 based Armada DB-88F8040-Modular and
DB-88F7040-Modular development boards.

DB-88F8040-Modular specifications:
- Quad-core ARMv8 Cortex A72 CPU (up to 2 GHz)
- DDR4 DIMM - 64 bits + ECC
- 2 x 128 Mb SPI NOR flash memory
- 2 x 1G Ethernet port via RGMII (RJ45)
- 2 x SD card ports (4 bit port on CP, 8 bit port on AP)
- 2 SERDES modules with the following interfaces each:
  - 2 x SATA Rev 3.0 port (Port1 via SERDES module CON4 (active port), Port0
    via SERDES Module CON2 or CON1 (optional port))
  - 3 x PCI Express (PCIe) Gen 3.0 (Port2 via SERDES module CON5 (active port),
    Port1 via SERDES module CON7 (optional port), Port0 via SERDES module CON6
    (optional port))
  - 2 x USB3 (USB 2.0 backward compatible) host (via SERDES module CON9 and
    CON10)
  - 1 x 10G port over SFP+ connector (via SERDES module CON8)
- 1 x MCI interface by two over USB Type C connector
- 4 x serial COM port driven by the 88F8040 UART interface and converted to
  USB via FTDI IC
- I2C Master Interface
  - CP I2C 2x EEPROM @ Address 0x50 and 0x57
  - 1 x I/O Expander @ Address 0x21
  - Sample at Reset (SatR) memory device @ Address 0x4C and 0x4E
- I2C Slave Interface (via SERDES module) - Connection to each device on the
  board via an I2C multiplexer
- JTAG interface for CPU emulator
- Board dimensions: 270 mm x 240 mm (main + SERDES module)
- SERDES Module Dimensions: 70 mm x 105 mm

DB-88F7040-Modular specifications:
- Quad-core ARMv8 Cortex A72 CPU
  - CPU core operating speed of up to 1.6 GHz for Dual Core, 1.4 GHz for Quad
    Core
- DDR4 - 32 bit + ECC on Module - SLM1366-V1 (DB-DDR4-40B-MODULE) 4 GByte
  32-bit
- 1 x 128Mb SPI NOR flash memory
- 2 x 1G Ethernet port: 1 over RGMII (RJ45) and 1 over SGMII
- SD card 4 bits port on AP
- eMMc Module on CP
- 1 SERDES Modules with the following interfaces each:
  - 1 x SATA Rev 3.0 port (via SERDES module CON4)
  - 1 x PCI Express (PCIe) Gen 3.0 (via SERDES module CON5)
  - 2 x USB 3.0 (USB 2.0 backward compatible) host (via SERDES module CON9 and
    CON10)
  - 1 x 10G port over SFP+ connector (via SERDES module CON8)
- 2 x MCi interface by one over USB Type C connector
- 4 x Serial COM port driven by the 88F7040 UA
- RT interface and converted to USB via FTDI IC
- I2C Master Interface
  - 2 x EEPROM at address 0x57 and 0x50 in AP and 2 x EEPROM at address 0x57
    and 0x50 in CP
  - 1 x I/O Expander at address 0x21
  - Sample at Reset (SatR) memory device at address 0x4C and 0x4E
- I2C Slave Interface (via SERDES module) - Connection to each device on the
  board via an I2C multiplexer
- JTAG interface for CPU emulator
- Board dimensions - 270 mm x 240 mm (main + SERDES module)
- SERDES Module Dimensions - 70 mm x 105 mm

Booting from USB flash drive (dd sdcard image to the flash drive):
 1. reset U-Boot environment:
      env default -a
      saveenv

 2. prepare U-Boot manually (make sure to set correct dtb file name):
      setenv bootargs_root 'root=/dev/sda2 rw rootdelay=2 ip=dhcp'
      setenv fdtfile armada-7040-db.dtb
      setenv image_name Image
      setenv bootcmd 'usb start; ext4load usb 0:1 $kernel_addr $image_name; ext4load usb 0:1 $fdt_addr $fdtfile; setenv bootargs $console $mtdparts $bootargs_root; booti $kernel_addr - $fdt_addr'
      saveenv
      boot

Signed-off-by: Damir Samardzic <damir.samardzic@sartura.hr>
6 years ago
Damir Samardzic 322a02f666 mvebu: initial support for Marvell Armada 3720 DB board
Add initial support for Marvell Armada cortex-a53 based
DB-88F3720-DDR3-Modular development board.

Specifications:
- Dual core ARMv8 Cortex-A53 CPU (up to 1.0 GHz)
- 4Gb 16-bit DDR3/3L DRAM memory
- 128Mb SPI NOR flash memory
- 8Gb eMMC NAND flash memory
- 1 x SATA Rev 3.0 port
- 1 x PCI Express (PCIe) Gen 2.0 or 1 x mini PCI Express (PCIe) Gen 2.0
- 1 x 1G Ethernet port via RGMII (RJ45)
- 1 x SD card port
- 1 x USB3 (USB2 backward) host\device port via type C connector
- 1 x USB2 host port via type A connector
- 1 x serial COM port driven by the 88F3720 UART interface and converted to
  USB via FTDI IC (option to connect the UART DB9 adapter)
- I2C Master Interface:
  - 1 x EEPROM @ address 0x57
  - 1 x I/O Expanders @ address 0x22
  - Sample at Reset (SatR) memory device @ address 0x4C
  - RTC clock generator PT7C4337AWE @ address 0x68
  - USB3 switch PI5USB30213XEA @ address 0x0D
  - ID component of PHY module @ address 0x24
- 1 x JTAG interface for CPU emulator
- 1 x SETM and JTAG debug interface
- 1 x power connector for HDD supply
- 1 x 12V DC jack power connector
- Board dimensions: 150 mm x 179 mm
- LED interface for system status

Booting from SD card:
 1. reset U-Boot environment:
      env default -a
      saveenv

 2. prepare U-Boot with boot script:
      setenv bootcmd "load mmc 0:1 0x4d00000 boot.scr; source 0x4d00000"
      saveenv

    or manually:
      setenv fdt_name armada-3720-db.dtb
      setenv image_name Image
      setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $fdt_addr $fdt_name;setenv bootargs $console root=/dev/mmcblk1p2 rw rootwait; booti $kernel_addr - $fdt_addr'
      saveenv

Signed-off-by: Damir Samardzic <damir.samardzic@sartura.hr>
6 years ago
YuheiOKAWA 13684ba63f kernel: Add support spi-nor, Eon EN25QH32
Support Add spi-nor chip EN25QH32. JEDEC is 1c7016.

Can't boot issue, new revision hardware is EN25QH32 flash chip.
example, MZK-DP150N (ramips).
https://bugs.openwrt.org/index.php?do=details&task_id=1534

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>
6 years ago
Alif M. Ahmad b0a51dab8c x86: disable CONFIG_EFI_VARS
Disable CONFIG_EFI_VARS, since it suffers from sysfs limitation (no
support for variable longer than 1024 bytes).

kmod-fs-efivarfs is the replacement of this, which enables mounting
efivarfs file system and doesn't suffer from 1024 bytes limitation.

Signed-off-by: Alif M. Ahmad <alive4ever@live.com>
6 years ago
YuheiOKAWA d91953cb53 ramips: add support for YUKAI Engineering Inc. BOCCO
BOCCO is a communication robot provided by YUKAI Engineering Inc.

SoC: MT7620A
MEM: 256MB
Flash: 8MB
NAND: 512MB (non support)
Include Sound DAC and AMP.
No Wired Ethernet.

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>
6 years ago
Michal Cieslakiewicz 45dc530334 ar71xx: WNDR3700: enable RFKILL function for Wifi button
Wifi button for WNDR3700 dual band routers has been renamed to "rfkill"
and its emitted keycode changed to KEY_RFKILL. This allows OpenWrt/LEDE
to support it 'out of the box' without additional tweaking.

Until this patch, button had been sending BTN_2 keycode which was
ignored by default (no action script present). To get expected behaviour
of switching radios on and off, user had to manually rename/link
'rfkill' script to name 'BTN_2' in /etc/rc.button directory.

This patch follows similar changes for other Netgear ar71xx routers,
for example WNR2000v3. It applies cleanly to both latest trunk and 17.01
branch. Tested on WNDR3700v1.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
6 years ago
Christian Lamparter 707b6c815b brcm2708: add squashfs rootfs image
This patch adds a image with squashfs as the root filesystem.
A rootfs_data partition will be generated on the first boot
and placed inside the rootfs partition (just after the squashfs
image).

advantages:
 - it is possible to migrate from an existing -ext4
   installation and back via sysupgrade.
 - existing partition layout will not be lost.
 - slightly smaller image size.
 - support for attendedsysupgrade

disadvantages:
 - needs f2fs + tools as well. This is because fs-tools decides on the
   blocksize of the sdcard. So either f2fs or ext4 can get choosen as
   the rootfs_data filesystem (depends on the size of the root partition).
 - rootfs_data is placed into the rootfs partition. This makes
   it difficult for tools that expect a /dev/mmc0pX device.
   It also makes it difficult for data recovery tools since they
   might not expect to find a embedded partition or will be
   confused.

For people with existing build configurations: make sure to include mkf2fs
and f2fsck package into the image... Otherwise the new -squashfs image will
boot of a ram-overlay and won't keep the configurations after a reboot.

Cc: Álvaro Fernández Rojas <noltari@gmail.com>
Cc: Paul Spooren <spooren@informatik.uni-leipzig.de>
Cc: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Acked-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Kristian Evensen 8f9baf5e1a x86: Add APU3 reference to x86 board.d
There is a new APU-model available, APU3. The device is configured in
the same way as the APU1 and APU2, so the same LED/network setup can be
used.

I considered changing the case to pc-engines-apu*, but I chose to follow
the existing pattern and add the full board name.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
6 years ago
Christian Lamparter 16e39624b7 apm821xx: backport and reassign crypto4xx patches
This patch backports several patches that went upstream into
Herbert Xu's cryptodev-2.6 tree:

crypto: Use zeroing memory allocator instead of allocator/memset
crypto: crypto4xx - performance optimizations
crypto: crypto4xx - convert to skcipher
crypto: crypto4xx - avoid VLA use
crypto: crypto4xx - add aes-ctr support
crypto: crypto4xx - properly set IV after de- and encrypt
crypto: crypto4xx - extend aead fallback checks
crypto: crypto4xx - put temporary dst sg into request ctx

The older, outstanding patches from 120-wxyz series have been
upstreamed as well and therefore they have been reassigned to
fit into the series.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter e6e51ce87f apm821xx: don't select swconfig for the MR24
The swconfig package is part of the DEFAULT_PACKAGES list in
the apm821xx's nand subtarget. It's enabled by default because
the MX60(W) and WNDR4700 need it for their initramfs. However
the package is not necessary for the MR24's sysupgrade image, as
the MR24 does not have a switch.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Roman Yeryomin 1f42deec8e ipq40xx: fix ethernet on ap-dk01.1
Not sure how it worked before but ethernet is disabled
by default in ipq4019 dtsi.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
6 years ago
Koen Vandeputte e2aa0c3f8b kernel: bump 4.14 to 4.14.41
Refreshed all patches

Dropped upstreamed patches:
522-PCI-aardvark-fix-logic-in-PCI-configuration-read-write-functions.patch
523-PCI-aardvark-set-PIO_ADDR_LS-correctly-in-advk_pcie_rd_conf.patch
525-PCI-aardvark-use-isr1-instead-of-isr0-interrupt-in-legacy-irq-mode.patch
527-PCI-aardvark-fix-PCIe-max-read-request-size-setting.patch

updated patches:
524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch
030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch

Added new ARM64 symbol: CONFIG_ARM64_ERRATUM_1024718

Compile-tested on: cns3xxx, imx6, mvebu (arm64), x86_64
Runtime-tested on: cns3xxx, imx6, x86_64

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte 12f44b83a8 kernel: bump 4.9 to 4.9.100
Refreshed all patches

Added new ARM64 symbol: ARM64_ERRATUM_1024718

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Daniel Gonzalez Cabanelas fbbb977772 brcm63xx: Tune the network configuration for several routers
- DGND3700v1: fix port numbers, they're in reverse order
- FaST2704n: there is no WAN port identified as such, only 4 LAN
- AD1018: configure the "FIBRE" port as WAN

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
6 years ago
Rosen Penev fec205f654 ramips: mmc: Sync with staging driver
Mostly whitespace cleanups. Some unneeded code was removed.

MMC init was also moved to the probe function as in
6069bdd

The cleanup commits are over 100, making it hard to do them individually.

Tested on GnuBee PC1 with an SD card being used as swap.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
v2: Fixed compile issue with mt7620
6 years ago
Matthias Schiffer a5b77c9d9d
ath79: remove unused copy-file build step
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer aea146736c
ath79: fix TP-Link TL-WR1043ND v1 image build
Both initramfs and flashed images are built and boot. No Ethernet, no WLAN,
probably further issues, so the image is not added to TARGET_DEVICES for
now.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Felix Fietkau e9cb1b720d netfilter: fix hardware offload regression (FS#1551)
The relevant code needs to be enabled even if flow table support is only
compiled as module

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Mathias Kresin 75ed56a08a ath79: add AVM FRITZ!WLAN Repeater 300E
No known issues, everything works fine.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin bc04cf780e ath79: ar724x: fix pll settings
Add the syscon compatible, otherwise used functions like
syscon_regmap_lookup_by_phandle() will return an error and setting the
ethernet pll data wont work at all.

Fix the pll register width. Writing to registers out of the range via
syscon isn't possible and returns an error. On ar7242 the last pll
register - Current Audio Modulation Logic Output - is at 0x1805003c.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin f7ec385c13 ath79: add and enforce image metadata
Add metadata to images and make the metdata mandatory.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin f77db1a590 ath79: cleanup image build code
Remove recipes for not yet migrated boards. Drop variables which aren't
required due to the switch to devicetree like boardname.

Drop the legacy image build code. Boards added to this target shouldn't
use the legacy image build code anyway.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin cfe442c503 ath79: sysupgrade: drop unused variables
None of the variables are used at the moment.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 3e9d9f6225 ath79: sysupgrade: drop unused platform checks
None of these checks are used at the moment and most of them aren't
required if the image metadata validation is used.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 377197fdb3 ath79: sysupgrade: remove obsolete sysupgrade watchdog kill
The watchdog kill command was meant for busybox watchdog. Busybox watchdog
was replaced by the procd watchdog mid 2013 with commit df7ce9301a
("busybox: disable the watchdog utility by default"), which makes the kill
command obsolete since quite some time.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 0ff5785c5d ath79: fix dts files
Add the SoC compatible to the individual dts files. Rename the dts files
to match the common pattern.

Remove dts files wich aren't used and no image in ar71xx exists.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 8f7e28a783 ath79: enable wireless
PCI attached wireless works fine. So enable the wireless config symbols.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin bf781bd2ef ath79: cleanup kernel config
Remove outdated or not required kernel config settings.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin b2cef5d045 ath79: drop platform data patches
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin a181781bf8 octeontx: make board.d files executable
Add the executable permission to the files to ensure they run on
firstboot.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin d136192396 ath79: make board.d files executable
Add the executable permission to the files to ensure they run on
firstboot.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin d8b475212b lantiq: kernel 4.14: use vbus-supply devicetree property
It isn't a phy supply, as the phy is still up if the GPIO is low. It
rather is the supply for the vbus. A correct setting/definition will be
relevant as soon as USB peripheral mode is supported.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 0e9e8d8323 kernel: dwc2: add support for host mode external vbus supply
Backport patch adding support for the vbus-supply devicetree property,
which allows to specific GPIOs (via fixed regulators) to enable
vbus/usb power.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 0b62fe5ed8 lantiq: complete AVM FRITZ!Box 3370 support
Rename the image and use a compatible string which indicates that only
hardware revision 2 and higher is supported.

It allows to use the wireless LED, as HWRev 1 uses GPIO#39 for the
wireless LED and starting with HWRev 2 GPIO#35 is used for the wireless
LED and GPIO#39 for IFX_GPIO_MODULE_EXTPHY_MDIO.

The HWREV can be checked by connecting to the fritzbox right after power
on via ftp:

  ftp> quote GETENV HWSubRevision

Within the same HW revision 5 of the Fritz!Box 3370 different NAND flash
chips are used. Usually it isn't a big deal but depending on the used
NAND flash chip, the ECC calculation is done different (and incompatible
of course).

Boards with a Micron MT29F1G08ABADA NAND flash chip are using the NAND
chip to calculate the ECC (on-die). Boards with a Hynix HY27UF081G2M NAND
flash chip are doing the ECC calculation in software.

Supporting both with a single DTS isn't possible. It might be possible
to add a patch selecting the ECC mode dynamicaly based on the found NAND
flash chip. But such a patch has no chance to get accepted upstream and
most likely need to be touched with every kernel update.

Instead two images are created. One for Micron NAND flash chip and one
for Hynix NAND flash chip. So far no pattern is known to identify the
used flash chip without opening the box.

Add the power off GPIO. At least EVA version 2186 sets/keeps the GPIO as
input, which will cause a reboot 30sec after power on. For boards with
EVA version 2186 the installation is tricky as it has to be finished
within the 30sec time frame.

The EVA version can be checked by connecting to the fritzbox right after
power on via ftp:

  ftp> quote GETENV urlader-version

The ath9k eeprom/caldata is at a different and offset and stored in
reverse order (from the last byte to the beginning) on the flash.
Reverse the bits to bring the data into the format expected by the
ath9k driver.

Since the ath9k eeprom is stored in reverse order on flash, we can not
use the mac address from the on flash eeprom. Get the MAC address from
the tffs instead.

Within the same HW revision 5 of the Fritz!Box 3370 both version of the
vr9 SoC are used. During preparation of kernel 4.14 support, all
devicetree source files were changed to load the vr9 v1.1 and vr9 v1.2
gphy firmware, which fixed the embedded phys for boards using the
version 1.2 of the vr9 SoC.

While at it, add a trigger to make use of the LAN LED. Setup the
build-in switch and add a hint for LuCI two show the ports in order
matching the labels on the case

Add support for the second USB port and provide the volatage GPIOs. Use
GPIO#21 as PCIe reset pin. The lan led is connected to GPIO#38.

Name the rootfs partition ubi and remove the mtd/rootfs related kernel
bootargs to use the OpenWrt autoprobing based on the partition name.

Enable sysupgrade support to allow an upgrade from a running system.
Since sysupgrade wasn't supported till now, drop image build code which
was added to allow a sysupgrade from earlier OpenWrt versions.

Build images that allow an (initial) installation via EVA bootloader.

To install OpenWrt via Eva bootloader, within the first seconds after
power on a ftp connection need to be established to the FRITZ!Box at
192.168.178.1 and the the following ftp commands need to be run:

  ftp> quote USER adam2
  ftp> quote PASS adam2
  ftp> binary
  ftp> debug
  ftp> passive
  ftp> quote SETENV linux_fs_start 0
  ftp> quote MEDIA FLSH
  ftp> put /path/to/openwrt-lantiq-xrx200-FRITZ3370-eva-kernel.bin mtd1
  ftp> put /path/to/openwrt-lantiq-xrx200-FRITZ3370-eva-filesystem.bin mtd0

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin d7b7483343 lantiq: switch to kernel 4.14
Use kernel 4.14 by default.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
John Crispin 7e15e21766 Revert "ramips: mmc: Sync with staging drivers"
This reverts commit 2d401925b9.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Wei Yongjun 87c254c87e staging: mt7621-eth: fix return value check in mt7621_gsw_probe()
In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: f079b6406348 ("staging: mt7621-eth: add gigabit switch driver (GSW)")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years ago
Wei Yongjun edec251870 staging: mt7621-eth: fix return value check in mtk_connect_phy_node()
In case of error, the function of_phy_connect() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: e3cbf478f846 ("staging: mt7621-eth: add the drivers core files")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years ago
Wei Yongjun c4ae54dfab staging: mt7621-eth: fix return value check in mtk_probe()
In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: e3cbf478f846 ("staging: mt7621-eth: add the drivers core files")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years ago
Rosen Penev e07baec9fa ramips: pci: sync with staging driver
This is an amagalmation of two upstream commits dealing with whitespace
and dead code removal. I'm synching instead of having two separate commits
as they go out of order compared to previous commits here.

Tested on GnuBee PC1.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Rosen Penev 2d401925b9 ramips: mmc: Sync with staging drivers
Mostly whitespace cleanups. Some unneeded code was removed.

MMC init was also moved to the probe function as in
6069bdd087

The cleanup commits are over 100, making it hard to do them individually.

Tested on GnuBee PC1 with an SD card being used as swap.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Matthias Badaire a0685deec4 ramips: Add i2c support for mt7620n
I2c is supported on mt7620n like on mt7620a when checking the datasheet

Signed-off-by: Matthias Badaire <mbadaire@gmail.com>
6 years ago
Alberto Bursi e09d4c850d kirkwood: support for buttons in Audi and Viper
Both these devices have a wps and a reset button on
GPIO pins, which need kmod-gpio-button-hotplug
package to work.

Add this package to their default package config.

Troubleshooted and tested on a Viper.

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
6 years ago
Johann Neuhauser c15dfbeea0 ath79: fix gmac compatible in ar9330.dtsi and ag71xx_setup_gmac_933x
1. compatible property in node gmac was wrong

2. ag71xx_setup_gmac_933x should use np of gmac-config and
   not the pointer to gmac. gmac is only used for the reg address.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
6 years ago
Michael Gray bfbdeeb3de mvebu: add support for WRT32X (venom)
Linksys WRT32X (Venom) is identical in hardware to the WRT3200ACM
with a different flash layout and boots zImage rather than uImage.

Specification:
- Marvell Armada 385 88F6820 (2x 1.8GHz)
- 256MB of Flash
- 512MB of RAM
- 2.4GHz (bgn) and 5GHz (an+ac wave 2)
- 4x 1Gbps LAN + 1x 1Gbps WAN
- 1x USB 3.0 and 1x USB 2.0/eSATA (combo port)

Flash instruction:
Apply factory image via web-gui.

Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
6 years ago
Linus Walleij 1f56417e6b gemini: Augment DIR-685 device tree for RTL8366RB
This makes the ethernet and RTL8366RB come up on the
D-Link DIR-685.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
6 years ago
Linus Walleij 3b48111df9 gemini: create zImage for DIR-685
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
6 years ago
NeilBrown edea934799 ramips: remove unnecessary resource details.
These resources are extracted from devicetree, so they aren't
needed here.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years ago
NeilBrown 1f78625714 ramips: remove conditional compilation.
Code currently defines:

and then compiles code only if they are defined.
We might want to disable some of these via devicetree one
day, but for now just remove the #defines and the
conditions - all the code for different ports is
easy to identify.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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
Christian Lütke-Stetzkamp 2ad4daf579 ramips: Remove redundant owner assignment
Remove the owner assignment form the platform driver as
platform_driver_register() already initializes the owner.
Found using coccinelle.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years ago
Rosen Penev a098a78a33 ramips: Move PCI driver to files directory
This will make it easier to port upstream code.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Jo-Philipp Wich aadca035bc at91: sama5d4: fix bad mkubifs options
Drop the "-x lzo" compression type override from MKUBIFS_OPTS since we
do not support it in mkfs.ubifs. Attempting to use LZO compression results
in "Error: bad compressor name".

The build system also appends an explicit "--compr=zlib" to the mkfs command
line, turning the "-x" flag into a no-op anyway.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Rafał Miłecki 404508001e kernel: use accepted version of bcm47xxpart fix commit
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 070693477a kernel: backport mtd patch for minor partitioning cleanup
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Felix Fietkau a3096b4b33 kernel: fix build error in flow offload code with CONFIG_NETFILTER=n
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rafał Miłecki 02225f5763 bcm53xx: backport the first bunch of 4.18 BCM5301X patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Jo-Philipp Wich cf7a88cf5a at91: cleanup kernel configurations
The subtarget configurations contained a lot of reduntant symbols, arbitrary
overrides and symbols set to =m.

Remove most of these redundant settings to shrink the subtarget configurations
to a manageable size.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich f23326eb76 at91: sama5d2: remove CONFIG_XZ_DEC override
Fixes the following error spotted by the buildbot:

    Package kmod-fs-squashfs is missing dependencies for the following libraries:
    xz_dec.ko

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich 0167f53b9d at91: add missing config symbols
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich d8c7cd9cb1 kernel: rtl8366_smi: guard of_mdiobus_register() call
Make the call to of_mdiobus_register() dependant on CONFIG_OF to avoid
pulling in an unwanted dependency on of_mdio.ko.

Fixes: 3dc523f232 kernel: add OF support to rtl8355 driver
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Piotr Dymacz ce4d2fb5cc ar71xx: fix and improve ALFA Network Tube2H support
Fix ART offset (make it universal for 8/16 MB versions of the board) and
while at it, include also GPIO setup for h/w watchdog (EM6324QYSP5B).

Fixes: FS#1532

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Matthias Schiffer db34cdf6c5
ath79: Ubiquiti Airmax M: add relocate-kernel to invalidate cache
Apply ar71xx fix for broken Ubiquiti bootloader to ath79 as well.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Felix Fietkau 6069bdd087 ramips: move mtk-mmc init to probe function to avoid breaking NAND flash
The driver messes with the pin control settings - MMC and NAND are
mutually exclusive

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau f95a4aa565 ramips: clean up the mt7621 nand flash driver hacks, add support for the xiaomi mir3g flash chip
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rafał Miłecki 97f3c0f041 brcm47xx: switch to the kernel 4.14
The biggest (and the only?) disadventage of this is obviously an
increased image size.

For mips74k the size of vmlinux goes up from 4186684 B to 4701436 B.
Most devices use LZMA compressed kernel so probably more important is
vmlinux.lzma size which goes up from 1342945 B to the 1508498 B.

Still this isn't something that should stop target kernel bump. There
are various adventages of kernel 4.14. If kernel / image size is a
serious concern for anyone, it's perfectly possible to use previous
release which is pretty solid for the brcm47xx.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Cc: Paul Wassi <p.wassi@gmx.at>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago