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

BigTreeTech CB2/Pi2 config #6860

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

JohnTheCoolingFan
Copy link
Contributor

@JohnTheCoolingFan JohnTheCoolingFan commented Jul 1, 2024

Description

Added patches and config for BigTreeTech CB2/Pi2

GitHub issue reference:
Jira reference number AR-2332

How Has This Been Tested?

Build and load on BTT Pi 2, test peripherals and see how it runs for 5 minutes

Checklist:

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added size/large PR with 250 lines or more Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jul 1, 2024
@ColorfulRhino
Copy link
Collaborator

ColorfulRhino commented Jul 1, 2024

Not sure which board you used as template for the board config, but you don't need most of this stuff. Try using this as an example:

https://github.com/armbian/build/blob/main/config/boards/nanopi-r5c.csc (minus the asound and extlinux line, use BOOTBRANCH="tag:v2024.07-rc5" and BOOTCONFIG="generic-rk3568_defconfig" it works well for rk3568/rk3566)

Also, you have put your patches into rockchip instead of rockchip64 😉

And to prevent duplication, you could use a symlink for the dts file to point from one to the other if they're exactly the same, so you only have one dts and the other one is just a symlink (example: https://github.com/armbian/build/tree/main/patch/kernel/rockchip-rk3588-collabora/dt)

@rpardini
Copy link
Member

rpardini commented Jul 2, 2024

@JohnTheCoolingFan please pick armsurvivors@779b4ee -- you told me the other day I could drop it, but you seem to have forgotten?

@ColorfulRhino that addresses most of your comments, I think?

@rpardini rpardini added the Work in progress Unfinished / work in progress label Jul 2, 2024
@JohnTheCoolingFan
Copy link
Contributor Author

@JohnTheCoolingFan please pick armsurvivors@779b4ee -- you told me the other day I could drop it, but you seem to have forgotten?

@ColorfulRhino that addresses most of your comments, I think?

I did pick it, just didn't push onto a remote branch and it's not used in this branch. This is subject to change during the development of the PR. Pushed it to btt-cb2-rpardini. I have a number of branches for btt cb2 and cb1 and was organizing them yesterday, deleting unneeded ones. Will have to reevaluate branch this PR currently uses vs others I have.

@rpardini
Copy link
Member

rpardini commented Jul 2, 2024

it's not used in this branch

Yeah, but reviews are costly -- please don't waste our time, it's precious. Thanks.

@JohnTheCoolingFan
Copy link
Contributor Author

Yeah, but reviews are costly -- please don't waste our time, it's precious. Thanks.

When the PR is ready for review, I'll mark it as such. For now - it's a draft.

@rpardini
Copy link
Member

rpardini commented Jul 2, 2024

Well I sent #6874 (also draft) - I don't (or plan to) have the board

@JohnTheCoolingFan
Copy link
Contributor Author

Switched it to the @rpardini config. The built image does boot but there is no hdmi output, no ethernet connection and I still can't get proper input via UART pins. I don't have dedicated usb-to-uart converters yet and have been using a chinese arduino nano clone with a ch340 chip and the MCU reset pin tied to ground. I can get board's output butt can't input anything.

@JohnTheCoolingFan
Copy link
Contributor Author

Noticed that BTT had a custom armbianEnv.txt and there was overlay=hdmi, tried setting this in the image, didn't make the hdmi work.

I'm getting out of ideas. The device tree is same, based on the same kernel, so why is it not giving any output? The config is set to have output on both serial and display. And also Ethernet doesn't work even though it probably uses the same exact driver (based on 6.6 kernel).
Some help would really be appreciated. I can probably safely use an arduino to read serial output but not send until a proper usb-uart adapter comes in.

@JohnTheCoolingFan
Copy link
Contributor Author

Tried vendor's image, a minimal Armbian build. It had a lot of additional device tree overlays, including hdmi, which did get me a working hdmi output, but simply putting overlays=hdmi doesn't enable that output on the armbian build of this commit.
Also, I couldn't get any hardware UART from it even with a dedicated USB to UART adapter bases on a FT232RL chip. It didn't work on the vendor image and didn't work on the PR's commit build, even trying different UARTs and speeds (25000000, 15000000, 1500000, 115200, 9600).

@igorpecovnik
Copy link
Member

but simply putting overlays=hdmi doesn't enable that output on the armbian build of this commit.

What if you put HDMI to device tree?

@JohnTheCoolingFan
Copy link
Contributor Author

Ok, I finally got some progress with getting a tty. I shouldn't have traced down the gpio pins from rk3566 datasheet, the tx/rx pins are the same as in Btt Pi (CB1) or CM4. The pins are not marked as uart in the official manual, which just makes it extremely confusing. I now have a fully functional tty and can debug problems further.

Alright, so now I would like to first set up ethernet so I don't have to use uart as often. In the current config, the board is having problems setting up ethernet:

[   23.648519] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   23.650924] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00] driver [YT8531 Gigabit Ethernet] (irq=POLL)
[   24.651122] rk_gmac-dwmac fe010000.ethernet: Failed to reset the dma
[   24.651145] rk_gmac-dwmac fe010000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed
[   24.651152] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Hw setup failed
[   25.189408] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   25.191615] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00] driver [YT8531 Gigabit Ethernet] (irq=POLL)
[   26.195094] rk_gmac-dwmac fe010000.ethernet: Failed to reset the dma
[   26.195115] rk_gmac-dwmac fe010000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed
[   26.195122] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Hw setup failed

@JohnTheCoolingFan
Copy link
Contributor Author

Putting the boot log gist here just for the record: https://gist.github.com/JohnTheCoolingFan/5df87cc4b87298d6bc21e046bfcff5f6

@JohnTheCoolingFan
Copy link
Contributor Author

JohnTheCoolingFan commented Nov 20, 2024

With the diff I was provided, I could make a raw-ish device tree from a kernel 6.6 orangepi-3b device tree:
rk3566-bigtreetech-pi2-by-Cowboy-from-diff.dts.txt
and rk3566-orangepi-3b-full.dts.txt for reference

These device trees are pretty raw and as such are not suitable to be put into the patch folder I think, so I am working on a proper device tree, that is using the includes and labels instead of raw phandles.
I still had no good results from this, any help with this is appreciated.

@JohnTheCoolingFan JohnTheCoolingFan added Work in progress Unfinished / work in progress and removed Needs review Seeking for review labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware Hardware related like kernel, U-Boot, ... Help needed We need your involvement Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more Work in progress Unfinished / work in progress
Development

Successfully merging this pull request may close these issues.

6 participants