Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipq806x:TP-Link C2600: fix MAC address fetching for eth ports #4485

Closed
wants to merge 1 commit into from

Conversation

filippz
Copy link
Contributor

@filippz filippz commented Aug 28, 2021

The partitions that have compatible property set are skipped by mtd if
they are not contained inside partitions property and this breaks
fetching MAC address from "default-mac" partition.

Fix this by defining all the partitions inside partitions property with
compatible = "fixed-partitions" as nvmem requires the standard
partitions scheme to work correctly.

Fixes: FS#3945

Signed-off-by: Filip Matijević filip.matijevic.pz@gmail.com
Reviewed-by: Ansuel Smith ansuelsmth@gmail.com

The partitions that have compatible property set are skipped by mtd if
they are not contained inside partitions property and this breaks
fetching MAC address from "default-mac" partition.

Fix this by defining all the partitions inside partitions property with
compatible = "fixed-partitions" as nvmem requires the standard
partitions scheme to work correctly.

Fixes: FS#3945

Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
Reviewed-by: Ansuel Smith <ansuelsmth@gmail.com>
@adschm adschm added the target/ipq806x pull request/issue for ipq806x target label Aug 28, 2021
@Ansuel
Copy link
Member

Ansuel commented Aug 28, 2021

@adschm i think we can safely merge this

@rbpp
Copy link

rbpp commented Aug 28, 2021

PR tested and working as expected. Thanks!

@adschm
Copy link
Member

adschm commented Aug 29, 2021

I will test and merge this with commit message adjustments later tonight.

@adschm adschm closed this Aug 29, 2021
@adschm
Copy link
Member

adschm commented Aug 29, 2021

The only other device in ipq806x that does not have enclosing partitions node is db149. I wonder whether we should change this one too for consistency?

@Ansuel
Copy link
Member

Ansuel commented Aug 29, 2021 via email

@adschm
Copy link
Member

adschm commented Sep 11, 2021

The only other device in ipq806x that does not have enclosing partitions node is db149. I wonder whether we should change this one too for consistency?

Would somebody be able to prepare a patch and test?

@Ansuel
Copy link
Member

Ansuel commented Sep 11, 2021

prepare is ok... testing... i think nobody have a db149 dev board

@Hurricos
Copy link
Contributor

This issue also impacts the in-progress mpc85xx-based Aerohive HiveAP 370 (https://paste.c-net.org/ShroudPlank) and HiveAP 330, which both lack an enclosing: ...

partitions {
	compatible = "fixed-partitions";
	#address-cells = <1>;
	#size-cells = <1>;
:

Hurricos added a commit to Hurricos/openwrt that referenced this pull request Nov 23, 2021
We actually need to enclose the whole section of partitions in a
`partitions { ... }` because we need to assign it a `compatible =
"fixed-partitions";`; otherwise it won't be registered when bringing
up MTD, as per these links:

- https://forum.openwrt.org/t/tp-link-c2600-missing-default-mac-mtd-partition-in-snapshot/103945/6

- openwrt#4485
Hurricos pushed a commit to Hurricos/openwrt that referenced this pull request Nov 23, 2021
This patch adds support for the Aerohive HiveAP 370. It is very similar to
the HiveAP-330.

Specifications:
 * SoC: QorIQ P1020 e500v2 @ 800MHz
 * RAM: 512 MB
 * Flash: 1024 MB NAND flash
 * WiFi: Atheros QCA9890 (5 GHz) and AR9590 (2.4 GHz)
 * Ethernet: 2 x 1000Base-T (PoE)
 * LED: One combined activity LED (orange/white/off)
 * UART: 9600,8,N,1 RJ45 console

Installation:
 * Installation via console serial tftp over ethernet
   + Connect to the RJ45-based serial console port (see https://openwrt.org/docs/techref/hardware/port.serial)
   + Use miniterm/putty etc to connect 9600,8,N,1 (miniterm.py /dev/ttyS0 --raw --eol CR)
   + Power AP370 with PoE or 12V DC barrel jack
   + Hit space to interupt the boot process
   + Enter uboot password AhNf?d@ta06 or administrator
   + Enter the following commands to boot from tftp image:

     dhcp;
     setenv serverip <TFTP server IPv4 address>;
     tftpboot 0x1000000 openwrt-mpc85xx-p1020-aerohive_hiveap-370-initramfs-kernel.bin;
     tftpboot 0x6000000 openwrt-mpc85xx-p1020-aerohive_hiveap-370-squashfs-fdt.bin;

     setenv owrt_boot_a 'nand read 0x6000000 0x00520000 0x40000\; nand read 0x1000000 0x560000 0x02000000\; bootm 0x1000000 - 0x6000000\;'
     saveenv;

     bootm 0x1000000 - 0x6000000;

   + Once booted, patch your u-boot installation so that it runs
     `owrt_boot_a` on boot by doing:

     . /lib/upgrade/patch-aerohive-uboot.sh;
	 patch_aerohive_hiveap_370_uboot;

   + Finally, wget or scp over the sysupgrade file under /tmp, and
     sysupgrade with:

     sysupgrade -v /tmp/openwrt-mpc85xx-p1020-aerohive_hiveap-370-squashfs-sysupgrade.bin

Notes:

* The initial format of the ubi filesystem will take a long time, so
  please be patient.

* A/B partitioning functionality has been dropped: both copies of
  U-boot run `owrt_boot_a` to boot.

* There is no 'official' way to possible to revert to the original
  firmware, but this should be of no concern, as the device is EoL on
  the original FW:
  https://aerohive-www-cdn.aerohive.com/wp-content/uploads/Aerohive_EOS-EOL_AP370-AP390.pdf

* The kernel partition contains a shimmed dtb to allow for the use of
  sysupgrade-tar.

* The MAC address is pulled from NAND flash using nvmem

  We actually need to enclose the whole section of partitions in a
  `partitions { ... }` because we need to assign it a `compatible =
  "fixed-partitions";`; otherwise it won't be registered when bringing
  up MTD, as per these links:

  + https://forum.openwrt.org/t/tp-link-c2600-missing-default-mac-mtd-partition-in-snapshot/103945/6

  + openwrt#4485

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/ipq806x pull request/issue for ipq806x target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants