Commit Graph

71 Commits

Author SHA1 Message Date
Christian Lamparter
36483600d3 apm821xx: WNDAP660: fix ethernet port ordering
Tim Small reported:
| Viewing the 'Network' -> 'Switch' config page in LuCI:
|
| The LuCI LAN 1 port corresponds to the port physically
|     labelled 2 at the rear of the device.
| [...]
|
| When a patch cord is attached to the port labelled 1 [...],
| the LED labelled 2 illuminates. [...]

=> Ports, LuCI and LEDs are reversed/don't match.

Reported-by: Tim Small
Fixes: #10111
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-06-25 00:06:46 +02:00
Christian Lamparter
cd1b4ea5aa apm821xx: align gpio-keys node names with dt-schema
As per the series:
<https://www.spinics.net/lists/devicetree/msg508906.html>

"Enforce specific naming pattern for children (keys) to narrow the
pattern thus do not match other properties.  This will require all
children to be properly prefixed or suffixed (button, event, switch
or key)."

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-06-19 12:40:30 +02:00
Christian Lamparter
5f7828fcc2 apm821xx: MBL: make mtd chip work
The MBL has a 512KiB Microchip SST39VF040 chip for uboot and
not much else.

Thanks to Ewald who figured out that the "jedec-probe" vs.
"jedec-flash" was the wrong binding. With this information
and the jedec-probe support enabled => the chip works.

| physmap-flash 4fff80000.nor_flash: physmap platform flash device: [mem 0x4fff80000-0x4ffffffff]
| Found: SST 39LF040
| 4fff80000.nor_flash: Found 1 x8 devices at 0x0 in 8-bit bank

Suggested-by: Ewald Comhaire <e.comhaire@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-06-19 12:31:02 +02:00
Christian Lamparter
d65bafa34b apm821xx: use nested fixed-partitions
This makes it possible to fix Netgear WNDAP620+660 DTS ugliness.
Bring back the dtb and firmware partitions for the WNDR4700.
Thank you, mans0n.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-05-14 11:08:45 +02:00
Christian Lamparter
b0d5939b80 apm821xx: WNDR4700: use upstream tc654 cooling devices
Upstream hwmon-maintainer had various comments about
the changes to the tc654 driver. These have been
addressed and the cooling device support is destined
for inclusion.

One of the comments was the change of the cooling states
scaling. No longer the driver uses the same values as the
hwmon interface, instead the states are now the 17 states
the tc654 supports.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-19 19:34:18 +01:00
Christian Lamparter
a1693a8c2c apm821xx: WNDR4700: utilize ath9k nvmem-cells
the WNDR4700 can fetch its calibration data and
mac-addresses directly from the "wifi_data" partition.
This allows us to get rid of the 10-ath9k-eeprom file
for the apm821xx target completely.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-04 21:15:17 +01:00
Christian Lamparter
f095822699 apm821xx: convert legacy nand partition layout
in order to get nvmem-cells to work on AP and routers
(Netgears WNDR4700). The nvmem-cell needs to be within
a fixed-partition dt-node.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-04 21:15:17 +01:00
Christian Lamparter
1085c4b4a7 apm821xx: WNDR4700: delete dead dt definitions
cooling-{min|max}-level are no longer used.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-04 21:15:17 +01:00
Christian Lamparter
0e841fd4a2 apm821xx: remove broken PCIe MSI support
These never worked and upstream is in the process of removing
them as well. Legacy PCI interrupt signaling is still working
as before.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-12-27 13:55:10 +01:00
Christian Lamparter
4e6ebdd7ce apm821xx: remove overlapping partitions
Apart from the dtb partition, these were all "read-only;"
they serve no purpose other than being a copy of what
netgear had defined in their original firmware.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-12-27 13:55:10 +01:00
Christian Lamparter
832b9cbd74 apm821xx: fix WD MyBook Live DUO USB-Port
where to begin? the USB regulator settings were just
a part of the issue. With them changed, according to
the forum it still failed when a USB device was
connected to the port with:

dwc2 4bff80000.usbotg: dwc2_restore_global_registers: no global registers to restore
dwc2 4bff80000.usbotg: dwc2_exit_partial_power_down: failed to restore registers
dwc2 4bff80000.usbotg: exit partial_power_down failed
dwc2 4bff80000.usbotg: HC died; cleaning up

One clue was found upstream in
commit cc10ce0c51b1 ("usb: dwc2: disable power_down on Amlogic devices")

|Disable power_down by setting the parameter to
|DWC2_POWER_DOWN_PARAM_NONE. This fixes a problem on various Amlogic
|Meson SoCs where USB devices are only recognized when plugged in before
|booting Linux. A hot-plugged USB device was not detected even though the
|device got power (my USB thumb drive for example has an LED which lit
|up).
|[...]

the same method proposed there worked with APM821xx's USB IP-Core.

Link: https://forum.openwrt.org/t/wd-my-book-duo-usb/111926/2
Reported-by: thwe and takimata (openwrt forum)
Fixes: b70d3557e0 ("apm821xx: clean up gpio-hogs")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-12-27 13:55:10 +01:00
Christian Lamparter
8b0c053671 apm821xx: implement new LED label naming scheme
This patch updates all current APM82181 devices over to that
"new LED naming scheme". This includes many updates to the
device-tree:
	- dropped the deprecated, but beloved "label" property.
	- rename all DT leds node names to led-#.
	- add function and color properties.
	- utilized panic-indicator property.
	- dropped led- aliases (see below).

migration scripts for all devices are included.

For more information. See:
<https://www.kernel.org/doc/html/latest/leds/leds-class.html>

For the future: It looks like the color+function properties
won over the dt-alias / label. This will need to be wired up
into openwrt eventually. For APM821xx the situation is that
all devices have a dedicated power and fault indicator.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-10-22 21:25:18 +02:00
Christian Lamparter
bbb3852401 apm821xx: MBL: HDD regulators overhaul for MBL DUO
Takimata reported on the OpenWrt forum in thread [0], that his
MyBook Live Duo wasn't booting OpenWrt 21.02 after upgrading
from the previous OpenWrt 19.07.

The last logged entries on his console

|[    0.531599] sata1-regulator GPIO handle specifies active low - ignored
|[    0.538391] sata0-regulator GPIO handle specifies active low - ignored
|[    0.759791] ata2: SATA link down (SStatus 0 SControl 300)
|[    0.765251] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
|[    5.909555] ata1.00: qc timeout (cmd 0xec)
|[    5.913656] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
|[    6.231757] ata1: SATA link down (SStatus 0 SControl 300)

This extract clearly showed that the HDD on which OpenWrt is installed,
simply disappeared after the SATA power regulators had been initialized.

The reason why this worked with OpenWrt 19.07 was because the kernel
config symbol CONFIG_REGULATOR=y was not set in the target's config-4.14.

(This shows that the MBL Single does differ from the DUO in that
it does not have programmable power regulators for the HDDs.)

[0] <https://forum.openwrt.org/t/21-02-0-and-snapshot-fail-to-boot-on-my-book-live-duo/106585>

Reported-by: Takimata (forum)
Tested-by: Takimata (forum)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-10-22 21:25:18 +02:00
Christian Lamparter
7a6a349445 apm821xx: WNDAP620 + WNDAP660: reorganize partitions for 5.10
Due to 5.10 increased kernel size, the current 4MiB-ish kernel
partition got too small. Luckily, netgear's uboot environment
is setup to read 0x60000 bytes from the kernel partition location.

... While at it: also do some cleanups in the DTS in there.

The original (re-)installation described in
commit d82d84694e ("apm821xx: add support for the Netgear WNDAP620 and WNDAP660")
seemed to be still working for now. What I noticed though
is that the bigger initramfs images needed to use a different
destination address (1000000) to prevent it overwriting
itself during decompression. i.e:
 # tftp 1000000 openwrt-...-wndap620-initramfs-kernel.bin
 # bootm

However, in case of the WNDAP620+660 the factory.img image can be
written directly to the flash through uboot.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-10-10 16:44:15 +02:00
Christian Lamparter
df07bafcd2 apm821xx: MBL: correct phy-mode delay settings
This came up in an upstream commit: "
b1dd9bf688b0 "net: phy: broadcom: Fix RGMII delays for BCM50160 and BCM50610M"

The PHY driver entry for BCM50160 and BCM50610M calls
bcm54xx_config_init() but does not call bcm54xx_config_clock_delay() in
order to configuration appropriate clock delays on the PHY, fix that."

So the "rgmii" phy-mode has always been wrong, but went unnoticed since
the broadcom phy driver didn't push the delay settings to the chip.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-05-01 12:25:12 +02:00
Christian Lamparter
be23f9818a apm821xx: add support for kernel 5.10 for testing
This patch copies over refreshed patches from 5.4.

 - dropped crypto patches (they got upstreamed)

 - dropped renesas USB 3 firmware loader (they got upstreamed)

 - NAND now needs extra device-properties for ECC settings.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-03-05 22:47:14 +01:00
Christian Lamparter
252197f014 apm821xx: provide legacy interrupts for PCIe in DT
Devices with PCIe-Switches like the WNDR4700, MR24 and WNDAP660
need to have the interrupts property specified in the device-tree
for the legacy pci interrupt signaling method to work.

If the proper interrupt value is not specified, the default INTA
IRQ 12 is taken for all devices. This is especially bad, if the
device is setup to use INTC, because these interrupts will not
be serviced.

Russell Senior reported his experience on the MR24:
"The symptom is client devices can't see the beacons.
Wifi ifaces appear, can scan and hear other networks,
but clients can't see the MR24's SSIDs."

(The interrupts-property on the WNDAP620 was optional since it
uses INTA by default. Likewise the MX60W is in the same category)

Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-05 23:26:05 +02:00
Christian Lamparter
f589bd9283 apm821xx: fix typos in .dts files
This patch fixes various typos or tab-vs-space issues in
the APM821XX device targets Device-Tree source files.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:15:09 +02:00
Christian Lamparter
e4c33462f9 apm821xx: use SPDX-License-identifiers
Please note that the DTS are based on really old .DTS from vendors
themselves.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:15:03 +02:00
Christian Lamparter
eb6bb94b12 apm821xx: apm821xx.dtsi fix comment styles
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:58 +02:00
Christian Lamparter
4ea5d443db apm821xx: MX60W: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration for
the Meraki MX60W.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:55 +02:00
Christian Lamparter
1640e71e8e apm821xx: WNDR4700: delete wndr4700 board file
Thanks to the PCIE OF enumeration patch, this is technically
no longer needed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:49 +02:00
Christian Lamparter
9153955095 apm821xx: MR24: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration for
the Meraki MR24.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:44 +02:00
Christian Lamparter
b15420fc6c apm821xx: add missing cells-values for IIC1
These are copied over from the IIC0.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:42 +02:00
Christian Lamparter
90909ef4ba apm821xx: DTB: fix warnings related to sata-port warnings
This patch silences the following warnings:
>netgear-wndr4700.dts:168.3-13:Warning (reg_format): /plb/sata@bffd1800/sata-port@0:reg:property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
>netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #address-cells value
>netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #size-cells value

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:37 +02:00
Christian Lamparter
0facedb515 apm821xx: WNDAP6x0: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration of the
WNDAP620 and WNDAP660.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:31 +02:00
Christian Lamparter
2c3f16d70e apm821xx: WNDR4700: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration of the
WNDR4700.

This allows to get rid of the legacy firmware monikers and drop
the usbport LED declaration.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:27 +02:00
Christian Lamparter
3509d4ec56 apm821xx: wndr4700: add preliminary drivetemp sensor
This patch prepares the WNDR4700 to use the HDD sensor for
the thermal zone. While the kernel's thermal.txt device-tree
binding documentation files talks about supporting multiple
sensors for a zone. This sadly is NOT the case. Even the most
current upstream kernels (5.6-rc) supports just >one< sensor
per zone: (driver/base/of-thermal.c:886)
| * REVIST: for now, the thermal framework supports only
| * one sensor per thermal zone. Thus, we are considering
| * only the first two values as slope and offset.

I do hope that this warning will prevent others wasteing time
on trying to figure out why their multi-sensor thermal-zones
definitions are not working as specified.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-03-22 23:02:09 +01:00
Christian Lamparter
01fe7a2b64 apm821xx: add drivetemp sensor for the WD MyBook Series
This patch adds the hwmon-drivetemp to the device.
It also adds device-tree bindings. This can be useful to
automate external fans which can be controlled for example
by either an unused sata-port or by the usb-power regulator.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-03-22 23:02:09 +01:00
Christian Lamparter
1c880f2324 apm821xx: remove gpio-interrupt cruft
This hunk became obsolete the moment when our
gpio-button-hotplug learned how to deal with
interrupt-supported gpio buttons. The gpio driver
never supported interrupt handling, so these
properties never served any use (outside of a
enhanced ppc4xx-gpio driver that was dropped).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-02-29 14:14:08 +01:00
Christian Lamparter
95f2bb24be apm821xx: fix fan control on highest step
This patch removes a typo (extra "0") so that the 'cpu-alert6'
step is triggered once the system reaches 85°C.

Note: Unless the WNDR4700 is placed in an hot oven, the
hardware-monitor will never reach this value.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-09-29 00:46:13 +02:00
Christian Lamparter
971f31bedc apm821xx: fix bogus key-presses on boot
"There are often transient line events when
the system is powered up and initialized and it
is often necessary for the gpio_chip driver to
clear any interrupt flags in hardware before
setting up the gpio chip, especially the
irqchip portions of it."
<http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017630.html>

This patch adds a fix for the APM821XX's interrupt
controller to clear any bogus pending toggled
interrupts that happens on various APM821XX boards
on boot.

The patch also changes the debouce-interval from the
default 5ms debounce interval to 60ms all around.
The default setting caused on occasions that the button
state became stuck in a pressed state, even though the
button was released.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-06-20 19:58:27 +02:00
Christian Lamparter
1544df0d89 apm821xx: MX60: convert to interrupt-driven gpio-key driver
This patch converts the device to use the gpio-key
over gpio-key-polled driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-06-02 11:08:37 +02:00
Christian Lamparter
651adad603 apm821xx: MR24: convert to interrupt-driven gpio-key driver
This patch converts the device to use the gpio-key
over gpio-key-polled driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-06-02 11:08:37 +02:00
Christian Lamparter
9148cbcb7b apm821xx: WNDAP6X0: convert to interrupt-driven gpio-key driver
This patch converts the device to use the gpio-key
over gpio-key-polled driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-06-02 11:08:37 +02:00
Christian Lamparter
bd83592fc4 apm821xx: wndr4700: interrupt-driven gpio-keys
This patch fixes the active_low setting and
converts all of the physical keys on the wndr4700
to utilize the interrupt-driven gpio-keys driver
over the polled version.

The sdcard-insertion hack has been removed since the
block-subsystem will now be polling the device instead.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-05-31 10:30:03 +02:00
Petr Štetiar
00d14635db apm821xx: set mib-poll-interval on emac0 attached ar83xx switch
Commit "generic: ar8216: add mib_poll_interval switch attribute" sets
mib-poll-interval as disabled by default (was set to 2s), so it makes
switch LEDs trigger disfunctional on devices which don't have
mib-poll-interval set.

So this patch sets mib-poll-interval to 500ms on devices which have
ar83xx switch connected to emac0, as the same value was set for built in
switches in 443fc9ac35 ("ath79: use ar8216 for builtin switch").

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-05-20 21:19:48 +02:00
Christian Lamparter
f932137385 apm821xx: dts overhaul
- remove stray #address-cells / #size-cells

 - fix partition unit-addresses in wd-mybooklive.dts

 - remove index from MBL's gpio node name

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-01-24 15:53:03 +01:00
Petr Štetiar
cbb44f6ed7 apm821xx: 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
a692eecda1 apm821xx: 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
Christian Lamparter
32141c183a apm821xx: add linux 4.19 apm821xx patches
This patch updates the apm821xx target to use the 4.19 kernel.

4.19 ships with all the crypto4xx driver patches. Furthermore,
the DW-DMA fix for the SATA controller has been backported from
4.20 and integrated.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-12-27 14:36:23 +01:00
Christian Lamparter
0bce89037f apm821xx: WNDAP620: remove bad semicolon in dts after #include
This patch fixes a build warning triggered by a semicolon in
the dts after the #include directive.

netgear-wndap620.dts:11:33: warning: extra tokens at end of #include directive

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-12-09 15:27:34 +01:00
Christian Lamparter
bd3e234473 apm821xx: move fifo-entry-size property to WNDR4700
This property (and value) came from Netgear's WNDR4700
stock firmware dts. However, other devices do not set
it and the EMAC default is 16, which matches that of
the programming notes of the APM82181 spec.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-12-09 15:27:29 +01:00
Christian Lamparter
d82d84694e apm821xx: add support for the Netgear WNDAP620 and WNDAP660
This patch adds support for the Netgear WNDAP620 and WNDAP660,
they are similar devices, but due to the LAN LED configuration,
the switch setup and WIFI configuration each gets a different
device target.

Hardware Highlights WNDAP620:
CPU: AMCC PowerPC APM82181 at 1000 MHz
DRAM:  128 MB, 2 x 64 MiB DDR2 Hynix H5PS5162GF
CPU: AMCC PowerPC APM82181 at 1000 MHz
FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A
Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY - Only 1 GBit Port (POE)
Wifi: Atheros AR9380 minipcie - Dual-Band - 3x3:3
Serial: console port with RJ45 Interface (9600-N-8-1)
LEDS: Power, LAN-Activity, dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs
Button: Soft Reset Button
Antennae: 3 internal dual-band antennae + 3 x RSMA for external antennaes

Hardware Highlights WNDAP660:
CPU: AMCC PowerPC APM82181 at 1000 MHz + 2 Heatsinks
DRAM:  256 MB, 2 x 128 MiB DDR2
FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A
Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY (POE)
Wifi1: Atheros AR9380 minipcie - Dual-Band - 3x3:3
Wifi2: Atheros AR9380 minipcie - Dual-Band - 3x3:3
Serial: console port with RJ45 Interface (9600-N-8-1)
LEDS: Power, LAN-Activity, 2x dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs
Button: Soft Reset Button
Antennae: 6 internal dual-band antennae + 3 x RSMA for external antennaes

Flashing requirements:

 - needs a tftp server at 192.168.1.10/serverip.
 - special 8P8C(aka RJ45)<->D-SUB9 Console Cable
   ("Cisco Console Cable"). Note: Both WNDAP6x0 have
   a MAX3232 transceivers, hence no need for any separate
   CMOS/TTL level shifters.

External Antenna:
The antennae mux is controlled by GPIO 11 and GPIO14. Valid Configurations:
 = Config# = | = GPIO 11 = | = GPIO 14 = |  ===== Description =====
      1.     |   1 / High  |  0 / Low    | Use the internal antennae (default)
      2.     |   0 / Low   |  1 / High   | Use the external antennae

The external antennaes are only meant for the 2.4 GHz band.

One-way Flashing instructions via u-boot:

 0. connect the serial cable to the RJ45 Console Port
    Note: This requires a poper RS232 and not a TTL/USB adaptor.

 1. power up the AP and interrupt the u-boot process at

    'Hit any key to stop autoboot'

 2. setup serverip and ipaddr env settings
    Enter the following commands into the u-boot shell
    # setenv ipaddr 192.168.1.1
    # setenv serverip 192.168.1.10

 3. download the factory.img image to the AP
    Enter the following commands into the u-boot shell

    # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-squashfs-factory.img

 4. verfiy image integrity
    Enter the following commands into the u-boot shell

    # crc32 $fileaddr $filesize

    If the calculated crc32 checksum does not match, go back to step 3.

 5. flash the image
    Enter the following commands into the u-boot shell

    # nand erase 0x110000 0x1bd0000
    # nand write ${kernel_addr_r} 0x110000 ${filesize}

 6. setup uboot environment
    Enter the following commands into the u-boot shell

    # setenv bootargs
    # setenv fileaddr
    # setenv filesize
    # setenv addroot 'setenv bootargs ${bootargs} root=/dev/ubiblock0_0'
    # setenv owrt_boot 'nboot ${kernel_addr_r} nand0 0x110000; run addroot; run addtty; bootm ${kernel_addr_r}'
    # setenv bootcmd 'run owrt_boot'
    # saveenv

 7. boot
    # run bootcmd

Booting initramfs instructions via u-boot:

 Follow steps 0 - 2 from above.

 3. boot initramfs
    Enter the following commands into the u-boot shell

    # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-initramfs-kernel.bin
    # run addtty
    # bootm ${kernel_addr_r}

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-11-26 12:05:46 +01:00
Christian Lamparter
f6968952df apm821xx: MR24: add to uboot-envtools
This patch adds the complicated u-boot
environment access settings for to the
MR24 target.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-11-26 12:05:46 +01:00
Christian Lamparter
fc70276e6c apm821xx: add disk-activity triggers via DT.
The WNDR4700 and the MBL have a dedicated HDD activity LED.
This patch adds the default led triggers to the DTS and
removes the entries in 01_leds.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-10-20 16:13:39 +02:00
Christian Lamparter
1d5d77612f apm821xx: apm82181.dtsi overhaul
- order entries by mmio address where possible

 - switch to lower-case address values

 - comment on BSP u-boot behaviour in regards to
   what it edits and look for

 - annotate irq lines with the help of interrupt-names

 - remove deprecated "device_type" properties
   The pci and network device_type had to stay since
   they are required by the drivers and u-boot.
   the cpu and memory device_types will remain as well
   as they are still part of the DT Spec.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-10-20 16:13:39 +02:00
Christian Lamparter
9ca82c2374 apm821xx: force WNDR4700 console to 115200n8
With the upcoming 4.19 release, the serial console on the
Netgear WNDR4700 would no longer work as it is never really
set and always relied on the kernel's serial code not to
change the baud rate.

On the stock firmware, Netgear forced the console setting
through a custom CONFIG_CMDLINE in their kernel to 115200.
Normally, they should have done it in a different way and
just passed the baudrate through a "console=..." kernel
parameter via the bootargs in the "/chosen" dt node.
But in their default u-boot bootcmd setting, they somehow
forgot to add the "run addtty", so there's no easy way to
pass the baudrate from u-boot to the kernel. So it has
to be forced as otherwise it ends up as 9600 baud.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-10-20 16:13:39 +02:00
Christian Lamparter
68bb91018d apm821xx: set uart compatible to ns16750
The APM821XX/PPC460EX datasheet mentions:
"Register compatibility with 16750 register set"

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-10-20 16:13:39 +02:00
Christian Lamparter
c417aee9f1 apm821xx: fix dtc compiler warnings for MX60(W) and MR24's dts files
This patch fixes some of the dtc warnings:

MR24:
"reg" property in [...]mdio/phy@1 has invalid length (4 bytes)
Node [...]button@1 has a unit name, but no reg property
Relying on default #address-cells value for [...]phy@1
Relying on default #size-cells value for [...]phy@1

MX60(W):
Node [..]nand/all has a reg or ranges property, but no unit name
Node [..]button@1 has a unit name, but no reg property

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2018-09-29 17:23:11 +02:00