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

sunxi-6.10: Add armbian patches #7127

Merged
merged 7 commits into from
Sep 10, 2024
Merged

Conversation

The-going
Copy link
Contributor

@The-going The-going commented Aug 23, 2024

Description

  • Add armbian patches from sunxi-6.7
  • Adapt the patch series to the new v6.10.5 kernel version
  • Delete unused patches and add newly extracted patches.

How Has This Been Tested?

  • Build for arm64 & test work on board
 ____  ____  _   __  __  __   _  _   
| __ )|  _ \(_) |  \/  |/ /_ | || |  
|  _ \| |_) | | | |\/| | '_ \| || |_ 
| |_) |  __/| | | |  | | (_) |__   _|
|____/|_|   |_| |_|  |_|\___/   |_|  
                                     
Welcome to Armbian_community 24.8.0-trunk Bookworm with bleeding edge Linux 6.10.5-edge-sunxi64

No end-user support: built from trunk

System load:   2%               Up time:       11 min
Memory usage:  6% of 1.94G      IP:            192.168.100.101
CPU temp:      26°C             Usage of /:    18% of 7.2G

Time        CPU    load %cpu %sys %usr %nice %io %irq   Tcpu  C.St.

15:14:27  1008 MHz  0.00   5%   0%   0%   0%   3%   0%  23,3 °C  0/7
15:14:33  1008 MHz  0.00   3%   2%   0%   0%   0%   0%  22,8 °C  0/7
15:14:38  1008 MHz  0.00   2%   2%   0%   0%   0%   0%  22,2 °C  0/7

@github-actions github-actions bot added Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Aug 23, 2024
@JohnTheCoolingFan
Copy link
Contributor

Proposing to remove the bigtreetech cb1 related patches that use the old pre-mainline device trees, for 6.10 the bigtreetech-pi device tree will be used with different patches.

@The-going
Copy link
Contributor Author

Proposing to remove the bigtreetech cb1 related patches that use the old pre-mainline device trees, for 6.10 the bigtreetech-pi device tree will be used with different patches.

I only have bananpi-m64 available.
I thoughtlessly adapted all the other patches to the new version and did not test them.
It is assumed that someone else will change this.

@The-going The-going marked this pull request as draft August 23, 2024 10:59
@JohnTheCoolingFan
Copy link
Contributor

That's fine, I'll touch this up in a later PR

@The-going
Copy link
Contributor Author

The-going commented Aug 23, 2024

At this stage, the compilation is error-free for arm64,
but with a lot of warnings for wifi drivers.

I'm done with this.

@The-going The-going marked this pull request as ready for review August 25, 2024 13:16
@The-going
Copy link
Contributor Author

building package linux-image-edge-sunxi without errors.

@The-going
Copy link
Contributor Author

@JohnTheCoolingFan You can just continue.
I can give you access to my repository.

@JohnTheCoolingFan
Copy link
Contributor

JohnTheCoolingFan commented Aug 26, 2024

Getting an error trying to do kernel-dtb for bigtreetech-cb1 or bananapim4zero edge, on commit c54ab52:

arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi:708.21-723.5: ERROR (phandle_references): /soc/spi@5011000: Reference to non-existent node or label "spi1_cs1_pin"

  also defined at arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4-zero.dts:235.7-248.3

@The-going
Copy link
Contributor Author

Getting an error trying to do kernel-dtb for bigtreetech-cb1 or bananapim4zero edge

It looks like I haven't made a commit with the bugs fixed. This is my inattention.

@JohnTheCoolingFan
Copy link
Contributor

Simply changed some file names so that the cb1 dtsi enhancements would be applied and other dts files won't be created, trying to use the bigtreetech-pi dts. No Ethernet and no HDMI output, though... Not sure why.

@The-going
Copy link
Contributor Author

No Ethernet and no HDMI output, though... Not sure why.

What does dmesg report? UART console.

@JohnTheCoolingFan
Copy link
Contributor

What does dmesg report? UART console.

Well, there's no eth0 interface and the only snippet I could find about hdmi is this:

