aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mpc85xx
Commit message (Collapse)AuthorAgeFilesLines
* mpc85xx: add support for Watchguard Firebox T10David Bauer2023-03-0711-1/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- SoC: Freescale P1010 RAM: 512MB FLASH: 1 MB SPI-NOR 512 MB NAND ETH: 3x Gigabite Ethernet (Atheros AR8033) SERIAL: Cisco RJ-45 (115200 8N1) RTC: Battery-Backed RTC (I2C) Installation ------------ 1. Patch U-Boot by dumping the content of the SPI-Flash using a SPI programmer. The SHA1 hash for the U-Boot password is currently unknown. A tool for patching U-Boot is available at https://github.com/blocktrron/t10-uboot-patcher/ You can also patch the unknown password yourself. The SHA1 hash is E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA 2. Interrupt the bootmenu by pressing CTRL+C. A password prompt appears. The patched password is '1234' (without quotation marks) 3. Download the OpenWrt initramfs image. Copy it to a TFTP server reachable at 10.0.1.13/24 and rename it to uImage. 4. Connect the TFTP server to ethernet port 0 of the Watchguard T10. 5. Download and boot the initramfs image by entering "tftpboot; bootm;" in U-Boot. 6. After OpenWrt booted, create a UBI volume on the old data partition. The "ubi" mtd partition should be mtd7, check this using $ cat /proc/mtd Create a UBI partition by executing $ ubiformat /dev/mtd7 -y 7. Increase the loadable kernel-size of U-Boot by executing $ fw_setenv SysAKernSize 800000 8. Transfer the OpenWrt sysupgrade image to the Watchguard T10 using scp. Install the image by using sysupgrade: $ sysupgrade -n <path-to-sysupgrade> Note: The LAN ports of the T10 are 1 & 2 while 0 is WAN. You might have to change the ethernet-port. 9. OpenWrt should now boot from the internal NAND. Enjoy. Signed-off-by: David Bauer <mail@david-bauer.net>
* mpc85xx: p2020: enable CONFIG_MAX63XX_WATCHDOGJosef Schlehofer2023-03-041-0/+1
| | | | | | | | | This enables CONFIG_MAX63XX_WATCHDOG [1], which can be used on P2020 RDB. [1] https://cateee.net/lkddb/web-lkddb/MAX63XX_WATCHDOG.html Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* kernel: Add CONFIG_PPC_QUEUED_SPINLOCKS configuration optionHauke Mehrtens2023-02-231-1/+0
| | | | | | | | | | The CONFIG_PPC_QUEUED_SPINLOCKS configuration option is not defined for kernel 5.15, it is defined for kernel 5.10. This fixes the compilation of mpc85xx/p2020 with kernel 5.15. Reviewed-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* mpc85xx: switch default kernel to 5.15Nick Hainke2023-02-221-2/+1
| | | | | | | | | | The default kernel should be switched to 5.15 in order to enable testing by a broader audience. Tested on TP-Link TL-WDR4900 v1. Acked-by: Josef Schlehofer <pepe.schlehofer@gmail.com> Signed-off-by: Nick Hainke <vincent@systemli.org>
* mcp85xx: Switch TP-Link TL-WDR4900 v1 to DSAPawel Dembicki2023-02-208-25/+105
| | | | | | | | | This patch introduces DSA support for TP-Link TL-WDR4900 v1 switch. Swconfig driver for QCA8327 switch is removed because this router is only one device which use Qualcom swconfig switch. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Tested-by: Nick Hainke <vincent@systemli.org> # TP Link WDR4900 v1 (5.15)
* mpc85xx: refresh kernel configPawel Dembicki2023-02-202-27/+15
| | | | | | It was done by "make kernel_oldconfig" command for 5.10 and 5.15. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
* mpc85xx: p2020: kernel: enable CONFIG_BLK_DEV_NVMEŠimon Bořek2023-02-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables use of NVMe storage devices with appropriate adapter in miniPCIe slots (including for boot) in Turris 1.x routers and possibly NXP P2020RDB boards (these are the only currently supported p2020 devices according to docs[^1]). Proper detection, mountability and readability was proved to be working on Turris 1.1, OpenWrt 21.02 with similar configuration. Increases gzip compressed kernel size by approximately 37 KiB (from 3 703 KiB to 3 740 KiB). Should boot from those devices be possible the driver needs to be built in. Inclusion as a module would prevent this functionality. CONFIG_BLK_DEV_NVME=y Includes NVMe driver in the kernel.[^2] CONFIG_NVME_CORE=y Selected by CONFIG_BLK_DEV_NVME.[^3] Not necessarily needed to be enabled explicitly, but included to match the form of similar functionality implementations for mvebu, x86_64 and rockchip_armv8 targets. CONFIG_NVME_MULTIPATH disabled explicitly to prevent using more space than necessary. [^1]: https://openwrt.org/docs/techref/targets/mpc85xx [^2]: https://cateee.net/lkddb/web-lkddb/BLK_DEV_NVME.html [^3]: https://cateee.net/lkddb/web-lkddb/NVME_CORE.html Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
* mpc85xx: p2020: kernel: refresh configurationŠimon Bořek2023-02-071-5/+15
| | | | | | | 'make kernel_oldconfig CONFIG_TARGET=subtarget' applied to current master Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
* treewide: replace wpad-basic-wolfssl defaultRosen Penev2023-02-041-1/+1
| | | | | | | The newly merged mbedtls backend is smaller and has fewer ABI related issues than the wolfSSL one. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* kernel: backport of changes & helpersRafał Miłecki2023-01-071-1/+1
| | | | | | This code is required for upcoming NVMEM changes. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mpc85xx: change CPU_TYPE from 8540 to 8548Šimon Bořek2022-12-291-1/+1
| | | | | | | | | | | | | | | | | | All subtargets as p1010, p1020, p2020 uses e500v2 cores [1] [2] [3] [4], so let's force cpu type to 8545 for all mpc85xx target even though there might exist device with e500v1, but there is no such router supported in OpenWrt and because of that it does not make sense to to set CPU_TYPE for each subtarget. All MPC85xx SoC can be found here: https://www.nxp.com/products/processors-and-microcontrollers/legacy-mpu-mcus/powerquicc-processors:POWERQUICC_HOME#powerquicc-iii-mpc85xx [1] https://www.nxp.com/docs/en/application-note/AN2807.pdf [2] https://www.nxp.com/docs/en/fact-sheet/QP1010FS.pdf [3] https://www.nxp.com/docs/en/product-brief/P1020PB.pdf [4] https://www.nxp.com/docs/en/fact-sheet/QP20XXFS.pdf Co-authored-by: Pali Rohár <pali@kernel.org> Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
* mpc85xx: drop empty patch as it backported to LTS kernel 5.15.70Josef Schlehofer2022-12-241-0/+0
| | | | | | | | | This patch is part of Linux kernel 5.15.70, the content was removed, but the empty file is still being carried over the repository, so remove it once for all Fixes: e1b009c ("kernel: bump 5.15 to 5.15.70") Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* mpc85xx: fix missing kernel config symbolJosef Schlehofer2022-11-161-0/+1
| | | | | | | | | | | | | While compiling OpenWrt master for Turris 1.x routers (p2020), it reported following error: Gianfar Ethernet (GIANFAR) [Y/n/m/?] y Freescale DPAA2 Ethernet Switch (FSL_DPAA2_SWITCH) [N/m/y/?] (NEW) Error in reading or end of file. Let's fix it by disabling it. Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* kernel: bump 5.15 to 5.15.75John Audia2022-10-302-4/+4
| | | | | | | | | | | | | | | | | | | | | Removed upstreamed: bcm27xx/patches-5.15/950-0446-drm-vc4-Fix-timings-for-VEC-modes.patch[1] Manually rebased: patches-5.15/950-0600-xhci-quirks-add-link-TRB-quirk-for-VL805.patch bcm27xx/patches-5.15/950-0606-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch bcm27xx/patches-5.15/950-0717-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch All other patches automatically rebased 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.75&id=2810061452f9b748b096ad023d318690ca519aa3 Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.10 to 5.10.150John Audia2022-10-302-4/+4
| | | | | | | | | | | Manually rebased: bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch All patches automatically rebased. Signed-off-by: John Audia <therealgraysky@proton.me> [Move gro_skip in 680-NET-skip-GRO-for-foreign-MAC-addresses.patch to old position] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* mpc85xx: fix unset kernel symbolDavid Bauer2022-10-141-0/+2
| | | | Signed-off-by: David Bauer <mail@david-bauer.net>
* mpc85xx: p1010: make TP-Link WDR4900 v1 build againMatthias Schiffer2022-10-141-3/+17
| | | | | | | Add the spi-loader as a pre-kernel stage, so we can lift the kernel size limit. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* mpc85xx: add SPI kernel loader for TP-Link TL-WDR4900 v1Matthias Schiffer2022-10-1422-0/+1364
| | | | | | | | | | Similar to the lzma-loader on our MIPS targets, the spi-loader acts as a second-stage loader that will then load and start the actual kernel. As the TL-WDR4900 uses SPI-NOR and the P1010 family does not have support for memory mapping of this type of flash, this loader needs to contain a basic driver for the FSL ESPI controller. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* kernel: bump 5.10 to 5.10.145John Audia2022-10-021-37/+0
| | | | | | | | | | | | | | Manually rebased: hack-5.10/780-usb-net-MeigLink_modem_support.patch Removed upstreamed: patches-5.10/110-gpio-mpc8xxx-Fix-support-for-IRQ_TYPE_LEVEL_LOW-flow.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.145&id=24196210b198e8e39296e277bb93b362aa207775 Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.15 to 5.15.70John Audia2022-10-021-37/+0
| | | | | | | | | | | | | | | | | | Manually rebased: hack-5.15/780-usb-net-MeigLink_modem_support.patch Removed upstreamed: patches-5.15/110-gpio-mpc8xxx-Fix-support-for-IRQ_TYPE_LEVEL_LOW-flow.patch[1] All other patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.70&id=89cfddd416bac41ff35f37f928ed3d7fefef908e Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.15 to 5.15.68John Audia2022-09-175-40/+20
| | | | | | | | | | All patches automatically rebased Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <therealgraysky@proton.me>
* mpc85xx: Add 5.15 kernel as testing and fix configsWojciech Dubowik2022-09-144-0/+6
| | | | | | | | | Build system: x86_64 Build-tested: generic Run-tested: generic/TL-WDR4900 v1 board from TP-Link Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@westermo.com> Signed-off-by: Petr Štetiar <ynezz@true.cz> [un-dmarc]
* mpc85xx: Copy over kernel 5.10 patches and config to 5.15Wojciech Dubowik2022-09-1412-0/+831
| | | | | | | Split patches for better change visibility. Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@westermo.com> Signed-off-by: Petr Štetiar <ynezz@true.cz> [un-dmarc, commit description]
* mpc85xx: Make AP3825i boot env partition writableMartin Kennedy2022-09-111-2/+0
| | | | | | | | | | | | | | | End-users may need to be able to rewrite u-boot configuration on the WS-AP3825i, which has had repeated issues with the exact configuration of u-boot, e.g. commit 1d06277407 ("mpc85xx: Fix output location of padded dtb") (alongside other failures documented for example in this post[^1] from the main AP3825i porting thread). To assist with this, remove the `read-only` property from the u-boot configuration partitions cfg1 and cfg2. [^1]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168/107 Signed-off-by: Martin Kennedy <hurricos@gmail.com>
* mpc85xx: add patch to fix gpio mpc8xxxJosef Schlehofer2022-09-111-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backports patch, which is currently on review [1] for kernel 5.10 and kernel 5.15, where it applies cleanly. This was tested on CZ.NIC Turris 1.1 router running OpenWrt 21.02.03 with kernel 5.15. Before: - In /var/log/messages: ``` [ 16.392988] lm90 0-004c: cannot request IRQ 48 [ 16.398280] lm90: probe of 0-004c failed with error -22 ``` - Sensors does not work: ``` root@turris:~# sensors No sensors found! Make sure you loaded all the kernel drivers you need. Try sensors-detect to find out which these are. ``` After: ``` root@turris:/# sensors sa56004-i2c-0-4c Adapter: MPC adapter (i2c@3000) temp1: +44.0°C (low = +0.0°C, high = +70.0°C) (crit = +85.0°C, hyst = +75.0°C) temp2: +73.8°C (low = +0.0°C, high = +70.0°C) ALARM (HIGH) (crit = +85.0°C, hyst = +75.0°C) ``` [1] https://lore.kernel.org/linux-gpio/20220906105431.30911-1-pali@kernel.org/ Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* mpc85xx: Drop pci aliases to avoid domain changesMartin Kennedy2022-09-026-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of upstream Linux commit 0fe1e96fef0a ("powerpc/pci: Prefer PCI domain assignment via DT 'linux,pci-domain' and alias"), the PCIe domain address is no longer numbered by the lowest 16 bits of the PCI register address after a fallthrough. Instead of the fallthrough, the enumeration process accepts the alias ID (as determined by `of_alias_scan()`). This causes e.g.: 9000:00:00.0 PCI bridge: Freescale Semiconductor Inc P1020E (rev 11) 9000:01:00.0 Network controller: Qualcomm Atheros AR958x 802.11abgn ... to become 0000:00:00.0 PCI bridge: Freescale Semiconductor Inc P1020E (rev 11) 0000:01:00.0 Network controller: Qualcomm Atheros AR958x 802.11abgn ... ... which then causes the sysfs path of the netdev to change, invalidating the `wifi_device.path`s enumerated in `/etc/config/wireless`. One other solution might be to migrate the uci configuration, as was done for mvebu in commit 0bd5aa89fcf2 ("mvebu: Migrate uci config to new PCIe path"). However, there are concerns that the sysfs path will change once again once some upstream patches[^2][^3] are merged and backported (and `CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT` is enabled). Instead, remove the aliases and allow the fallthrough to continue for now. We will provide a migration in a later release. This was first reported as a Github issue[^1]. [^1]: https://github.com/openwrt/openwrt/issues/10530 [^2]: https://lore.kernel.org/linuxppc-dev/20220706104308.5390-1-pali@kernel.org/t/#u [^3]: https://lore.kernel.org/linuxppc-dev/20220706101043.4867-1-pali@kernel.org/ Fixes: #10530 Tested-by: Martin Kennedy <hurricos@gmail.com> [Tested on the Aerohive HiveAP 330 and Extreme Networks WS-AP3825i] Signed-off-by: Martin Kennedy <hurricos@gmail.com>
* kernel: Activate CONFIG_GPIOLIB in generic configurationHauke Mehrtens2022-08-101-1/+0
| | | | | | | | All targets expect the malta target already activate the CONFIG_GPIOLIB option. Move it to generic kernel configuration and also activate it for malta. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: bump 5.10 to 5.10.122John Audia2022-06-271-1/+1
| | | | | | | | | All patches automatically rebased. Build system: x86_64 Build-tested: ipq806x/R7800 Signed-off-by: John Audia <therealgraysky@proton.me>
* generic: enable CRYPTO_LIB_BLAKE2S[_X86|_ARM]Tomasz Maciej Nowak2022-06-241-0/+2
| | | | | | | | | | | | This is now built-in, enable so it won't propagate on target configs. Link: https://lkml.org/lkml/2022/1/3/168 Fixes: 79e7a2552e89 ("kernel: bump 5.15 to 5.15.44") Fixes: 0ca93670693b ("kernel: bump 5.10 to 5.10.119") Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com> (Link to Kernel's commit taht made it built-in, CRYPTO_LIB_BLAKE2S[_ARM|_X86] as it's selectable, 5.10 backport) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* mpc85xx: p2020: add RTC ds1307 to kernelJosef Schlehofer2022-06-191-0/+1
| | | | | | | | | | | | | | If the RTC module is compiled as a module, the hctosys fails to initialize because ds1307 is loaded later. Fixes: [ 2.004145] hctosys: unable to open rtc device (rtc0) [ 11.957997] rtc-ds1307 0-006f: registered as rtc0 This is similar to commit 5481ce9a1157a43d8b2c963e03fb243e70974361, which was done for imx6 target. Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* mpc85xx: enable NAND support for all subtargetsJosef Schlehofer2022-06-193-3/+1
| | | | | | | | | | | | | | In subtarget p2020, there wasn't enabled nand support, and because of that there weren't available tools from mtd-utils package, which has utilities for NAND flash memory even though reference board, which is the only currently supported device in p2020 subtarget has NAND [1]. All subtargets in mpc85xx has already enabled nand support, let's do it globally. [1] https://www.nxp.com/design/qoriq-developer-resources/p2020-reference-design-board:P2020RDB Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* mpc85xx: enable error reporting for RAM and PCIeJosef Schlehofer2022-05-141-0/+4
| | | | | | | | | | | | | | | | | | | | All Freescale processors used in this target are capable to detect error and correction. [1] It can not be used as kernel module. [2] This is helpful to report hardware errors. It enables three kernel options: - EDAC, which is a subsystem - EDAC_LEGACY_SYSFS, it enables sysfq nodes - MP85XX, support for Freescale MPC8349, MPC8560, MPC8540, MPC8548, T4240 EDAC is already enabled for following targets: qoriq, octeon, octeontx and zynq. [1] https://cateee.net/lkddb/web-lkddb/EDAC.html [2] https://patchwork.ozlabs.org/patch/554908/ Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
* mpc85xx: Fix output location of padded dtbMartin Kennedy2022-04-302-3/+3
| | | | | | | | | | | | | | | | | | | | | In commit 7e614820a892 ("mpc85xx: add support for Extreme Networks WS-AP3825i"), we borrowed a recipe convention from apm821xx for device tree blob padding. Unfortunately, in the apm821xx target, the image recipes name the device tree blob differently, meaning that in mpc85xx, the padded dtb is never consumed. Change the definition of `Build/dtb` so that it outputs the padded dtb to the correct location for it to be consumed. Also, rename the recipe to `Build/pad-dtb`, so it is clear we are building and padding the device tree blob. This change fixes Github issue #9779 [1]. [1]: https://github.com/openwrt/openwrt/issues/9779 Fixes: 7e614820a892 ("mpc85xx: add support for Extreme Networks WS-AP3825i") Signed-off-by: Martin Kennedy <hurricos@gmail.com>
* mpc85xx: set WS-AP3825i mac-address in preinitDavid Bauer2022-04-261-0/+12
| | | | | | | | | The bootloader does seem to not correctly patch in the MAC address for eth0 / eth1 in some cases. While the root cause is not known, manually applying the MAC-Address in preinit does not hurt. Reported-by: Tom Herbers <freifunk@tomherbers.de> Signed-off-by: David Bauer <mail@david-bauer.net>
* mpc85xx: define reset-delay for WS-AP3825i eth PHYDavid Bauer2022-04-261-0/+4
| | | | | | | | | | | | The WS-AP3825i uses Atheros PHYs which according to the datasheet require the reset to be asserted for at least 1 ms. This fixes broken eth1 upon soft-reboot. eth0 is no affected, as the ifup / ifdown cycle in preinit prevents this issue from happening when the system is ready. Reported-by: Tom Herbers <freifunk@tomherbers.de> Signed-off-by: David Bauer <mail@david-bauer.net>
* mpc85xx: overhaul WS-AP3825i LED setupDavid Bauer2022-03-242-12/+31
| | | | | | | | | | | | As the LED controller is working now, we can make good use of the LEDs now. - Drop the model-name prefix - Rename eth0 / eth1 LEDs to LAN1 / LAN2, as they are labeled as such on the casing - Enable wired LEDs in userspace Signed-off-by: David Bauer <mail@david-bauer.net>
* mpc85xx: move Extreme WS-AP3825i GPIO extenderDavid Bauer2022-03-241-23/+25
| | | | | | | Move the GPIO extender to the SoC node. Otherwise, the legacy PowerPC init code will not populate the BUS and thus never probe spi-gpio. Signed-off-by: David Bauer <mail@david-bauer.net>
* kernel: bump 5.10 to 5.10.107John Audia2022-03-191-7/+0
| | | | | | | | | | All patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <graysky@archlinux.us>
* mpc85xx: fix missing kernel config symbol and DTS whitespace issuePetr Štetiar2022-03-172-1/+2
| | | | | | | | | | | | | Buildbot has reported following issue while crunching mpc85xx/p1010 subtarget: Extreme Networks WS-AP3825i (WS_AP3825I) [N/y/?] (NEW) Fix it by disabling that config symbol in target kernel config and while at it fix DTS whitespace issue. Fixes: 7e614820a892 ("mpc85xx: add support for Extreme Networks WS-AP3825i") Signed-off-by: Petr Štetiar <ynezz@true.cz>
* mpc85xx: add support for Extreme Networks WS-AP3825iMartin Kennedy2022-03-167-1/+407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware: - SoC: Freescale P1020 - CPU: 2x e500v2 @ 800MHz - Flash: 64MiB NOR (1x Intel JS28F512) - Memory: 256MiB (2x ProMOS DDR3 V73CAG01168RBJ-I9H 1Gb) - WiFi1: 2.4+5GHz abgn 3x3 (Atheros AR9590) - Wifi2: 5GHz an+ac 3x3 (Qualcomm Atheros QCA9890) - ETH: 2x PoE Gigabit Ethernet (2x Atheros AR8035) - Power: 12V (center-positive barrel) or 48V PoE (active or passive) - Serial: Cisco-compatible RJ45 next to 12V power socket (115200 baud) - LED Driver: TI LV164A - LEDs: (not functioning) - 2x Power (Green + Orange) - 4x ETH (ETH1 + ETH2) x (Green + Orange) - 2x WiFi (WiFi2 + WiFi1) Installation: 1. Grab the OpenWrt initramfs <openwrt-initramfs-bin>, e.g. openwrt-mpc85xx-p1020-extreme-networks_ws-ap3825i-initramfs-kernel.bin. Place it in the root directory of a DHCP+TFTP server, e.g. OpenWrt `dnsmasq` with configuration `dhcp.server.enable_tftp='1'`. 2. Connect to the serial port and boot the AP with options e.g. 115200,N,8. Stop autoboot in U-Boot by pressing Enter after 'Scanning JFFS2 FS:' begins, then waiting for the prompt to be interrupted. Credentials are identical to the one in the APs interface. By default it is admin / new2day: if these do not work, follow the OEM's reset procedure using the reset button. 3. Set the bootcmd so the AP can boot OpenWrt by executing: ```uboot setenv boot_openwrt "cp.b 0xEC000000 0x2000000 0x2000000; interrupts off; bootm start 0x2000000; bootm loados; fdt resize; fdt boardsetup; fdt chosen; bootm prep; bootm go;" setenv bootcmd "run boot_openwrt" saveenv ``` If you plan on going back to the vendor firmware - the bootcmd for it is stored in the boot_flash variable. 4. Load the initramfs image to RAM and boot by executing ```uboot setenv ipaddr <ipv4 client address>; setenv serverip <tftp server address>; tftpboot 0x2000000 <openwrt-initramfs-bin>; interrupts off; bootm start 0x2000000; bootm loados; fdt resize; fdt boardsetup; fdt chosen; bootm prep; bootm go; ``` 5. Make a backup of the "firmware" partition if you ever wish to go back to the vendor firmware. 6. Upload the OpenWrt sysupgrade image via SCP to the devices /tmp folder. 7. Flash OpenWrt using sysupgrade. ```ash sysupgrade /tmp/<openwrt-sysupgrade-bin> ``` Notes: - We must step through the `bootm` process manually to avoid fdt relocation. To explain: the stock U-boot (and stock Linux) are configured with a very large CONFIG_SYS_BOOTMAPSZ (and the device's stock Linux kernel is configured to be able to handle it). The U-boot version predates the check for the `fdt_high` variable, meaning that upon fdt relocation, the fdt can (and will) be moved to a very high address; the default appears to be 0x9ffa000. This address is so high that when the Linux kernel starts reading the fdt at the beginning of the boot process, it encounters a memory access exception and panics[5]. While it is possible to reduce the highest address the fdt will be relocated to by setting `bootm_size`, this also has the side effect of limiting the amount of RAM the kernel can use[3]. - Because it is not relocated, the flattened device tree needs to be padded in the build process to guarantee that `fdt resize` has enough space. - The primary ethernet MAC address is stored (and set) in U-boot; they are shimmed into the device tree by 'fdt boardsetup' through the 'local-mac-address' property of the respective ethernet node, so OpenWrt does not need to set this at runtime. Note that U-boot indexes the ethernet nodes by alias, which is why the device tree explicitly aliases ethernet1 to enet2. - LEDs do not function under OpenWrt. Each of 8 LEDs is connected to an output of a TI LV164A shift register, which is wired to GPIO lines and operates through bit-banged SPI. Unfortunately, I am unable to get the spi-gpio driver to recognize the `led_spi` device tree node at all, as confirmed by patching in printk messages demonstrating spi-gpio.c::spi_gpio_probe never runs. It is possible to manually articulate the shift register by exporting the GPIO lines and stepping their values through the sysfs. - Though they do not function under OpenWrt, I have left the pinout details of the LEDs and shift register in the device tree to represent real hardware. - An archive of the u-boot and Linux source for the AP3825i (which is one device of a range of devices code-named 'CHANTRY') be found here[1]. - The device has an identical case to both the Enterasys WS-AP3725i and Adtran BSAP-2030[2] (and potentially other Adtran BSAPs). Given that there is no FCC ID for the board itself (only its WLAN modules), it's likely these are generic boards, and even that the WS-AP3725i is identical, with only a change in WLAN card. I have ordered one to confirm this. - For additional information: the process of porting the board is documented in an OpenWrt forum thread[4]. [1]: magnet:?xt=urn:btih:f5306a5dfd06d42319e4554565429f84dde96bbc [2]: https://forum.openwrt.org/t/support-for-adtran-bluesocket-bsap-2030/48538 [3]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168/29 [4]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168 [5]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168/26 Tested-by: Martin Kennedy <hurricos@gmail.com> Signed-off-by: Martin Kennedy <hurricos@gmail.com>
* mpc85xx: HiveAP-330: add tmp125 temperature sensorChristian Lamparter2022-02-252-1/+10
| | | | | | | | | | | the Aerohive HiveAP-330 and HiveAP-350 come equipped with an TI TMP125 temperature chip. This patch wires up the necessary support for this sensor and exposes it through hwmon / thermal sensor framework. Upstream support is coming, but it has to go through hwmon-next first. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* mpc85xx: fix KEY_RFKILL vs KEY_RFKillChristian Lamparter2022-02-201-1/+1
| | | | | | | | This fixes a buildbot builder error: Error: arch/powerpc/boot/dts/tl-wdr4900-v1.dts:245.18-19 syntax error Fixes: 256e1dbc7d09 ("mpc85xx: utilize dt-binding definitions for keys + gpios") Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* mpc85xx: add HiveAP-350 alternative name for HiveAP-330Christian Lamparter2022-02-191-0/+2
| | | | | | | The HiveAP-350 has six external antennas connectors. (It also has twice the flash?) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* mpc85xx: utilize dt-binding definitions for keys + gpiosChristian Lamparter2022-02-195-39/+50
| | | | | | | | | include the device-tree binding headers that provide definitions for keys codes and gpios in the device-tree files. Random bonus: merge tl-wdr4900-v1's uboot with the nvmem-node. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* mpc85xx: change legacy "eeprom" compatibleChristian Lamparter2022-02-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | silences the following message: > eeprom 0-0051: eeprom driver is deprecated, please use at24 instead The chip was likely a Dallas Semiconductor and later MAXIM part before Analog Devices, Inc. bought MAXIM. From the datasheet: "The DS28CN01 combines 1024 bits of EEPROM with challenge-and-response authentication security implemented with the FIPS 180-1/180-2 and ISO/IEC 10118-3 Secure Hash Algorithm (SHA-1)." ... "Write Access Requires Knowledge of the Secret and the Capability of Computing and Transmitting a 160-Bit MAC as Authorization" OpenWrt doesn't use it. There's no in-kernel driver from what I know. Let's document that the chip is at the location. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* mpc85xx: update lp5521 led-controller node for 5.10Christian Lamparter2022-02-191-10/+57
| | | | | | | | | | | | | | | | | | | | The tricolor LED which is controlled by a lp5521 needed some maintenance as the driver failed to load in the current v5.10 image: | lp5521: probe of 0-0032 failed with error -22 This is because the device-tree needed to be updated to match the latest led coloring and function trends. - removed the device name from the label - added color/function properties - added required reg and cells properties For reference a disabled multicolor/RGB is added since this reflects the real hardware. Unfortunately, the multicolor sysfs interface isn't supported by yet. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* mpc85xx: Patch HiveAP 330 u-boot to fix bootMartin Kennedy2022-02-195-48/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Kernel 5.10 was enabled for mpc85xx, the kernel once again became too large upon decompression (>7MB or so) to decompress itself on boot (see FS#4110[1]). There have been many attempts to fix booting from a compressed kernel on the HiveAP-330: - b683f1c36d8a ("mpc85xx: Use gzip compressed kernel on HiveAP-330") - 98089bb8ba82 ("mpc85xx: Use uncompressed kernel on the HiveAP-330") - 26cb167a5ca7 ("mpc85xx: Fix Aerohive HiveAP-330 initramfs image") We can no longer compress the kernel due to size, and the stock bootloader does not support any other types of compression. Since an uncompressed kernel no longer fits in the 8MiB kernel partition at 0x2840000, we need to patch u-boot to autoboot by running variable which isn't set by the bootloader on each autoboot. This commit repartitions the HiveAP, requiring a new COMPAT_VERSION, and uses the DEVICE_COMPAT_MESSAGE to guide the user to patch u-boot, which changes the variable run on boot to be `owrt_boot`; the user can then set the value of that variable appropriately. The following has been documented in the device's OpenWrt wiki page: <https://openwrt.org/toh/aerohive/hiveap-330>. Please look there first/too for more information. The from-stock and upgrade from a previous installation now becomes: 0) setup a network with a dhcp server and a tftp server at serverip (192.168.1.101) with the initramfs image in the servers root directory. 1) Hook into UART (9600 baud) and enter U-Boot. You may need to enter a password of administrator or AhNf?d@ta06 if prompted. If the password doesn't work. Try reseting the device by pressing and holding the reset button with the stock OS. 2) Once in U-Boot, set the new owrt_boot and tftp+boot the initramfs image: Use copy and paste! # fw_setenv owrt_boot 'setenv bootargs \"console=ttyS0,$baudrate\";bootm 0xEC040000 - 0xEC000000' # save # dhcp # setenv bootargs console=ttyS0,$baudrate # tftpboot 0x1000000 192.168.1.101:openwrt-mpc85xx-p1020-aerohive_hiveap-330-initramfs-kernel.bin # bootm 3) Once openwrt booted: carefully copy and paste this into the root shell. One step at a time # 3.0 install kmod-mtd-rw from the internet and load it opkg update; opkg install kmod-mtd-rw insmod mtd-rw i_want_a_brick=y # 3.1 create scripts that modifies uboot cat <<- "EOF" > /tmp/uboot-update.sh . /lib/functions/system.sh cp "/dev/mtd$(find_mtd_index 'u-boot')" /tmp/uboot cp /tmp/uboot /tmp/uboot_patched ofs=$(strings -n80 -td < /tmp/uboot | grep '^ [0-9]* setenv bootargs.*cp\.l' | cut -f2 -d' ') for off in $ofs; do printf "run owrt_boot; " | dd of=/tmp/uboot_patched bs=1 seek=${off} conv=notrunc done md5sum /tmp/uboot* EOF # 3.2 run the script to do the modification sh /tmp/uboot-update.sh # verify that /tmp/uboot and /tmp/uboot_patched are good # # my uboot was: (is printed during boot) # U-Boot 2009.11 (Jan 12 2017 - 00:27:25), Build: jenkins-HiveOS-Honolulu_AP350_Rel-245 # # d84b45a2e8aca60d630fbd422efc6b39 /tmp/uboot # 6dc420f24c2028b9cf7f0c62c0c7f692 /tmp/uboot_patched # 98ebc7e7480ce9148cd2799357a844b0 /tmp/uboot-update.sh <-- just for reference # 3.3 this produces the /tmp/u-boot_patched file. mtd write /tmp/uboot_patched u-boot 3) scp over the sysupgrade file to /tmp/ and run sysupgrade to flash OpenWrt: sysupgrade -n /tmp/openwrt-mpc85xx-p1020-aerohive_hiveap-330-squashfs-sysupgrade.bin 4) after the reboot, you are good to go. Other notes: - Note that after this sysupgrade, the AP will be unavailable for 7 minutes to reformat flash. The tri-color LED does not blink in any way to indicate this, though there is no risk in interrupting this process, other than the jffs2 reformat being reset. - Add a uci-default to fix the compat version. This will prevent updates from previous versions without going through the installation process. - Enable CONFIG_MTD_SPLIT_UIMAGE_FW and adjust partitioning to combine the kernel and rootfs into a single dts partition to maximize storage space, though in practice the kernel can grow no larger than 16MiB due to constraints of the older mpc85xx u-boot platform. - Because of that limit, KERNEL_SIZE has been raised to 16m. - A .tar.gz of the u-boot source for the AP330 (a.k.a. Goldengate) can be found here[2]. - The stock-jffs2 partition is also removed to make more space -- this is possible only now that it is no longer split away from the rootfs. - the console-override is gone. The device will now get the console through the bootargs. This has the advantage that you can set a different baudrate in uboot and the linux kernel will stick with it! - due to the repartitioning, the partition layout and names got a makeover. - the initramfs+fdt method is now combined into a MultiImage initramfs. The separate fdt download is no longer needed. - added uboot-envtools to the mpc85xx target. All targets have uboot and this way its available in the initramfs. [1]: https://bugs.openwrt.org/index.php?do=details&task_id=4110 [2]: magnet:?xt=urn:btih:e53b27006979afb632af5935fa0f2affaa822a59 Tested-by: Martin Kennedy <hurricos@gmail.com> Signed-off-by: Martin Kennedy <hurricos@gmail.com> (rewrote parts of the commit message, Initramfs-MultiImage, dropped bootargs-override, added wiki entry + link, uboot-envtools) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* kernel: move bootargs-append patch to genericSungbo Eo2022-01-291-2/+2
| | | | | | | | | | This moves bootargs-append support patch from ipq40xx and ipq806x to generic. This way we can append additional boot arguments from DTS instead of only being able to overwrite them. This is a preparation for kirkwood support of ipTIME NAS1. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* build: move Build/copy-file to image-commands.mkChristian Lamparter2022-01-151-4/+0
| | | | | | This is makro is present in more than one place. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* kernel: bump 5.10 to 5.10.88Rui Salvaterra2021-12-271-55/+0
| | | | | | | | | Deleted (upstreamed): mpc85xx/patches-5.10/002-powerpc-85xx-fix-oops-when-CONFIG_FSL_PMC-n.patch [1] [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.88&id=151ffac3ac277ad7c2a5f201b566b56d97ed3a99 Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>