Commit Graph

563 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
Ansuel Smith 71eb7b057b ipq806x: refresh patches for kernel 5.4
Refresh patches and minor changes for new kernel support

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 68b526e0a4 ipq806x: correct wrong node in r7800 dts
A mux node was missing in the gpio node of the r7800 dts.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith d4c95b5d5c ipq806x: use correct definition for nand-controller node
From kernel Documentation this should be called nand-controller

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 851862cf80 ipq806x: include ipq806x-v1.0 dtsi
Since this dtsi now have wrong definition in the upstream version,
include it to overwrite and remove any problem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 57ea767a53 ipq806x: remove skeleton definition
This was already deprecated. With kernel 5.4 it has been removed.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 9a1ec4d3f4 ipq806x: copy files to kernel 5.4
Copy files to kernel 5.4 to start porting.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Koen Vandeputte f4bea1b6a3 kernel: bump 4.14 to 4.14.171
Refreshed all patches.

Fixes:
- CVE-2013-1798

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 20b5a4ca01 kernel: bump 4.19 to 4.19.101
Refreshed all patches.

Fixes:
- CVE-2019-14896
- CVE-2019-14897

Remove upstreamed:
- 023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch
- 950-0202-staging-bcm2835-camera-fix-module-autoloading.patch
- 001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Álvaro Fernández Rojas 0c97f034c9 ipq806x: refresh kernel patches
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Ansuel Smith 5318a6dea3 ipq806x: add fab scaling support
Add fab scaling support and dtsi definition

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 0ef755b8ad ipq806x: refactor l2 freq scaling patch
Refactor l2 freq scaling patch to support voltage
scaling and add support to base cache scaling on
cpu freq scaling. Update the dtsi files with the new
definition used in the new code.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 411ad3727a ipq806x: reorganize nand_pins mux definition
It's wrong set the mux to bias-disable. The best way to
do this is by creating a separate group and disable the
specific pins.

By documentation, any subgroup with no bias definition
is ignored so the mux definition is useless.
Rework the definition by sremoving the mux subgroup and
set the remaining subgroup with the mux function and
drive-strength

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 5ba02d10ed ipq806x: opp/core: fix broken patch Handle opp voltage adjust
The opp_notifier introduced with patch 0054-Handle-OPP-voltage adjust
for some reason missed the actual registration in the opp struct,
resulting in never being registred.
This was present in kernel 4.9 patchset but dropped in the transition
 to 4.14. Reintroduce this and fix patch 0055 about L2 cache scaling.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter 80c8a9aeed ipq806x: remove CONFIG_MDIO_IPQ8064 symbol
This driver is not available on upstream.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Hauke Mehrtens b6cdc042af kernel: bump 4.19 to 4.19.93
Refreshed all patches.

The patch hack-4.19/550-loop-better-discard-for-block-devices.patch was
replaced with an new version of the patch from:
https://lore.kernel.org/patchwork/patch/1153625/
https://lore.kernel.org/patchwork/patch/1153626/

Compile-tested on: ipq40xx, lantiq
Runtime-tested on: ipq40xx, lantiq

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Adrian Schmutzler e0382e88a9 ipq806x: build DEVICE_DTS based on SOC and device name
This patch uses the SOC variable to calculate DTS names automatically
based on the SOC and the device definition node name.

This reduces redundancy and (by having to choose DTS name
appropriately) will unify the naming of a device in different places
(image/Makefile, DTS name, compatible, image name). This is supposed
to make life easier for developers and reviewers.

Since the kernel uses a "soc-device.dts" scheme for this target, we
use this for the derivation of DEVICE_DTS, too, leaving the DTS names
unchanged for this target.

Note that for some devices the kernel itself uses inconsistent names
(DTS naming scheme vs. compatible), leaving us with a manual overwrite
of DEVICE_DTS for those cases.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Ansuel Smith b04ccdb1e8 ipq806x: fix wrong definition for tsense calib
We have only 11 sensors on ipq806x. Fix the reg property
to load the right amount of data instead of the entire
space.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 77f4d5c6bb ipq806x: rework ipq806x specific tsense temp driver
Tsense driver for ipq806x have various problem.
- Emit wrong error. On probing of this driver, nvmem driver can be
  not ready and this cause a EDEFER error. Actually this is not an
  error as the kernel will retry to probe the driver after the
  nvmem driver is loaded.
- Use uninitialized value on trigger of critical temp
- Doesn't free allocated memory

Because of this, rework the driver and improve it by removing extra
load of data.

Change the logic of loading data. Use the backup calib data only
when the calib data is not present. As the calibration is only
needed to set the temp offset, we don't really need to read
both calib data and set the offset based only on the backup one.
Also change how the notifier function work. At times when we
output the trigger message, we already have read the temp so
remove the extra read and the wrong uninitialized data that
probably caused a kernel panic for null pointer exception.
(Think we never experience this bug because the router
never reached that temp ever... So just lucky)

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith a666f817a2 ipq806x: update kernel config with new driver
The config name for cpufreq driver has changed.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith c8086c7d2d ipq806x: refresh new and changed patches
Refresh patches to remove fuzz

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 62a4e4b319 ipq8065: update dtsi with new opp table
The new driver use opp table to register frequency.
Drop psv bindings as they are not used anymore.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith adc0bebd87 ipq8064: update dtsi with new opp table
The new driver use opp table to register frequency.
Drop psv bindings as they are not used anymore.
Adds speedbin definition for nvmem driver

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith e18f8e417f ipq806x: add patch to support krait cpu scaling driver
This patch has been proposed but never actually merged to
mainline. It was accepted but never re proposed by the
creator.
Rework it, fix kernel panic cause by double kfree.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith a37f787162 ipq806x: backport qcom-cpufreq-kryo patch
Backport patch applied to qcom-cpufreq-kryo
driver as krait cpu will base on this driver.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 4165f2340e ipq806x: drop old cpufreq patch
Drop old cpufreq as now we have new driver that
can use normal kernel opp definition

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith e9a982e1d9 ipq806x: opp/core: update patch updating voltage tolerance on voltage adjust
Rework 0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t
to reflect changes upstream.

- Skip unnecessary allocation of buffer to set u_volt
- Change opp u_volt directly

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 456ab9a912 ipq806x: opp/core: update patch allowing adjusting of OPP voltages at runtime
Update 0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime with
upstream version.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 5ab9c0b388 ipq806x: fix bug in L2 cache scaling
It has been notice a buf in L2 cache scaling where the scaling is not
done proprely if the frequency is set to the initial state before
the new frequency.

From: https://patchwork.kernel.org/patch/10565443/

* The clocks are set to aux clock rate first to make sure the
* secondary mux is not sourcing off of QSB. The rate is then set to
* two different rates to force a HFPLL reinit under all
* circumstances.

In the initial stage of boot to force a new frequency to apply, is
needed to first set the frequency back to the lowest one (aux_rate)
and then to the target one. This force and make sure the controller
actually switch the frequency to the right one. Apply the same
mechanism to L2 frequency scaling. Before scaling to the target
frequency, first set the frequency to the aux_rate to force the
transition, then scale it to the target frequency. Doing the wrong way
can produce unexpected results and could lock the scaling mechanism
until a full reboot is done (Causing a full reset by the krait-cc driver)

From: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=77612720a2362230af726baa4149c40ec7a7fb05

When the Hfplls are reprogrammed during the rate change,
the primary muxes which are sourced from the same hfpll
for higher frequencies, needs to be switched to the 'safe
secondary mux' as the parent for that small window. This
is done by registering a clk notifier for the muxes and
switching to the safe parent in the PRE_RATE_CHANGE notifier
and back to the original parent in the POST_RATE_CHANGE notifier.

This should apply also to L2 scaling... as we can't relly use
the notifier, we manually do this on L2 scaling.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Hauke Mehrtens f0df0d6a14 kernel: bump 4.19 to 4.19.91
Refreshed all patches.

Compile-tested on: ipq40xx, apm821xx
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Koen Vandeputte 7604e53d5f kernel: bump 4.14 to 4.14.159
Refreshed all patches.

Remove upstreamed:
- 302-0002-dmaengine-dw-implement-per-channel-protection-contro.patch

Fixes:
- CVE-2019-19332

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Hauke Mehrtens 729d7bc751 kernel: Deactivate CONFIG_SFP in generic config
Deactivate CONFIG_SFP for kernel 4.19 in the generic configuration.
The CONFIG_SFP configuration option was not set to anything in the
ath79 build for me, set it to deactivated by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Ansuel Smith 2a82e0e1ca ipq806x: switch to 4.19 kernel version
It has been used by several people for some time already and feedback
has been mostly positive.

