My overlay can't find clk_mcasp0

I'm trying to get my audio cape to work (which is nearly identical to the cape that was available for sale). I've had it working to some level of success with past kernels (3.1.18), but now I'm on 4.4.6. My existing DTS didn't work, so I'm looking at how the BB-BONE-AUDI-02 DTS is written.

One of the differences is that it doesn't explicitly call out the McASP clock frequency like the older one did. Instead, it seems to refer to clk_mcasp0. But when I copy the same code into my DTS, I get:

[ 103.180866] of_resolve_phandles: Could not find symbol 'clk_mcasp0'
[ 103.187269] bone_capemgr bone_capemgr: slot #4: Failed to resolve tree

I found it defined by grepping /boot/dtbs. It's in /boot/dtbs/4.4.6-bone-rt-r6/am335x-abbbi.dtb. Where can I find the source files for these DTBs?

Is this dtb part of what's loaded by default in 4.4.6-bone-rt-r6? If not, can I copy the definition into my

FWIW, here's my DTS and some output from dmesg: http://pastebin.com/niDkWdWV

Thanks,

You need to add this to your base *.dtb:

https://github.com/RobertCNelson/dtb-rebuilder/blob/4.1-ti/src/arm/am335x-boneblack-audio.dts#L17-L28

(that section can not be loaded as overlay, it must be in your base dtb)

Regards,

btw, the one thing i haven't tried, have everything in the clk defined
except for the gpio and load that as part of the audio overlay..

side note, we just got audio (cape audio rev b) working a few weeks back,
so this is relatively new

Regards,

Thanks, Robert. I'll give that a shot. I'm not immediately sure what my current base *.dtb is, nor how to build a new one and specify that be used. But maybe I can piggyback off the one you show there.

Out of curiosity, why can't this be done as an overlay (to help me understand the Device Tree better)?

Thanks!

I’m trying to get my audio cape to work (which is nearly identical to the cape that was available for sale). I’ve had it working to some level of success with past kernels (3.1.18), but now I’m on 4.4.6. My existing DTS didn’t work, so I’m looking at how the BB-BONE-AUDI-02 DTS is written.

One of the differences is that it doesn’t explicitly call out the McASP clock frequency like the older one did. Instead, it seems to refer to clk_mcasp0. But when I copy the same code into my DTS, I get:

[ 103.180866] of_resolve_phandles: Could not find symbol ‘clk_mcasp0’
[ 103.187269] bone_capemgr bone_capemgr: slot #4: Failed to resolve tree

I found it defined by grepping /boot/dtbs. It’s in /boot/dtbs/4.4.6-bone-rt-r6/am335x-abbbi.dtb. Where can I find the source files for these DTBs?

Is this dtb part of what’s loaded by default in 4.4.6-bone-rt-r6? If not, can I copy the definition into my

FWIW, here’s my DTS and some output from dmesg: http://pastebin.com/niDkWdWV

You need to add this to your base *.dtb:

https://github.com/RobertCNelson/dtb-rebuilder/blob/4.1-ti/src/arm/am335x-boneblack-audio.dts#L17-L28

btw, the one thing i haven’t tried, have everything in the clk defined except for the gpio and load that as part of the audio overlay…

side note, we just got audio (cape audio rev b) working a few weeks back, so this is relatively new

Thanks, Robert. I’ll give that a shot. I’m not immediately sure what my current base *.dtb is, nor how to build a new one and specify that be used. But maybe I can piggyback off the one you show there.

Switch to r7, just pushed it out this morning.

dtb=am335x-boneblack-audio.dtb

Out of curiosity, why can’t this be done as an overlay (to help me understand the Device Tree better)?

Just a bug in the clock driver, the dynamic overlay changes is still very fragile. In most cases moving the driver as a module vs built-in, fixes it right up… Except this is the clock driver, it needs to be built in…

Regards,

> > You need to add this to your base *.dtb:
> >
> > dtb-rebuilder/src/arm/am335x-boneblack-audio.dts at 4.1-ti · RobertCNelson/dtb-rebuilder · GitHub
> >
> > btw, the one thing i haven't tried, have everything in the clk defined except for the gpio and load that as part of the audio overlay..
> >
> > side note, we just got audio (cape audio rev b) working a few weeks back, so this is relatively new
>
> Thanks, Robert. I'll give that a shot. I'm not immediately sure what my current base *.dtb is, nor how to build a new one and specify that be used. But maybe I can piggyback off the one you show there.

Switch to r7, just pushed it out this morning.

Should that be available in apt, or do I need to git pull and build it myself? I tried "apt-get update && apt-get install -y linux-image-4.4.6-bone-rt-r7" but no luck. Maybe it just takes a while to show up?

Thanks!

Should that be available in apt, or do I need to git pull and build it myself? I tried "apt-get update && apt-get install -y linux-image-4.4.6-bone-rt-r7" but no luck. Maybe it just takes a while to show up?

It should be out now.. The builders where still a little behind from
v4.6-rc2 build's..

Regards,

