Okay, second pass more things work, more corner cases to fix...

Here is the base u-boot patch, plus the cape manager:

https://github.com/RobertCNelson/Bootloader-Builder/blob/master/patches/v2017.01-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch

https://github.com/RobertCNelson/Bootloader-Builder/blob/master/patches/v2017.01-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch

Probally lots of string handling bugs, found my self trying to write
everything in bash, yet it's C.. ;)

So, the fun details of U-Boot:

U-Boot found the BeagleBone Serial Cape:

Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
/lib/firmware/BB-BONE-SERL-03-00A1.dtbo
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net:   eth0: MII MODE

U-Boot loaded the BeagleBone Serial Cape overlay on top of the main dtb:

loading /boot/dtbs/4.4.39-ti-r77/am335x-boneblack.dtb ...
62069 bytes read in 135 ms (448.2 KiB/s)
debug: [uboot_overlay_addr1=/lib/firmware/BB-BONE-SERL-03-00A1.dtbo] ...
loading /lib/firmware/BB-BONE-SERL-03-00A1.dtbo ...
887 bytes read in 189 ms (3.9 KiB/s)
loading /boot/initrd.img-4.4.39-ti-r77 ...
5237762 bytes read in 466 ms (10.7 MiB/s)
debug: [console=ttyO0,115200n8
bone_capemgr.disable_partno=BB-BONE-SERL-03 root=/dev/mmcblk0p1 ro
rootfstype=ext4 rootwait coherent_pool=1M quiet net.ifnames=0] ...
debug: [bootz 0x82000000 0x88080000:4fec02 88000000] ...

Kernel: second ttyS2 comes up nice and early...

root@beaglebone:~# dmesg | grep serial
[    2.073749] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158,
base_baud = 3000000) is a 8250
[    2.088159] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 159,
base_baud = 3000000) is a 8250
[    7.807662] systemd[1]: Created slice system-serial\x2dgetty.slice.

Hurrah!!!

First issue... Now the Kernel Cape Manager get's in the way, i need to
pass a global kill switch (or find the global disable), right now you
have to "disable" capes loaded by U-Boot.. (you don't have too, it
just looks weird when they both load fine..)

root@beaglebone:~# dmesg | grep bone
[    0.000000] Kernel command line: console=ttyO0,115200n8
bone_capemgr.disable_partno=BB-BONE-SERL-03 root=/dev/mmcblk0p1 ro
rootfstype=ext4 rootwait coherent_pool=1M quiet net.ifnames=0
[    2.345976] bone_capemgr bone_capemgr: Baseboard:
'A335BNLT,00C0,2516BBBK2626'
[    2.346020] bone_capemgr bone_capemgr:
compatible-baseboard=ti,beaglebone-black - #slots=4
[    2.382381] bone_capemgr bone_capemgr: slot #0: No cape found
[    2.412268] bone_capemgr bone_capemgr: slot #1: 'BeagleBone RS232
CAPE,00A1,Beagleboardtoys,BB-BONE-SERL-03'
[    2.450326] bone_capemgr bone_capemgr: slot #2: No cape found
[    2.494321] bone_capemgr bone_capemgr: slot #3: No cape found
[    2.500199] bone_capemgr bone_capemgr: Skipping loading of disabled
cape with part# BB-BONE-SERL-03
[    2.500214] bone_capemgr bone_capemgr: initialized OK.
[    6.813904] systemd[1]: Set hostname to <beaglebone>.
[   15.389423] LUN: removable read only file:
/var/cache/doc-beaglebone-getting-started/beaglebone-getting-started-2016-11-07.img

So to actually test follow:

*************Actual testing...***************************************

Step 1: Do you have a usb serial adapter to monitor the boot process?

no = stop reading now...  till you have one in hand...
yes = please continue

Step 2: Remove /uEnv.txt  (i forgot to code that path in this test)

rm /uEnv.txt

Step 3: Update u-boot to v2017.01-rc2

cd /opt/scripts/tools/developers/
git pull
./update_bootloader.sh --use-beta-bootloader

On reboot, it should show:

U-Boot SPL 2017.01-rc2-00003-g835d6bbf46 (Dec 29 2016 - 15:28:49)
Trying to boot from MMC1

U-Boot 2017.01-rc2-00003-g835d6bbf46 (Dec 29 2016 - 15:28:49 -0600),
Build: jenkins-github_Bootloader-Builder-496

If not, eMMC probably messing with you..

dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=10

Step 4: /boot/uEnv.txt

remove "cape_universal=enable" we dont want any false posititves...

and remember to disable your Kernel overlay:

cape_disable=bone_capemgr.disable_partno=BB-BONE-SERL-03

Step 5: Profit!!! ;)

*****************************************************************

I know it's a little limited, but something for testing over Christmas. ;)

FAQ:

What does this solve?  Lots of random kernel races... (looking at
video/emmc/etc)... As U-Boot updates the final *.dtb and not the
kernel...

What about 2+ overlays?  "should" work, we should be able to load 4
cape's via eeprom ID, plus a 5th via: dtb_overlay in /boot/uEnv.txt

Does this replace the current method? Yes, I'm thinking for v4.10.x+ ;)

What have you tested it on?  Just BB-UART2-00A0.dtbo and then i wrote
this email up and got ready to go home...

Will this fix the issue with the painful out of box experience with
LCD3/LCD4/LCD7? Correct, as long as they have an eeprom. ;)

How do i actually test things?

Easiest, /boot/uEnv.txt

dtb=am335x-boneblack-overlay.dtb

Regards,


-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYjLVmp-SNruT_qo%3DbbwSxBwv-mnMMXFa3zsGyq3nYBnPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to