Commit Graph

703 Commits

Author SHA1 Message Date
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>
2020-01-08 14:30:43 +01:00
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>
2020-01-08 14:30:43 +01:00
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>
2020-01-08 14:30:43 +01:00
Christian Lamparter 80c8a9aeed ipq806x: remove CONFIG_MDIO_IPQ8064 symbol
This driver is not available on upstream.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-01-05 19:01:52 +01:00
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>
2020-01-05 00:43:36 +01:00
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>
2019-12-27 18:00:32 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:42 +01:00
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>
2019-12-26 08:31:41 +01:00
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>
2019-12-26 08:31:41 +01:00
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>
2019-12-26 08:31:41 +01:00
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>
2019-12-24 17:45:33 +01:00
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>
2019-12-24 01:22:45 +01:00
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>
2019-12-23 15:25:36 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-19 22:41:57 +01:00
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>
2019-12-10 09:50:42 +01:00
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>
2019-11-29 09:59:49 +01:00
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>
2019-11-22 16:56:46 +01:00
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>
2019-11-19 14:59:03 +01:00
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>
2019-11-06 00:21:15 +01:00
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>
2019-11-04 18:50:53 +01:00
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>
2019-10-18 21:05:34 +02:00
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>
2019-10-15 18:13:54 +02:00
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>
2019-10-14 12:36:02 +02:00
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>
2019-10-13 21:48:58 +02:00
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>
2019-10-13 19:03:57 +02:00
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>
2019-10-06 21:28:49 +02:00
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>
2019-09-29 00:46:13 +02:00
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>
2019-09-19 23:43:27 +02:00
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>
2019-09-05 23:33:19 +02:00
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>
2019-09-05 14:33:20 +02:00
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>
2019-09-05 14:33:19 +02:00
Adrian Schmutzler d94a3f328f ipq806x: Replace backticks by $(...)
This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-08-31 12:08:23 +02:00
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>
2019-08-22 21:15:28 +02:00
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>
2019-08-17 23:52:34 +08:00
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>
2019-08-14 12:36:37 +02:00
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>
2019-08-14 12:10:12 +02:00
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>
2019-08-02 22:45:02 +02:00
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>
2019-07-22 14:27:37 +02:00
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>
2019-07-17 08:05:38 +02:00
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>
2019-05-21 09:45:15 +02:00
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]
2019-05-18 13:43:51 +02:00
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>
2019-03-27 10:48:59 +01:00
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]
2019-03-18 20:55:52 +01:00
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>
2019-02-28 11:54:09 +01:00
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>
2019-02-22 10:53:42 +01:00
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]
2019-02-14 16:56:15 +01:00
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>
2019-02-14 16:45:01 +01:00
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]
2019-01-24 15:53:03 +01:00
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]
2019-01-24 15:53:03 +01:00
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>
2019-01-07 17:09:06 +01:00
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]
2019-01-01 16:39:59 +01:00
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]
2019-01-01 15:40:13 +01:00
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>
2018-12-17 00:21:34 +01:00
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>
2018-12-15 21:06:11 +01:00
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>
2018-12-12 18:59:01 +01:00
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>
2018-12-10 11:48:44 +01:00
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)
2018-12-06 08:42:40 +01:00
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>
2018-12-06 08:15:50 +01:00
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>
2018-11-26 12:05:46 +01:00
Ram Chandra Jangir 1ade96def7 ipq8064: pinctrl: Fixed missing RGMII pincontrol definitions
Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2018-11-26 12:05:46 +01:00
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>
2018-11-26 12:05:45 +01:00
Koen Vandeputte e14dc93073 kernel: bump 4.14 to 4.14.81
Refreshed all patches.

Removed upstreamed patches:
- 081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch

Altered patches:
- 0054-cpufreq-dt-Handle-OPP-voltage-adjust-events

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-11-14 16:27:43 +01:00
Koen Vandeputte c764b2b531 kernel: bump 4.14 to 4.14.79
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-11-05 16:00:00 +01:00
Koen Vandeputte ca88f4153f kernel: bump 4.14 to 4.14.77
Refreshed all patches.

Altered patches:
- 666-Add-support-for-MAP-E-FMRs-mesh-mode.patch

New symbol for arm targets:
- HARDEN_BRANCH_PREDICTOR

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-10-19 10:01:57 +02:00
Mathias Kresin 80c61c161a treewide: use wpad-basic for not small flash targets
Add out of the box support for 802.11r and 802.11w to all targets not
suffering from small flash.

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

Mathias did all the heavy lifting on this, but I'm the one who should
get shouted at for committing.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-10-16 15:07:41 +01:00
Koen Vandeputte a2adeffffc kernel: bump 4.14 to 4.14.74
Refreshed all patches.

Fixes CVE:

- CVE-2018-7755

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-10-04 16:15:03 +02:00
Christian Lamparter 63a7cf6791 treewide: replace 'linux, stdout-path' with 'stdout-path'
This follows a similar upstream patch by Rob Herring:

|commit 78e5dfea84dc15d69940831b3981b3014d17222e
|Author: Rob Herring <robh@kernel.org>
|Date:   Wed Feb 28 16:44:06 2018 -0600
|    powerpc: dts: replace 'linux,stdout-path' with 'stdout-path'
|
|    'linux,stdout-path' has been deprecated for some time in favor of
|    'stdout-path'. Now dtc will warn on occurrences of 'linux,stdout-path'.
|    Search and replace all the of occurrences with 'stdout-path'.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-09-29 17:23:11 +02:00
Hauke Mehrtens 3fa7e62cec mac80211: fix selecting of ath10k -ct firmware
There is not firmware file with -ct-ct postfix, remove one -ct.

Fixes: 61b5b4971e ("mac80211: make ath10k-ct the default ath10k")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2018-09-27 00:22:13 +02:00
John Crispin 61b5b4971e mac80211: make ath10k-ct the default ath10k
We select ath10k-ct by default, but it is still possible to build
the upstream version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John Crispin <john@phrozen.org>
2018-09-26 16:39:44 +02:00
Koen Vandeputte e9d92bf1e1 kernel: bump 4.14 to 4.14.72
Refreshed all patches.

Removed upstreamed:
- 203-MIPS-ath79-fix-restart.patch
- 0013-MIPS-ath79-fix-system-restart.patch
- 180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch
- 181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon. patch
- 700-1-6-e1000e-Remove-Other-from-EIAC.patch
- 700-2-6-Partial-revert-e1000e-Avoid-receiver-overrun-interrupt-bursts.patch
- 700-3-6-e1000e-Fix-queue-interrupt-re-raising-in-Other-interrupt.patch
- 700-4-6-e1000e-Avoid-missed-interrupts-following-ICR-read.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-09-26 15:54:18 +02:00
Koen Vandeputte 01793e8752 kernel: bump 4.14 to 4.14.67
Refreshed all patches.

Removed upstreamed patches:
- 037-v4.18-0008-ARM-dts-BCM5301x-Fix-i2c-controller-interrupt-type.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-08-28 23:05:39 +02:00
David Bauer 8e9a59a6b9 build: add mkrasimage
The current make-ras.sh image generation script for the ZyXEL NBG6617
has portability issues with bash. Because of this, factory images are
currently not built correctly by the OpenWRT buildbots.

This commit replaces the make-ras.sh by C-written mkrasimage.

The new mkrasimage is also compatible with other ZyXEL devices using
the ras image-format.
This is not tested with the NBG6616 but it correctly builds the
header for ZyXEL factory image.

Signed-off-by: David Bauer <mail@david-bauer.net>
2018-08-28 11:26:53 +02:00
Paul Wassi e348ccc4e6 treewide: fix some cosmetic glitches in dts files
- fix single spaces hidden by a tab
- replace indentation with spaces by tabs
- make empty lines empty
- drop trailing whitespace
- drop unnecessary blank lines

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
2018-08-27 19:31:17 +02:00
Mathias Kresin dd448cd276 treewide: fix upgrade led handling
The upgrade led is only used if a running led is defined. If no running
led is defined, the upgrade led is ignored and upgrade isn't indicated
at all.

Instead, turn off the running led prior to turning the upgrade led on.
In most cases there isn't any visual change, but it allows to use an
independent led for upgrade indication.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-08-16 21:20:57 +02:00
Mathias Kresin 56b8ac1e86 treewide: consolidate upgrade state set
Set the (sys)upgrade state when sourcing the stage2 script instead of
setting the state for each target individual.

