1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 10:49:13 +02:00
openwrt/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts

316 lines
6.4 KiB
Plaintext
Raw Normal View History

/*
* Aerohive HiveAP-330 Device Tree Source
*
* Copyright (C) 2017 Chris Blake <chrisrblake93@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#include <dt-bindings/leds/common.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
/include/ "fsl/p1020si-pre.dtsi"
/ {
model = "Aerohive HiveAP-330";
compatible = "aerohive,hiveap-330";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_fault_red;
led-running = &led_power_green;
led-upgrade = &led_fault_red;
label-mac-device = &enet0;
spi0 = &spi0;
};
memory {
device_type = "memory";
};
board_lbc: lbc: localbus@ffe05000 {
reg = <0 0xffe05000 0 0x1000>;
ranges = <0x0 0x0 0x0 0xec000000 0x4000000>;
nor@0,0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cfi-flash";
reg = <0x0 0x0 0x4000000>;
bank-width = <2>;
device-width = <1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
mpc85xx: Patch HiveAP 330 u-boot to fix boot 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>
2021-12-22 19:08:33 +01:00
firmware@0 {
reg = <0x0 0x3f00000>;
label = "firmware";
/*
* This unknown/invalid compatible prevents
* openwrt's mtdsplit_fit to go off a tangent if it
* finds a magic value inside the uncompressed kernel
* at a blocksized aligned place.
*/
compatible = "areohive,hiveap-330-image";
};
partition@0 {
reg = <0x0 0x40000>;
label = "dtb";
};
partition@40000 {
mpc85xx: Patch HiveAP 330 u-boot to fix boot 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>
2021-12-22 19:08:33 +01:00
compatible = "openwrt,uimage", "denx,uimage";
reg = <0x40000 0x3ec0000>;
label = "kernel";
};
mpc85xx: Patch HiveAP 330 u-boot to fix boot 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>
2021-12-22 19:08:33 +01:00
partition@3f00000 {
reg = <0x3f00000 0x20000>;
label = "hw-info";
read-only;
mpc85xx: Patch HiveAP 330 u-boot to fix boot 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>
2021-12-22 19:08:33 +01:00
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_hwinfo_0: macaddr@0 {
reg = <0x0 0x6>;
};
};
partition@3f20000 {
reg = <0x3f20000 0x20000>;
label = "boot-info";
read-only;
};
partition@3f40000 {
reg = <0x3f40000 0x20000>;
label = "boot-info-backup";
read-only;
};
partition@3f60000 {
reg = <0x3f60000 0x20000>;
label = "u-boot-env";
};
partition@3f80000 {
reg = <0x3f80000 0x80000>;
label = "u-boot";
read-only;
};
};
};
};
board_soc: soc: soc@ffe00000 {
ranges = <0x0 0x0 0xffe00000 0x100000>;
spi0: spi@7000 {
temperature-sensor@1 {
compatible = "ti,tmp125";
reg = <1>;
spi-max-frequency = <5000000>;
};
};
i2c@3100 {
tpm@29 {
compatible = "atmel,at97sc3204t";
reg = <0x29>;
};
lp5521@32 {
compatible = "national,lp5521";
reg = <0x32>;
clock-mode = /bits/ 8 <2>;
#if 1
led_fault_red: led@0 {
reg = <0>;
chan-name = "fault:red";
led-cur = /bits/ 8 <0x2f>;
max-cur = /bits/ 8 <0x5f>;
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_FAULT;
};
led_power_green: led@1 {
reg = <1>;
chan-name = "power:green";
led-cur = /bits/ 8 <0x2f>;
max-cur = /bits/ 8 <0x5f>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
};
led@2{
reg = <2>;
chan-name = "blue";
led-cur = /bits/ 8 <0x2f>;
max-cur = /bits/ 8 <0x5f>;
color = <LED_COLOR_ID_BLUE>;
};
#else
/*
* openwrt isn't ready to handle multi-intensity leds yet
* # echo 255 255 255 > /sys/class/leds/tricolor/multi_intensity
* # echo 255 > /sys/class/leds/tricolor/brightness
*/
rgbled-0 {
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_RGB>;
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
chan-name = "tricolor";
led-cur = /bits/ 8 <0x2f>;
max-cur = /bits/ 8 <0x5f>;
color = <LED_COLOR_ID_RED>;
};
led@1 {
reg = <1>;
chan-name = "tricolor";
led-cur = /bits/ 8 <0x2f>;
max-cur = /bits/ 8 <0x5f>;
color = <LED_COLOR_ID_GREEN>;
};
led@2{
reg = <2>;
chan-name = "tricolor";
led-cur = /bits/ 8 <0x2f>;
max-cur = /bits/ 8 <0x5f>;
color = <LED_COLOR_ID_BLUE>;
};
};
#endif
};
eeprom@51 {
/*
* 1Kbit I2C/SMBus EEPROM with SHA-1 Engine
* Aerohive calls it "dallas".
*/
compatible = "adi,ds28cn01";
reg = <0x51>;
read-only;
};
};
mdio@24000 {
phy0: ethernet-phy@0 {
interrupts = <3 1 0 0>;
reg = <0x1>;
};
phy1: ethernet-phy@1 {
interrupts = <2 1 0 0>;
reg = <0x2>;
};
};
mdio@25000 {
status = "disabled";
};
mdio@26000 {
status = "disabled";
};
enet0: ethernet@b0000 {
status = "okay";
phy-handle = <&phy0>;
phy-connection-type = "rgmii-id";
nvmem-cells = <&macaddr_hwinfo_0>;
nvmem-cell-names = "mac-address";
};
enet1: ethernet@b1000 {
status = "disabled";
};
enet2: ethernet@b2000 {
status = "okay";
phy-handle = <&phy1>;
phy-connection-type = "rgmii-id";
nvmem-cells = <&macaddr_hwinfo_0>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};
gpio0: gpio-controller@fc00 {
};
usb@22000 {
phy_type = "ulpi";
dr_mode = "host";
};
usb@23000 {
status = "disabled";
};
};
pci0: pcie@ffe09000 {
reg = <0x0 0xffe09000 0x0 0x1000>;
ranges = <0x2000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x20000000
0x1000000 0x0 0x00000000 0x0 0xffc30000 0x0 0x10000>;
pcie@0 {
ranges = <0x2000000 0x0 0xa0000000
0x2000000 0x0 0xa0000000
0x0 0x20000000
0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;
};
};
pci1: pcie@ffe0a000 {
reg = <0x0 0xffe0a000 0x0 0x1000>;
ranges = <0x2000000 0x0 0xc0000000 0x0 0xc0000000 0x0 0x20000000
0x1000000 0x0 0x00000000 0x0 0xffc20000 0x0 0x10000>;
pcie@0 {
ranges = <0x2000000 0x0 0xc0000000
0x2000000 0x0 0xc0000000
0x0 0x20000000
0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;
};
};
buttons {
compatible = "gpio-keys";
reset {
label = "Reset button";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
/include/ "fsl/p1020si-post.dtsi"
mpc85xx: Drop pci aliases to avoid domain changes 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>
2022-08-30 02:47:24 +02:00
/*
* For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
* aliases to determine PCI domain numbers, drop aliases so as not to
* change the sysfs path of our wireless netdevs.
*/
/ {
aliases {
/delete-property/ pci0;
/delete-property/ pci1;
};
};