[    0.033135] platform 3001000.clock: Fixed dependency cycle(s) with /soc/rtc@7000000
[    0.036404] platform 6000000.hdmi: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[    0.036813] platform 6000000.hdmi: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[    0.036922] platform 6510000.tcon-top: Fixed dependency cycle(s) with /soc/hdmi@6000000
[    0.036979] platform 6510000.tcon-top: Fixed dependency cycle(s) with /soc/lcd-controller@6515000
[    0.036996] platform 6510000.tcon-top: Fixed dependency cycle(s) with /soc/bus@1000000/mixer@100000
[    0.037163] platform 6510000.tcon-top: Fixed dependency cycle(s) with /soc/lcd-controller@6515000
[    0.037232] platform 6515000.lcd-controller: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[    0.037477] platform 7000000.rtc: Fixed dependency cycle(s) with /soc/clock@7010000
[    0.037582] platform 7000000.rtc: Fixed dependency cycle(s) with /soc/clock@7010000
[    0.037679] platform 7010000.clock: Fixed dependency cycle(s) with /soc/rtc@7000000
[    0.038781] platform 6000000.hdmi: Fixed dependency cycle(s) with /connector
[    0.038861] platform connector: Fixed dependency cycle(s) with /soc/hdmi@6000000

I suspect that there might be something about the device tree not loading properly, but the patches to explicitly enable hdmi and ethernet are applied with no errors, perhaps I overlooked something? A warning during compile, or changes in drivers from 6.6... Will have to do quite a bit of investigation on that one. At least the board boots properly, wifi works fine at least.

@The-going
Copy link
Contributor Author

I suspect that there might be something about the device tree not loading properly, but the patches to explicitly enable hdmi and ethernet are applied with no errors, perhaps I overlooked something? A warning during compile, or changes in drivers from 6.6...

After I adapted the patches and began to build, the compiler reported an error
of duplicate nodes in the DTS many times. I had to remove some of them.
I could have confused something.
If you have a working image (with a different core), will you be able to compare the HDMI nodes in the DTS.
Not the files, but the ones that were applied on a working device?
Using the command:

dtc --sort -I fs -O dts  /sys/firmware/devicetree/base > dts-out.txt

Maybe this will give you a clue.

As for Ethernet eth0.
I realized that the problem is with the pwm driver.
@chraac has kindly agreed to add a pwm driver to this pull request.
He seems to have a working option here #7139.
Let's wait a bit.

@JohnTheCoolingFan
Copy link
Contributor

Well, here's the output file from that command:
dts-out.txt

As for ethernet, yes, it is dependent on sunxi pwm, but also from what I remember u-boot also plays a role in initializing the ethernet PHY.

@chraac
Copy link
Collaborator

chraac commented Aug 29, 2024

Hi @The-going , regarding the sunxi's pwm driver and gmac driver, created a PR at you fork, please have a look:
The-going#25

@github-actions github-actions bot added the size/large PR with 250 lines or more label Aug 31, 2024
@The-going
Copy link
Contributor Author

