Project

General

Profile

Porting #1249

Add support for the beaglebone green

GNUtoo - over 5 years ago - . Updated over 3 years ago.

Status:
fixed
Priority:
wish
Assignee:
% Done:

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

0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch (22.8 KB) 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch GNUtoo, 2017-03-24 05:16 PM
0002-Forward-port-parabola-patch.patch (5.84 KB) 0002-Forward-port-parabola-patch.patch GNUtoo, 2017-03-24 05:17 PM
0003-Beaglebone-green.patch (777 Bytes) 0003-Beaglebone-green.patch GNUtoo, 2017-03-24 05:18 PM
Makefile (91 Bytes) Makefile GNUtoo, 2017-03-24 05:18 PM
boot.cmd (369 Bytes) boot.cmd GNUtoo, 2017-03-24 05:19 PM

Related issues

Related to Packages - Bug #1261: [linux-libre*] mkinitcpio -p linux-libre* => /boot/initramfs-%PKGBASE%.imgfixed2017-03-24

Actions

History

#1

Updated by GNUtoo over 5 years ago

I gave up trying to understand u-boot environment.
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.
Note that I have Ethernet (PHY?) issues:
  • 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.

#5

Updated by GNUtoo over 5 years ago

/boot/Makefile

#6

Updated by GNUtoo over 5 years ago

/boot/boot.cmd

Note that it contains a workaround for the bug #1261
Once #1261 is fixed, this file should be updated not to break booting.

#7

Updated by isacdaavid over 5 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?

#8

Updated by Anonymous over 5 years ago

  • Related to Bug #1261: [linux-libre*] mkinitcpio -p linux-libre* => /boot/initramfs-%PKGBASE%.img added
#9

Updated by Anonymous over 5 years ago

  • Assignee set to Anonymous
#10

Updated by Anonymous over 5 years ago

  • Assignee changed from Anonymous to isacdaavid
#11

Updated by isacdaavid over 5 years ago

  • % Done changed from 0 to 50
  • Priority changed from bug to wish
  • Status changed from open to in progress
#12

Updated by isacdaavid over 5 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.

#13

Updated by GNUtoo over 5 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.

I can however manage some downtime and:
  • 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.

#14

Updated by GNUtoo about 5 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.

Since Barebox uses the devicetree, I looked a bit in Linux to see the differences between the Green and the Black version.
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.
Here are the advantages over u-boot:
  • The BeagleBoneBlack is supported, whereas, it is not in u-boot.
  • Ethernet works in Linux and Barebox
however there are some caveats too:
  • 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.

#15

Updated by isacdaavid about 5 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.

#16

Updated by GNUtoo almost 5 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.

#17

Updated by GNUtoo almost 5 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.

#18

Updated by GNUtoo over 3 years ago

  • Assignee changed from isacdaavid to GNUtoo
#19

Updated by GNUtoo over 3 years ago

Status:
  • 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.
#20

Updated by GNUtoo over 3 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

Also available in: Atom PDF