This change fixes the, due to a missing state set, not working upgrade
led on ath79 and apm821xx.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-08-16 21:20:57 +02:00
Rosen Penev e22cc57593 ipq806x: dts: Remove device_type = "ethernet-phy"
device_type is deprecated. Upstream doesn't seem to like it either.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-07-19 18:58:24 +02:00
Aleksandr V. Piskunov 36fea5a7b9 ipq806x: fix numbering for Netgear R7800 LAN ports
Netgear R7800 switch LAN ports are numbered backwards in LuCI,
i.e. numbering is not corresponding to the actual physical port labels,
patch fixes that.

Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
[merged with existing board using the same config]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-07-04 01:20:02 +02:00
Mathias Kresin 750e4b62b1 ipq806x: drop gpio export patch
The hack isn't used by any board.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-06-28 18:39:57 +02:00
Stefan Lippers-Hollmann 7c7ca66109 ipq806x: switch the NBG6817 wlan LEDs from amber to white
The original device support patch configured the amber wlan LEDs (which
are meant as error indicator by the OEM) controlled by the SOC's GPIO
as wlan traffic indicators, as the correct white wlan LEDs are
connected to GPIOs controlled by the QCA9984/ ath10k wlan cards were
not accessible. The recent addition of GPIO/ LED support to ath10k now
makes it possible to use the correct white LEDs instead - and
"mac80211: ath10k: use tpt LED trigger by default" also enables them by
default. While both LEDs are independent of each other (two separate
LEDs sharing one light tunnel), triggering both on wlan traffic is not
the intended behaviour (bright yellow light).

Tested on the ZyXEL NBG6817.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2018-06-28 18:39:57 +02:00
Hannu Nyman 7b74b40fe9 ipq806x: remove "firmware" partition definition from netgear routers
Remove the "firmware" partition definition from the DTS of R7800
to fix sysupgrade.

Commit 4645a6d3 defined CONFIG_MTD_SPLIT_UIMAGE_FW=y for ipq806x
and that causes mtd to misbehave as additional kernel and ubi
partitions are detected from inside the "firmware" partition.
  [    1.111324] 0x000001480000-0x000001880000 : "kernel"
  [    1.121005] 0x000001880000-0x000007900000 : "ubi"
  [    1.283912] 0x000007900000-0x000008000000 : "reserve"
  [    1.296407] 0x000001480000-0x000007900000 : "firmware"
  [    1.468043] no rootfs found after FIT image in "firmware"
  [    2.426860] 2 uimage-fw partitions found on MTD device firmware
  [    2.426931] 0x000001480000-0x000001880000 : "kernel"
  [    2.440420] 0x000001880000-0x000007900000 : "ubi"

Both kernel and ubi are already defined in DTS, so this duplication
leads into errors in sysupgrade:
  Writing from <stdin> to kernel ...
  ubiattach: error!: strtoul: unable to parse the number '6 mtd10'
  ubiattach: error!: bad MTD device number: "6 mtd10"

The partition is defined to same area as kernel+ubi, and is not
needed for sysupgrade anymore. Remove it to fix things.

Only tested for the R7800 but all of them should behave equal.

Fixes: FS#1617

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
[squashed commits, add "tested on" note]
Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-06-27 22:11:06 +02:00
Kevin Darbyshire-Bryant 094d49cddf kernel: bump 4.14 to 4.14.51
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Refresh patches.

Remove patch that can be reverse applied:
mvebu/patches-4.14/530-ATA-ahci_mvebu-enable-stop_engine-override.patch
mvebu/patches-4.14/531-ATA-ahci_mvebu-pmp-stop-errata-226.patch

Update patch that no longer applied:
ipq806x/patches-4.14/0035-clk-mux-Split-out-register-accessors-for-reuse.patch

Compiled-tested-for: lantiq, ramips
Run-tested-on: lantiq BT hh5a, ramips MIR3g

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tested-by: Michael Yartys <michael.yartys@protonmail.com>
Tested-by: Rosen Penev <rosenp@gmail.com>
2018-06-26 08:57:21 +02:00
INAGAKI Hiroshi 4645a6d318 ipq806x: add support for NEC Aterm WG2600HP
NEC Aterm WG2600HP is a 2.4/5 GHz band 11ac router, based on Qualcomm
IPQ8064.

Specification:

- IPQ8064 (384 - 1,400 MHz)
- 512 MB of RAM
- 32 MB of Flash (SPI)
- 4T4R 2.4/5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 12x LEDs, 4x keys
- 1x USB 3.0 Type-A
- UART header on PCB
  - RX, TX, NC, GND, Vcc from power connector side
  - baudrate: 115200 bps

Flash instruction using initramfs image:
1. Connect serial cable to UART header
2. Connect power cable and turn on the router
3. When the "Press the [f] key and hit [enter] to enter failsafe mode"
message is displayed on the console, press the "f" key and Enter key
sequentially to enter the failsafe mode
4. create fw_env.config file with following contents on failsafe mode:
  /dev/mtd9 0x0 0x10000 0x10000
5. Execute following commands to add and change the environment
variables of U-Boot
  fw_setenv ipaddr "192.168.0.1"
  fw_setenv serverip "192.168.0.2"
  fw_setenv autostart "yes"
  fw_setenv bootcmd "tftpboot 0x44000000 wg2600hp-initramfs.bin;
  bootipq"
6. Set the IP address of the computer to 192.168.0.2, connect to the LAN
port of WG2600HP, and start the TFTP server on the computer
7. Rename OpenWrt initramfs image for WG2600HP to
"wg2600hp-initramfs.bin" and place it in the TFTP directory
8. Remove power cable from WG2600HP, reconnect it and restart WG2600HP
9. WG2600HP downloads initramfs image from TFTP server on the computer,
loads it and boot with initramfs image
10. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with the sysupgrade image
11. Wait ~180 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-06-19 20:46:01 +02:00
John Crispin ee1dbffeed ipq806x: D7800 only has a single sata port
Signed-off-by: John Crispin <john@phrozen.org>
2018-06-18 20:29:37 +02:00
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>
2018-06-07 09:19:39 +02:00
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>
2018-06-07 09:06:19 +02:00
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>
2018-05-24 08:58:17 +02:00
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>
2018-05-22 20:47:20 +02:00
Stefan Lippers-Hollmann 2819732219 ipq806x: drop linux 4.9 support
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2018-05-22 20:34:14 +02:00
Stefan Lippers-Hollmann 18e9ed2482 ipq806x: switch to linux 4.14
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-05-22 20:34:14 +02:00
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>
2018-04-26 08:53:54 +02:00
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>
2018-04-20 20:58:52 +02:00
Rafał Miłecki 31aaa670d4 ipq806x: replace linux,part-probe with a proper partitions subnode
This solution is more upstream compatible as it only requires specifying
of_match_table in the parser code and doesn't depend on linux,part-probe
which is solution made generic by a LEDE downstream patch that can't be
upstreamed.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Acked-by: John Crispin <john@phrozen.org>
2018-04-09 07:45:34 +02:00
Christian Mehlis 0c7e78930b ipq806x: add support for Compex WPQ864
Hardware highlights:
- SoC: Qualcomm Atheros IPQ8064/5 ARM Dual Core CPU
- RAM: (512MB or 1GB) DDR3 System Memory
- Storage: 32MB NOR (Cypress S25FL256S1)
           256MB NAND (Micron MT29F2G08ABBEAH4)
- Ethernet: 5 x 1G via QCA8337N
- USB: 1 x USB 2.0/3.0 + 1 x USB 2.0 on mini PCIe3 socket
- PCIe: 3x mini PCIe (third mini PCIE3 is PCIe/USB shared)
- SIM Card Slot: 2 x Slot
- Buttons: Reset Button
- LEDs: 18x, 8x GPIO controllable
- Buzzer

The correct amount of RAM will be passed by the bootloader.

In contrast to the documentation provided by Compex, the third PCIe
doesn't use GPIO16 for PERST. Instead, GPIO3 is shared and used as PERST
for PCIe0 and PCIe2.

So far, no one was able to get USB 3.0 working with the 1GB RAM version,
while it works fine for my 512MB version. Since USB 3.0 doesn't work with
the Compex firmware for the 1G variant either, it could be a hardware
issue with these boards.

OpenWrt will be installed to the NAND flash. Make sure to have a full
working image on the NOR flash. It will be the backup in case anything
goes wrong.

It has been observed that an image loaded via tftpboot might have
bitflips. Hence the extra step to create a crc32 checksum to allow to
compare the checksum with the one from the source file prior to flashing.

In all cases it is necessary to set the following u-boot parameter to an
empty (whitespace) value, to ensure that the chosen bootargs of the dts
isn't overwritten or set to bogus - not working - values:

  (IPQ) # set bootargs " "
  (IPQ) # set fsbootargs " "
  (IPQ) # saveenv

The sysupgrade image can be installed directly on flash using u-boot (put
jumper in JP13 (leave JP9 open) to boot from nand):

  (IPQ) # set serverip 192.168.1.20
  (IPQ) # set ipaddr 192.168.1.1

  (IPQ) # tftpboot 0x42000000 openwrt-ipq806x-compex_wpq864-squashfs-nand-factory.bin
  (IPQ) # crc32 0x42000000 $filesize

  (IPQ) # nand erase 0x1340000 0x4000000
  (IPQ) # nand write 0x42000000 0x1340000 $filesize

The initramfs image can be started using:

  (IPQ) # set fdt_high 0x48000000
  (IPQ) # tftpboot 0x44000000 openwrt-ipq806x-compex_wpq864-initramfs-fit-uImage.itb
  (IPQ) # bootm 0x44000000

Signed-off-by: Christian Mehlis <christian@m3hlis.de>
Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-03-15 08:17:10 +01:00
Mathias Kresin 1b906723eb ipq40xx/ipq806x: move qcom-dwc3 usb driver to generic
If the a kernel package exists within multiple targets an error/warning
is shown.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-03-14 19:04:51 +01:00
John Crispin b7f115f22a ipq806x: drop ipq40xx support
Signed-off-by: John Crispin <john@phrozen.org>
2018-03-14 19:04:50 +01:00
Magnus Kroken 5af85dab22 kernel: bump 4.9 to 4.9.85
Signed-off-by: Magnus Kroken <mkroken@gmail.com>
2018-03-03 12:58:55 +01:00
Dongming Han 04d3308b62 ipq806x: add support for GL.iNet GL-B1300
This patch adds support for GL.iNet GL-B1300

Specification:
- SOC:        IPQ4028 / QCA Dakota
- RAM:        256 MiB
- FLASH:      32 MiB
- ETH:        Qualcomm Atheros QCA8075 Gigabit Switch (2 x LAN, 1 x WAN)
- USB:        1 x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC)
- WLAN1:      Qualcomm Atheros QCA4028 2.4GHz 802.11bgn 2:2x2
- WLAN2:      Qualcomm Atheros QCA4028 5GHz 802.11a/n/ac 2:2x2
- INPUT:      one reset and one WPS button
- LEDS:       3 leds: Power, WIFI(only for 2.4G currently), and one reserved
- UART:       1 x UART on PCB (3.3V, TX, RX, GND) - 115200 8N1

Installation:
Method 1:
- use serial port to stop uboot
- uboot command: run lf
Method 2:
- push down reset button and power on
- wait until three leds constantly on then release
- upgrade by uboot web at http://192.168.1.1
Note:
- the sysupgrade image need to be renamed to lede-gl-b1300.bin in both method.
- the sysupgrade image can be automatically downloaded if tftp server at
  192.168.1.2 have that file.
- the wifi led will be flashing when writing image.

Signed-off-by: Dongming Han <handongming@gl-inet.com>
2018-02-14 09:40:32 +01:00
Stefan Lippers-Hollmann 4baffa02ce ipq806x: switch to full dual-boot for the nbg6817 sysupgrade support
Instead of writing to the currently booted partition set, this
implements full dual-boot support for sysupgrade by always writing to
the other, currently inactive, partition set and toggling the dualflag
after a successful flash.

The currently active/ booted partition set is determined by parsing
/proc/cmdline for its rootfs parameter (supplied by the DTS), instead
of reading from the 0:DUAL_FLAG mtd, in order to prevent (potentially)
bricking both partition sets.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2018-02-13 12:45:00 +01:00
Stefan Lippers-Hollmann 42fe7b3bbe ipq806x: request the first free loop device dynamically for the nbg6817 sysupgrade
Instead of hardcoding /dev/loop0, it's safer to query for the first
free loop device and assign that dynamically. While /dev/loop0 is a
reasonable assumption immediately following "losetup --detach-all",
detaching the mounted overlay is no longer strictly necessary once
dual-boot support has been added for the nbg6817.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2018-02-13 12:45:00 +01:00
Stefan Lippers-Hollmann b36cf0be30 ipq806x: use absolute the device path in $kernel for the nbg6817 sysupgrade
Harmonize the variable usage for $kernel and $rootfs to always contain
the full device path, instead of just its basename.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2018-02-13 12:45:00 +01:00
Luis Araneda 887925b098 ipq806x: support new location of USB PHY kernel module
PHY drivers were grouped into vendor specific directories
by upstream commit 0b56e9a7e8358e59b21d8a425e463072bfae523c

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2018-02-13 11:56:40 +01:00
Sven Eckelmann 25a72f5a01 ipq-wifi: drop OpenMesh A42 board-2.bin
The BDFs for OpenMesh A42 were upstreamed [1] to the ath10k-firmware
repository and are now part of ath10k-firmware 2018-01-26. The
ipq-wifi-openmesh_a42 package can now be dropped because OpenWrt already
ships the QCA4019 board-2.bin from this version.

[1] https://wireless.wiki.kernel.org/en/users/drivers/ath10k/boardfiles

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2018-02-11 16:33:00 +01:00
David Bauer 1113fcdc80 ipq806x: mark AVM FB4040 switchport as untagged
This commit marks the CPUs switchport explicit as untagged.
Otherwise, an eth0.1 interface is created and the devices
LAN-ports are not working.

Signed-off-by: David Bauer <mail@david-bauer.net>
2018-02-11 16:02:52 +01:00
Hauke Mehrtens 4d649ba949 ipq806x: make patches apply again
Some part of this patch was added to the generic patches as it was
needed also for some other target. Do not add it here any more.

Fixes: 02050f7e7d ("kernel/4.{4, 9}: add manufacturer ID for Winbond NANDs")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2018-01-20 23:24:02 +01:00
Kevin Darbyshire-Bryant d8565a06dc kernel: bump 4.9 to 4.9.77
Refresh patches.
Remove upstreamed patches:

target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

CVEs completely or partially addressed:

CVE-2017-5715
CVE-2017-5753
CVE-2017-17741
CVE-2017-1000410

Compile-tested: ar71xx Archer C7 v2
Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-01-20 20:22:01 +01:00
Christian Lamparter 9c2ac19b03 ipq806x: remove merged ipq4019 patch
The patch 0022-dts-ipq4019-support-ARMv7-PMU.patch
was merged into 4.8-rc1.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[refresh patches]
Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-18 21:21:11 +01:00
Christian Lamparter 5988364cf3 ipq806x: remove dependency on non-existent kmod
During the integration of the ipq40xx target,
the phy drivers were included into the ipq806x's
target kernel config.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-01-18 21:21:11 +01:00
Christian Lamparter 51dd8f3875 ipq-wifi: align AVM FRITZ!Box 4040's board-2.bin package
This patch renames the AVM FRITZ!Box 4040's board-2.bin
file and package to match the 'vendor_product' format.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-01-18 21:21:11 +01:00
Christian Lamparter 42b47f1b40 ipq806x: overhaul AVM FRITZ!box 4040 device-tree file
This patch aligns the device-tree file with the latest
guidelines.
 - No longer include qcom-ipq4019-ap.dk01.1.dtsi. This
   file is only partially upstream and therefore subjected
   to changes that might not be compatible with the board.

   As a result, the definitions from the file have been
   copied into this dts.

 - exclusively use decimal GPIO addresses.

 - reorganize the reserved-memory layout to waste less
   memory. There's no point in keeping the u-boot loader
   around. This should also make it possible    to create
   an image that will boot with the original EVA/ADAM2 loader
   without needing to install the modified u-boot loader.
   And finally mark the "tz-apps" as reusable.
   There isn't a way to  upload apps to the trust-zone in OpenWrt
   yet. But it might see some use in the future as a "secure"
   key-store/TPM.

 - sort the first-level nodes alphabetically.
 - sort nodes with an address by the address.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-01-18 21:21:11 +01:00