Well, on this branch, 6.6 works fine, and 6.10 works if the FDTFILE is changed to be the same as in 6.6 (I have added a hook that changed it to bigtreetech-pi in #6656 ). Ethernet works, but HDMI doesn't.
Should I commit the hook removal to this branch? It was previously done because there wasn't a usual bigtreetech-cb1 device tree before patches in this PR were added.

I didn't understand what it was about.
What kind of hook are we talking about?
The commit number?
816101bc777?

@JohnTheCoolingFan
Copy link
Contributor

Yes, that one.

@The-going
Copy link
Contributor Author

Yes, that one.

What does this code do?
It's not clear to me. I really don't understand what this code does.

It is a very bad practice to use any hooks for patches.
Instead, it would be preferable to make a new DTS file.

It is also a very bad practice to make symbolic links in a folder for one kernel version to existing patch files in a folder for another kernel version.
Patches for a single version live their own lives.
They may change and then your links will stop working or your patches will not be able to be applied cleanly.

@The-going
Copy link
Contributor Author

Should I commit the hook removal to this branch?

Please do this in a separate pull request.
And replace symbolic links with real patch files.

@JohnTheCoolingFan
Copy link
Contributor

What does this code do?

Change BOOT_FDT_FILE to a different one because the original plan was to go along with the mainline dts and adapt patches to build on top of it. Otherwise there would be a bunch of dts files (two from a patch, one in mainline) and only one of them used for the board. others being just a leftover junk.

Please do this in a separate pull request.
And replace symbolic links with real patch files.

Will do. A PR to main armbian repo or to the branch of this PR? Just to clarify

@The-going
Copy link
Contributor Author

PR to main armbian repo

And please mark it as a bugfix

@JohnTheCoolingFan
Copy link
Contributor

BigTreeTech CB1 working on this branch rebased on current main (https://github.com/JohnTheCoolingFan/armbian-build/tree/main-sunxi-6.10-btt-cb1-hdmi), Ethernet works, HDMI doesn't, I don't know the reason, but it's ok for this PR and I will address that in a future PR after this gets merged. As for which device trees to use, also matter of discussion for next PRs.

@chraac
Copy link
Collaborator

chraac commented Sep 6, 2024

Hi @The-going ,
Tested this fork on Zero2W (H616), wireless and ethernet works well now, but found maybe a potential issue on the Zero2W (H616): seems like the thermal_zone is not being created correctly under the path /sys/devices/virtual/thermal
08d91b5c96e5e3935d8de0e1f0b03bb

Usually, there should be some thermal_zone folder there (from sunxi-6.6):
e6a1e4733c034053e29a59cb718937e

Are there any patches related to this in the older kernel versions? If so, I'd be happy to assist with porting them to the new kernel.

@The-going
Copy link
Contributor Author

(H616): seems like the thermal_zone is not being created correctly under the path /sys/devices/virtual/thermal

Are there any patches related to this in the older kernel versions? If so, I'd be happy to assist with porting them to the new kernel.

Yes there is.
patch/kernel/archive/sunxi-6.7/patches.armbian/drv-thermal-sun8i_thermal-Add-for-H616.patch

But it can also be incorrectly applied (written) thermal-zones ... trips

grep -Enr '^diff.*/sun50i-h616.dtsi' patch/kernel/archive/sunxi-6.7/patches.armbian/* | awk -F":" '{print $1}'

I'm sorry, I caught a cold and got sick. I hope to be able to continue in three days.

@chraac
Copy link
Collaborator

chraac commented Sep 8, 2024

(H616): seems like the thermal_zone is not being created correctly under the path /sys/devices/virtual/thermal

Are there any patches related to this in the older kernel versions? If so, I'd be happy to assist with porting them to the new kernel.

Yes there is. patch/kernel/archive/sunxi-6.7/patches.armbian/drv-thermal-sun8i_thermal-Add-for-H616.patch

But it can also be incorrectly applied (written) thermal-zones ... trips

grep -Enr '^diff.*/sun50i-h616.dtsi' patch/kernel/archive/sunxi-6.7/patches.armbian/* | awk -F":" '{print $1}'

I'm sorry, I caught a cold and got sick. I hope to be able to continue in three days.

Take care! No worries, I'll continue working on this branch to ensure the OPi Zero2W runs smoothly on version 6.10.

The-going and others added 6 commits September 9, 2024 10:34
Adapt the patch series to the new v6.10.5 kernel version
The patches in the series were applied to the Linux
kernel git repository as the "git am" command.
And then re-extracted to the target patches.armbian
folder using the tools/mk_format_patch script.
In this case, the series.armbian file is created anew
and all patches in the series strictly correspond
to this list.

I.e. unused ones will be deleted. The name of the patch
file will match the string "Subject:".

Signed-off-by: The-going <[email protected]>
Add a lost patch adding spi1_cs1_pin for sun50i-h616
Recent changes in the kernel make the patch unusable for
drm/sun4i/sun4i_hdmi_enc.c.
I'll deal with it later if someone doesn't fix it sooner.
@The-going
Copy link
Contributor Author

Zero2W (H616): seems like the thermal_zone is not being created correctly under the path /sys/devices/virtual/thermal

There have been changes to the temperature driver in the v6.10.5..v6.10.9 range.
Before conducting research, please pull out the latest changes.

To make our patch work, we will return to the edid structure
while it is safe.
@The-going
Copy link
Contributor Author

@igorpecovnik At this stage, compilation sun4i_hdmi_audio is successful for sunxi.
I have no way to check the performance of this driver.

I think it can be merge with the main branch.

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 11 Milestone: Fourth quarter release labels Sep 9, 2024
@The-going
Copy link
Contributor Author

@JohnTheCoolingFan @chraac
You can find the kernel repository with patches already applied at:
sunxi-6.10-rebase

@DealsBeam
Copy link

Thank you guys for the hard work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Milestone: Fourth quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

5 participants