Newcomer questions: capes and overlays

Hi,

I’m just getting started on this great platform and I’ve got some questions about capes/overlays on which I thought perhaps someone could share their expertise.

Most of the documentation you find online still refers to cape manager and slots, which is slightly confusing for beginners. I did find this page [1] and I understand (I think) that there is no longer a cape manager and that u-boot does the loading of capes.

So first questions:

  • Is this assumption correct?
  • I do understand the concept of the device tree and loading overlays, but… what is the difference between overlays, capes and virtual capes? I’ve seen all mentioned in various places, but nowhere could I find a description of each. I’ve also seen “manual overlays” mentioned. Do they all actually refer to the same thing?
  • How can one see which capes/overlays are loaded once the system has booted up in the new uboot overlays world?

I’m starting to look at the PRUSS and how to use them, and I’m not sure which overlays should be loaded to enable them, or if access to them is already enabled by default. On /boot/uEnv.txt there seem to be a couple of options, one of which is commented out. I notice the difference in the naming (’-RPROC-’, vs. -UIO- commented out), so I’m guessing that the RPROC PRUSS overlay is loaded and the UIO one is not.

But could someone elaborate a bit more on this?

###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_uio (4.4.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo

Finally, on my /boot/uEnv.txt file I can see these lines, which I understand are for older kernels. As a humble piece of feedback from a newcomer, these make the file more confusing for options that no longer apply. Would it not make sense to remove them for new images?

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

Thanks!

[1] https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays

Hi,

I'm just getting started on this great platform and I've got some questions
about capes/overlays on which I thought perhaps someone could share their
expertise.

Most of the documentation you find online still refers to cape manager and
slots, which is slightly confusing for beginners. I did find this page [1]
and I understand (I think) that there is no longer a cape manager and that
u-boot does the loading of capes.

So first questions:

- Is this assumption correct?

Yes,

- I do understand the concept of the device tree and loading overlays,
but... what is the difference between overlays, capes and virtual capes?
I've seen all mentioned in various places, but nowhere could I find a
description of each. I've also seen "manual overlays" mentioned. Do they all
actually refer to the same thing?

Yes,

- How can one see which capes/overlays are loaded once the system has booted
up in the new uboot overlays world?

Plug in a USB serial debug cable into the debug header, U-Boot is very
verbose about what loads..

I'm starting to look at the PRUSS and how to use them, and I'm not sure
which overlays should be loaded to enable them, or if access to them is
already enabled by default. On /boot/uEnv.txt there seem to be a couple of
options, one of which is commented out. I notice the difference in the
naming ('*-RPROC-*', vs. *-UIO-* commented out), so I'm guessing that the
RPROC PRUSS overlay is loaded and the UIO one is not.

But could someone elaborate a bit more on this?

###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_uio (4.4.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo

"uio" has been used since 3.8.x

"pru_rproc" is TI's design, really only used with the "v4.4.x-ti" kernel.

We try to eaisly allow you to swap betwen uio and pru_rproc

Finally, on my /boot/uEnv.txt file I can see these lines, which I understand
are for older kernels. As a humble piece of feedback from a newcomer, these
make the file more confusing for options that no longer apply. Would it not
make sense to remove them for new images?

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

Nope, as people still use 3.8.x and 4.1.x+ (pre u-boot overlays)..

Regards,

2017-12-01 4:25 GMT+01:00 Robert Nelson <robertcnelson@gmail.com>:

Perfect, thanks a lot for all the answers. I guess the U-Boot output is not
present in the kernel syslog as U-Boot loads the capes before the kernel
starts.

There was project to support ^ a few years ago, the patches for u-boot
and the kernel never got merged..

Quick questions on this, though:

- Are there any plans to make reading the currently loaded overlays from
userspace possible? E.g. similarly as they could be read before from the
'slots' file

I've started passing "uboot_detected_capes=" thru /proc/cmdline, but
this is only enabled for capes detected via an eeprom.

- Reading
https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Where_did_the_slots_file_go.3F
is this still the plan of action and is Stage 2 thus now complete?

Yeah, stage 2 is effectively v4.14.x

During the v4.15.x merge, the bone_capemgr's infrastructure pretty
much got nuked from all the device tree overlay changes done in the
kernel.

And regarding the loading of overlays:

- What is the difference between the uboot_overlay_addr{0..7} and the
dtb_overlay options in /boot/uEnv.txt? It seems they all can be used to
specify a custom overlay to load on top of the universal cape overlay?

Address 0...3 are directly tied to the 4 i2c at24 eeprom address in
the Cape Spec.

Address 4...7 are me being lazy on not coming up a with a new variable name..

dtb_overlay is a remnant from when i first started testing U-Boot
overlays. Since i posted, "try this with dtb_overlay=" on a public
forum, i have no plans to remove it.

- To be clear, when you say 'really only used with the "v4.4.x-ti" kernel'
do you mean only with that particular kernel, or "v4.4.x-ti and later"? I'm
just trying to understand which cape I should best use and which procedure
(UIO vs. rproc) I should learn to start using the PRUSS.

in v4.4.x-ti, it's possible to enable "either" UIO or rproc, via just
tweaking the device tree.

In v4.9.x-ti, TI's rproc changes broke the device tree node enough
where i haven't spent enough time getting UIO to work.

I also just learnt recently that there seems to be a "TI kernel" and a "Bone
kernel". If I understand it correctly, the "TI kernel" is shipped by default
on the Debian images and has TI patches, whereas the "Bone kernel" is
effectively the mainline kernel.

- Is this correct?

TI Kernel:

Mainline + ti.com patches + Our Patchset

Bone Kernel:

Mainline + Our Patchset

- If so, what are their main differences?

The biggest diff:

TI Kernel: (targeting am335x and am57xx devices)
CONFIG_SMP=y

Bone Kernel: (targeting am335x devices)
CONFIG_THUMB2_KERNEL=y

- Are they both maintained, and where is each repo?

https://github.com/RobertCNelson/ti-linux-kernel-dev

https://github.com/RobertCNelson/bb-kernel

Regards,

2017-12-04 16:26 GMT+01:00 Robert Nelson <robertcnelson@gmail.com>:

> Perfect, thanks a lot for all the answers. I guess the U-Boot output is
> not
> present in the kernel syslog as U-Boot loads the capes before the kernel
> starts.

There was project to support ^ a few years ago, the patches for u-boot
and the kernel never got merged..

Ack. Thanks again for the detailed reply.

> Quick questions on this, though:
>
> - Are there any plans to make reading the currently loaded overlays from
> userspace possible? E.g. similarly as they could be read before from the
> 'slots' file

I've started passing "uboot_detected_capes=" thru /proc/cmdline, but
this is only enabled for capes detected via an eeprom.

Ok. So from a user's POV, they should be able to see the capes loaded from
an EEPROM listed under the uboot_detected_capes= parameter when reading
/proc/cmdline, correct?

Yes, with u-boot v2017.11+

> - To be clear, when you say 'really only used with the "v4.4.x-ti"
> kernel'
> do you mean only with that particular kernel, or "v4.4.x-ti and later"?
> I'm
> just trying to understand which cape I should best use and which
> procedure
> (UIO vs. rproc) I should learn to start using the PRUSS.

in v4.4.x-ti, it's possible to enable "either" UIO or rproc, via just
tweaking the device tree.

In v4.9.x-ti, TI's rproc changes broke the device tree node enough
where i haven't spent enough time getting UIO to work.

From someone having recently installed an image with a v4.4.x-ti kernel, is
the recommendation to use UIO or rproc? Is one of them the way to go and the
other one being deprecated?

Use what you like. There's lots of threads on this list with the
community vs TI on which implementation is "best"..

UIO has been used since 3.8.13..

rproc is TI's "recommended" way to use the pruss

> I also just learnt recently that there seems to be a "TI kernel" and a
> "Bone
> kernel". If I understand it correctly, the "TI kernel" is shipped by
> default
> on the Debian images and has TI patches, whereas the "Bone kernel" is
> effectively the mainline kernel.
>
> - Is this correct?

TI Kernel:

Mainline + ti.com patches + Our Patchset

Bone Kernel:

Mainline + Our Patchset

What's exactly "our patchset"? Which changes does it roughly contain?

kernel overlays (now being eol), pinmux-helper, new boards, etc...

Regards,

Hi Robert,

With regard to your comment on uboot overlays, slots 0-3 vs 4-7, where should one place a standard .dtbo ( eQEP, 2b ) to get it to load properly? I have not had luck with slot 0 or 4…

thanks…