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

BeagleV-Ahead: New Community support #5712

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Kreyren
Copy link
Contributor

@Kreyren Kreyren commented Sep 14, 2023

REVIEWERS: Squash using GitHub UI with message from the first commit

beaglev-ahead: Official support

Adds community support for the board

Includes a kernel config for thead edge thus the high count of changes

Description

Implement a community support for BeagleV-Ahead

Depends on changes from #5689

Progress from #5684

The original work is on https://github.com/Kreyren/armbian-build-kreyren/compare/6cd581c96c0b7b800b6549afe23112d4a662d2a0..811288169004dccacab964129ecaf8cfe891b22d i tried to shorten it as much as possible for the easy merge request review

  • The image boots and seems to work without major issues

  • If the fans doesn't work then invoke following from userland:

echo 1 > /sys/class/pwm/pwmchip0/export
echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/period
echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle
echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable

Making fans to spin is implemented in the DTS and they should work, mentioned just in case to avoid overheating of the chip

  • The audio has issues with playback e.g. crab rave from youtube has lot of popping sounds on both the HDMI output and headphones through JACK, same observed on the official image

Tracked in #5692 for the optimized toolchain

  • UEFI was not implemented and i try to submit that in next patch, TODO tracking

  • Complains about:

[🐳|🔨]   ===================== WARNING ======================
[🐳|🔨]   This board does not use CONFIG_DM_USB. Please update
[🐳|🔨]   the board to use CONFIG_DM_USB before the v2019.07 release.
[🐳|🔨]   Failure to update by the deadline may result in board removal.
[🐳|🔨]   See doc/driver-model/MIGRATION.txt for more info.
[🐳|🔨]   ====================================================
[🐳|🔨]   ===================== WARNING ======================
[🐳|🔨]   CONFIG_OF_EMBED is enabled. This option should only
[🐳|🔨]   be used for debugging purposes. Please use
[🐳|🔨]   CONFIG_OF_SEPARATE for boards in mainline.
[🐳|🔨]   See doc/README.fdt-control for more info.
[🐳|🔨]   ====================================================

I try to address it in next merge request

  • The GPU and NPU are not usable, context in Figure out the GPU and NPU GPU/NPU Support? ryan4yin/nixos-licheepi4a#11.. blame the manufacturer

  • GNOME doesn't compile as it's currently broken for riscv64 in debian repositories

  • I didn't work on ubuntu compatibility, @chainsx seems to be better option for that as it seems to be his main distro and the OS configuration is shared from SiPeed LicheePi 4A

  • Debian claims that bookworm will never support riscv so should be flagged

  • Trixie doesn't build because:

[🐳|🚸] Could not find package filename for 'base-files' in 'https://packages.debian.org/bookworm/riscv64/base-files/download' [ looking for base-files ]

Debian upstream informed and working on the issue, i try to submit patch if they take long time

  • Complains about:
[    2.563670]
[    2.565219] ********************************************************************
[    2.572714] **     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE           **
[    2.580204] **                                                                **
[    2.587680] **  WRITEABLE clk DebugFS SUPPORT HAS BEEN ENABLED IN THIS KERNEL **
[    2.595150] **                                                                **
[    2.602619] ** This means that this kernel is built to expose clk operations  **
[    2.610105] ** such as parent or rate setting, enabling, disabling, etc.      **
[    2.617589] ** to userspace, which may compromise security on your system.    **
[    2.625091] **                                                                **
[    2.632561] ** If you see this message and you are not debugging the          **
[    2.640030] ** kernel, report this immediately to your vendor!                **
[    2.647498] **                                                                **
[    2.654967] **     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE           **
[    2.662433] ********************************************************************
[    2.669998] random: fast init done

I try to address that in upcoming merge, TODO tracking

  • The flashing is not implemented and needs to be done manually as i and the riscv community ware unable to find any documentation or data on how to make it bootable through the sdcard, needs to be flashed through fastboot:
  1. Hold the BOOT button and connect the USB-C cable to your system
  2. Verify that the Android Downloader shows up in # dmesg
  3. Verify that fastboot can see the device with # fastboot devices
  4. Invoke:
# fastboot flash rom ./path/to/uboot/binary # Flash the binary in the tempfs so that we can flash it
# fastboot reboot # Reboot the device to the binary
# fastboot flash uboot ./path/to/uboot/binary # Flash the uboot on the board
# fastboot flash root ./path/to/rootfs.tar # Flash the rootfs
  1. Remove the USB-C and try to boot the device, you should be greeted with armbian

Jira reference number: Ehwww jira

How Has This Been Tested?

By a community member on his device
As a part of #5689 and #5714

Built using:

$ ./compile.sh build BOARD=beaglev-ahead BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=yes EXPERT=yes KERNEL_CONFIGURE=no RELEASE=sid

Checklist:

  • git revert development: New vscod{e,ium} configuration #5691
  • 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
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Jacob Hrbek added 11 commits September 9, 2023 01:35
Adds official support for the board and solid foundation for the development
This reverts commit 38cc22e.
This contribution declares `default.code-workspace` which is used to open a development environment with tools and configuration needed to make development of armbian more efficien, reliable and easier through integrated linting, formatting, visual improvements and configuration for non-standard file extensions

Additionally to that it also implements compatibility for nix(os) which opens the vscod{e,ium} with tools needed for development to avoid issues of missing binaries and dependencies for the build and linting for nix files
This reverts commit febb196.
@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 14, 2023

Too many changes, closing for the time being until dependent changes are merged

@Kreyren Kreyren closed this Sep 14, 2023
@Kreyren Kreyren mentioned this pull request Sep 14, 2023
7 tasks
@Kreyren Kreyren reopened this Sep 14, 2023
@Kreyren Kreyren marked this pull request as ready for review September 14, 2023 02:22
@Kreyren Kreyren requested review from a team and igorpecovnik as code owners September 14, 2023 02:22
@Kreyren Kreyren marked this pull request as draft September 21, 2023 10:18
@Kreyren Kreyren closed this Sep 21, 2023
@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 21, 2023

BeagleBoard provided the Hardware Files in https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/commit/3b72a86f4856ca7dd90391a2a381b9385039fb86

It's still not open-source as it depends on proprietary ecad software, but i can import this in kicad and work on my own design so it's fine by me. -> Re-Opening

@Kreyren Kreyren reopened this Sep 21, 2023
@Kreyren Kreyren marked this pull request as ready for review September 21, 2023 23:35
Copy link
Collaborator

@viraniac viraniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kreyren I think you missed to commit lib/functions/compilation/opensbi.sh file

@viraniac viraniac self-requested a review September 26, 2023 22:34
@viraniac
Copy link
Collaborator

@Kreyren I think you missed to commit lib/functions/compilation/opensbi.sh file

My bad, I see there is a different merge request for that. However I am not seeing the option to undo the change request

@rpardini
Copy link
Member

Saw the presentation at ER2023. Seems like this doesn't support vector extensions, and would require an external toolchain? Yes/no, how are you handling this?

@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 29, 2023

@Kreyren I think you missed to commit lib/functions/compilation/opensbi.sh file

