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
sipeed-lichepi-4a: Official support #5689
Conversation
Adds official support for the board and solid foundation for the development
lib/functions/compilation/uboot.sh
Outdated
# FIXME-QA(Krey): I don't like the handling of OPENSBI here | ||
do_with_ccache_statistics run_host_command_logged_long_running \ | ||
"CFLAGS='${uboot_cflags}'" "KCFLAGS='${uboot_cflags}'" \ | ||
CCACHE_BASEDIR="$(pwd)" PATH="${toolchain}:${toolchain2}:${PATH}" \ | ||
CCACHE_BASEDIR="$(pwd)" OPENSBI="$([ -z "$OPENSBISOURCE" ] || echo "$SRC/cache/sources/opensbi/fw_dynamic.bin")" PATH="${toolchain}:${toolchain2}:${PATH}" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the handling here, but i couldn't think of a way to improve it without rewriting things, kept as is for easy review
lib/functions/compilation/uboot.sh
Outdated
# FIXME-DOCS(Krey): Missing explanation | ||
: "${artifact_version:?artifact_version is not set}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was unable to provide a docs for what this does, someone decypher it plz
KERNEL_TARGET="legacy" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to work on current and edge kernel implementation in different merge request
KERNELSOURCE='https://github.com/revyos/thead-kernel' | ||
KERNELBRANCH="branch:lpi4a" | ||
declare -g KERNEL_MAJOR_MINOR="5.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the kernel that sipeed considers their official and work on mainlining there
|
||
case "$BRANCH" in | ||
legacy) | ||
UBOOT_USE_GCC='< 8.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seek chainsx for rationale about this, if needed
# FIXME(Krey): Figure out sane values | ||
## [ -n $CPUMIN ] || CPUMIN=480000 | ||
## [ -n $CPUMAX ] || CPUMAX=1010000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brainstorm? I dunno what values to put there as the default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just don't assign values. Or take it from /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will investigate..
Armbian documentation provided in sipeed/sipeed_wiki#512 to accompany this contribution |
CC seemingly the assigned developer for licheepi4a upstream in sipeed @Zepan - Can you provide context to how to make the sdcard boot to work? I tried to fastboot it according to the sipeed wiki and installing that on various offsets, but it's not working. I assume that it has some special process like the AllWinner A64 and currently have to fastboot flash it to the eMMC for testing.. Tried to brainstorm that in the riscv community and we weren't able to make it boot from the sdcard either, the closest we got is https://github.com/ryan4yin/nixos-licheepi4a/tree/main#flash-into-sd-card Documentation for the TH1520 would also help as it's really painful to develop without it atm, any relevant information related to making the board work is also appreciated e.g. context to the audio issue |
Built the thing, flashed it and it works 🤷 Just shows 7.52G instead of the 16GB I don't know the components of the 16GB vs 8GB version, but either:
|
That's very helpful! thanks |
Interesting 🤔 Armbian produces the rootfs as .tar.zstd and i decompressed it in tar and then flashed it on the device, i try to investigate it and get back to you |
Boot log
In addition to that here you go~ :p Btw. I am maintainer of OLIMEX Teres-A64 in Armbian https://www.armbian.com/olimex-teres-a64 and work/developing an OSHW hardware i am not some random troll, though people keep saying that i am loud for reasons~ |
Share contact on them plz, might make it less of a pain to develop |
|
Yep will work on that tomorrow bcs too tired now, i guess the most sensible thing would be to add an |
@chainsx Were you able to figure out what the dip switches are for? (They are not populated on my board) |
Is the official revyos using the optimized toolchain? Cuz i have the audio issue there as well and can't figure out how to check if it is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- rework into existing coding style,
- do not split board configs,
- keep only board related things in PR (SBI is not this board specific, also other fixes),
- advertisement and banners in PR's are not allowed. In case you want to show your graphics skills, make a wallpaper
- do not place donation links to your PR. If its not possible to work without, simply close the PR down.
- do not place your (c) to trivial config changes or things you have copy / pasted. Git does this for us.
- support always starts with .wip (all riscv64 will be WIP/CSC for another 6 months for sure), then we decide if it can be moved under supported or to csc / eos. Active maintainer is just a minimal condition. We don't know that and general software support for this hardware is early WIP.
- riscv64 hardware is not well supported even on userland. Packages are missing.
- riscv64 is not a family but architecture. This file adds no value except confusion: config/sources/families/include/riscv64_common.inc
Next time make sure to provide professional cleaned code that is easy and fast to review. Or PR will be closed without even looking.
Propose better handling for the issue of 3 variants (beta, 8GB, 16GB)
Will be submitted as separate at the cost of verifying functionality as that depends on a functional config (rationale for it to be included here..)
The kernel, bootloader, sbi and toolchain are changes made by sipeed affiliates so the configuration is at the same or higher quality then the official image. decide if it should be moved in wip or csc, i suggest conf > csc and discourage wip
All packages needed for the board to work are available in debian sid with the exception of gnome that is currently broken.
Will investigate, might remove or rename to Note #5692 as it's needed to fix issues with the config |
13c2aab
to
87f236e
Compare
This should address issues with eMMC to enable booting from it without an sdcard pdp7/linux@81572ed |
REVIEWERS: Squash using GitHub UI with message from the first commit
Adds official support for the board and solid foundation for the development
Description
Progress from #5684
Uses #5714 for compilation of OpenSBI, but doesn't depend on it
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
The fans doesn't work and need to be corrected on boot with:
CC @chainsx - Rerefencing #5684 (comment) -> you seem to have better understanding for how to make it work, please implement it
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
UEFI was not implemented and i try to submit that in next patch, TODO tracking
@chainsx You seem to be working on UEFI in your armbian fork rn, want to take over that implementation or do you want me to handle it?
Build Log: https://paste.next.armbian.com/oxamexecoj
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
Debian claims that bookworm will never support riscv so should be flagged
Trixie doesn't build because:
Debian upstream informed and working on the issue, i try to submit patch if they take long time
I try to address that in upcoming merge, TODO tracking
TODO: Track this
# dmesg
# fastboot devices
Issues were observed with serial console in
picocom
as it starts to print data that are not sensible, to fix this useC-a C-x
to close picocom and reopen it again, repeat until it worksI tried to adjust the coding style to the armbian standard where possible
riscv64 include was added with stuff that should always be included
thead family adjusted to provide generic configuration for the family of chips
Installs the 8GB version, needs to be adjusted for the 16GB
These errors were already present in the code before i touched them:
So the
Lint On Scripts / Shell script analysis (pull_request)
failure won't be addressed in this merge request.Refer to https://forum.armbian.com/topic/30111-implement-request-for-comment-rfc for permanent solution, i've partially refactored the uboot compilation so once we agree that the current coding style is atrocious and define a clear standard to follow then i can do more refactoring.
Jira reference number: Ehwww jira
How Has This Been Tested?
Through pain, suffering and lack of sleep by trying to boot the SD Card and flashing the fastboot and then testing the features
Changes tested on the 16GB version
As delivered by the manufacturer and verified with RV Debugger Plus (supplied by manufacturer) through UART serial console
Notice: I got two RV Debuggers Plus where one of them works fine and the other seems to have issues, it's likely an older version provided through promotion and needs to be flashed with newer firmware
Built using:
$ ./compile.sh build BOARD=sipeed-licheepi-4a BRANCH=legacy BUILD_DESKTOP=no BUILD_MINIMAL=yes EXPERT=yes KERNEL_CONFIGURE=no RELEASE=sid
Checklist:
Made where possible, i try to work on the documentation separatedly
Beyond the one mentioned
Credit
i compared his changes from https://github.com/chainsx/armbian-riscv-build/compare/911ed65ea5b37abf6e6fa0c8974083dcb0d7b8a2..081c7de1cfa9034009b64e7b129d93c38ce6c332 and used them as a reference for implementation in addition to my changes
Please archive the repository once you are done with it so that it can be used for a reference, thankuu