Okay, second pass more things work, more corner cases to fix...
Here is the base u-boot patch, plus the cape manager:
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!!!