Beaglebone black BB-BONE-AUDI-02-00A0.dts

I convertert the BB-BONE-AUDI-02-00A0.dtbo in BB-BONE-AUDI-02-00A0.dts and I find this:

/dts-v1/;

/ {

	fragment@0 {
		target-path = [ 2f 00 ];

		__overlay__ {

			chosen {

				overlays {
					BB-BONE-AUDI-02-00A0 = "Sat Aug 21 14:57:17 2021";
				};
			};
		};
	};

	fragment@1 {
		target = < 0xffffffff >;

		__overlay__ {

			P9_25_pinmux {
				status = "disabled";
			};

			P9_28_pinmux {
				status = "disabled";
			};

			P9_29_pinmux {
				status = "disabled";
			};

			P9_30_pinmux {
				status = "disabled";
			};

			P9_31_pinmux {
				status = "disabled";
			};
		};
	};

	fragment@2 {
		target = < 0xffffffff >;

		__overlay__ {

			pinmux_bone_audio_cape_audio_pins {
				pinctrl-single,pins = < 0x190 0x20 0x194 0x20 0x198 0x20 0x19c 0x22 0x1ac 0x20 0x6c 0x07 >;
				phandle = < 0x05 >;
			};
		};
	};

	fragment@3 {
		target-path = [ 2f 00 ];

		__overlay__ {

			clk_mcasp0_fixed {
				#clock-cells = < 0x00 >;
				compatible = "fixed-clock";
				clock-frequency = < 0x1770000 >;
				phandle = < 0x01 >;
			};

			clk_mcasp0 {
				#clock-cells = < 0x00 >;
				compatible = "gpio-gate-clock";
				clocks = < 0x01 >;
				enable-gpios = < 0xffffffff 0x1b 0x00 >;
				phandle = < 0x04 >;
			};

			sound {
				compatible = "simple-audio-card";
				simple-audio-card,name = "AudioCape Rev B";
				simple-audio-card,widgets = "Headphone\0Headphone Jack\0Line\0Line In";
				simple-audio-card,routing = "Headphone Jack\0HPLOUT\0Headphone Jack\0HPROUT\0LINE1L\0Line In\0LINE1R\0Line In";
				simple-audio-card,format = "dsp_b";
				simple-audio-card,bitclock-master = < 0x02 >;
				simple-audio-card,frame-master = < 0x02 >;
				simple-audio-card,bitclock-inversion;

				simple-audio-card,cpu {
					sound-dai = < 0xffffffff >;
				};

				simple-audio-card,codec {
					#sound-dai-cells = < 0x00 >;
					sound-dai = < 0x03 >;
					clocks = < 0x04 >;
					clock-names = "mclk";
					phandle = < 0x02 >;
				};
			};
		};
	};

	fragment@4 {
		target = < 0xffffffff >;

		__overlay__ {
			#address-cells = < 0x01 >;
			#size-cells = < 0x00 >;
			clock-frequency = < 0x186a0 >;
			status = "okay";

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

	fragment@5 {
		target = < 0xffffffff >;

		__overlay__ {
			#sound-dai-cells = < 0x00 >;
			pinctrl-names = "default";
			pinctrl-0 = < 0x05 >;
			status = "okay";
			op-mode = < 0x00 >;
			tdm-slots = < 0x02 >;
			num-serializer = < 0x10 >;
			serial-dir = < 0x02 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 >;
			tx-num-evt = < 0x01 >;
			rx-num-evt = < 0x01 >;
		};
	};

	__symbols__ {
		bone_audio_cape_audio_pins = "/fragment@2/__overlay__/pinmux_bone_audio_cape_audio_pins";
		clk_mcasp0_fixed = "/fragment@3/__overlay__/clk_mcasp0_fixed";
		clk_mcasp0 = "/fragment@3/__overlay__/clk_mcasp0";
		sound_master = "/fragment@3/__overlay__/sound/simple-audio-card,codec";
		tlv320aic3104 = "/fragment@4/__overlay__/tlv320aic3104@18";
	};

	__fixups__ {
		ocp = "/fragment@1:target:0";
		am33xx_pinmux = "/fragment@2:target:0";
		gpio1 = "/fragment@3/__overlay__/clk_mcasp0:enable-gpios:0";
		mcasp0 = "/fragment@3/__overlay__/sound/simple-audio-card,cpu:sound-dai:0\0/fragment@5:target:0";
		i2c2 = "/fragment@4:target:0";
	};

	__local_fixups__ {

		fragment@3 {

			__overlay__ {

				clk_mcasp0 {
					clocks = < 0x00 >;
				};

				sound {
					simple-audio-card,bitclock-master = < 0x00 >;
					simple-audio-card,frame-master = < 0x00 >;

					simple-audio-card,codec {
						sound-dai = < 0x00 >;
						clocks = < 0x00 >;
					};
				};
			};
		};

		fragment@5 {

			__overlay__ {
				pinctrl-0 = < 0x00 >;
			};
		};
	};
};

But it’s different to .dts that , why?
How to enable the 24.576Mhz oscillator by the GPIO1_27 in the .dts?

Hello,

One way, an older model of using the .dts files/framework, was to compile the BeagleBoard-DeviceTrees repo. after cloning it w/ git.

I cannot tell you right now if that is still available. I can test it soon. devicetree-source/BB-BONE-AUDI-02-00A0.dts at master · beagleboard/devicetree-source · GitHub seems to be an older model of the DTS spec. when they worked on it back then…

I see that the .dtb and .dts files that would be compiled from BeagleBoard-DeviceTrees is sort of out of date also. I think people are trying now to update things.

It would be neat to have audio working. I saw Bela as an opportunity for me to try different audio functionality.

Aw. I see now, the .dts in question was for an older model Cape for BeagleBone original (I think). '14 was before my time (sort of). Using the current models and spec, one would think this may be able to be used.

Seth

P.S. I see it worked for the BBB too! Nice, I always wondered what every happened to the audio processing instances from the BBB. I appreciate you bringing this up. I hope someone else has more to offer in ways of actual facts. The Cape most likely used i2c to chat to/from the BBB but again, I was not around then.

Also, here is the entire .dts file that is available:

/*
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
/dts-v1/;
/plugin/;

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

	/* identification */
	part-number = "BB-BONE-AUDI-02";
	version = "00A0", "A0";

	/* state the resources this cape uses */
	exclusive-use =
		/* the pin header uses */
		"P9.31",	/* mcasp0: mcasp0_aclkx */
		"P9.29",	/* mcasp0: mcasp0_fsx */
		"P9.28",	/* mcasp0: mcasp0_axr2 */
		"P9.25",	/* mcasp0: mcasp0_ahclkx */
		/* the hardware ip uses */
		"gpio1_18", "gpio1_19",
		"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
				>;
			};
		};
	};

	fragment@1 {
		target = <&i2c2>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			clock-frequency = <100000>;
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <&i2c2_pins>;


			tlv320aic3x: tlv320aic3x@18 {
				compatible = "ti,tlv320aic3x";
				reg = <0x18>;
				status = "okay";
			};
		};
	};

	fragment@2 {
		target = <&mcasp0>;
		__overlay__ {
			pinctrl-names = "default";
			pinctrl-0 = <&bone_audio_cape_audio_pins>;

			status = "okay";

			op-mode = <0>;          /* MCASP_IIS_MODE */
			tdm-slots = <2>;
			num-serializer = <16>;
			serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
				2 0 1 0
				0 0 0 0
				0 0 0 0
				0 0 0 0
			>;
			tx-num-evt = <1>;
			rx-num-evt = <1>;
		};
	};

	fragment@3 {
		target = <&ocp>;
		__overlay__ {
			sound {
				compatible = "ti,da830-evm-audio";
				ti,model = "DA830 EVM";
				ti,audio-codec = <&tlv320aic3x>;
				ti,mcasp-controller = <&mcasp0>;
				ti,codec-clock-rate = <12000000>;
				ti,audio-routing =
					"Headphone Jack",       "HPLOUT",
					"Headphone Jack",       "HPROUT",
					"LINE1L",               "Line In",
					"LINE1R",               "Line In";
			};
		};

	};
};

For anyone interested, this may be a work group of sorts if the beagleboard.org persons will allow it for audio outside of Bela. The PRU w/ Xenomai is hard to beat but audio is awesome nevertheless. I always wanted to test alsa more. But yes, w/ the newer kernels, some things have changed.

That overlay source is located here:

Regards,

1 Like