Ref: https://github.com/openwrt/openwrt/pull/2472
Tested-by: Hannu Nyman <hannu.nyman@iki.fi> [ipq8065, R7800]
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq8065, NBG6817]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[separate commit, commit subject and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Ansuel Smith ce8707ea79 ipq806x: update USB3 modules for 4.19
- Use new dwc3-qcom usb driver.
- Drop dwc3-of-simple as we have a dedicated driver now.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[split into separate commit, commit subject facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Pavel Kubelun 77e7d6c20d ipq806x: add missing core1 voltage tolerance
Voltage tolerance is accounted per core, not per cpu, so add
missing DT entry.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 402153623d ipq806x: fix tsens driver in 4.19
Added patch:

 - 063-3 Fix tsense shared memory problem

Recent changes in ioremap_resource function are causing fails for the
memory areas which are already mapped. This changes are causing tsense
driver failures during initialization:

  qcom-tsens 900000.thermal-sensor: tsens init failed

So this patch uses simple ioremap in order to use this shared memory
space.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[commit subject and desciption facelitf]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Christian Lamparter f28e6ae7ce ipq806x: improve mdio gpios list
Improve rediability of gpio mdio list. No functional change.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[proper authorship of the patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Christian Lamparter 2296d41a1c ipq806x: ap161: fix wrong definition stdout
From documentation
https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt
should be just stdout-path

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[proper authorship of the patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Christian Lamparter 044c79689b ipq806x: ap148: reorganize dts
Reorganize dts to use tags from ipq8064 dtsi

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter fe26364065 ipq806x: d7800: fix warning on dtc compilation
There is warning with "property has invalid length (4 bytes)"
related to nand definition. Set size-cells to zero to fix this.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter 1acc054341 ipq806x: r7800: add missing wifi definition for pcie
Add missing wifi compatible definition for r7800 device.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter 2da033eaa6 ipq806x: use ipq8064 dedicated watchdog
Add missing watchdog to list of compatible timers

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter df35293000 ipq806x: add nand and sata tags
Add some tags for nand and sata structure to easily
reference them in other dts.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter 5ce72009ac ipq806x: increase drive-strength for pinmux
Increase drive-strength from
https://lore.kernel.org/patchwork/patch/626885/

2mA drive strength is not enough when we connect multiple i2c devices
on the bus with different pull up resistors.

This issue was detected when multiple i2c devices
connected on the other side of level shifters on Linaro sensor board.
Maxing up to 16mA made i2c much stable.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter 9e7a8beb9c ipq806x: add missing gpio and gsbi declaration
Adds missing gpio and gsbi declaration.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 2336c2dbb1 ipq806x: disable spc on ipq8065 soc
Spc is disabled in ipq8065 board as it does cause cpu lockup
(probably caused by wrong register being set)

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 71b1062230 ipq806x: set apq8064 regulator to support cpuidle
Set qcom,apq8064-saw2-v1.1-cpu as regulator to make cpuidle work.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter 61505922dc ipq806x: convert ipq8064 dtsi interrupts
Convert hardcoded interrupts value to types defined in gci include file.
Interrupts sets to 0 are converted to IRQ_TYPE_LEVEL_HIGH to fix
kernel warning. Same fix has been applied to arm64 dts.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1797143
https://patchwork.kernel.org/patch/10367453/
https://patchwork.kernel.org/patch/10315315/

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter afcb78f103 ipq806x: use new usb3 implementation
Use new usb3 implementation and refresh dts to the new dwc3 structure

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[proper authorship of the patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Christian Lamparter 96a509eeeb ipq806x: fix missing compatible and rename
- ipq8064 compatible was missing from nbg6817.
- Rename ap148 with a better descriptive name.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[proper authorship of the patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Christian Lamparter 9e9fe2392e ipq806x: convert ok to okay in dts
DT spec require okay instead of ok in dts files

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Christian Lamparter 63066d3006 ipq806x: refresh 4.19 patches
Reworked:

 - 0034 patchset update

Added:

 - 080 Add support for pinctrl-msm framework

Removed:

 - 0074-ipq806x-usb-Control-USB-master-reset.patch
   (we now have a dedicated driver for qcom usb)

 - 0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke
   (merged upstream)

 - 310-msm-adhoc-bus-support
   (it looks like it was never actually used in any dts)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[commit subject and description facelift, SoB fix]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Ansuel Smith f81e148eb6 ipq806x: update 4.19 kernel config
These changes are needed in order to migrate old kernel 4.14 config to
the upcoming kernel version 4.19.  Also add missing configuration
options that comes up with this SoC.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[line wrap long commit description, add 4.19 to subject, soc->SoC]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Ansuel Smith c5d2f3c476 ipq806x: copy files from 4.14 to 4.19
This copies files from files-4.14 to files-4.19 directory in order to
get clear diffs for any changes done from now on.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[added missing commit description, refreshed ea8500 and wpq864 DTS]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Koen Vandeputte d395583d69 kernel: bump 4.14 to 4.14.158
Refreshed all patches.

Altered patches:
- 400-mtd-add-rootfs-split-support.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 414b7c107a kernel: bump 4.14 to 4.14.156
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte db9e9e8382 kernel: bump 4.14 to 4.14.155
Refreshed all patches.

Altered patches:
- 707-dpaa-ethernet-support-layerscape.patch

Remove upstreamed:
- 034-v4.20-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch
- 001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch
- 073-qcom-ipq4019-fix-cpu0-s-qcom-saw2-reg-value.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte d6aea46a50 kernel: bump 4.14 to 4.14.154
Refreshed all patches.

Altered patches:
- 902-debloat_proc.patch
- 040-dmaengine-qcom-bam-Process-multiple-pending-descript.patch
- 807-usb-support-layerscape.patch
- 809-flexcan-support-layerscape.patch
- 816-pcie-support-layerscape.patch

Remove upstreamed:
- 150-MIPS-bmips-mark-exception-vectors-as-char-arrays.patch
- 303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch

New symbols:
X86_INTEL_MPX
X86_INTEL_MEMORY_PROTECTION_KEYS
X86_INTEL_TSX_MODE_OFF
X86_INTEL_TSX_MODE_ON
X86_INTEL_TSX_MODE_AUTO
SGL_ALLOC

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Petr Štetiar 04d6753d03 Revert "ipq806x: fix EA8500 switch control"
There is a problem with the EA8500, the switch will not work after soft
reboot, the only way to get it working again is to power cycle it
manually.

There are probably several issues in the play, it's quite hard to fix it
without having access to the actual device, so I don't see any other
option now, then revert the offending commit.

Ref: PR#2047
Fixes: FS#2168 ("Switch no longer work after restart on Linksys EA8500")
Reported-by: Adam <424778940z@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
David Bauer 70d5989c9c ipq806x: use switch trigger for WAN LED on NETGEAR boards
With this commit, the WAN LED is triggered by the switch port state
instead of the eth0 netdev.
Otherwise, the LED is always illuminated, regardless of the WAN port
link state.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Christian Lamparter 54d9ac8ba8 ipq806x: WPQ864: fix partition unit-address
This patch fixes what seems to be a simple copy & paste
error with the unit-address of the BOOTCONFIG partition.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Adrian Schmutzler 48b5d08a48 treewide: use a single ath10k MAC patching function with checksum
While all ath10k eeproms have a checksum field, so far two
functions for patching ath10k MAC address have been present (and
been used).

This merges code to provide a single function ath10k_patch_mac
in caldata.sh, having its name in accordance with ath9k functions.
By doing so, correct MAC patching for current and future ath10k
devices should be ensured.

This patch adds checksum adjustments for several targets on
ath79 and lantiq.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 2c60de0e3f treewide: move MAC address patch functions to common library
This unifies MAC address patch functions and moves them to a
common script. While those were implemented differently for
different targets, they all seem to do the same. The number of
different variants is significantly reduced by this patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 5b6a809092 treewide: move calibration data extraction function to library
This moves the almost identical calibration data extraction
functions present multiple times in several targets to a single
library file /lib/functions/caldata.sh.

Functions are renamed with more generic names to merge different
variants that only differ in their names.

Most of the targets used find_mtd_chardev, while some used
find_mtd_part inside the extraction code. To merge them, the more
abundant version with find_mtd_chardev is used in the common code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[rebase on latest master; add mpc85xx]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler c1388a2deb base-files: move xor() from caldata extraction to functions.sh
The xor() function is defined in each of the caldata extraction
scripts for several targets. Move it to functions.sh to reduce
duplicate code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 794d4b6652 treewide: remove kmod-usb-core from DEVICE_PACKAGES
This removes _all_ occurrences of kmod-usb-core from
DEVICE_PACKAGES and similar variables.

This package is pulled as dependency by one of the following
packages in any case:
- kmod-usb-chipidea
- kmod-usb-dwc2
- kmod-usb-ledtrig-usbport
- kmod-usb-ohci
- kmod-usb2
- kmod-usb2-pci
- kmod-usb3

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[remove kmod-usb-core from EnGenius ESR600]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Eneas U de Queiroz 9de9e9c6c5 ipq806x: remove unsupported hw-crypto qce driver
The following symbols, selected by the qce driver were removed:
	CONFIG_CRYPTO_CBC
	CONFIG_CRYPTO_CTR
	CONFIG_CRYPTO_DES
	CONFIG_CRYPTO_DEV_QCE
	CONFIG_CRYPTO_ECB
	CONFIG_CRYPTO_NULL
	CONFIG_CRYPTO_SEQIV
	CONFIG_CRYPTO_XTS

CONFIG_CRYPTO_GF128MUL was removed as well, since it is only needed by
some cipher modes (LRW, GCM), none of which are selected, and it is
packaged as a module.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
5 years ago
Adrian Schmutzler f8d9648529 ipq806x: provide label MAC address
This patch adds the label MAC address for several devices in
ipq806x.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rafał Miłecki 641f6b6c26 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable
It's a variable set by procd that should replace hardcoded
/tmp/sysupgrade.tgz.

This change requires the most recent procd with the commit 0f3c136
("sysupgrade: set UPGRADE_BACKUP env variable").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 62dbe361a1 treewide: when copying a backup file always specify dest name
$CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz.
This change makes code more generic and allows refactoring $CONF_TAR.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki bf39047872 treewide: don't hardcode "sysupgrade.tgz" file name
1) Add BACKUP_FILE and use it when copying an archive to be restored
   after sysupgrade (on the next preinit).
2) Use CONF_TAR for copying backup prepared by the /sbin/sysupgrade

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Adrian Schmutzler d94a3f328f ipq806x: Replace backticks by $(...)
This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Paul Spooren 853e4dd306 ipqx0xx: add Generic subtarget
Both targets miss a subtarget causing an image naming style which is
different from other all othe targets, even tho it already uses
`x/generic/` as subfolder as if the subtarget would exist.

This commit adds the Generic subtarget resulting in consistent naming.

    ~/src/openwrt/openwrt/bin/targets/ipq806x/generic$ ls
    openwrt-ipq806x-generic-netgear_d7800-initramfs-uImage
    openwrt-ipq806x-generic-netgear-d7800.manifest
    openwrt-ipq806x-generic-netgear_d7800-squashfs-factory.img
    openwrt-ipq806x-generic-netgear_d7800-squashfs-sysupgrade.bin

CC: John Crispin <john@phrozen.org>

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years ago
Chuanhong Guo 92e60260d5 treewide: sync bootcount scripts across targets
This commit made the following changes to sync all bootcount scripts:

1. use boot() instead of start()
    This script only needs to be executed once when boot is complete.
    use boot() to make this explicit.

2. drop sourcing of /lib/functions.sh
    This is aready done in /etc/rc.common.

3. ramips: replace board name checking with a case

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler b133e466b0
treewide: convert WiFi caldata size and offset to hexadecimal
This changes size and offset set for WiFi caldata extraction and
MAC address adjustment to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-cal-data in DTS files.

Since dd cannot deal with hexadecimal notation, one has to convert
back to decimal by simple $(($hexnum)).

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 75bfc393ba treewide: convert MAC address location offsets to hexadecimal
This changes the offsets for the MAC address location in
mtd_get_mac_binary* and mtd_get_mac_text to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-mac-address in DTS files.

(e.g. 0x1006 and 0x5006 are much more useful than 4102 and 20486)

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Moritz Warning 2afb3a56f1 ipq806x: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Rafał Miłecki 1cbe0d659c treewide: sysupgrade: get rid of platform_nand_pre_upgrade()
1) nand_do_upgrade() is always called by a target code
2) nand_do_upgrade() starts with calling platform_nand_pre_upgrade()

It means there is no need for the platform_nand_pre_upgrade() callback
at all. All code that was present there could bo moved & simplly called
by a target right before the nand_do_upgrade().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 8b4bc7abe0 treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()
stage2 passes image path to platform_do_upgrade() as an argument so it
can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Koen Vandeputte f442b306f9 kernel: bump 4.14 to 4.14.120
Refreshed all patches.

Remove upstreamed:
- 103-MIPS-perf-ath79-Fix-perfcount-IRQ-assignment.patch
- 060-fix-oxnas-rps-dt-match.patch

Altered patches:
- 0067-generic-Mangle-bootloader-s-kernel-arguments.patch
- 006-mvebu-Mangle-bootloader-s-kernel-arguments.patch
- 996-generic-Mangle-bootloader-s-kernel-arguments.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Jeff Kletsky b3770eaca3 mtd: base-files: Unify dual-firmware devices (Linksys)
Consistently handle boot-count reset and upgrade across
ipq40xx, ipq806x, kirkwood, mvebu

Dual-firmware devices often utilize a specific MTD partition
to record the number of times the boot loader has initiated boot.

Most of these devices are NAND, typically with a 2k erase size.
When this code was ported to the ipq40xx platform, the device in hand
used NOR for this partition, with a 16-byte "record" size. As the
implementation of `mtd resetbc` is by-platform, the hard-coded nature
of this change prevented proper operation of a NAND-based device.

* Unified the "NOR" variant with the rest of the Linksys variants

* Added logging to indicate success and failure

* Provided a meaningful return value for scripting

* "Protected" the use of `mtd resetbc` in start-up scripts so that
   failure does not end the boot sequence

* Moved Linksys-specific actions into common `/etc/init.d/bootcount`

For upgrade, these devices need to determine which partition to flash,
as well as set certain U-Boot envirnment variables to change the next
boot to the newly flashed version.

* Moved upgrade-related environment changes out of bootcount

* Combined multiple flashes of environment into single one

* Current-partition detection now handles absence of `boot_part`

Runtime-tested: Linksys EA8300

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[checkpatch.pl fixes, traded split strings for 80+ chars per line]
5 years ago
Koen Vandeputte af6c86dbe5 kernel: bump 4.14 to 4.14.108
Refreshed all patches.

Altered patches:
- 950-0033-i2c-bcm2835-Add-debug-support.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Wang Xin-yu (王昕宇) 57b1e951b5 ipq806x: Enlarge R7500v2 flash - use netgear partition
This patch increases available space from 20MB to 86MB.
Netgrear OEM firmware contains a 'netgear' partition followed 'ubi',
which can be used in openwrt for larger ubi space. (similar to
Netgear R7800).

original author (notmyrealhandle) tested this on R7500v2 and point that
OEM firmware can auto rebuild this partition (if used by openwrt).

Author: notmyrealhandle<22336358+notmyrealhandle@users.noreply.github.com>
Signed-off-by: Wang Xin-yu (王昕宇) <comicfans44@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [minor touch-ups]
5 years ago
INAGAKI Hiroshi 9c7fd17f4a ipq806x: fix LED configuration for NEC Aterm WG2600HP
NEC WG2600HP uses port1 on QCA8337 as a WAN port, so "0x2" should
be used as a portmask instead of "0x1e" for "WAN" LED configuration.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
Koen Vandeputte 3a2668c6d5 kernel: bump 4.14 to 4.14.102
Refreshed all patches.

Remove upstreamed:
- 272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch

Remove upstreamed hunks:
- 080-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch

Fixes:
- CVE-2018-1000026

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Roman Glova 064e431575 ipq8064: Enabling sata port ipq8064 based devices
(original text here: https://patchwork.kernel.org/patch/8686761/)

On some SOCs PORTS_IMPL register value is never programmed by the BIOS
and left at zero value. Which means that no sata ports are avaiable for
software. AHCI driver used to cope up with this by fabricating the
port_map if the PORTS_IMPL register is read zero, but recent patch
broke this workaround as zero value was valid for nvme disks.
This patch adds ports-implemented dt bindings as workaround for this issue
in a way that DT can dictate the port_map incase where the SOCs does not
program it already.

This patch is equal to commits:
67f8425d0ee1 ("ipq8064: dts: force AP148 SATA port mapping")
2e7a2c91019c ("ARM: dts: qcom: Move common nodes to ipq8064-v.1.0.dtsi")
in the upstream linux kernel.

Signed-off-by: Roman Glova <roman_glova@epam.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[added upstream commits, reorg' commit message]
5 years ago
Koen Vandeputte 9a1d7ff187 kernel: bump 4.14 to 4.14.99
Refreshed all patches.

Remove upstreamed:
- 950-0434-mmc-bcm2835-Recover-from-MMC_SEND_EXT_CSD.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Petr Štetiar 6928d06a7e ipq806x: dts: Unify naming of gpio-led nodes
In DTS Checklist[1] we're now demanding proper generic node names, as
the name of a node should reflect the function of the device and use
generic name for that[2]. Everybody seems to be copy&pasting from DTS
files available in the repository today, so let's unify that naming
there as well and provide proper examples.

1. https://openwrt.org/submitting-patches#dts_checklist
2. https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#generic-names-recommendation

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [split up]
5 years ago
Petr Štetiar 93c30bef7c ipq806x: dts: Unify naming of gpio-keys nodes
In DTS Checklist[1] we're now demanding proper generic node names, as
the name of a node should reflect the function of the device and use
generic name for that[2]. Everybody seems to be copy&pasting from DTS
files available in the repository today, so let's unify that naming
there as well and provide proper examples.

1. https://openwrt.org/submitting-patches#dts_checklist
2. https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#generic-names-recommendation

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [split up]
5 years ago
Koen Vandeputte f56a4e809b kernel: bump 4.14 to 4.14.91
Refreshed all patches.

Removed upstreamed:
- 500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
INAGAKI Hiroshi 51fe956c4f ipq806x: add support for Buffalo WXR-2533DHP
Buffalo WXR-2533DHP is a 2.4/5 GHz band 11ac router, based on Qualcomm
IPQ8064.

The U-Boot on WXR-2533DHP employs a complicated dual firmware
protection scheme against corruptions of the kernel and rootfs
images. See the notes in buffalo.sh for details.

specifications:

- Qualcomm IPQ8064 (384 - 1,400 MHz, 2C2T)
- 512 MB of RAM (DDR3)
- 256 MB of Flash (NAND)
- 4T4R 2.4/5 GHz Wlan (QCA9980)
- 5x 10/100/1000 Mbps Ethernet
- 10x LEDs, 8x keys (6x buttons, 2x slide-switches)
- 2x USB 3.0 Type-A
- 12VDC/4A AC Adapter
- UART through-hole on PCB
  - J3: Vcc, GND, TX, RX from USB port side
  - 115200n8

Boot instructions for the initramfs image:

1. Prepare the TFTP server with the initramfs image renamed to
   "wxr2300dhp-initramfs.uImage" and IP address "192.168.11.10".
2. Press the "AOSS" button while powering on the WXR-2533DHP.
3. Wait until the "Wireless" LED flashes before releasing the AOSS button.
   The WXR-2533DHP will grab the image from TFTP server and will boot it.

Flashing instructions:

To persistently write the firmware, flash an openwrt sysupgrade image
from inside the initramfs, for example transfer
via `scp <sysupgrade> root@192.168.1.1:/tmp` and flash on the device
with `sysupgrade -n /tmp/<sysupgrade>`. Then wait ~120 seconds to
let it finish the flashing process.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [reworded message]
5 years ago
INAGAKI Hiroshi 250f5ec139 ipq806x: add ramdisk feature
This commits adds the "ramdisk" feature to ipq806x target. The
main driving force behind this decision is to facilitate the
installation of OpenWrt on some locked IPQ806x devices.

Examples:

- NEC Aterm WG2600HP

  The U-Boot on WG2600HP is protected with a password which prevents
  users from gaining access to the u-boot prompt in order to install
  the images from there.

  Therefore, on this device, installing OpenWrt by the user involves
  changing the bootcmd as follows so that WG2600HP downloads and
  executes initramfs image from TFTP server.

  ex.:
    bootcmd="ping ${serverip} && tftpboot 0x44000000 wg2600hp-initramfs.bin; bootipq"

- Buffalo WXR-2533DHP

  The U-Boot on WXR-2533DHP has built-in firmware recovery mode.
  It's activated by holding the "AOSS" button during boot. This
  will trigger the device to download the firmware from an TFTP
  server and booting from it. By using this, the user  can the
  install OpenWrt firmware without having access to the UART
  console.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [reworded commit]
5 years ago
Stefan Lippers-Hollmann 6b63595fec ipq806x: drop kernel/ rootfs partition images for the ZyXEL NBG6817
Since commit 8e9a59a6b9 (build: add
mkrasimage) a proper factory image can be provided for the ZyXEL
NBG6817, which can be flashed from the OEM firmware or used for
tftp based push-button recovery, therefore the previously used
partition images for mmcblk0p5-rootfs.bin and mmcblk0p4-kernel.bin
are no longer required (and using them properly has always been
slightly difficult and risky) and can now be dropped from the image
generation code.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
5 years ago
Christian Lamparter 330965b342 ipq806x: add ath10k calibration data MAC addresses patching
Ben Greear reported in his patch:
|Subject: netgear r7800: Fix mac address of radios.
|
|Reloading the driver causes the phyX to change, and that
|caused the MAC address to change.

This is because all ODM/OEMs except QCA bothered to write
the correct MAC address for the ath10k wifi into the
calibration data.

This patch copies over the MAC patching helper functions from ipq40xx's
target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
file and converts all the devices to patch the correct MACs into the
extracted calibration data before it gets sent to the driver, which sets
up the device with the correct MAC address. It also removes the entries
in the 10_fix_wifi_mac file as they have served their purpose for good.

Please note the C2600: There is conflicting information on what
the offset for the second wifi is supposed to be. This patch uses
what was specified in 10_fix_wifi_mac.

According to Ben Greear this method is save to use with the
stock firmware too. As he explained that the stock firmware
messes up rx-bssid mask calculation when the MAC is changed
after the first vif is created.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
INAGAKI Hiroshi 3198ec5b9d ipq806x: fix and cleanup dts for NEC WG2600HP
This commit fixes and cleanups qcom-ipq8064-wg2600hp.dts to improve the
support for WG2600HP.

- Use dt label in qcom-ipq8064.dtsi:

  - gmac1
  - gmac2
  - gsbi4
    - gsbi4_serial
  - gsbi5
  - hs_phy_0
  - ss_phy_0
  - usb3_0
  - usb3_1
  - pcie0
  - pcie1
  - qcom_pinmux

- Fix wrong pcie reset (perst) gpios

  - drop reset-gpio and use perst-gpios in qcom-ipq8064.dtsi

- Remove unnecessary dt label from device dts

  - flash
  - phy0, phy4

- Rename spi-nor node to "flash" from "m25p80"

- Fix qca,ar8327-initvals

  - use oem settings

    - fix: PAD0_MODE, PAD6_MODE
    - drop: PAD5_MODE (unnecessary)

- Move mtd partitions under partitions (fixed-partitions) node

- Specify "firmware" partition format

  - WG2600HP uses uImage format (denx,uimage)

- Change failsafe status LED to power_red

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Koen Vandeputte 0028f86687 kernel: bump 4.14 to 4.14.86
Refreshed all patches.

Altered patches:
- 180-usb-xhci-add-support-for-performing-fake-doorbell.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Petr Štetiar 9da6cd40eb apm821xx, ath79, ipq40xx, ipq806x, lantiq, ramips: base-files: Use generic diag.sh
I wanted to add status LEDs support to my imx6 based board and have found out,
that I could use diag.sh script found in ramips platform, which seems to be
also shared in a few other platforms:

 4801276bc2078c5bcf03003c831e3b0a target/linux/ramips/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ipq40xx/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ath79/base-files/etc/diag.sh

And @chunkeey suggested to me, that I can also add lantiq, ipq806x and
apm821xx to the list of platforms which could share this generic
diag.sh.

I've extended the base diag.sh in a way, that if it detects any of the
DTS LED aliases, then it would use the generic DTS set_led_state code.
The code in platform's diag.sh has moved to base-files package in this
commit:

 base-files: diag.sh: Make it more generic towards DTS so it could be reused

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Christian Lamparter <chunkeey@gmail.com> (apm821xx and ipq40xx)
6 years ago
Ram Chandra Jangir 9ed180b000 ipq806x: dts: Add support for RGMII RX and TX clock delays
This change enables support to select phy4 in RGMII mode and
enables RGMII TX/RX clock internal delays.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
6 years ago
Ram Chandra Jangir dc6af37544 ipq806x: Add support for IPQ8064 AP161 board
Specification:
   - SoC: Qualcomm Atheros IPQ8064 ARM-v7 Dual Core SMP CPU
   - RAM: 512MB DDR3 System Memory
   - NOR Flash: 32MB SPI NOR
   - NAND Flash: 256MB NAND
   - Ethernet: 5 x 1G via QCA8337N
   - USB: 2 x USB 3.0 SuperSpeed
   - PCIe: 3x Mini PCIe 2.0 Slots
	   Three PCIE2.0 connectors can connect two or three radio cards
           such as the CUS260 for 2.4 GHz WLAN and the CUS239 for 802.11ac WLAN

 How to flash via u-boot console:
   tftpboot 0x44000000 openwrt-ipq806x-qcom_ipq8064-ap161-squashfs-nand-factory.bin
   nand erase  0x1340000 0x4000000
   nand write  0x44000000 0x1340000 $filesize
   setenv bootargs ‘console=ttyMSM0,115200 ubi.mtd=ubi root=/dev/ubiblock0_1’
   saveenv
   bootm

 Further upgrades via sysupgrade.

 Tested on IPQ8064 AP161 Board:
   1) 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>
6 years ago
Ram Chandra Jangir 1ade96def7 ipq8064: pinctrl: Fixed missing RGMII pincontrol definitions
Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
6 years ago
Ben Greear 38167cb7f4 hotplug: Allow configuring radio name.
This way the radio (phy) name can be the same through module reloads.

To set the desired name:

uci set wireless.@wifi-device[0].phyname=wiphy0

I guess this only works on ipq6086 boards as I could not find a more
generic place to put this.  Maybe someone can improve it.

Signed-off-by: Ben Greear <greearb@candelatech.com>
6 years ago