Commit Graph

21 Commits (7c1c0a00fc7948d119a3e3a0dc7a8e89a5c54acc)

Author SHA1 Message Date
Adrian Schmutzler 7c1c0a00fc ipq806x: use qcom-ipq8064-v1.0.dtsi from upstream
This uses upstream qcom-ipq8064-v1.0.dtsi and modifies it by patches
instead of keeping a local version. As a consequence:

- we use a part of the shared definitions there and update device
  DTS files accordingly
- we move additional stuff from our local v1.0.dtsi to the patch
- we drop partitions, LEDs and keys from the file as we will
  implement them differently anyway

Like with the previous patch, this follows the idea that a diff
from upstream might be easier to handle than a big file of our
own with different distribution pattern of properties.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b7b7c2a6ad ipq806x: use qcom-ipq8064.dtsi from upstream
Though a qcom-ipq8064.dtsi file exists upstream, we still do overwrite
it with a full version of our own in the ipq806x target. About half of
the contents of our file are upstream content, the other half are local
improvements.

To prevent us from having a lot of code maintained twice in parallel,
this adjusts the target to use the upstream qcom-ipq8064.dtsi. Our
local changes are arranged into three patches, the first pulling a
commit from upstream, the second doing a few small adjustments, and
the third adding all additional stuff.

This should get us the best of both worlds.

The property "ports-implemented" on sata@29000000 is moved to
2nd-level DTSI files as kernel defines it there as well.

While at, rename 080-ARM-dts-qcom-add-gpio-ranges-property.patch to
include the kernel version where it's added upstream.

Even though this might look more complicated in the first place,
the aim is to bring our files closer to upstream, so we can benefit
from changes directly and vice-versa. After all, this drop about
650 lines just copied from the upstream DTSI file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3635f7efc1 ipq806x: really fix aliases node for Qualcomm IPQ8064/DB149
Having looked at this again, it appears that only gsbi2_serial
is actually enabled for this device, so the entry in the broken
aliases node was correct.

Therefore, this needs to set its own serial0 instead of inheriting
"serial0 = &gsbi4_serial;" from DTSI. Do this with the correctly
named aliases node now.

