customize cap-universal-00A0.dts

Hello!

The work of Charles is great and very helpful:
https://github.com/cdsteinkuehler/beaglebone-universal-io

Now I want to customize the file to:

  1. enable all GPIO from HDMI (because I disable the HDMI)

  2. enable UART5 (because I disable the HDMI)
    The steps I already made:

  3. uncomment P8.27 - P8.46

  4. uncomment “uart5”
    Now I have to set for P8_27:

P8_26_default_pin: pinmux_P8_26_default_pin { pinctrl-single,pins = <0x07c 0x37>; }; /* Mode 7, Pull-Up, RxActive */ P8_26_gpio_pin: pinmux_P8_26_gpio_pin { pinctrl-single,pins = <0x07c 0x2F>; }; /* Mode 7, RxActive */ P8_26_gpio_pu_pin: pinmux_P8_26_gpio_pu_pin { pinctrl-single,pins = <0x07c 0x37>; }; /* Mode 7, Pull-Up, RxActive */ P8_26_gpio_pd_pin: pinmux_P8_26_gpio_pd_pin { pinctrl-single,pins = <0x07c 0x27>; }; /* Mode 7, Pull-Down, RxActive */

Replace _26 to _27
But what for “0x07c” ?
How are calculate or is there a list?

Thank you!

Hello!

The work of Charles is great and very helpful:
https://github.com/cdsteinkuehler/beaglebone-universal-io

Now I want to customize the file to:

   1. enable all GPIO from HDMI (because I disable the HDMI)
   2. enable UART5 (because I disable the HDMI)

I intend for the HDMI pins to be a separate overlay which you would load
if you have disabled the on-board HDMI. I already made the eMMC
version, but ran out of steam before I did the HDMI and HDMIN.

The steps I already made:

   1. uncomment P8.27 - P8.46
   2. uncomment "uart5"

Now I have to set for P8_27:
            P8_26_default_pin: pinmux_P8_26_default_pin {
                pinctrl-single,pins = <0x07c 0x37>; }; /* Mode 7,
Pull-Up, RxActive */
            P8_26_gpio_pin: pinmux_P8_26_gpio_pin {
                pinctrl-single,pins = <0x07c 0x2F>; }; /* Mode 7,
RxActive */
            P8_26_gpio_pu_pin: pinmux_P8_26_gpio_pu_pin {
                pinctrl-single,pins = <0x07c 0x37>; }; /* Mode 7,
Pull-Up, RxActive */
            P8_26_gpio_pd_pin: pinmux_P8_26_gpio_pd_pin {
                pinctrl-single,pins = <0x07c 0x27>; }; /* Mode 7,
Pull-Down, RxActive */

Replace _26 to _27
But what for "0x07c" ?
How are calculate or is there a list?

The bit definitions are in the "Control Module" section of the AM335x
Technical Reference Manual, generally section 9.3.1.50 (although check
the register list at the start of section 9.3 to be sure).

Hello Charles!

I made an own Overlay, but it seems I made an error.
I use in my new file:
`
/* identification */
part-number = “cape-bone-myoverlay”;
version = “00A1”;

`

and

`
fragment@2 {
target = <&ocp>;
overlay {

// !!!WARNING!!!
// gpio-of-helper &gpio pointers are off-by-one vs. the hardware:
// hardware GPIO bank 0 = &gpio1
cape-myoverlay {

`

I use dtc: no error with:

dtc -@ -I dts -O dtb -o /lib/firmware/cape-myoverlay-00A1.dtbo cape-myoverlay-00A1.dts

But when I try:

echo cape-myoverlay > /sys/devices/bone_capemgr.9/slots

I get:

bash: echo: write error: Invalid argument

Maybe you know where I made a mistake? Is it the own itendifier?
Or are my file wrong? Then I can upload maybe here to doublecheck.

Thank you!

Maybe better to attach the file now.

You will find it now here as attached file.

cape-myoverlay-00A1.dts (27.6 KB)

Hello Charles!

I made an own Overlay, but it seems I made an error.
I use in my new file:
    /* identification */
    part-number = "cape-bone-myoverlay";
    version = "00A1";

<snip>

It looks like you're working on the HDMI version of the universal
overlay that I haven't gotten around to implementing yet. I encourage
you to clone the github repo and send a pull request when you're finished!

But when I try:
echo cape-myoverlay > /sys/devices/bone_capemgr.9/slots

I get:
bash: echo: write error: Invalid argument

Maybe you know where I made a mistake? Is it the own itendifier?
Or are my file wrong? Then I can upload maybe here to doublecheck.

