Commit Graph

9 Commits (2630aae36fc2628647c349fc680c7b595fd73e4f)

Author SHA1 Message Date
Christian Lamparter 2630aae36f ipq40xx: device-tree overhaul
- replace licence texts with SPDX-License-Identifier where
   applicable.

 - make node-names more generic to fit with Device-Tree Release v0.2
   Section 2.2.2 Generic Names Recommendation.

 - utilize wifi0/1, blsp1_uart1 labels

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
John Crispin 95672e0433 ipq40xx: use patches that were sent upstream
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 1e48e56c50 ipq40xx: drop bus driver, its a no-op and only does lots of alloc/free
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Sven Eckelmann c4c2a8f00c ipq40xx: Move reserved-memory DT to qcom-ipq4019.dtsi
The tz and smem reserved-memory information handled in the upstream Linux
sources by the SoC specific dtsi and not by the the boards dts. Using the
same approach in OpenWrt avoids unneccessary duplication.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
Sven Eckelmann 0d62432834 ipq40xx: Remove unused reserved-memory nodes
The reserved-memory regions are mostly undocumented by QCA and are named
very unspecific in the QSDK device trees. It was tried to clean them up by
commit 71ed9f10a3 ("ipq40xx: Use detailed reserved memory for A42") and
similar changes.

The features which require these regions were mostly unknown but
Senthilkumar N L <snlakshm@qti.qualcomm.com> and Sricharan Ramabadhran
<srichara@qti.qualcomm.com> provided some more insight in some of them:

* crash dump feature
  - a couple of regions used when 'qca,scm_restart_reason' dt node has the
    value 'dload_status' not set to 1
    + apps_bl <0x87000000 0x400000>
    + sbl <0x87400000 0x100000>
    + cnss_debug <0x87400000 0x100000>
    + cpu_context_dump <0x87b00000 0x080000>
  - required driver not available in Linux
  - safe to remove
* QSEE app execution
  - region tz_apps <0x87b80000 0x280000>
  - required driver not available in Linux
  - safe to remove
* communication with TZ/QSEE
  - region smem <0x87b80000 0x280000>
  - driver changes not yet upstreamed
  - must not be removed because any access can crash kernel/program
* trustzone (QSEE) private memory
  - region tz <0x87e80000 0x180000>
  - must not be removed because any access can crash kernel/program

Removing the unnecessary regions saves some kilobyte of reserved-memory and
cleans up the device tree:

* 2560 KiB
  - 8devices Jalapeno
  - AVM FRITZ!Box 4040
  - Compex WPJ428
  - Meraki MR33 Access Point
  - OpenMesh A42
* 14336 KiB
  - GL.iNet GL-B1300
  - Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
Sven Eckelmann 71ed9f10a3 ipq40xx: Use detailed reserved memory for A42
The APPSBL and anything after that it not allowed to touch some of the
memory regions which are used by other components. Still trying to write to
the memory can lead to sudden device restarts

  (IPQ40xx) # mw 87e80000 0
  data abort
  pc : [<873149f8>]          lr : [<87308578>]
  sp : 86edfc28  ip : 86ef4412     fp : 00000000
  r10: 00000000  r9 : 00000000     r8 : 86edff68
  r7 : 00000003  r6 : 8737e624     r5 : 86ef4420  r4 : 8736c154
  r3 : 00000000  r2 : 00000010     r1 : 00000000  r0 : 00000000
  Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
  Resetting CPU ...

The device manufacturer only provided a very rough list of regions:

* rsvd1:     0x87000000 0x500000
* wifi_dump: 0x87500000 0x600000
* rsvd2:     0x87b00000 0x500000

A more detailed list for devices using the AP.DK reference design memory
maps was provided by Roman Yeryomin <roman@advem.lv> in commit 56f2df879fd
("ipq806x: ipq4019: add ap-dk01.1-c1 board support"):

* apps_bl:          0x87000000 0x400000
* sbl:              0x87400000 0x100000
* cnss_debug:       0x87500000 0x600000
* cpu_context_dump: 0x87b00000 0x080000
* tz_apps:          0x87b80000 0x280000
* smem:             0x87e00000 0x080000
* tz:               0x87e80000 0x180000

The u-boot function ipq_fdt_mem_rsvd_fixup seems to suggest that only the
rsvd2 (tz_apps, smem, tz) should be protected. All other regions would have
been removed by it when CONFIG_QCA_APPSBL_DLOAD is not enabled. This allows
to reduce the 16MB reserved memory region to only 4.5MB.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
Sven Eckelmann 9ca81646b9 ipq40xx: Use constant to set gpio active low/high
The GPIO configuration in the DTS have as third parameter the active
low/high configuration. This parameter is not easy to parse by humans when
it is only set to 0/1. It is better to use the predefined constants
GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
Sven Eckelmann 688ae1c4c0 ipq40xx: Fix DTS status parameter values
The "Devicetree Specification, Release v0.2 - 2.3.4 status" [1] only allows
the "okay" value for an operational device. The "ok" value will be accepted
by the kernel but should be avoided.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
6 years ago
Christian Lamparter d0e9621404 ipq40xx: OpenMesh A42 overhaul
Sort the soc entries in the dts by address and use dtc labels whenever
possible.

Adjust the DTS files, the OpenMesh A42 is actually an IPQ4018 and not an
IPQ4019.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago