Commit Graph

1017 Commits (dcc34574efba524cf75608c3b61bfa579bfb8aa4)

Author SHA1 Message Date
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
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 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
Mathias Kresin ef19747b6c lantiq: kernel 4.14: Remove reboot/remove reset asserts
Backport patch accepted upstream which removes the reset asserts of the
xrx200 gphy driver on reboot/remove.

While doing a global software reset, these bits are not cleared and let
some bootloader fail to initialise the GPHYs. The bootloader don't expect
these bits to be set, as they aren't during power on.

The asserts were a workaround for a wrong syscon-reboot mask. With a mask
set which includes the GPHY resets of the first reset register, the
resets of the second reset register arn't required any more.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Kevin Darbyshire-Bryant 9aa196e0f2 kernel: bump 4.9 to 4.9.96
Refresh patches, following required reworking:

ar71xx/patches-4.9/930-chipidea-pullup.patch
layerscape/patches-4.9/302-dts-support-layercape.patch
sunxi/patches-4.9/0052-stmmac-form-4-12.patch

Fixes for CVEs:
CVE-2018-1108
CVE-2018-1092

Tested on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Arjen de Korte <build+openwrt@de-korte.org>
6 years ago
Mathias Kresin 74a0d8cd92 build: consolidate fake uImage header build commands
Merge the two existing functions and use a parameter for the type
header field.

It updates the syntax of the former mpc85xx fake ramdisk header
command to be compatible with mkimage from u-boot 2018.03 and fixes the
build error spotted by the build bot.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 0c26264dee lantiq: kernel 4.14: fix vr9 reboot mask
We need to reset the GPHYs on reboot as well. Otherwise the bootloader
might have issues to reset/find the GPHYs.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hauke Mehrtens a74fd570a2 kernel: update kernel 4.14 to 4.14.32
The following patches are now included upstream:
* 0052-MIPS-lantiq-fix-usb-clocks.patch
* 0053-MIPS-lantiq-enable-AHB-Bus-for-USB.patch
* 0060-lantiq-ase-enable-MFD-SYSCON.patch

Closes: FS#1466

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Mathias Kresin af3a9566fe lantiq: intel-xway: add vr9 v1.1 phy support
During upstreaming the intel phy driver, support for the vr9 v1.1
embedded phys got lost. Backport the upstream send patch adding support
for the vr9 v1.1 embbeded phys to the driver.

Signed-off-by: Mathias Kresin <dev@kresin.me>

cosmetic fixes

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Thomas Nixon 8c88e23b99 lantiq: fix DM200 boot with fake uImage headers
The latest bootloader versions load the firmware into memory and call
`chk_dniimg` (defined in Netgear GPL release), which expects to find
three consecutive block-aligned uImages. Add two fake uImage headers
after the kernel to fool this check.

This wastes up to 128k of space for alignment. The alternative would be
to put the rootfs in a second uImage, but this would limit the firmware
size to 0x710000 (the number of bytes loaded and verified by the
bootloader) instead of 0x7b0000 (the size of the firmware partition).

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
6 years ago
Valentin Spreckels ac1c31c259 lantiq: fix AVM initramfs image
Create an initramfs that can be used with the EVA bootloader.

Signed-off-by: Valentin Spreckels <Valentin.Spreckels@Informatik.Uni-Oldenburg.DE>
6 years ago
Hauke Mehrtens bf4aa52dbf kernel: make mtd patches apply again
This makes some of the mtd patches apply again after some generic
patches were changed.
These problems where found by build bot.

Fixes: ac9bcefa3b ("kernel: use V10 of mtd patchset adding support for "compatible" string")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Martin Schiller d84ac78d6a lantiq/xrx200: add usif support to dts files
The Lantiq XRX200 aka VR9 doesn't have an asc0. Instead,
there is an USIF module which can either be an UART or a
SPI Controller.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
6 years ago
Magnus Kroken 5af85dab22 kernel: bump 4.9 to 4.9.85
Signed-off-by: Magnus Kroken <mkroken@gmail.com>
6 years ago
Felix Fietkau a49f6565b3 kernel: m25p80: allow fallback from spi_flash_read to regular SPI transfer
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 46c49d8381 kernel: optimize for performance by default starting with 4.14
Keep size optimizations for smaller targets that already switched

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Hauke Mehrtens 6eaf8b3d89 lantiq: kernel 4.14: update dts files
Updated the devicetree source files to make use of the following
upstreamed drivers:

 - xrx200 ethernet phy
 - reset controller unit
 - dwc2
 - fpi

Use our custom xrx200 ethernet phy compatible to support boards, which
have switched the vr9 revision during lifetime, with a single devicetree
source file.

By switching to the dwc2 driver + usb phy framework, we don't need to used
our custom gpio power patch and can use a fixed regulator instead.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin f519fea4c6 lantiq: kernel 4.14: cleanup dts files
Move common used parts to dtsi. Add labels to nodes and reference nodes
via labels in dts files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 82ae68be70 lantiq: kernel 4.14: fix usb
On danube the USB0 registers are at 1e101000 similar to all other lantiq
SoCs.

On Danube and AR9 the USB core is connected to the AHB bus, hence we need
to enable the AHB Bus as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 2368f7cb78 lantiq: kernel 4.14: autoselect matching vr9 rev firmware
Add a custom xrx200 ethernet phy compatible to load the firmware matching
the vr9 revision without specifing an expected revision.

We have quite a few boards in the tree were later produced ones are using
a more recent vr9. It is impossible to distinguish which revision of the
vr9 is used without opening the case and removing a heatsink for some of
them.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin a48b4ae38b lantiq: kernel 4.14: don't use CPU interrupt controller IPI IRQ domain support
This reverts kernel commit 1eed40043579 ("MIPS: smp-mt: Use CPU interrupt
controller IPI IRQ domain support"). With the patch applied, the kernel
hangs during boot if SMP is active.

The Lantiq IRQ controller gets registered first and it directly handles
the MIPS native SW1/2 and HW0 - HW5 IRQs. It looks like this controller
already registers IRQ 0 - 7 and the generic driver only gets the following
IRQs starting later.

The upstream discussion can be found at
https://www.linux-mips.org/archives/linux-mips/2017-05/msg00059.html.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin cf53f2180c lantiq: kernel 4.14: select MFD SYSCON for ase
Enable syscon to use it for the RCU MFD on Amazon SE as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hauke Mehrtens f1d84023cb lantiq: kernel 4.14: update patches and config
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hauke Mehrtens 5eeaba31b8 lantiq: kernel 4.14: copy patches, config and dts files
This just copies the patches, configuration and dts files into the
directories hich are used for kernel 4.14.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Mathias Kresin f8a6987cd1 lantiq: make dts files and kernel config kernel version specific
Move the devicetree source files to a kernel specific directory in
preparation of adding kernel 4.14 support.

Rename the subtarget kernel config files to match a specific kernel
version.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 627a28eb09 lantiq: rename gphy firmware
Rename the gphy firmware to match the name requested by kernel 4.14 and
update the devicetree source files to use the new name.

Update the u-boot lantiq Makefile to be compatible with the new names as
well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 188328111b treewide: move nand_do_upgrade call to platform_do_upgrade
Calling nand_do_upgrade() from platform_pre_upgrade() was deprecated
with 30f61a34b4 ("base-files: always use staged sysupgrade").

Update the platform upgrade code to use platform_do_upgrade() for NAND
images as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin c4ac02ffca treewide: 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
Felix Fietkau cde71a543c build: replace uses of OpenWrt with $(VERSION_DIST)
This makes the distribution name more configurable.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Yousong Zhou 82ceb2ad2a build: add config option KERNEL_MIPS_FPU_EMULATOR
To make it more accessible for nodejs users to configure and run a build
on mips target lacking hardware fpu

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years ago
Mathias Kresin d3fd38637f lantiq: create ATM/PTM interfaces with dsl as netdev name
Renaming an atm etherbride using 'ip link' (via hotplug) is racy since the
original netdev might disappear before br2684ctl has finished appling it's
setting:

 local2.notice br2684ctl[1667]: Interface "nas0" created sucessfully
 local2.notice br2684ctl[1667]: Communicating over ATM 0.8.35, encapsulation: LLC
 kern.info kernel: dsl0: renamed from nas0
 kern.err kernel: br2684:br2684_regvcc: tried to attach to non-existent device
 local2.err br2684ctl[1667]: Could not configure interface:No such device or address

By passing the final used netdev name to br2684ctl_wrap another race
condition workaround will be enabled again.

Change the lantiq ptm driver to create a netdev with the name dsl as well.
Albeit the rename via 'ip link' works fine so far, using a different
approach for ptm then atm could be confusing.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin d726187367 lantiq: fix wbmr-hp-g300h image metadata
The Annex A and Annex B version are using the same (old) userspace
boardname. Update the SUPPORTED_DEVICES to allow an update from lede-17.01.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Thomas Nixon 9fc9fbeb97 lantiq: fix dts compatible string
This was broken in 7bab49fd ("lantiq: add compatible strings to dts
files"), causing for the dm200 garbled serial output during boot, and
likely other issues.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
[fix the compat string of the P2601HNFX as well]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Martin Schiller 94952636e7 lantiq: remove DSL_ChipSetHWVersion from status information
The value DSL_ChipSetHWVersion is fetched from the dsl frontend
via the dsl_control service, but not really provided by the dsl
frontend firmware and for now always "UNKNOWN".

The lantiq support told us that this information wouldn't be
provided in the foreseeable future, so let's remove this
useless "UNKNOWN" information.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
7 years ago
Hauke Mehrtens f704b643b9 kernel: Update kernel 4.9 to 4.9.70
Runtime tested on lantiq.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Mathias Kresin 4a4d957d1a lantiq: sync image filename with boardname
Use <manufacturer>_<modelname> as image name.

Use the BOARD_NAME variable to ensure that the former used boardname is
still used as the subdirectory name for the sysupgrade-tar image, to
not break sysupgrade from earlier versions.

While at it, normalise the image filenames by using only lower case
characters and bin as file extension for sysupgrade images.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 58c6ad53a8 lantiq: drop unused variable from image build code
Remove the DEVICE_PROFILE variable. The variable isn't
used at all.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 7f68bd8119 lantiq: use the generic board detect
Drop the target specific detection function in favour of the generic
one provided by base-files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin ed72540c10 lantiq: add missing model names
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 26dc65b126 lantiq: remove the former board name from device tree model
Remove the former used board name from the device model property and
use the model name as it is.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 63d7f7fc92 lantiq: use the compatible string as board name
Use the first compatible string as board name in userspace. Add the new
board name as well as the former used board name to the image metadata
to keep compatibilty with already deployed installations.

Don't add the former used boardname for boards which exists only in
master or evaluation boards.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin aba421432f lantiq: drop SoC name from eval boards compatible string
Keep it in the same format as used for the other eval boards.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 7bab49fd7a lantiq: add compatible strings to dts files
The compatible string is mandetory for devicetree source file.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Christian Lamparter da6fdce365 base-files: unify get_dt_led helper function
Lantiq and IPQ806X (which includes IPQ40XX) both define the
same custom function {ipq806x|lantiq}_get_dt_led.

This patch moves the function into the base-file package at
lib/functions/leds.sh to make it more accessible for other
targets as well.

Cc: Mathias Kresin <dev@kresin.me>
Cc: John Crispin <john@phrozen.org>
Cc: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago