Netgear R7800 exploration (IPQ8065, QCA9984)

So we can either revert the commit or modify the patch.

Either way this one is used only in ap148 reference board

I removed patch 037 that creates the SMEM parser and 302 that patches it. (That invalidates the functionality for AP148. ) Image compiled ok, but did not boot. The router was left into recovery mode, so I could use TFTP without needing to use the reset button.

I wonder if those nand changes are necessary. If too many changes are tried at the same time, it can be rather impossible to say what part fails.

I've added added more nand changes, seems that I've missed address-cells and size-cells in IPQ8064 dtsi

https://github.com/dissent1/r7800/blob/49-3/target/linux/ipq806x/patches-4.9/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch#L45

Unfortunately yes, all those changes in nand and pci are needed... that's why we need a serial console to check the exact problem.

But! We can port these patches into kernel 4.4
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/drivers/mtd/nand?h=release/dandelion_preview&id=1775edb3df641a14f06977ad8de2532b37a1ec5d
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/drivers/mtd/nand?h=release/dandelion_preview&id=1d6cca65a3bcec4b29e1cbc9c6eff8ce4c250b42

along with my dts changes for nand and check if it's nand driver that fails

Looks like blogic has got his version ready:

ipq806x: add v4.9 support
https://git.lede-project.org/?p=source.git;a=commit;h=bb255f74290d889b65a563bac7a4be0427fdbec8

At least the core functionality, I guess. There are so few patches, that possibly some features have been dropped.

Have you tried booting with those address and size cells added?

I suppose it would have been good to point on this thread to @blogic

pushed v4.9 support but left v4.4 as default. i used the codeaurora v4.7 series as a basis as it also adds ipq4xxx support, then went over all our patches and picked up the missing ones. i am pretty confident that its all there but was going to send @dissent1 a mail to ask for help testing.

only problem i am aware of is that cpuidle borks up. we need to add a new node for qcom,scm, this requires 3 clocks and i am not sure which to add for ipq860x. not adding the node makes the kernel blow up upon first idle state. with cpuidle disabled it works well though.

v4.9 will also bring qca8k support for the qca8337 switches so i will add userland support for DSA int he coming days.

any help testing is more than welcome.

I've used this as basis https://source.codeaurora.org/quic/la/kernel/msm/log/?h=linaro/release/qcomlt-4.9
It contains all patches rebased for k4.9 already including kraut specific opp, clk and cpufreq patches
Check https://github.com/dissent1/r7800/tree/49-3/target/linux/ipq806x/patches-4.9 please
Besides there's absent ipq806x fix from Linux-next
https://github.com/dissent1/r7800/blob/49-3/target/linux/ipq806x/patches-4.9/001-arm-dts-qcom-Fix-ipq-board-clock-rates.patch
But we fail to boot up for some reason, though everything seems fine

@blogic actually a lot of patches are missing it seems

I compiled 4.9 image for R7800 based on blogic's code, but the result is the same.

The router does not boot properly. It actually ends up in the u-boot TFTP recovery mode (power led slowly blinking), so that I can just send a new firmware image via TFTP without needing to touch the reset button.

That makes me to think that somehow the kernel image gets invalidated very early. By u-boot?

That has now happened with both alternative 4.9 approaches.

But I have no serial console attached, so no additional info at this point.

Check my previous msg pls.

I know how to handle scm, there's only 1 clock and that is <&rpmcc RPM_DAYTONA_FABRIC_CLK>, but your commit is missing 3xx patches that adds support for ipq806x rpm clock controller

@dissent1 why did you not post these patches ?

looks like there are no ipq4xxx patches. can you update your tree with the missing patches you listed above so i can pull this lot into trunk as a replacement of what we have right now ? i'd like to start testing ipq4xxx after that

Erm, I've started k4.9 patches only yesterday and we can't boot up. We have no serial access so we can't check the exact reason.
But those patches are already in k4.4 tree in LEDE
https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/ipq806x/patches-4.4/305-add-board-clocks-and-rpmcc-into-DT.patch;h=be45895824064270f8bb6c89165aa7ef4db926e5;hb=HEAD
https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/ipq806x/patches-4.4/311-add-rpmcc-for-ipq806x.patch;h=bb9dd87dd65273f06b16949af5ce2c8900892501;hb=HEAD

The clocks fix patch has been submitted to upstream kernel after I've found that upstream clocks are incorrect, so it's in 305 patch along with rpmcc node.

Btw qcom-scm driver doesn't contain ipq806x compatibility string, so in DT it should be set as apq8064 or I'll made a patch to add the compatibility into the driver.

I'll rebase upon current head and make PR in a while

how do you want to prodceed ? use the patches i pushed and add the missing bits or try to make yours boot and add ipq4xxx support.

i would like to use as little of QCAs hacky work ad possible. its just too bad quality.

I'll rearrange your patches and make it a single commit on top of a current head.
Will also add 4.9 files and config symbols.
At the moment I have no means to make it bootable as I cannot verify the error because neither me nor anyone I know have access to serial console on the device.
I'm almost done, verifying the compilation and editing patch headers to reflect real commits in linaro repo on code-aurora.

Well bad quality or not, but those patches that are not upstream make the device work rock steady actually.

i have access on a ap148 eval kit. i can boot your tree if that helps ?

Does your tree boot on that kit? If yes, then it won't help unfortunately.
I suppose there's some issue with nand

i'll try your tree. the board does have nand.

Smem partition parser that is used for ap148 to parse partitions is dropped in k4.9 for now. It doesn't compile and I'm not sure it is gonna work because nand node layout has changed in nand driver. That's why I asked if your tree boots on ap148 because your tree has it dropped as well.
https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/ipq806x/patches-4.4/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch;h=7c0c8035652a9b7a89d4623e6689027c88b9ac41;hb=HEAD

@blogic I'm finished with patches. Also added missing config symbols and files-4.9.
https://github.com/dissent1/r7800/commit/f40b829fc44c0c33b6dba666317fc19be68e61d4

I'm not sure how to number ipq40xx patches.

UPDATE: forgot to squash commits. Updated the link.

That's definitely nand issues or smth in device tree not corresponding to new nand driver though I've updated it as well.
Backporting the nand driver into k4.4 leads to a boot loop.