Thanks, just found it (while my manual build was running :slight_smile: ). Good thing, too; I forgot how to go from building the kernel to installing the image, dtbs, modules, and headers :slight_smile:

I updated to -r7, and set the dtb=am335x-boneblack-audio.dtb

uEnv.txt: #Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0uname_r=4 - Pastebin.com

Booting fails now. Log: U-Boot SPL 2016.03-00001-gd12d09f (Mar 17 2016 - 16:16:15)Trying to boot from - Pastebin.com

U-Boot SPL 2016.03-00001-gd12d09f (Mar 17 2016 - 16:16:15)
Trying to boot from MMC
bad magic
.
.
.
Loading, please wait...
mount: can't find /root in /etc/fstab
Target filesystem doesn't have requested /sbin/init.
mount: mounting /dev on /root/dev failed: No such file or directory
No init found. Try passing init= bootarg.
modprobe: module i8042 not found in modules.dep
modprobe: module ehci-pci not found in modules.dep
modprobe: module ehci-orion not found in modules.dep
modprobe: module uhci-hcd not found in modules.dep
modprobe: module ohci-hcd not found in modules.dep

I updated to -r7 with apt-get install.

Did my MMC get corrupted?

Oh, I'm on a BB Green. Should that have been am335x-bonegreen-audio.dtb?

I'm in initramfs, but I'm not sure how to find the uEnv.txt file to edit it.

dtb=am335x-boneblack-audio.dtb

doesn't setup the emmc...

Regards,

Augh, right. So, how do I get past this situation? Do I need to boot from SD card, or can I fix it via initramfs?

I tried googling, but didn't have much luck.

I’m trying to use the same codec as Rick but I need to use a ‘bone-rt’ kernel (old PRU api and PREEMPT). Can you tell me what/where the base *.dtb is and how to compile it when using a bone-rt kernel?
Thanks!

dtb=am335x-boneblack-audio.dtb

doesn’t setup the emmc…

Does this mean that the board won’t be able to boot from the emmc when using this dtb? If so, how is it supposed to be used?

I had to make one that also enabled the emmc:

  http://pastebin.com/Wja7ZQRk

Note that there's a problem with that file. It includes am33xx-overlay-edma-fix.dtsi, which causes the mcasp driver to load first, and it ends up not being properly configured when you load the overlay. I'll be writing a full DTS for my project, rather than use the overlay mechanism, but for now that's how I do it.

Thanks Rick!

When you say the driver ends up not being properly configured when you load the overlay, does that mean I should not load the overlay? Or should I load it and expect problems? which problems?

The DTB I posted includes am33xx-overlay-edma-fix.dtsi, which enables mcasp0 and mcasp1. This causes the snd_soc_davinci_mcasp driver to load, and it configures itself at that time. But that DTB doesn't have the necessary entries for that driver to properly configure. When you then later load the overlay (e.g. BB-BONE-AUDI-02), the driver ignores the new entries.

There are a couple of solutions. The best is to move all the remaining entries that are in the overlay into a new .dts file based on this <
http://pastebin.com/Wja7ZQRk>, compile that, and load it at boot.

Or, compile this .dts <http://pastebin.com/vny3wpnq> and load it at boot, then load the cape overlay. The drawback to this is (apparently) the eDMA slots won't get assigned properly for mcasp, so there might be issues down the road. It seems to work as-is for me, but I don't know if there is higher CPU loading, or what. I don't really understand the eDMA issues.

I see that on 4.1.14-bone-rt-r17 kernel the edma fix is compiled into
the am335x-boneblack-emmc-overlay.dtb resulting in
any audio cape overlay not loading.

so i guess i can grab this file
https://github.com/beagleboard/linux/blob/4.1/arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dts

but i have no idea how to complie it and what paths i need to include to
get it to complie

I am wondering why that *fix* was needed and why it wants to enable the
davinci_mdio_default pins so we cant enable audio overlays

I see that on 4.1.14-bone-rt-r17 kernel the edma fix is compiled into
the am335x-boneblack-emmc-overlay.dtb resulting in
any audio cape overlay not loading.

so i guess i can grab this file

linux/arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dts at 4.1 · beagleboard/linux · GitHub

but i have no idea how to complie it and what paths i need to include to
get it to complie

it's easy, there is a whole repo setup to just do that..

git clone -b 4.1.x GitHub - RobertCNelson/dtb-rebuilder
cd ./dtb-rebuilder/

make/sudo make install/etc...

I am wondering why that *fix* was needed and why it wants to enable the

davinci_mdio_default pins so we cant enable audio overlays

oh it's been discussed on this list before, there was a specific case it
needed to be enabled by default to fix a case..

and the "fix" was pushed to the repo, before we got the that audio cape.

Regards,

very interesting. after removing the eDMA fix and recompiling we still
cant load the audio cape

sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins

stuff removed for clarity

pin 82 (44e10948.0): 4a101000.mdio (GPIO UNCLAIMED) function
davinci_mdio_default group davinci_mdio_default
pin 83 (44e1094c.0): 4a101000.mdio (GPIO UNCLAIMED) function
davinci_mdio_default group davinci_mdio_default

I think this is the reason.