Mathias Kresin b6868e2f47 ipq806x: fix ZyXEL NBG6817 sysupgrade
Use the first found directory in the tar archive instead of relying on
a directory named according to the userspace boardname.

It allows to change the boardname without adding another compatibility
layer to the zyxel sysupgrade.

Fixes: 33f09cf151 ("ipq806x: convert to dt-based board-detection")
Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-18 07:22:37 +01:00
Pavel Kubelun 644a0d5403 ipq8065: adjust SS USB PHY power settings
According to QSDK ipq8065 has different SS USB PHY power settings.

Adjust it according to QSDK settings.

It also corresponds to oem Netgear R7800 tarball for soc ver >= 2.
eeac2e1019/git_home/linux.git/sourcecode/arch/arm/mach-msm/board-ipq806x.c (L2494)

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:05:11 +01:00
Pavel Kubelun e93a16ed3f ipq806x: usb: add phy 1 master reset control
In current state only phy 0 master reset is controlled.
Add the phy 1 reset.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:04:57 +01:00
Pavel Kubelun de748a121e ipq806x: usb: Control USB master reset
Picking commit from QSDK
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=eggplant&id=a86bda9f8a7965f0cedd347a9c04800eb9f41ea3

Commit message:
"During removal of the glue layer(dwc3-of-simple), USB master reset is set to active and during insertion it is de-activated."

Change-Id: I537dc810f6cb2a46664ee674840145066432b957
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
(cherry picked from commit 4611e13580a216812f85f0801b95442d02eeb836)"

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:02:06 +01:00
Pavel Kubelun 6617f3c6ab ipq806x: dwc3: Fix power_on and power_off sequence
Picking commit from QSDK
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/drivers/phy/phy-qcom-dwc3.c?h=eggplant&id=d316437c9cdb70023a760342678f32e27241725a

The commit fixes:
- dwc3 phy module unloading
- possibly fixes FS#177 when some devices were improperly enumerated as HS while being SS thus stucking the driver during boot.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:02:06 +01:00
Pavel Kubelun c263e18a53 ipq806x: Update HSIO recommended usb phy settings
Picking commit from QSDK
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/drivers/phy/phy-qcom-dwc3.c?h=eggplant&id=cf82fdf4bdd081cd81bb081f7815b915bc8bb851

The comit adjusts USB dwc3 phy default values as per QSDK recomendation and allows to set it through DT.

Commit message:
"SoC version based values will be recovered from the device node.
If device node does not have such values, defaults are applied.

Change-Id: Ia77b5b7fe95ce1a433885df1761091bced98d989
Signed-off-by: Gokul Sriram Palanisamy <gpalan@codeaurora.org>"

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:02:06 +01:00
Pavel Kubelun a4c1767897 Revert "ipq8064: Fix dwc3 module unloading"
Preparing for proper fixes thus reverting commits:
- 8db079a9ff "ipq8064: Fix dwc3 module unloading"
- c75f059b0c "ipq8064: Fix dwc3 module unloading"

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:02:05 +01:00
Pavel Kubelun 7903a9219c ipq806x: update clk and cpufreq drivers
A newer clk and cpufreq drivers for ipq806x platform had been sent upstream.

A change that i have noticed is that now it's possible to set min, cur and max frequencies from sysfs (previously it was bugged and caused nothing).

Following patches are removed:
 - 0036-clk-Avoid-sending-high-rates-to-downstream-clocks-du.patch - seems it was dropped from the patchset by current committer.
 - 0044-clk-qcom-krait-Remove-CLK_IS_ROOT.patch - already applied to the driver itself in the corresponding patch.
 - 0057-clk-qcom-Add-regmap-mux-div-clocks-support.patch - seem to be irrelevant to ipq806x.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:02:05 +01:00
Pavel Kubelun 83499bef73 ipq806x: force 2nd pci slot into gen1 mode
According to QSDK and OEM tarballs (checked c2600, r7500v2, r7800) 2nd pci slot (pci1, 2,4 GHz card)) on ap148 based boards should operate in gen1 mode.
EA8500 is an exception and according to GPL pcie0 should operate in gen1 mode.

In previous commit we've added the support for this option, so enable it in DT for affected devices.

QSDK ref:
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=release/endive_preview_cc&id=f3b07fe309027c52fc163149500cedddd707c506

While at it move the phy transmit termination offset value into dtsi file as it's platform specific.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:02:05 +01:00
Pavel Kubelun 36a96a4493 ipq806x: fix wireless regression
In current state there's huge regression on ipq806x target that causes the device to transmit broken/malformed frames that are not corrected/detected by error control mechanisms and other less severe issues.
https://bugs.lede-project.org/index.php?do=details&task_id=1197

This finally had been narrowed down to patch 0071-pcie-qcom-fixes.patch

Meanwhile QSDK contains a handful of commits that add support for ipq806x to upstream qcom pcie driver
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/log/drivers/pci/host/pcie-qcom.c?h=eggplant
Unfortunately qca developers do not bother to push it upstream.

Using those commits instead of lede 0071 patch fixes mentioned issue and probably many others as it seems that corrupted data has been originating within pcie misconfiguration.

Fixes: FS#1197 and probably others
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2018-01-17 11:02:05 +01:00
Mathias Kresin 16f2befc3c ipq806x: drop ubifs support
Ubifs is disabled for all boards except the evaluation boards and the
Fritz!Box 4040 anyway. According the author, the ubifs support for the
Fritz!Box 4040 wasn't enabled on purpose.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-15 21:45:43 +01:00
Mathias Kresin 0af5e9bdc4 ipq806x: drop legacy image leftovers
Remove leftover code used for legacy images. There are no relevant
binary differences for the images after removing the legacy leftovers.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-15 21:45:43 +01:00
Mathias Kresin 52e7df3f49 ipq806x: unset filesystem specific build command by default
Initialise the filesystem specific build command. Otherwise it will be
unintended inherit to following images and will cause a wrong image
format.

The issue is around for ages but was only recently triggered due to the
added support for the Openmesh a42.

Fixes: FS#1276

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-15 21:45:43 +01:00
Mathias Kresin f319c5c254 ipq806x: remove unnecessary filesystem specific build
The Openmesh factory image doesn't need a squashfs specific build command.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-15 21:45:43 +01:00
Mathias Kresin f2a8e02134 ipq806x: use bin file extension for sysupgrade-tar images
Use the file extension bin for sysupgrade-tar images to unify the file
extension across the target/tree.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-15 21:45:43 +01:00
Sven Eckelmann 86e18f6706 ipq806x: add support for OpenMesh A42
* QCA IPQ401x
* 256 MB of RAM
* 32 MB of SPI NOR flash (s25fl256s1)
  - 2x 15 MB available; but one of the 15 MB regions is the recovery image
* 2T2R 2.4 GHz
  - QCA4019 hw1.0 (SoC)
  - requires special BDF in QCA4019/hw1.0/board-2.bin with
    bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=OM-A42
* 2T2R 5 GHz
  - QCA4019 hw1.0 (SoC)
  - requires special BDF in QCA4019/hw1.0/board-2.bin with
    bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=OM-A42
* multi-color LED (controlled via red/green/blue GPIOs)
* 1x button (reset; kmod-input-gpio-keys compatible)
* external watchdog
  - triggered GPIO
* 1x USB (xHCI)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x gigabit ethernet
* powered only via POE
  - 802.3af POE on Ethernet 1
  - 18-24v passive POE (mode B) on Ethernet 2

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
2018-01-13 08:00:14 +01:00
Sven Eckelmann c242643d1a ipq806x: enable gpio watchdog support
The kernel driver gpio-wdt or the userspace tool om-watchdog can be used to
trigger external gpio watchdog chips. The gpio-wdt driver has the benefit
that it can be configured together with the rest of the device in the DTS
and better integrates in the OpenWrt via procd.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
2018-01-13 08:00:07 +01:00
Luis Araneda 7293499f71 ipq806x: Sort occurrences of boardame alphabetically
This restores the alphabetical sort that was present
before the renaming of boardname.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2018-01-13 07:33:03 +01:00
Luis Araneda 33f09cf151 ipq806x: convert to dt-based board-detection
Use the generic board detection method:
- Board name: First compatible string from the device tree
- Board model: Model property from the device tree

Change occurrences of board name in userspace by the compatible
string, and removed target specific board detection script

Replace the definition of SUPPORTED_DEVICES in Device/Default
to extract the dt compatible string from each device definition.
Additionally, for devices supported by lede-17.01, append
the value of BOARD_NAME to SUPPORTED_DEVICES in the device
definition.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2018-01-13 07:33:03 +01:00
Luis Araneda 3cbdae2421 ipq806x: sync image filename with dt compatible string
Use <manufacturer>_<modelname> as image name for board using the
devicetree compat string as boardname.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2018-01-13 07:33:02 +01:00
Luis Araneda 09e13bd341 ipq806x: add a helper variable with the vendor name stripped
This will allow to maintain the current syntax for LEDs config
when switching to a device tree compatible string boardname.

None of the current boards use a comma in the boardname, so they
will be unaffected.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2018-01-13 07:33:02 +01:00
Luis Araneda 8ed5dfedc6 ipq806x: add missing dt compatible string to ap-dk04 board
Compatible string is mandatory to dts files

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2018-01-13 07:33:02 +01:00
Mathias Kresin c3d9fe96dc ipq806x: drop partitial supported boards
There are only artifacts for these boards in our tree and not even
partial support.

Drop teh stale files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-13 07:33:02 +01:00
Kevin Darbyshire-Bryant 1d2590f838 kernel: bump 4.9 to 4.9.75
Refresh patches

Fixes:  CVE-2017-5754 aka Meltdown

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>
[fix conflict after 4.14 bump]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2018-01-10 00:11:39 +02:00
Mathias Kresin f0227af5d6 ipq806x: drop kernel 4.4 leftovers
Remove the kernel 4.4 specific devicetree source files.

Fixes: 3a3564ead5 ("ipq806x: remove v4.4 support")

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-01-09 22:06:37 +01:00
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>
2017-12-14 09:29:30 +01:00
Luis Araneda 575178e462 treewide: add only one device when appending to TARGET_DEVICES
This will avoid some conflicts when doing a git rebase or merge,
specially when adding support to a new device.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
[drop brcm47xx changes which rename the images]
Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-12-12 18:47:26 +01:00
Stijn Tintel f997478655 kernel: bump 4.9 to 4.9.67
Refresh patches.
Remove upstreamed patches:
- generic/190-1-5-e1000e-Fix-error-path-in-link-detection.patch
- generic/190-3-5-e1000e-Fix-return-value-test.patch
- generic/190-4-5-e1000e-Separate-signaling-for-link-check-link-up.patch
- generic/190-5-5-e1000e-Avoid-receiver-overrun-interrupt-bursts.patch
- ramips/0102-MIPS-ralink-Fix-MT7628-pinmux.patch
- ramips/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function
Update patches that no longer apply:
- layerscape/815-spi-support-layerscape.patch
- ramips/0099-pci-mt7620.patch

Compile-tested on ar71xx, brcm2708/bcm2708, octeon and x86/64.
Runtime-tested on ar71xx, brcm2708/bcm2708, octeon and x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-12-07 01:41:09 +02:00
Koen Vandeputte 62ede4f783 kernel: bump 4.9 to 4.9.63
Refreshed all patches.

Removed upstreamed parts.

Compile-tested: cns3xxx, imx6, mvebu, layerscape
Run-tested: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2017-11-22 20:45:52 +01:00
Roman Yeryomin 8bb33f3c98 ipq806x: ipq4019: enable usb phy
Run tested on ap-dk01.2-c1

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-11-17 08:18:00 +01:00
Stefan Lippers-Hollmann 9a221c6d69 ip806x: nbg6817: sysupgrade support both targets for kernel/ rootfs partitions
With this commit and the previous "nbg6817: don't hardcode the rootfs location
by using append-rootblock instead" applied, it is possible to boot- and
sysupgrade from both dual-boot sets (the primary mmcblk0p4+mmcblk0p5 or the
alternative mmcblk0p7+mmcblk0p8). However the sysupgrade support does not
toggle between both dual-boot sets between firmware upgrades so far.

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

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

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

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

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

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

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

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

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

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2017-10-29 03:11:51 +01:00
Stefan Lippers-Hollmann b583aaf5aa ip806x: nbg6817: don't hardcode the rootfs location by using append-rootblock instead
This changes the cmdline from:

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

to

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

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

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

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

Further upgrades via sysupgrade.

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

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

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

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

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

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:19:32 +02:00
Roman Yeryomin 21802ce3ab ipq806x: ipq4019: dts: remove spi chip node from ap-dk01 dtsi
All ap-dk01 boards have different spi chips, thus no point in keeping it in dtsi.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:19:19 +02:00
Roman Yeryomin 97a836318f ipq806x: ipq4019: dts: move ap-dk01 networking entries to dtsi
That is mdio/ethernet and wifi are present on all ap-dk01 boards.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:19:02 +02:00
Roman Yeryomin 45b1042a0a ipq806x: ipq4019: dts: remove counter entry from ap-dk01 boards
There is no code implementing "qcom,qca-gcnt", so no point in keeping it.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:18:51 +02:00
Roman Yeryomin 91f0345801 ipq806x: ipq4019: dts: move ap-dk01 tcsr nodes to dtsi
tcsr configuration is the same for all ap-dk01 boards

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:18:38 +02:00
Roman Yeryomin ba9aa76a3a ipq806x: ipq4019: dts: remove crypto nodes from board dts
crypto and cryptobam are already present in dtsi used by these boards:
- fritz4040
- nbg6617
- rt-ac58u

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:18:24 +02:00
Roman Yeryomin 1abc788924 ipq806x: ipq4019: dts: move xo and timer nodes to SoC dtsi
xo and timer are common thing and it makes more sense to keep them in SoC dtsi

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:18:11 +02:00
Roman Yeryomin ab3ab6241f ipq806x: ipq4019: dts: fix pinctrl node name
Signed-off-by: Roman Yeryomin <roman@advem.lv>
2017-10-30 01:17:58 +02:00
Stefan Lippers-Hollmann 189433e543 ipq806x: nbg6817: sync MAC addresses to the upstream values
The ZyXEL NBG6817 calculates all MAC addresses based on the ethaddr
value stored in the U-Boot environment (0:APPSBLENV). No MAC addresses
are stored in the ART partition and the generated MAC addresses for the
wlan interfaces alternate randomly between 12:34:56:78:90:12 and
00:03:7f:12:34:56.

interface	  new/ OEM MAC	old MAC

wlan-2.4g (phy1): ethaddr	undefined
wlan-5g   (phy0): ethaddr + 1	undefined
lan             : ethaddr + 2	ethaddr
wan             : ethaddr + 3	ethaddr + 1

This patch defines stable MAC addresses for the wlan interfaces for
the first time instead of generating them at random. The previously
defined values for lan/ wan are changed to follow the settings of the
OEM firmware.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2017-11-03 20:04:51 +01:00
Stefan Lippers-Hollmann 6e6d4f2e87 ipq806x: nbg6817: add kmod-fs-ext4 to device packages
The ZyXEL NBG6817 uses an eMMC flash for the rootfs, which is split
into the readonly squashfs and ext4 for the overlay. This adds the
required package to the device packages to allow mounting the overlay
by default.

/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/loop0 on /overlay type ext4 (rw,noatime,data=ordered)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
mountd(pid1040) on /tmp/run/blockd type autofs (rw,relatime,fd=7,pgrp=1,timeout=30,minproto=5,maxproto=5,indirect)

Before this commit, the ext4 based overlayfs could not be mounted,
which left only the tmpfs based/ volatile  emergency overlay in place.

Fixes: https://forum.lede-project.org/t/zyxel-nbg6817-flashing-from-oem/768

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2017-11-03 20:04:51 +01:00
Jonas Gorski 6f528dfbd9 treewide: do not use IMG_PREFIX in Image/Prepare
IMG_PREFIX can be modified in ImageBuilder by passing EXTRA_IMAGE_NAME
on command line, but Image/Prepare is not run in ImageBuilder. This
causes missing files when IMG_PREFIX is used for target file names in
Image/Prepare, then as source file names in Image/BuildKernel or
Image/Build.

Fix this by using a fixed output file name in Image/Prepare, and copy to
the expected file name in Image/BuildKernel instead, which is run by
ImageBuilder.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
2017-10-26 12:26:25 +02:00
Tolga Cakir f4d4a3c0ef ipq806x: fix Zyxel NBG6817 WiFi button
Zyxel NBG6817 features a WiFi button, which becomes functional by setting
correct GPIO. It is a switch-type button, so it emits KEY_RFKILL on each ON
and OFF state. This is achieved by setting input-type to EV_SW.

Signed-off-by: Tolga Cakir <tolga@cevel.net>
2017-10-25 09:22:14 +02:00
Stijn Tintel 834810617e kernel: bump 4.9 to 4.9.58
Refresh patches.
Compile-tested: ar71xx, octeon, x86/64.
Runtime-tested: octeon, x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-10-23 17:23:34 +03:00
Stijn Tintel e37c7636ee kernel: update 4.9 to 4.9.50
Refresh patches.
Compile-tested on ipq8065/nbg6817 and x86/64.
Runtime-tested on ipq8065/nbg6817 and x86/64.

Fixes CVE-2017-1000251.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
[adapt qcom_nandc.c patches to match upstream changes, test ipq8065/nbg6817]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2017-09-18 04:35:57 +03:00
Baptiste Jonglez 5889f92f7d ipq806x: Archer C2600: fix switch ports numbering
The order of LAN ports shown in Luci is reversed compared to what is
written on the case of the device.  Fix the order so that they match.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-08-24 08:39:12 +02:00
Stijn Tintel 2d02a4f5bd kernel: update 4.9 to 4.9.44
Refresh patches.
Adapt 704-phy-no-genphy-soft-reset.patch.
Remove brcm2708/950-0005-mm-Remove-the-PFN-busy-warning.patch.
Compile-tested on brcm2708/bcm2708 and x86/64.
Runtime-tested on brcm2708/bcm2708 and x86/64.

Fixes the following vulnerabilities:
- CVE-2017-7533
- CVE-2017-1000111
- CVE-2017-1000112

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-08-17 12:34:34 +02:00
Mathias Kresin e4e984f2a0 treewide: use only board_name function to get name
Do not parse /tmp/sysinfo/board_name, /proc/cpuinfo or the device tree
compatible string directly. Always use the board_name function to get
the board name.

The admswconfig package still reads /proc/cpuinfo directly. The code
looks somehow broken and the whole adm5120 which uses this package
looks unmaintained. Leave it as it is for now.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-07-15 23:13:34 +02:00
Mathias Kresin e0b9ec8e96 treewide: drop target board_name functions
They are not used any longer.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-07-15 23:13:34 +02:00
Mathias Kresin f12a32630f treewide: use the generic board_name function
Use the generic function instead ot the target specific ones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-07-15 23:13:34 +02:00
Mathias Kresin ac3e05c5d7 treewide: populate boardname and model earlier
For targets using the generic board detection and board specific
settings in diag.sh, the board name is still unset at the time the
set_state() provided by diag.sh is called by 10_indicate_preinit.

Change the execution order to ensure the boardname is populated before
required the first time. Do the target specific board detection as
early as possible, directly followed by the generic one to allow a
seamless switch to the generic function for populating /tmp/sysinfo/.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-07-15 23:13:34 +02:00
Koen Vandeputte cd54b2d42b kernel: update kernel 4.9 to 4.9.37
- Refreshed all patches
- Removed upstreamed
- Adapted 4 patches:

473-fix-marvell-phy-initialization-issues.patch
-----------------------------------------------
Removed hunk 5 which got upstreamed

403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
--------------------------------------------------------------
Adapted these 2 RFC patches, merging the delta's from an upstream commit
(see below) which made it before these 2.

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
stable.git/commit/?h=v4.9.36&id=97ace183074d306942b903a148aebd5d061758f0

180-usb-xhci-add-support-for-performing-fake-doorbell.patch
-----------------------------------------------------------
- Moved fake_doorbell bitmask due to new item

Compile tested on: cns3xxx, imx6
Run tested on: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2017-07-15 00:13:05 +02:00
Matthias Schiffer 438dcbfe74
base-files: automatically handle paths and symlinks for RAMFS_COPY_BIN
Depending on busybox applet selection, paths of basic utiilties may differ,
and may not work as symlinks to busybox. Simply using whatever binary is
found in PATH and detecting symlinks automatically is more robust and
easier to maintain.

The list of binaries is also slightly cleaned up and duplicates are
removed.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-07-11 17:26:32 +02:00
Matthias Schiffer 08a94ecaee
ipq806x: upgrade: fix RAMFS_COPY_*
RAMFS_COPY_* are moved to platform.sh toplevel. The unneeded
linksys_preupgrade function is removed, and the nand_do_upgrade call is
moved to platform_do_upgrade.

Fixes: 30f61a34b4 "base-files: always use staged sysupgrade"
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-07-11 17:19:23 +02:00
Ram Chandra Jangir c2a4f144d7 ipq806x: Enable AP148 fit image(.itb) generation
This change enables .itb image generation for AP148,
It will help us to boot and test AP148 with NOR flash.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-07-06 07:16:40 +02:00
Piotr Dymacz 7d6c63d875 build: rename TPLINK_BOARD_NAME to TPLINK_BOARD_ID
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2017-06-29 10:37:36 +02:00
Stijn Tintel 880f73c327 kernel: cleanup CONFIG_SCHED_HRTICK
Remove CONFIG_SCHED_HRTICK from target configs, as it was added to the
generic config in b47fd76563.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-06-29 04:46:59 +02:00
Koen Vandeputte 69649a1b45 kernel: update kernel 4.9 to 4.9.34
- Refreshed all patches
- Adapted 1 (0031-mtd-add-SMEM-parser-for-QCOM-platforms.patch)

Compile tested on: brcm2708, cns3xxx, imx6
Run tested on: brcm2708, cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[Compile and run tested on brcm2708]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-06-27 07:21:03 +02:00
Pavel Kubelun 189239ade3 ipq806x: qca99xx: fix wifi calibration
As of now OTP is being correctly parsed and the driver requires to parse pre-caldata to follow corresponding routine.

Rename cal file into pre-calfile so the board initialized correctly with API 2 board data (board-2.bin).

Also remove the now unneeded for qca9984 board.bin symlink to 5GHz calfile.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2017-06-17 11:51:41 +02:00
Jo-Philipp Wich 55623a9c83 kernel: update kernel 4.9 to 4.9.31
Fixes the following security vulnerabilities:

CVE-2017-8890
The inet_csk_clone_lock function in net/ipv4/inet_connection_sock.c in the
Linux kernel through 4.10.15 allows attackers to cause a denial of service
(double free) or possibly have unspecified other impact by leveraging use
of the accept system call.

CVE-2017-9074
The IPv6 fragmentation implementation in the Linux kernel through 4.11.1
does not consider that the nexthdr field may be associated with an invalid
option, which allows local users to cause a denial of service (out-of-bounds
read and BUG) or possibly have unspecified other impact via crafted socket
and send system calls.

CVE-2017-9075
The sctp_v6_create_accept_sk function in net/sctp/ipv6.c in the Linux kernel
through 4.11.1 mishandles inheritance, which allows local users to cause a
denial of service or possibly have unspecified other impact via crafted
system calls, a related issue to CVE-2017-8890.

CVE-2017-9076
The dccp_v6_request_recv_sock function in net/dccp/ipv6.c in the Linux
kernel through 4.11.1 mishandles inheritance, which allows local users to
cause a denial of service or possibly have unspecified other impact via
crafted system calls, a related issue to CVE-2017-8890.

CVE-2017-9077
The tcp_v6_syn_recv_sock function in net/ipv6/tcp_ipv6.c in the Linux kernel
through 4.11.1 mishandles inheritance, which allows local users to cause a
denial of service or possibly have unspecified other impact via crafted
system calls, a related issue to CVE-2017-8890.

CVE-2017-9242
The __ip6_append_data function in net/ipv6/ip6_output.c in the Linux kernel
through 4.11.3 is too late in checking whether an overwrite of an skb data
structure may occur, which allows local users to cause a denial of service
(system crash) via crafted system calls.

Ref: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8890
Ref: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9074
Ref: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9075
Ref: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9076
Ref: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9077
Ref: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9242
Ref: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.9.31

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-06-08 01:03:39 +02:00
Sergey Ryazanov 68e7a2a0b7 kernel: disable CONFIG_SG_POOL by default
CONFIG_SG_POOL symbol is selected only by CONFIG_SCSI, since the last
one is disabled by default then disable CONFIG_SG_POOL by default too.
And explicitly enable it only for platforms that use CONFIG_SCSI.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2017-06-07 18:31:10 +02:00
Ram Chandra Jangir e178d51a04 ipq806x: Enable ubi image for ipq40xx AP-DK04.1-C1 board
This change add IPQ40xx AP-DK04.1-C1 board image support,
enables ubi image for IPQ40xx AP-DK04.1-C1 board and also
add sysupgrage support for AP-DK04.1-C1 and generates a
sysupgrade.tar image.

Testing:
 *Tested on IPQ40xx AP-DK04.1-C1:
   a. NAND boot
   b. ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-06-07 06:33:33 +02:00
Ram Chandra Jangir 5e1cc0c090 ipq806x: Updated various ipq40xx pin definitions
This change populates default values for various GPIO functions
in ipq40xx pinctrl driver.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-06-07 06:33:33 +02:00
Ram Chandra Jangir 7bf74d3185 ipq806x: add qpic nand and bam dma node's in ipq4019 dts tree
This change adds QPIC BAM dma and NAND driver node's in IPQ4019
device tree, also enable this for AP-DK04.1 based boards.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-05-29 07:26:03 +02:00
Ram Chandra Jangir 35307c0bbf ipq806x: Add support for custom data mapping in bam_dma dmaengine
This change adds a new function to support for preparing DMA descriptor
for custom data.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-05-29 07:25:59 +02:00
Ram Chandra Jangir ea9e0cf2ce ipq806x: Added bam transaction and support additional CSRs
This change adds support for below:
- Bam transaction which will be used for any NAND request.
- Reset function for NAND BAM transaction
- Add support for additional CSRs.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-05-29 07:25:54 +02:00
Ram Chandra Jangir 2048cab22b ipq806x: Add bam_dma support in qcom_nand driver
The existing qcom_nand driver supports ADM DMA which is mainly
required for ipq806x family based boards,
IPQ40xx based boards uses BAM DMA in NAND driver, so this patch
adds BAM DMA support with compatible string as qcom,ebi2-nandc-bam.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-05-29 07:25:46 +02:00
Ram Chandra Jangir d227bb06df ipq806x: Add support to configure ipq40xx GPIO_PULL bits
GPIO_PULL bits configurations in TLMM_GPIO_CFG register
differs for IPQ40xx from rest of the other qcom SoC's.
This change add support to configure the msm_gpio_pull
bits for ipq40xx, It is required to fix the proper
configurations of gpio-pull bits for nand pins mux.

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2017-05-29 07:25:39 +02:00
Hauke Mehrtens 0b17375931 kernel: update kernel 4.9 to 4.9.30
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2017-05-27 00:48:37 +02:00
Mathias Kresin 822ee54544 treewide: fix device tree path in scripts
The device tree is at /proc/device-tree/ without a base subdir.

Fixes: da472e5b30 ("treewide: access device tree from userspace via /proc/")

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-05-26 15:18:30 +02:00
Mathias Kresin da472e5b30 treewide: access device tree from userspace via /proc/
Access the device tree via /proc/device-tree/ is the documented way to
access the properties. Everything else might not work in future.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-05-26 08:04:15 +02:00
Koen Vandeputte e842e16f45 kernel: update kernel 4.9 to 4.9.29
- Refresh all patches
- Removed upstreamed
- Adapted 1

Compile tested on: bcm53xx, cns3xxx, imx6, lantiq
Run tested on: cns3xxx & imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[update from 4.9.28 to 4.9.29]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2017-05-21 21:51:22 +02:00
Jo-Philipp Wich 3c3f7cfe4d ipq806x: fix EA8500 switch configuration
Do not assign the CPU port twice, this confuses LuCI and possible other
programs relying on topology information in board.json.

Ref: https://github.com/openwrt/luci/issues/1086

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-05-03 14:15:34 +02:00
Thomas Reifferscheid 956e31b1e4 ipq8064: fix dwc3-of-simple module unloading for Netgear R7500
Without patch unloading the dwc3-of-simple module went stuck after
successfully removing hcd.1 during the hcd.0 removal:

root@LEDE:/# rmmod dwc3-of-simple
[   21.391846] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   21.391931] usb usb4: USB disconnect, device number 1
[   21.397038] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   21.401111] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   21.406685] usb usb3: USB disconnect, device number 1
[   21.412848] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   21.417248] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   21.422521] usb usb2: USB disconnect, device number 1
followed by nothing.

Sometimes a stall CPU was detected, or a kernel panic,
or a reboot occurred after a couple of minutes.

At the same time unloading the dwc3 module followed by dwc3-of-simple
module was working repeatedly.

root@LEDE:/# rmmod dwc3
[   53.827328] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   53.827412] usb usb4: USB disconnect, device number 1
[   53.832630] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   53.836452] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   53.842314] usb usb3: USB disconnect, device number 1
[   53.848412] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   53.852542] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   53.857882] usb usb2: USB disconnect, device number 1
[   53.863956] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   53.867875] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   53.873696] usb usb1: USB disconnect, device number 1
[   53.879742] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
root@LEDE:/# rmmod dwc3-of-simple
root@LEDE:/#

For the non-working case, the code was stuck in a readl() in
http://lxr.free-electrons.com/source/drivers/usb/host/xhci.c#L91
because
http://lxr.free-electrons.com/source/drivers/usb/dwc3/dwc3-of-simple.c#L126
was disabling the wrong clocks when removing hcd.1 (it was disabling
the clock of hcd.0). That's why the readl() went stuck when removing
hcd.0

The patch however addresses the clock assignment from the Netgear R7500
dts file and backs off the previous attempt.

Now unloading and repeated module loading is working just fine.

root@LEDE:/# rmmod dwc3-of-simple
[   24.089679] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   24.089765] usb usb4: USB disconnect, device number 1
[   24.094856] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   24.098963] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   24.104522] usb usb3: USB disconnect, device number 1
[   24.111194] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   24.115086] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   24.120396] usb usb2: USB disconnect, device number 1
[   24.126503] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   24.130347] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   24.135948] usb usb1: USB disconnect, device number 1
[   24.142085] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
root@LEDE:/#

Fixes: dwc3-of-simple module unloading for Netgear R7500

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
2017-04-24 09:20:23 +02:00
Thomas Reifferscheid 8db079a9ff ipq8064: Fix dwc3 module unloading
The patch follows the qualcomm code comments setting
SSUSB_CTRL_TEST_POWERDOWN to 0x1 and is testing and clearing the
bit during USB superspeed PHY init. According to Andy Gross it
needs to be BIT(26).

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
2017-04-24 09:19:49 +02:00
Mathias Kresin 226e194335 generic: mtd: backport mx25u25635f stateless 4b support
Use the stateless 4-byte op codes for this flash chip to fix reboot
hangs on SoCs expecting the flash chip in 3-byte mode.

Fixes: FS#179

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-04-19 21:00:52 +02:00
Mathias Kresin 8b3fa168b4 firmware: rework fritz-tools package
Split the fritz-tools into subpackages. fritz_tffs_read is usefull for
all Fritz boards where fritz-cal_extract is only required for the
Fritz 4040 at the moment.

Rename the tffs related binary to the more catchy name fritz_tffs and
move the whole package to utilities since the package doesn't really
provide a firmware file.

Make the fritz-tools available for all targets and build them shared.
The tffs is used by avm on lantiq and ar71xx as well.

Tested-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-04-08 14:30:00 +02:00
Hauke Mehrtens b26e34214c kernel: update kernel 4.9 to 4.9.20
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2017-04-02 12:47:55 +02:00
Thomas Reifferscheid 17f60b1cd2 ipq8064: fix dwc3-of-simple module unloading
Without patch unloading the dwc3-of-simple module went stuck after
successfully removing hcd.1 during the hcd.0 removal:

root@LEDE:/# rmmod dwc3-of-simple
[   21.391846] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   21.391931] usb usb4: USB disconnect, device number 1
[   21.397038] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   21.401111] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   21.406685] usb usb3: USB disconnect, device number 1
[   21.412848] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   21.417248] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   21.422521] usb usb2: USB disconnect, device number 1
followed by nothing.

Sometimes a stall CPU was detected, or a kernel panic,
or a reboot occurred after a couple of minutes.

At the same time unloading the dwc3 module followed by dwc3-of-simple
module was working repeatedly.

root@LEDE:/# rmmod dwc3
[   53.827328] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   53.827412] usb usb4: USB disconnect, device number 1
[   53.832630] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   53.836452] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   53.842314] usb usb3: USB disconnect, device number 1
[   53.848412] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   53.852542] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   53.857882] usb usb2: USB disconnect, device number 1
[   53.863956] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   53.867875] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   53.873696] usb usb1: USB disconnect, device number 1
[   53.879742] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
root@LEDE:/# rmmod dwc3-of-simple
root@LEDE:/#

For the non-working case, the code was stuck in a readl() in
http://lxr.free-electrons.com/source/drivers/usb/host/xhci.c#L91
because
http://lxr.free-electrons.com/source/drivers/usb/dwc3/dwc3-of-simple.c#L126
was disabling the wrong clocks when removing hcd.1 (it was disabling
the clock of hcd.0). That's why the readl() went stuck when removing
hcd.0

The patch however addresses the clock assignment from the .dtsi
file. Most probably it went into openwrt here:
https://dev.openwrt.org/browser/trunk/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch?rev=45261
copied from Qualcomms attempt here: https://lkml.org/lkml/2015/11/20/116

Now unloading and repeated module loading is working just fine,
no matter if you'd remove dwc3-of-simple or dwc3.

root@LEDE:/# rmmod dwc3-of-simple
[   24.089679] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   24.089765] usb usb4: USB disconnect, device number 1
[   24.094856] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   24.098963] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   24.104522] usb usb3: USB disconnect, device number 1
[   24.111194] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   24.115086] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   24.120396] usb usb2: USB disconnect, device number 1
[   24.126503] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   24.130347] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   24.135948] usb usb1: USB disconnect, device number 1
[   24.142085] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
root@LEDE:/#

Fixes: dwc3-of-simple module unloading

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
2017-03-28 09:03:55 +02:00
Thomas Reifferscheid c75f059b0c ipq8064: Fix dwc3 module unloading
Allow module unloading by fixing a mistake.
qcom_dwc3_phy_write_readback() is expecting (phy, offset, mask, value)
while the mistake was calling it with       (phy, offset, value, mask)

The patch is swapping value and mask.

Without the patch unloading the dwc3 module was showing a
write to QSCRATCH failed and repeated module loading was
failing:

root@LEDE:/# rmmod dwc3
[   19.167998] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   19.168084] usb usb4: USB disconnect, device number 1
[   19.173371] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   19.177134] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   19.182960] usb usb3: USB disconnect, device number 1
[   19.189023] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   19.192989] qcom-dwc3-usb-phy 110f8830.phy: write: 8000000 to QSCRATCH: 0 FAILED
[   19.199064] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   19.205912] usb usb2: USB disconnect, device number 1
[   19.211611] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   19.215905] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   19.221751] usb usb1: USB disconnect, device number 1
[   19.227307] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
[   19.231795] qcom-dwc3-usb-phy 100f8830.phy: write: 8000000 to QSCRATCH: 0 FAILED
root@LEDE:/# modprobe dwc3
[   29.583343] phy phy-100f8830.phy.4: phy init failed --> -110
[   29.583399] dwc3 10000000.dwc3: failed to initialize core
[   29.588169] dwc3: probe of 10000000.dwc3 failed with error -110
[   29.652943] phy phy-110f8830.phy.2: phy init failed --> -110
[   29.652988] dwc3 11000000.dwc3: failed to initialize core
[   29.657735] dwc3: probe of 11000000.dwc3 failed with error -110
root@LEDE:/#

With patch repeated module unloading and loading is working good:
root@LEDE:/# rmmod dwc3
[   22.622214] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   22.622298] usb usb4: USB disconnect, device number 1
[   22.627401] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   22.631492] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   22.637054] usb usb3: USB disconnect, device number 1
[   22.643721] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   22.647421] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   22.652910] usb usb2: USB disconnect, device number 1
[   22.659219] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   22.662768] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   22.668604] usb usb1: USB disconnect, device number 1
[   22.674803] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
root@LEDE:/# modprobe dwc3
[   25.404592] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[   25.404694] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[   25.409444] xhci-hcd xhci-hcd.0.auto: hcc params 0x0228f065 hci version 0x100 quirks 0x00010010
[   25.416589] xhci-hcd xhci-hcd.0.auto: irq 168, io mem 0x10000000
[   25.426509] hub 1-0:1.0: USB hub found
[   25.431626] hub 1-0:1.0: 1 port detected
[   25.435472] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[   25.439206] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[   25.444573] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[   25.452926] hub 2-0:1.0: USB hub found
[   25.460420] hub 2-0:1.0: 1 port detected
[   25.525037] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[   25.525099] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 3
[   25.529750] xhci-hcd xhci-hcd.1.auto: hcc params 0x0228f065 hci version 0x100 quirks 0x00010010
[   25.537002] xhci-hcd xhci-hcd.1.auto: irq 169, io mem 0x11000000
[   25.546583] hub 3-0:1.0: USB hub found
[   25.551997] hub 3-0:1.0: 1 port detected
[   25.555734] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[   25.559621] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 4
[   25.564942] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[   25.573063] hub 4-0:1.0: USB hub found
[   25.580842] hub 4-0:1.0: 1 port detected
root@LEDE:/#

Fixes: dwc3 module unloading

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
2017-03-28 09:02:38 +02:00
Thomas Reifferscheid e52117354c ipq8064: enable 2nd USB port on R7500
Makes use of the syscon tcsr and enables both USB ports. Cleans up
qcom-ipq8064.dtsi from previous attempts.

Fixes FS#497

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
2017-03-27 08:15:37 +02:00
Pavel Kubelun 9ac4c1dcee ipq806x: tsens: convert degrees to millicelsius
Current driver shows temp in full degrees while other apps await it
to be in millidegrees.

Initially the driver represents termal data in millidegrees but then
it gets divided by TSENS_FACTOR. So lets just set it to '1'.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2017-03-27 08:05:10 +02:00
Pavel Kubelun dc32d0a53c ipq806x: add ipq806x specific tsens driver
Current upstream driver doesnt fully support ipq806x devices
ipq806x has 11 sensors, the upstream one doesn't allow to check
sensors 0-4, only 5-10.

A specific driver for ipq806x has been found in Qualcomm SDK repo.

https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=release/endive_preview_cc&id=c089e464cd7ce652419a0dc44d7959ce4d24b8a5
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=release/endive_preview_cc&id=c23d94b702c4182862e7f5051a2b7d00bb922a29
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=release/endive_preview_cc&id=742f3684b62a6b9f082cb49404b1a92dc0b16bf5
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=release/endive_preview_cc&id=c0a9b2e2a382c152fa128f5b864c800dd6dfb311

Merging it into LEDE with this commit.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
2017-03-27 08:05:10 +02:00
Hauke Mehrtens fb7ea71c15 kernel: update kernel 4.9 to 4.9.17
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2017-03-26 12:23:19 +02:00
Mathias Kresin 86a0cbb333 treewide: select ath10k firmware explicit
Do not rely on the default firmware selected by ath10k.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-03-24 08:09:39 +01:00
Thomas Reifferscheid b69807e2b2 ipq806x: fix Netgear X4 R7500 ath10k firmware selection
Netgear X4 R7500 comes with a QCA988X. Select a firmware that matches
the ath10k chipset

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
2017-03-24 08:09:39 +01:00
John Crispin 666bfc6fb5 Revert "ipq806x: make the dwc3 driver and required phy drivers built-in"
This reverts commit d5b10bb560.

This caused boot errors on some ipq8 boards

Signed-off-by: John Crispin <john@phrozen.org>
2017-03-23 08:29:44 +01:00
John Crispin 3a3564ead5 ipq806x: remove v4.4 support
Signed-off-by: John Crispin <john@phrozen.org>
2017-03-22 09:45:18 +01:00
John Crispin ef6c4cc4ee ipq806x: set v4.9 as default
Signed-off-by: John Crispin <john@phrozen.org>
2017-03-22 09:45:18 +01:00
John Crispin d5b10bb560 ipq806x: make the dwc3 driver and required phy drivers built-in
Signed-off-by: John Crispin <john@phrozen.org>
2017-03-22 09:45:18 +01:00
John Crispin 7dc5617173 ipq806x: enable QCE hardware crypto inside the kernel
Signed-off-by: John Crispin <john@phrozen.org>
2017-03-22 09:45:18 +01:00