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
Add support for Odroid M1S Board #3121
Conversation
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.
Although this PR is still a draft, could you please put it on hold? We plan to merge #3063 this week and it will need to be updated afterwards, so I wanted to give you a heads-up about that. I remember you wrote you developed the support also for 6.6 kernel, so I hope this is not a big complication for you.
Maybe @agners has some more comments regarding this PR as well.
But anyway, thanks for your work!
Yes, I have a 6.6 branch as well, so no issues there. I will rebase onto that once 6.6 is merged. |
ce9ce3c
to
e196d9e
Compare
First 2 patches are actually from PR #3165, but apart from that this should be ready for review. Changes from first round:
|
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.
Looks good from my perspective 👍 There are just some nits below.
However I don't have M1S yet to try it out - but it should be somewhere on the way, same for @agners.
If there's no concern on Stefan's side, we could merge it before we start 12.0 beta, hopefully we should get M1S and add it to our board farm for testing before the public release.
buildroot-external/board/hardkernel/odroid-m1s/patches/uboot/0004-Fix-ethernet-properties.patch
Show resolved
Hide resolved
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.
Thanks for your work, this looks great!
- Activate UMS gadget on OTG port,allowing to mount internal eMMC on PC, making it easy for user to reinstall etc if required. The hardkernel UMS tool wont boot once mainline uboot is installed. I've also included a serial console on the OTG at the same time.
So you are exporting /dev/mmcblk0
as a block device, but that is also used for the data partition etc. I don't think it is safe to mount partitions/write to the block device when there are read-write partitions on that device 😰
That said I like adding UMS gadget support, that allows for some neat user experience. We could use that for other boards as well. However, the concurrent access for the block device is a problem 😢
You are currently using the kernel modules directly, from what I know this is the legacy way of enabling USB gadget modules (e.g. the drivers are in a legacy directory https://github.com/torvalds/linux/blob/v6.1/drivers/usb/gadget/legacy/Kconfig). The modern way is to use configfs to configure gadget devices. There are libraries with tools which allow to describe the gadget devices, see https://github.com/linux-usb-gadgets/libusbgx/blob/master/doc/gadget_schemes.txt.
Since we just step into this, I think it would be better if we go the modern approach 🤔
...al/board/hardkernel/odroid-m1s/patches/linux/0004-set-peripheral-mode-for-usb-otg-port.patch
Outdated
Show resolved
Hide resolved
Yes, that could be an issue, I was thinking it would provide an easy way for user to reinstall system etc, but even that wont necessarily be safe. Not sure if there is a way around this?
Yes I am aware that modules are considered legacy, however the configfs way is 100x more complicated than the legacy modules when used directly. I will however have alook and see if some tools help with that! |
We could introduce a separate systemd target which stops before mounting the data partition, but instead enables USB gadget mode (e.g. I guess the only way to do this safe would be a rootfs/squashfs we load into RAM at boot. Or pivot into a temporary root. That is what OpenWrt does IIRC. In any case, I'd suggest to split out/revert the USB gadget stuff from this PR so we can get ODROID-M1S going.
Yeah tools make it easier, but it is still more complicated. But then, also more flexible 😅 |
I agree with Stefan, let's separate the basic board support from the USB gadget stuff, as it may get fairly complex. Then, and after fixing merge conflicts caused by #3165 merge, we can move on with merging the M1S support 🎉 |
Synced from Hardkernel unofficial 6.1 tree https://github.com/tobetter/linux/blob/ae33b445578884c70d7bfc5d6d519de4db815ccd/arch/arm64/boot/dts/rockchip/rk3566-odroid-m1s.dts With additional cleanup and fixes for mainline linux
8471059
to
d7b4b20
Compare
Yeh either of those could work. I have rebased on dev and split out the UMS, will create a separate PR for it. |
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.
Looks good, thank you for your work 👍
Hardkernel have recently released the Odroid M1S which is a slimmed down version of the original Odroid M1.
Features:
This needs to be added as a new board since it uses a different TPL blob for DDR initialiasation.
There is no upstream support for this board just yet, however that is in progress. For now I am using the following:
Uboot using generic-rk3568 target
Linux device tree synced from the unofficial hardkernel 6.1 linux
https://github.com/tobetter/linux/tree/odroid-6.1.y
Installation to eMMC can be done directly with Hardkernel's USB UMS tool
https://wiki.odroid.com/odroid-m1s/getting_started/os_installation_guide?redirect=1#install_over_usb_from_pc