Fixes: c83f7b6d21 ("ipq806x: fix aliases node name for Qualcomm
IPQ8064/DB149")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e363470d1a ipq806x: use consistent DT labels for gsbiX_serial
Kernel uses the label gsbiX_serial, so let's adjust our labels to
this naming scheme.

This is cosmetic, and actually only already existing gsbi4_serial
has been used at all.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c83f7b6d21 ipq806x: fix aliases node name for Qualcomm IPQ8064/DB149
This device uses a node incorrectly named "alias" instead of
"aliases" since it was introduced.

Remove it without replacement, as the definitions in it don't
seem to be required anyway:

The serial0 definition has never been effective anyway and this
would be the only device deviating from the common setting
"serial0 = &gsbi4_serial;" for ipq8064. (So, maybe the wrong
node prevented us from finding out about the wrong serial
definition?)

The mdio-gpio0 alias was supposed to be removed in d2a2eb7e48
anyway, the redundant definition in the alias node was just
overlooked back then.

Fixes: 0fd202f3e5 ("ipq806x: add db149 dts files")
Fixes: d2a2eb7e48 ("ipq806x: replace caf nss-gmac driver by upstream stmmac")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Pawel Dembicki f93267bccf ipq806x: enable Linksys EA8500 eth1 interface
At this moment Linksys EA8500 uses only eth0.

This patch change switch registers, which allow to use eth1 as lan
and eth0 as wan. The method work with similar Linksys EA7500V1
and it work with EA8500.

Suggested-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Brian Onn <brian.a.onn@gmail.com>
Tested-by: Adrian Panella <ianchi74@outlook.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Pawel Dembicki 20c7abd4b7 ipq806x: add support for Linksys EA7500 V1
This patch adds support for the Linksys EA7500 V1 router.

Specification:
 - CPU: Qualcomm IPQ8064
 - RAM: 256MB
 - Flash: NAND 128MB
 - WiFi: QCA9982 an+ac + QCA9983 bgn
 - Ethernet: 5 GBE Ports (WAN+ 4xLAN) (QCA8337)
 - USB: 1x USB 3.0 1x USB2.0
 - Serial console: RJ-45 115200 8n1 (1V8 Voltage level)
 - 2 Buttons
 - 1 LED

Known issues:
 - Some devices won't flash via web gui

Installation:
- Newer stock images doesn't allow to install custom firmware.
- Please downgrade software to 1.1.2 version. Official firmware:
https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.gpg.img
- Do it two times to downgrade all stored images.
- Apply factory image via web-gui.

Serial + TFTP method:
 - downgrade to 1.1.2 two times
 - connect ehternet and serial cable
 - set ip address of tftp server to 192.168.1.254
 - put openwrt factory image to tftp folder and rename it to macan.bin
 - stop device while booting in u-boot
 - run command: "run flashimg"
 - run command: "setenv boot_part 1"
 - run command "saveenv"
 - reset

Back to stock:
- Please use old non-gpg image like this 1.1.2:
https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.img
- ssh to router and copy image to tmp
- use sysupgrade -n -F

Tested by github users: @jack338c and @grzesiczek1

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[removed i2c4_pins, mdio0_pins, nand_pins, rgmii2_pins from DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 883250014d ipq806x: move serial0 to DTSI files
All device DTS files in the target set the serial0 property to the
same value (*). So, let's move the definitions to the DTSI files.

That's also where the kernel defines it (qcom-ipq8064-v1.0.dtsi).

* The only exception is ipq8064-db149, which defines
  "serial0 = &uart2;", but inside a block called "alias" instead of
  "aliases". It must be assumed that this is broken anyway, so we
  don't touch it here.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 74e339f118 ipq806x: move stdout-path to DTSI files
All device DTS files in the target set the stdout-path to the same
value. So, let's move the definitions to the DTSI files.

That's also where the kernel defines it (qcom-ipq8064-v1.0.dtsi).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ed761344d2 ipq806x: disentangle and clean up SoC DTSI files
So far, the DTSI files on ipq806x had a linear inheritance:

  qcom-ipq8064.dtsi
  v
  qcom-ipq8064-v1.0.dtsi
  v
  qcom-ipq8064-v2.0.dtsi
  v
  qcom-ipq8065.dtsi

This poses problems when one wants to set something that is specific
to an architecture closer to the top of the tree.

In this patch, we remove the chain-like inheritance and have all
other files derived from qcom-ipq8064.dtsi (changing this name to
something more generic is not possible due to upstream use).

The removal of inheritance will require a few entries to be copied
from qcom-ipq8064-v2.0.dtsi to qcom-ipq8065.dtsi. However, it also
opens an opportunity for some clean-up:

- Many definitions can be improved by just using the innermost labels.

- Instead of disabling the CPU_SPC node for ipq8065, it is now off by
  default and enabled where needed.

- Instead of patching phy-tx0-term-offset into qcom-ipq8064.dtsi and
  then having it changed for qcom-ipq8064-v2.0/qcom-ipq8065, just have
  the appropriate settings done in the lower DTSI files directly.

- For the opp_table0 adjustments for ipq8065, just redefine what's
  changed, but don't add all the untouched properties again.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 19c8f11d92 ipq806x: move common pinmux nodes to SoC DTSI
As almost same pinmux nodes are repeated in each device dts,
let's define them once in the ipq8064 dtsi and remove the rest.

* uart0_pins : Did not touch.
* i2c4_pins  : This node seems to be not used at all in dts.
               Added the most common form in the dtsi. Did not touch rpm_pins.
* spi_pins   : The common mux node is already present in the dtsi.
               Removed the duplicate nodes from dts.
* nand_pins  : Moved the entire node.
* mdio0_pins : Moved the common mux node.
* rgmii2_pins: Moved the common mux node. "pins" property is overrided in ap161.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler bdd4153b0e ipq806x: add newline at the end of qcom-ipq8064-v1.0.dtsi
The file does not have a newline at the end. Add it to apply to
common style.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Ansuel Smith e42aca06ab ipq806x: move mdio node to ipq8064 dts
As mdio0 is used in every dts move it to general ipq8064
dts and use label to set device specific definition.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith b921e31428 ipq806x: rework dts to use label
We should use label instead of redefine the node.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 64b2557e90 ipq806x: remove wrong compatible from timer node
This compatible definition deprecated long ago.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 0d8098548e ipq806x: use mdio dedicated driver
Enable kernel config flag
Convert all dts to use the new mdio driver

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

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

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

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

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

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago