Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
BB-BONE-AUDI-02: Enable for 4.x kernel with overlay
* Remove I2C pin muxing definitions which are wrong and are actually
  redundant here
* McASP MCLK is fed from BB and is used by the codec (clk_mcasp0)

Note: the clk_mcasp0 is generated on the BB iteself and acivation has to
be added to bb-boneblack-overlay.dts as below:
...
...
	clk_mcasp0_fixed: clk_mcasp0_fixed {
	      #clock-cells = <0>;
	      compatible = "fixed-clock";
	      clock-frequency = <24576000>;
	};

	clk_mcasp0: clk_mcasp0 {
	      #clock-cells = <0>;
	      compatible = "gpio-gate-clock";
	      clocks = <&clk_mcasp0_fixed>;
	      enable-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; /* BeagleBone Black Clk enable on GPIO1_27 */
	};
...

Signed-off-by: Eyal Reizer <eyalr@ti.com>
  • Loading branch information
eyalreizer authored and RobertCNelson committed Mar 1, 2016
1 parent 87d9186 commit 419c160
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions src/arm/BB-BONE-AUDI-02-00A0.dts
Expand Up @@ -8,6 +8,9 @@
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>

/ {
compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";

Expand All @@ -22,28 +25,21 @@
"P9.29", /* mcasp0: mcasp0_fsx */
"P9.28", /* mcasp0: mcasp0_axr2 */
"P9.25", /* mcasp0: mcasp0_ahclkx */
"P9.30", /* mcasp0: mcasp0_axr0 */
/* the hardware ip uses */
"gpio1_18", "gpio1_19",
"gpio3_21",
"mcasp0";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {

i2c2_pins: pinmux_i2c2_pins {
pinctrl-single,pins = <
0x150 0x72 /*spi0_scl.i2c2_sda,SLEWCTRL_SLOW | INPUT_PULLUP |MODE2*/
0x154 0x72 /*spi0_d0.i2c2_scl,SLEWCTRL_SLOW | INPUT_PULLUP | MODE2*/
>;
};

bone_audio_cape_audio_pins: pinmux_bone_audio_cape_audio_pins {
pinctrl-single,pins = <
0x1ac 0x00 /* mcasp0_ahclkx, MODE0 | INPUT */
0x19c 0x22 /* mcasp0_ahclkr, */
0x194 0x20 /* mcasp0_fsx, MODE0 | OUTPUT */
0x190 0x20 /* mcasp0_aclkr.mcasp0_aclkx, MODE0 | OUTPUT_PULLDOWN */
0x198 0x20
0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */
0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx, INPUT */
0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr0.mcasp0_axr0 */
0x19c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 */
0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE0) /* MCASP0_AHCLKX -> MCASP0_AHCLKX (I2S_MCLK_OUT)- in */
>;
};
};
Expand All @@ -59,16 +55,10 @@
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pins>;


tlv320aic3104: tlv320aic3104@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic3104";
reg = <0x18>;

AVDD-supply = <&ldo4_reg>;
IOVDD-supply = <&ldo4_reg>;
DRVDD-supply = <&ldo4_reg>;
DVDD-supply = <&ldo4_reg>;
};
};
};
Expand All @@ -79,9 +69,7 @@
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&bone_audio_cape_audio_pins>;

status = "okay";

op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
num-serializer = <16>;
Expand Down Expand Up @@ -119,9 +107,11 @@
sound-dai = <&mcasp0>;
};

sound_master: simple-audio-card,codec {
sound_master: simple-audio-card,codec {
#sound-dai-cells = <0>;
sound-dai = <&tlv320aic3104>;
system-clock-frequency = <12000000>;
clocks = <&clk_mcasp0>;
clock-names = "mclk";
};
};
};
Expand Down

47 comments on commit 419c160

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Nelson,

I made the code changes above to the BB-BONE-AUDI-02-00A0.dtx file located at /opt/source/lib/bb.org-overlays/src/arm/. The top section of code for file bb-boneblack-overlay.dts is no where on my BBB, so I was not able to make that modification.

I still have no audio working. I am using 4.1.15-ti-rt-r43 currently. I am using (CircuitCo) BB Black Audio Cape Rev B with my BBB Rev C. I am also using 4D Systems (4D 7.0" LCD Cape II ) and still have no audio. Is there a workable patch that allows the two to work together? I have been at this a while with no success.

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to typo BB-BONE-AUDI-02-00A0.dtx should be BB-BONE-AUDI-02-00A0.dts.

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burjam2000 update to 4.1.18-ti-rt-r52

and use: dtb=am335x-boneblack-audio.dtb

RobertCNelson/ti-linux-kernel-dev@2a25192

Regards,

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm new and appreciate your patience. Where do I utilize that statement?

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo apt-get update
sudo apt-get install linux-image-4.1.18-ti-rt-r52
sudo reboot

Then:

sudo nano /boot/uEnv.txt

dtb=am335x-boneblack-audio.dtb

Reboot, then load the "BB-BONE-AUDI-02" overlay..

Regards,

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying now! :-)

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I comment out
cape_disable=capemgr.disable_partno=BB-BONELT-HDMI, BB-BONELT-HDMIN to keep the audio going to the audio cape?

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't apply to 4.1.x kernel's..

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have CAPE=BB-BONE-AUDI-02 in the /etc/default/capemgr

Shouldn't that load the BB-BONE-AUDI-02 overlay when I boot?

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it should

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I verify it loaded correctly?

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dmesg | grep bone

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-03-11 at 2 26 49 pm

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-03-11 at 2 38 12 pm

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one shows the LCD cape too

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No audio. Looks like the LCD and audio are both trying to use slot 0.

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then sudo reboot?

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-03-11 at 3 31 56 pm

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run the ./install.sh again?

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executed ./install.sh again. :-) and rebooted.

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-03-11 at 5 08 34 pm

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming line 10 indicates a conflict still on P9.30?

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Mr. Nelson, I'm sure you are busy and apologize for to being a pest. Do I just remove all the references to the up, down, left, right buttons to remove the conflict at P9.30?

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'll give that a try. Have a great weekend. If you are ever in Dallas/Fort Worth, I will buy you a beer!!!

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2016-03-18 at 8 12 19 pm

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it loaded. However, I get this now when I try to execute the following:

screen shot 2016-03-18 at 8 17 18 pm

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code removed from BB-BONE-LCD7-01-00A3.dts

"P9.15", /* keys: gpio1_16 LEFT /
"P9.23", /
keys: gpio1_17 RIGHT /
"P9.16", /
keys: gpio1_19 UP /
"P9.30", /
keys: gpio3_16 DOWN /
"P9.21", /
keys: gpio0_3 ENTER */

"gpio1_16", /* LEFT /
"gpio1_17", /
RIGHT /
"gpio1_19", /
UP /
"gpio3_16", /
DOWN /
"gpio0_3", /
ENTER */

BONE_P9_15 (PIN_INPUT | MUX_MODE7) /* gpmc_a0.gpio1_16 /
BONE_P9_23 (PIN_INPUT | MUX_MODE7) /
gpmc_a1.gpio1_17 /
BONE_P9_16 (PIN_INPUT | MUX_MODE7) /
gpmc_a3.gpio1_19 /
BONE_P9_30 (PIN_INPUT | MUX_MODE7) /
mcasp0_axr0.gpio3_16 /
BONE_P9_21 (PIN_INPUT | MUX_MODE7) /
spi0_d0.gpio0_3 */

        gpio_keys {
            compatible = "gpio-keys";
            pinctrl-names = "default";
            pinctrl-0 = <&bb_lcd_keymap_pins>;

            #address-cells = <1>;
            #size-cells = <0>;

            button@1 {
                debounce_interval = <50>;
                linux,code = <105>;
                label = "left";
                gpios = <&gpio1 16 0x1>;
                gpio-key,wakeup;
                autorepeat;
            };

            button@2 {
                debounce_interval = <50>;
                linux,code = <106>;
                label = "right";
                gpios = <&gpio1 17 0x1>;
                gpio-key,wakeup;
                autorepeat;
            };

            button@3 {
                debounce_interval = <50>;
                linux,code = <103>;
                label = "up";
                gpios = <&gpio1 19 0x1>;
                gpio-key,wakeup;
                autorepeat;
            };

            button@4 {
                debounce_interval = <50>;
                linux,code = <108>;
                label = "down";
                gpios = <&gpio3 16 0x1>;
                gpio-key,wakeup;
                autorepeat;
            };

            button@5 {
                debounce_interval = <50>;
                linux,code = <28>;
                label = "enter";
                gpios = <&gpio0 3 0x1>;
                gpio-key,wakeup;

            };

        };

Appreciate any help on resolving.

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it loaded... so the pinmux is fine now.. My audio cape is at work, so i won't be able to look at this till monday..

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Nelson, Thank you for the quick response. Did I remove all the correct code from the LCD7 dts file?

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok if you need to wait until Monday. I very much appreciate your help on this.

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it seems to be working just fine:

debian@beaglebone:~$ uname -r
4.1.18-ti-r53
debian@beaglebone:~$ cat /boot/uEnv.txt  | grep dtb
dtb=am335x-boneblack-audio.dtb 
debian@beaglebone:~$ cat /proc/cmdline 
console=tty0 console=ttyO0,115200n8 bone_capemgr.enable_partno=BB-BONE-AUDI-02 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
debian@beaglebone:~$ dmesg | grep bone
[    0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8 bone_capemgr.enable_partno=BB-BONE-AUDI-02 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
[    3.376325] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,�,BBG115096703'
[    3.376355] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
[    3.427072] bone_capemgr bone_capemgr: slot #0: No cape found
[    3.486875] bone_capemgr bone_capemgr: slot #1: No cape found
[    3.546871] bone_capemgr bone_capemgr: slot #2: No cape found
[    3.606869] bone_capemgr bone_capemgr: slot #3: No cape found
[    3.612667] bone_capemgr bone_capemgr: enabled_partno PARTNO 'BB-BONE-AUDI-02' VER 'N/A' PR '0'
[    3.612679] bone_capemgr bone_capemgr: slot #4: override
[    3.612693] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[    3.612708] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-BONE-AUDI-02'
[    3.613012] bone_capemgr bone_capemgr: initialized OK.
[    3.623590] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-BONE-AUDI-02-00A0.dtbo' loaded; overlay id #0
[   14.710733] LUN: removable file: /var/cache/doc-beaglebone-getting-started/beaglebone-getting-started-2015-12-04.img
debian@beaglebone:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: B [AudioCape Rev B], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

speaker test works:

debian@beaglebone:~$ speaker-test

speaker-test 1.0.28

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 32768
Period size range from 128 to 16384
Using max buffer size 32768
Periods = 4
was set period_size = 8192
was set buffer_size = 32768
 0 - Front Left
Time per period = 2.238623
 0 - Front Left
Time per period = 2.901242
 0 - Front Left

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Nelson,

Thank you for the follow up response. Here are the responses to the commands I get.
screen shot 2016-03-21 at 12 20 08 pm

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix your /boot/uEnv.txt

You have:

capemgr.disable_partno=BB-BONELT-HDMI
&
capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

You just need: (i dont have the lcd plugged in so i faked it)

cape_enable=bone_capemgr.enable_partno=BB-BONE-LCD7-01:00A3,BB-BONE-AUDI-02

Now, that works fine:

BB-BONE-LCD7-01:00A3: patch: https://paste.debian.net/417746/

debian@beaglebone:~$ uname -r
4.1.18-ti-r53
debian@beaglebone:~$ cat /proc/cmdline 
console=tty0 console=ttyO0,115200n8 bone_capemgr.enable_partno=BB-BONE-LCD7-01:00A3,BB-BONE-AUDI-02 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
debian@beaglebone:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: B [AudioCape Rev B], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Nelson, sorry to keep you waiting on my results. When I rebooted after adding cape_enable=bone_capemgr.enable_partno=BB-BONE-LCD7-01:00A3,BB-BONE-AUDI-02
The BBB will not boot up at all. I'm assuming I'll have to go through this process again. :-(

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got all 4 led's on solid.

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the link for the LCD7 patch isn't working.

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Nelson!! YOU ROCK!!!! It works!!! :-)

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Nelson, might I trouble you with a more simple question? Is there any chance in the future, BBB is going to move from 512 to 1.0 GB RAM?

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr. Nelson, I was hoping not to trouble you, but I upgraded to the latest image 4.1.18/52 and have a new conflict of P9.31. Shown in the attached image. I googled and found the potential culprit being the cape-universaln-00A0.dts, but I made that correction and still show the problem. I have double checked my previous updates in this thread for the LCD7 and AUDI-02 and they are correct/complete. I do hate asking, but am at a loss. If I may trouble you once more for some help, I would be very grateful.
screen shot 2016-04-17 at 11 13 22 pm

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the P9.31 correction I made.

cdsteinkuehler/beaglebone-universal-io@2f42fb0

@RobertCNelson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burjam2000 why would the conflict with cape-universaln-00A0.dts matter? look at your log, it wasn't even loaded...

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So then I am good to go is what you are saying?

@burjam2000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Mr. Nelson for the help and again my apologies for the trouble.

Please sign in to comment.