Porting #1249
Add support for the beaglebone green
50%
Description
The beaglebone green doesn't work out of the box:
Using the default beaglebone (black) u-boot image results in the beaglebone black dtb being loaded, which, at the end makes the Ethernet not work:
It can't properly negociate because it uses the generic PHY driver instead of the one for the "SMSC LAN8710/LAN8720" Ethernet PHY.
To make it work I did a very dirty workaround that only works because 'green' has the same number of characters than 'black' and that uboot didn't have checksums to check itself:
cd /boot sed s#am335x-boneblack#am335x-bonegreen#g -i u-boot.img sed s#am335x-boneblack.dtb#am335x-bonegreen.dtb#g -i u-boot.img dd if=MLO of=/dev/mmcblk1 count=1 seek=1 conv=notrunc bs=128k dd if=u-boot.img of=/dev/mmcblk1 count=2 seek=1 conv=notrunc bs=384k
However I was pointed out that a patch might resolve the issue:
https://rcn-ee.com/repos/git/u-boot-patches/v2017.03/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
I don't have the time to test it right now, but I will later
Files
Related issues
History
Updated by GNUtoo over 6 years ago
Instead I did the following:
- I use the master revision (d5abcf94c7 ti: boot: Register the MMC controllers in SPL in the same way as in u-boot) from mainline u-boot, with the patches I will attach here
- I generated a boot.scr with the files I will attach.
- The Ethernet stops working after some point
- It stops working really fast under high load traffic
- It seems to be related to the PHY driver somehow, and autonegotiation.
Denis.
Updated by GNUtoo over 6 years ago
- File 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch added
u-boot patches
Updated by GNUtoo over 6 years ago
Updated by GNUtoo over 6 years ago
Updated by isacdaavid over 6 years ago
so, does the patchset produce better results than sed or not? which solution would you like to see used in a new uboot package?
Updated by Anonymous over 6 years ago
- Related to Bug #1261: [linux-libre*] mkinitcpio -p linux-libre* => /boot/initramfs-%PKGBASE%.img added
Updated by isacdaavid over 6 years ago
- % Done changed from 0 to 50
- Priority changed from bug to wish
- Status changed from open to in progress
Updated by isacdaavid over 6 years ago
a package called uboot-am335x_green
based on that very commit and those patches now exists in [libre-testing]
, although you probably won't see it on the website.
would you like to give it a try?, I don't have the hardware to test it. please write back with any news and suggestions.
Updated by GNUtoo over 6 years ago
I'd like to but I cannot do it right now as:
- My beaglebone green is now my main server and is hosting several services that I depend on.
- It's near where I currently reside but not in the same place, and I would need to dedicate time to go at the location where the beaglebone green is and do some testing.
- Create a microSD card to test the new bootloader with that.
- Carry out the test when I go to the place where the beaglebone green is.
I'll report here when I'll have tested it.
Updated by GNUtoo about 6 years ago
I now have a second BeagleBoneGreen so I can carry out tests.
Barebox supports the "BeagleBone", so I gave a try.
The code can detect which BeagleBone it runs on, but it doesn't have any support for the BeagleBoneGreen and detects it as a BeagleBoneBlack.
The only relevant differences seem to be:
- A lot of nodes and pads required to make HDMI work on the Black version
- The Green seem to have an UART2 that I didn't find on the Black.
- The BeagleBoneBlack is supported, whereas, it is not in u-boot.
- Ethernet works in Linux and Barebox
- The eMMC is detected and works fine but I can't manage to detect an external microSD anymore, including in Linux.
- USB gadget support is absent in Barebox for the BeagleBone's PHY or USB controller. This is not very convenient: The stock u-boot had the ums command that could export the eMMC over usb with the 'ums 0 mmc 1' command.
- It probably doesn't have a PKGBUILD but I can make one if needed.
Being far more familiar with Barebox than with u-boot and having a strong preference for Barebox as a user, I will try to work with upstream to fix the issues and make a PKGBUILD when it's good enough to be used.
That said I will also try to test the u-boot package soon.
Updated by isacdaavid about 6 years ago
GNUtoo wrote:
Being far more familiar with Barebox than with u-boot and having a strong preference for Barebox as a user, I will try to work with upstream to fix the issues and make a PKGBUILD when it's good enough to be used.
That said I will also try to test the u-boot package soon.
please do. I'll be happy to have either package.
Updated by GNUtoo almost 6 years ago
Sorry for the delay, I finally tested the package, and here are some comments below:
The flash instructions in post_install script prints the following:
# dd if=/boot/MLO of=/dev/mmcblk0 count=1 seek=1 conv=notrunc bs=128k # dd if=/boot/u-boot.img of=/dev/mmcblk0 count=2 seek=1 conv=notrunc bs=384k
If an microSD card is inserted, it will install the bootloader there.
To boot on the internal eMMC, mmcblk1 should be used instead.
Having the bootloader on the internal eMMC makes more sense to me.
To make it work I also needed to inform u-boot about my rootfs with:
# echo "root=/path/to/rootfs >> /boot/uEnv.txt
This ensures that the bootloader uses the correct rootfs. I use LVM, and without that it tried to use the /boot partition as rootfs
And finally u-boot environment has:
bootdir=/boot
so I had to do that:
# cd /boot # ln -s . boot
This ensures that u-boot can load the Linux kenrel, initramfs and dtb at the /boot/ prefix, while keeping the compatibility with rootfs containing the /boot in them (such as an unique ext4 filesystem).
Beside that everything seem to work fine so far, but I didn't do extensive tests.
Denis.
Updated by GNUtoo almost 6 years ago
It seems that the u-boot also need to pass some extra argument such as rw to have the root filesystem mounted read-write, this can be made trough:
optargs=coherent_pool=1M rw
in /boot/uEnv.txt
And this time the Ethernet seem to work fine so far, Linux detected the right PHY, and I ran iperf3 during several minutes without any issues. Besides I never saw the Ethernet link switch to 1000 like I probably had back then.
Denis.
Denis.
Updated by GNUtoo over 4 years ago
- The Beaglebone green is supported by upsrteam u-boot => We need to make an uboot4extlinux-am335x
- The Beaglebone black is supported by upsrteam barebox but not the beaglebone green. Detection for it needs to be added by reading the eeprom instead of the SOC version.
Updated by GNUtoo over 4 years ago
- Status changed from in progress to fixed
This is now fixed as upstream u-boot now supports the beaglebone green.
There is also a new version of u-boot in Parabola:
pacman -S uboot4extlinux-am335x_bone