My bad, I see there is a different merge request for that. However I am not seeing the option to undo the change request -- @viraniac (#5712 (comment))

Sorry didn't get a notification, elaborate what do you mean?

Saw the presentation at ER2023. Seems like this doesn't support vector extensions, and would require an external toolchain? Yes/no, how are you handling this? -- @rpardini (#5712 (comment))

yes i am handling this - Not recognized as a major issue, tester didn't report any issues including the audio.

No idea what do you mean by ER2023, the TH1520 is using C910 cores and the addition of standard V extension is called C920 cores by t-head used in e.g. the SOPHON SG2042 which is just stupid marketing and as far as i know it doesn't really need that extension for runtime.

It would benefit from the t-head optimized toolchain mainly in performance as proposed in #5692 where @chainsx claims in #5689 (comment) that not using the optimized toolchain causes various issues such as with audio that was observed by me using the revyOS build, but @Rabenda claims in ryan4yin/nixos-licheepi4a#14 (comment) that the toolchain is not relevant to the audio issue.
The cause of the audio issue is currently unknown and not reported to be affected in beaglev likely due to using a newer kernel in comparison to licheepi 4a or possible issue in the blob itself as the C906 audio is proprietary atm.

So the optimized toolchain should be a subject by next merge request as igor requested me to try to shorted the merge requests as much as possible.

@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 29, 2023

@rpardini Maybe you are confusing that with this issue? revyos/revyos#17

The scope of that is not yet understood, worst case scenario TH1520 is franken ISA not-complying with RISCV afaik.

@RevySR
Copy link

RevySR commented Sep 30, 2023

The cause of the audio issue is currently unknown and not reported to be affected in beaglev likely due to using a newer kernel in comparison to licheepi 4a or possible issue in the blob itself as the C906 audio is proprietary atm.

So the optimized toolchain should be a subject by next merge request as igor requested me to try to shorted the merge requests as much as possible.

audio problem

The audio problem affects two cases

  1. load firmware failed
  • Latest thead-u-boot needs to be used with the latest c906 audio firmware
  1. alsa buffer problem.

vector problem

Requires the kernel to add vector register contexts
sophgo/linux-riscv@1ae9f2d
thead-kernel has a similar commit.

compiler extension

Chinese docs: https://revyos.github.io/docs/en/build/debian/%E7%BC%96%E8%AF%91%E5%99%A8%E7%9B%B8%E5%85%B3%E8%AF%B4%E6%98%8E/
c910 has v0p7 and xtheadc (xthead vendor extension)
Both can be used independently

thead-gcc has vector and xtheadc
gcc-13.2 has xthead extension(xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadfmv_xtheadint_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync)

Because the range of use is not very wide, so we have to consider whether to use it or not.

@RevySR
Copy link

RevySR commented Sep 30, 2023

thead-gcc (v2.6.1) prebuilt:
https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1663142514282/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1-20220906.tar.gz

@chainsx chainsx mentioned this pull request Oct 3, 2023
8 tasks
@github-actions github-actions bot removed the Software label Dec 5, 2023
@igorpecovnik igorpecovnik added the Backlog Stalled work that needs to be completed label Dec 24, 2023
@igorpecovnik
Copy link
Member

Any interest to rework this?

@Kreyren
Copy link
Contributor Author

Kreyren commented Mar 6, 2024

Any interest to rework this? -- @igorpecovnik (#5712 (comment))

Yes, i am monitoring the development and i am currently unsure how should this be implemented in downstream. I try to brainstorm it with beagles and revyOS devs as they are working on linux 6.0+ support

@Kreyren Kreyren marked this pull request as draft March 6, 2024 17:23
@Kreyren
Copy link
Contributor Author

Kreyren commented Mar 7, 2024

https://lore.kernel.org/linux-riscv/20230722-upstream-beaglev-ahead-dts-v1-0-ccda511357f4@baylibre.com/T/#t

beaglev-ahead is getting the dts mainlined

https://lore.kernel.org/linux-riscv/20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com/T/#t eMMC is pending

I guess i can adjust this merge request to track with upstream changes and we could merge it as community support with a disclaimer of functionality, RFC @igorpecovnik

@silver2row
Copy link

neat...

I gave up, picked it back up, and gave up again. I am about to start from scratch!

Seth

P.S. Thank you guys for posting, i.e. gals too. I bet with a little hoopla from thead marketing, things will transpire just fine. Too bad about the NPU and GPU though. Anyway, off to another day of luxury grass mowing. I cannot wait to see what happens!

@Kreyren
Copy link
Contributor Author

Kreyren commented Mar 20, 2024

neat...

I gave up, picked it back up, and gave up again. I am about to start from scratch!

Seth

P.S. Thank you guys for posting, i.e. gals too. I bet with a little hoopla from thead marketing, things will transpire just fine. Too bad about the NPU and GPU though. Anyway, off to another day of luxury grass mowing. I cannot wait to see what happens! -- @silver2row (#5712 (comment))

Huh?

@silver2row
Copy link

@Kreyren ,

Hello...it is me. I posted some hastebin ideas on the forums... I directed the build at you. Are you still trying things?

I have no clue about RevyOS and/or could care less about the GPU support. Currently, since the headers are there allocated from chip to headers, I am more worried about makers like myself making things with this board. Selfish maybe but I enjoy building in time...

Okay... https://forum.armbian.com/topic/29298-beaglev-ahead-and-armbian-support/#comment-187147

I built the docker image with:

./compile.sh build BOARD=beaglev-ahead BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=yes EXPERT=yes KERNEL_CONFIGURE=no RELEASE=sid

I received an error about no board file.

I do not have the board file. If you need support on building, I know less than you about Armbian for sure, I can try alternatives and builds around the OpenSBI, different cross_compilers, toolchains, and so on...

Please let me know where I can fit in?

Seth

@Kreyren
Copy link
Contributor Author

Kreyren commented Apr 8, 2024

https://forum.armbian.com/topic/29298-beaglev-ahead-and-armbian-support/#comment-187147

I didn't see you trying to reach me on forum, sorry about that!


Lot has changed since me making this merge request i am working on adjusting this merge request to use mainline and will give you a new instructions to test, currently researching them through LicheePi 4A

@silver2row
Copy link

silver2row commented Apr 14, 2024

   The following packages have unmet dependencies:
    mtd-utils : Depends: libssl3 (>= 3.0.0) but it is not installable
   E: Unable to correct problems, you have held broken packages.

So, it seems that libssl3 is not installable on the debian distro I am using...

Okay...so. Ubuntu is welcomed due to the libssl3 error. I will attempt this build again with Ubuntu and not Debian.

Seth

@Kreyren
Copy link
Contributor Author

Kreyren commented Apr 14, 2024

I don't think it's a good idea to try to build this and run it on the device as too many things have changed since this was submitted, wait for me to adjust the contribution for you to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Stalled work that needs to be completed
Development

Successfully merging this pull request may close these issues.

None yet

6 participants