BeBoPr goes Black - modmaker/BeBoPr GitHub Wiki
This is an overview of the steps taken to make the BeBoPr compatible with the Beaglebone Black.
Update: 2013-07-07 - See this page for an alternative solution.
From the early beginning it was clear that the BeBoPr and the Beaglebone Black (BBB) would have a resource conflict with a lot of the signals on the Beaglebone P8 expansion connector. To resolve these conflicts, the Beaglebone Black had to be used like the original (White), without HDMI and embedded FLASH devices. Since the BBB can also work with a uSD card, that's not much of an issue. With the changes and fixes described in the following paragraphs, the BBB can boot from a micro SD card and use the BeBoPr without limitations.
Disabling the HDMI devices on P8:
The TDA19988 HDMI transmitter has only inputs on the P8 connector, so to free the bus, only the AM3358 outputs have to be reconfigured for the BeBoPr. A kernel boot option can be used to prevent the use of the HDMI signals by the kernel.
capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
Disabling the eMMC devices on P8:
The eMMC device is a bi-directional bus on the P8 connector. To free these signals for the BeBoPr, both the eMMC FLASH device and the AM335x processor's mmc1 signals must be disabled. The mmc1 signals are disabled by adding the following kernel boot option:
capemgr.disable_partno=BB-BONE-EMMC-2G
However the initial 3.8.13 kernels have a bug in the DT configuration for the BBB. The following patch fixes that:
---
arch/arm/boot/dts/am335x-boneblack.dts | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts
index 1545cca..a7eb55b 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -46,7 +46,7 @@
vmmc-supply = <&vmmcsd_fixed>;
bus-width = <8>;
ti,non-removable;
- status = "okay";
+ status = "disabled";
reset = <&rstctl 0 0>;
reset-names = "eMMC_RSTn-CONSUMER";
--
It now part of the Beaglebone kernel tree and can be found here: The discription to the patch is not completely accurate, if not applied the kernel will keep the mmc1 device active although it's not used. This prevents the BeBoPr using the signals on P8 and driving the eMMC #reset pin.
Now that we've disabled the AM3358's side of the signals, we still need to keep the eMMC FLASH memory quiet. To disable the FLASH device, the BBB drives the GPIO1_20
output via an inverter to the eMMC device's #reset input.
The u-boot that comes with the BBB knows how to drive this signal, so we can put the FLASH in reset right from the start. Add the following line to the start of uEnv.txt:
gpio set 52
Regrettably Circuitco had not configured the FLASH device properly on my BBBs: To make it work, a register in the FLASH device must be written to activate the #reset input. Luckily u-boot knows how to do this and since the setting seems to be non-volatile, this has to be done only once. Go to the u-boot prompt and type:
mmc dev 1
mmc rstn 1
Or add these two lines to the beginning of your uEnv.txt file (before the gpio set 52
), reboot once and then remove them again)
Changes to the BeBoPr software:
A device tree overlay for the BeBoPr with instructions and additional information can be found here. Put the binary overlay in the firmware directory of your BBB and it will be loaded by the kernel during boot.
/lib/firmware/2191-R2.dtbo
If the overlay is loaded, the status LED on the BeBoPr will start flashing just like the heartbeat LED on the Beaglebone. More detailed information can be found by issueing the following commands on a console and verifying the output:
root@arm:~# dmesg | grep capemgr
[ 0.000000] Kernel command line: console=ttyO0,115200n8i capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc
[ 0.992161] bone-capemgr bone_capemgr.8: Baseboard: 'A335BNLT,0A5A,1613BBBK1769'
[ 0.999941] bone-capemgr bone_capemgr.8: compatible-baseboard=ti,beaglebone-black
[ 1.008079] bone-capemgr bone_capemgr.8: Skipping disabled cape with part# BB-BONE-EMMC-2G
[ 1.016790] bone-capemgr bone_capemgr.8: Skipping disabled cape with part# BB-BONELT-HDMI
[ 1.025426] bone-capemgr bone_capemgr.8: Skipping disabled cape with part# BB-BONELT-HDMIN
[ 1.058222] bone-capemgr bone_capemgr.8: slot #0: 'BEBOPR,R2,AES electronics,2191'
[ 1.097407] bone-capemgr bone_capemgr.8: slot #1: No cape found
[ 1.134515] bone-capemgr bone_capemgr.8: slot #2: No cape found
[ 1.171624] bone-capemgr bone_capemgr.8: slot #3: No cape found
[ 1.177879] bone-capemgr bone_capemgr.8: slot #4: specific override
[ 1.184475] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 4
[ 1.192506] bone-capemgr bone_capemgr.8: slot #4: 'Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G'
[ 1.202634] bone-capemgr bone_capemgr.8: slot #5: specific override
[ 1.209229] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 5
[ 1.217259] bone-capemgr bone_capemgr.8: slot #5: 'Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI'
[ 1.227312] bone-capemgr bone_capemgr.8: slot #6: specific override
[ 1.233905] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 6
[ 1.241936] bone-capemgr bone_capemgr.8: slot #6: 'Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN'
[ 1.252274] bone-capemgr bone_capemgr.8: Skipping loading of disabled cape with part# BB-BONE-EMMC-2G
[ 1.261941] bone-capemgr bone_capemgr.8: Skipping loading of disabled cape with part# BB-BONELT-HDMI
[ 1.271509] bone-capemgr bone_capemgr.8: Skipping loading of disabled cape with part# BB-BONELT-HDMIN
[ 1.281334] bone-capemgr bone_capemgr.8: initialized OK.
[ 1.286943] bone-capemgr bone_capemgr.8: loader: before slot-0 2191:R2 (prio 0)
[ 1.294615] bone-capemgr bone_capemgr.8: loader: check slot-0 2191:R2 (prio 0)
[ 1.315417] bone-capemgr bone_capemgr.8: loader: after slot-0 2191:R2 (prio 0)
[ 1.329254] bone-capemgr bone_capemgr.8: slot #0: Requesting part number/version based '2191-R2.dtbo
[ 1.351045] bone-capemgr bone_capemgr.8: slot #0: Requesting firmware '2191-R2.dtbo' for board-name 'BEBOPR', version 'R2'
[ 9.391852] bone-capemgr bone_capemgr.8: slot #0: dtbo '2191-R2.dtbo' loaded; converting to live tree
[ 9.419045] bone-capemgr bone_capemgr.8: slot #0: #16 overlays
[ 9.576017] bone-capemgr bone_capemgr.8: slot #0: Applied #16 overlays.
[ 9.582958] bone-capemgr bone_capemgr.8: loader: done slot-0 2191:R2 (prio 0)
root@arm:~# cat /sys/kernel/debug/gpio
GPIOs 0-31, gpio:
gpio-8 (sysfs ) in hi
gpio-9 (sysfs ) in lo
gpio-10 (sysfs ) in hi
gpio-11 (sysfs ) in lo
GPIOs 32-63, gpio:
gpio-32 (bebopr:status_led ) out lo
gpio-34 (sysfs ) out hi
gpio-38 (sysfs ) out lo
gpio-53 (beaglebone:green:usr) out hi
gpio-54 (beaglebone:green:usr) out lo
gpio-55 (beaglebone:green:usr) out hi
gpio-56 (beaglebone:green:usr) out lo
GPIOs 64-95, gpio:
gpio-66 (sysfs ) out hi
gpio-78 (sysfs ) in hi
gpio-79 (sysfs ) in lo
GPIOs 96-127, gpio:
root@arm:~# cat /sys/kernel/debug/pwm
platform/48304200.ehrpwm, 2 PWM devices
pwm-0 (PWM_J3_EXTR ): requested
pwm-1 (PWM_J2_FAN ): requested
platform/48302200.ehrpwm, 2 PWM devices
pwm-0 (PWM_J4_BED ): requested
pwm-1 ((null) ):
The 3.8.13 kernel and DT stuff for the BBB generates different names for the devices that the BeBoPr software was using. An update for the software can be found at the BeBoPr repository
Changes to the BeBoPr hardware:
For some (yet) unknown reason, the BBB keeps the P8#5 pinmux configured to mode 1, instead of mode 7 as specified by the DT overlay. This pin is used to enable the cape's I/O. Until issue this is resolved, a simple hardware patch is needed to make the BeBoPr compatible with the BBB. See here for instructions.
The BBB boot process:
After the changes and fixes described above, the BBB loads MLO and u-boot.img from the eMMC card and then loads uEnv.txt from the boot partition of the micro SD card. If no uSD card is present, it will boot from eMMC, unless the contents prevents that (e.g. modification of uEnv.txt, or missing kernel image).
My (sample) uEnv.txt file on the uSD card (original from from Michael Haberler's Debian Wheezy starterkit):
#mmc dev 1
#mmc rstn 1
gpio set 52
optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
kernel_file=zImage
initrd_file=uInitrd
console=ttyO0,115200n8
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
loadkernel=load mmc ${mmcdev}:${mmcpart} 0x80200000 ${kernel_file}
loadinitrd=load mmc ${mmcdev}:${mmcpart} 0x81000000 ${initrd_file}; setenv initrd_size ${filesize}
loadfdt=load mmc ${mmcdev}:${mmcpart} 0x815f0000 /dtbs/${fdtfile}
mmcargs=setenv bootargs console=${console}i ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
#just zImage
boot_ftd=run loadkernel; run loadfdt
uenvcmd=run boot_ftd; run mmcargs; bootz 0x80200000 - 0x815f0000
#zImage + uInitrd: where uInitrd has to be generated on the running system.
#boot_ftd=run loadkernel; run loadinitrd; run loadfdt
#uenvcmd=run boot_ftd; run mmcargs; bootz 0x80200000 0x81000000:${initrd_size} 0x815f0000
Summary
- Patch the BeBoPr hardware for use with the BBB.
- Create an SD card with your favourite Linux distribution and beaglebone kernel 3.8.13.
- Add the BeBoPr device tree overlay to the firmware directory on the SD card.
- Edit the uEnv.txt file to disable HDMI and eMMC and assert the eMMC reset line.
- Build the BeBoPr mendel.elf program for the BBB.