This generally means you are trying to access a resource that is already
assigned to something else. Sometimes you will find useful hints in the
output of dmesg. Otherwise, short of digging out the kernel debugging
tools, I usually either just stare at the dts file looking for problems,
or start bisecting (ie: comment out chunks of the dts file until it
loads, then start adding back in until it fails).

Hello Charles!

I`m not familar with Git but I try as you say!

I change the Version from 00A1 to 00A0, now I get the error “File exists”
Here is my slots file:

0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
6: ff:P-O-L Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
7: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-universal

Iḿ not sure what Line 6 means. Is HDMI aktiv or not?
Because in the uEnv.txt I set disable, but maybe it doesn work(?)

Can someone please confirm, if HDMI is enabled and when yes, how can I disable in debian?

Thank you!

faimbs

Ok, it seems no working. Guess I have a spelling mistake!

Hello!

I’m close to finished. But there is one problem:
uEnv.txt:

optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=cape-myoverload,cape-universal

It doesn’t load my “cape-myoverload”:

0: 54:PF--- 1: 55:PF--- 2: 56:PF--- 3: 57:PF--- 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN 8: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-universal

As you can see, Number 7 is missing!

But when I set:

echo cape-myoverload > /sys/devices/bone_capemgr.9/slots

I get after:

0: 54:PF--- 1: 55:PF--- 2: 56:PF--- 3: 57:PF--- 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN 8: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-universal 9: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-myoverload

Why does the uEnv.txt not load my Overload?

Thank you!

I believe at boot time the cape manager is reading overlays from the
initial ramdisk which doesn't contain your new overlay.

Hello Charles!

Hmmm … but it load your overlay and I mean this was not part of the image.
Did you know if I can add the overlay?

Thank you!

Hello Charles!

Hmmm … but it load your overlay and I mean this was not part of the image.
Did you know if I can add the overlay?

Add the custom cape name to the cape variable in /etc/default/capemgr to load it early and bypass the initramfs problem.

My overlay has been added to the kernel source for a while, so it
actually _is_ part of the image if you're using a recent kernel.

You should be able to rebuild your initial ramdisk with updated overlay
files from /lib/firmware, but I've honestly never done this myself. I
typically rebuild kernels so often I haven't had the need to update the
initial ramdisk between releases.

Hello Robert!

Perfect, now it is loading with uEnv.txt

Thank you!

Hello Charles!

Thank you. But the info from Robert works fine.
That your overlay is part of the image I don’t know.

faimbs

Hello Charles!

Thank you. But the info from Robert works fine.
That your overlay is part of the image I don’t know.

It’s the only way to load a modified or new overlay. As the one builtin the kernel with that name had priority.

Hello to everyone!
I’ve just experimented this things in last week, and with suggestion of that “special community” I’ve solved the same problem.
Today I’ve downloaded last release of Ubuntu (14.04-05-06) with Linux arm 3.8.13-bone49 #1 kernel from here and written the image with “sudo ./setup_sdcard.sh --mmc /dev/sdxxx --uboot bone”.
All works very fine, except for load my cape overlay: from command line is ok, but from uEnv.txt (as we know, but when you are desparate…) and from ‘/etc/default/capemgr’ won’t work!
The problem is that ‘/etc/default/capemgr’ seems to not be read: I can put what I want in it, but no errors or warnings appear in dmesg…
My previous successfully tests are made with debian and 3.8.13-bone47 kernel.

What am I doing wrong?
what can I try to do?

Francesco.

Odd, the ubuntu upstart script looks like this:

https://github.com/RobertCNelson/omap-image-builder/blob/master/target/init_scripts/capemgr-ubuntu.sh

First thing it does is:

. /etc/default/capemgr

So what does your /etc/default/capemgr look like?

Regards,

Hi Robert,
this is my file:
ubuntu@arm:~$ cat /etc/default/capemgr

Default settings for capemgr. This file is sourced by /bin/sh from

/etc/init.d/capemgr.sh

Options to pass to capemgr

CAPE=BB-BONE-BRT-Tdl2
#CAPE=cape-universal

this is my dmesg report (partial)
ubuntu@arm:~$ dmesg | grep cape
[ 1.535953] bone-capemgr bone_capemgr.8: Baseboard: ‘A335BONE,00A6,0613BB001068’
[ 1.543752] bone-capemgr bone_capemgr.8: compatible-baseboard=ti,beaglebone
[ 1.582245] bone-capemgr bone_capemgr.8: slot #0: No cape found
[ 1.619351] bone-capemgr bone_capemgr.8: slot #1: No cape found
[ 1.656459] bone-capemgr bone_capemgr.8: slot #2: No cape found
[ 1.693569] bone-capemgr bone_capemgr.8: slot #3: No cape found
[ 1.699944] bone-capemgr bone_capemgr.8: initialized OK.

after boot:
ubuntu@arm:~$ cat /sys/devices/bone_capemgr.8/slots
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—

command line execution:
ubuntu@arm:~$ sudo sh -c “echo BB-BONE-BRT-Tdl2 > /sys/devices/bone_capemgr.8/slots”
[sudo] password for ubuntu:

then:
ubuntu@arm:~$ cat /sys/devices/bone_capemgr.8/slots
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-BRT-Tdl2

and my capes work!
I seems not load /etc/default/capemgr …

Any suggestion is welcome! (remember that I’m VERY newbie!)

Thanks a lot!

Francesco.

Hi Robert,
this is my file:
ubuntu@arm:~$ cat /etc/default/capemgr

Default settings for capemgr. This file is sourced by /bin/sh from

/etc/init.d/capemgr.sh

Options to pass to capemgr

CAPE=BB-BONE-BRT-Tdl2
#CAPE=cape-universal

this is my dmesg report (partial)
ubuntu@arm:~$ dmesg | grep cape
[ 1.535953] bone-capemgr bone_capemgr.8: Baseboard: ‘A335BONE,00A6,0613BB001068’
[ 1.543752] bone-capemgr bone_capemgr.8: compatible-baseboard=ti,beaglebone
[ 1.582245] bone-capemgr bone_capemgr.8: slot #0: No cape found
[ 1.619351] bone-capemgr bone_capemgr.8: slot #1: No cape found
[ 1.656459] bone-capemgr bone_capemgr.8: slot #2: No cape found
[ 1.693569] bone-capemgr bone_capemgr.8: slot #3: No cape found
[ 1.699944] bone-capemgr bone_capemgr.8: initialized OK.

after boot:
ubuntu@arm:~$ cat /sys/devices/bone_capemgr.8/slots
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—

command line execution:
ubuntu@arm:~$ sudo sh -c “echo BB-BONE-BRT-Tdl2 > /sys/devices/bone_capemgr.8/slots”
[sudo] password for ubuntu:

then:
ubuntu@arm:~$ cat /sys/devices/bone_capemgr.8/slots
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-BRT-Tdl2

ubuntu@arm:~$ dmesg | grep cape
[ 1.535953] bone-capemgr bone_capemgr.8: Baseboard: ‘A335BONE,00A6,0613BB001068’
[ 1.543752] bone-capemgr bone_capemgr.8: compatible-baseboard=ti,beaglebone
[ 1.582245] bone-capemgr bone_capemgr.8: slot #0: No cape found
[ 1.619351] bone-capemgr bone_capemgr.8: slot #1: No cape found
[ 1.656459] bone-capemgr bone_capemgr.8: slot #2: No cape found
[ 1.693569] bone-capemgr bone_capemgr.8: slot #3: No cape found
[ 1.699944] bone-capemgr bone_capemgr.8: initialized OK.
[ 186.713890] bone-capemgr bone_capemgr.8: part_number ‘BB-BONE-BRT-Tdl2’, version ‘N/A’
[ 186.713991] bone-capemgr bone_capemgr.8: slot #4: generic override
[ 186.714015] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 4
[ 186.714040] bone-capemgr bone_capemgr.8: slot #4: ‘Override Board Name,00A0,Override Manuf,BB-BONE-BRT-Tdl2’
[ 186.714186] bone-capemgr bone_capemgr.8: slot #4: Requesting part number/version based 'BB-BONE-BRT-Tdl2-00A0.dtbo
[ 186.714211] bone-capemgr bone_capemgr.8: slot #4: Requesting firmware ‘BB-BONE-BRT-Tdl2-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 187.028105] bone-capemgr bone_capemgr.8: slot #4: dtbo ‘BB-BONE-BRT-Tdl2-00A0.dtbo’ loaded; converting to live tree
[ 187.032022] bone-capemgr bone_capemgr.8: slot #4: #5 overlays
[ 187.247500] bone-capemgr bone_capemgr.8: slot #4: Applied #5 overlays.

Okay, final option, I'd just put the CAPE variable in:

/etc/init/capemgr.sh

Looks like for some reason upstart doesn't want to source the file for
a variable. Will debug later.

Regards,