ARM: dts: add BeagleBone Audio Cape (Rev A) dtsi
PATCH RESEND 1/1 ARM: dts: add BeagleBone Audio Cape (Rev A) dtsi
From: Jack Mitchell <[email protected]>
Devicetree include file for setting up the am335x mcasp bus, i2c-2 bus, and audio codec required for a functioning BeagleBone Audio Cape.
--- arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi | 124 +++++++++++++++++++++ arch/arm/boot/dts/am335x-bone-common.dtsi | 14 +++ 2 files changed, 138 insertions(+) create mode 100644 arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi
arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi new file +124 -0
@@ -0,0 +1,124 @@ +/* + * Copyright (C) 2014 Jack Mitchell <[email protected]> + * + * 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. + * + * In order to enable the BeagleBone Audio Cape this dtsi must be + * incuded in the top level dts. On BeagleBone Black hardware the + * status of the HDMI dts node must also be set to "disabled". + * + * --- a/arch/arm/boot/dts/am335x-bone.dts + * +++ b/arch/arm/boot/dts/am335x-bone.dts + * @@ -9,6 +9,7 @@ + * + * #include "am33xx.dtsi" + * #include "am335x-bone-common.dtsi" + * +#include "am335x-bone-audio-cape-reva.dtsi" + * + * &ldo3_reg { + * regulator-min-microvolt = <1800000>; + * + * On BeagleBone Black hardware the status of the HDMI dts node must + * also be set to "disabled" + * + * --- a/arch/arm/boot/dts/am335x-boneblack.dts + * +++ b/arch/arm/boot/dts/am335x-boneblack.dts + * @@ -73,6 +74,6 @@ + * pinctrl-names = "default", "off"; + * pinctrl-0 = <&nxp_hdmi_bonelt_pins>; + * pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; + * - status = "okay"; + * + status = "disabled"; + * }; + * }; + */ + +/ { + sound { + compatible = "ti,da830-evm-audio"; + ti,model = "AM335x BeagleBone Audio Cape Rev. A"; + ti,audio-codec = <&tlv320aic3106>; + ti,mcasp-controller = <&mcasp0>; + ti,codec-clock-rate = <12000000>; + ti,audio-routing = + "Headphone Jack", "HPLOUT", + "Headphone Jack", "HPROUT", + "LINE1L", "Line In", + "LINE1R", "Line In"; + }; + + audio-cape-gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&bone_audio_cape_led_pins>; + + audio-led0 { + label = "audio:green:usr0"; + gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + audio-led1 { + label = "audio:green:usr1"; + gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + }; +}; + +&am33xx_pinmux { + bone_audio_cape_led_pins: pinmux_bone_audio_cape_led_pins { + pinctrl-single,pins = < + 0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a2.gpio1_18 */ + 0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a3.gpio1_19 */ + >; + }; + + bone_audio_cape_pins: bone_audio_cape_pins { + pinctrl-single,pins = < + 0x190 (PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */ + 0x194 (PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */ + 0x19c (PIN_INPUT_PULLUP | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 */ + 0x1ac (PIN_INPUT_PULLUP | MUX_MODE2) /* mcasp0_ahclkx.mcasp0_axr3 */ + >; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; + clock-frequency = <100000>; + + tlv320aic3106: tlv320aic3106 at 1b { + compatible = "ti,tlv320aic3106"; + reg = <0x1b>; + status = "okay"; + + /* Regulators */ + AVDD-supply = <&vmmcsd_fixed>; + IOVDD-supply = <&vmmcsd_fixed>; + DRVDD-supply = <&vmmcsd_fixed>; + DVDD-supply = <&vdd1v8_fixed>; + }; +}; + +&mcasp0 { + pinctrl-names = "default"; + pinctrl-0 = <&bone_audio_cape_pins>; + + status = "okay"; + + op-mode = <0>; /* MCASP_IIS_MODE */ + tdm-slots = <2>; + serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ + 0 0 2 1 + >; + tx-num-evt = <1>; + rx-num-evt = <1>; +};
arch/arm/boot/dts/am335x-bone-common.dtsi +14 -0
@@ -62,12 +62,26 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; }; + + vdd1v8_fixed: fixedregulator at 1 { + compatible = "regulator-fixed"; + regulator-name = "vdd1v8_fixed"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; }; &am33xx_pinmux { pinctrl-names = "default"; pinctrl-0 = <&clkout2_pin>; + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + 0x178 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.i2c2_sda */ + 0x17c (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ + >; + }; + user_leds_s0: user_leds_s0 { pinctrl-single,pins = < 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */
Signature · 1 line
1.8.5.3
Quoted 46 lines · Jack Mitchell
From: Jack Mitchell <[email protected]>
Devicetree include file for setting up the am335x mcasp bus, i2c-2 bus, and audio codec required for a functioning BeagleBone Audio Cape.
Signed-off-by Jack Mitchell <[email protected]>Signed-off-by Matt Porter <[email protected]>--- arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi | 124 +++++++++++++++++++++ arch/arm/boot/dts/am335x-bone-common.dtsi | 14 +++ 2 files changed, 138 insertions(+) create mode 100644 arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsiarch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi new file +27
-0@@ -0,0 +1,124 @@ +/* + * Copyright (C) 2014 Jack Mitchell <[email protected]> + * + * 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. + * + * In order to enable the BeagleBone Audio Cape this dtsi must be + * incuded in the top level dts. On BeagleBone Black hardware the + * status of the HDMI dts node must also be set to "disabled". + * + * --- a/arch/arm/boot/dts/am335x-bone.dts + * +++ b/arch/arm/boot/dts/am335x-bone.dts + * @@ -9,6 +9,7 @@ + * + * #include "am33xx.dtsi" + * #include "am335x-bone-common.dtsi" + * +#include "am335x-bone-audio-cape-reva.dtsi" + * + * &ldo3_reg { + * regulator-min-microvolt = <1800000>; + * + * On BeagleBone Black hardware the status of the HDMI dts node must + * also be set to "disabled" + * + * --- a/arch/arm/boot/dts/am335x-boneblack.dts + * +++ b/arch/arm/boot/dts/am335x-boneblack.dts
arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi line 37
Quoted 10 lines
arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi new file +10
-0+ * @@ -73,6 +74,6 @@ + * pinctrl-names = "default", "off"; + * pinctrl-0 = <&nxp_hdmi_bonelt_pins>; + * pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; + * - status = "okay"; + * + status = "disabled"; + * }; + * }; + */ +
how about making the audio-cape-reva.dts which includes and overrides parameters of boneblack.dts?
Further, I see a bunch of capes in
http://elinux.org/Beagleboard:BeagleBone_Capes
Assuming that we dont want to discuss capebus all over again, is this the approach we'd like to consider in the interim?
Quoted 119 lines
arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi new file +87
-0+/ { + sound { + compatible = "ti,da830-evm-audio"; + ti,model = "AM335x BeagleBone Audio Cape Rev. A"; + ti,audio-codec = <&tlv320aic3106>; + ti,mcasp-controller = <&mcasp0>; + ti,codec-clock-rate = <12000000>; + ti,audio-routing = + "Headphone Jack", "HPLOUT", + "Headphone Jack", "HPROUT", + "LINE1L", "Line In", + "LINE1R", "Line In"; + }; + + audio-cape-gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&bone_audio_cape_led_pins>; + + audio-led0 { + label = "audio:green:usr0"; + gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + audio-led1 { + label = "audio:green:usr1"; + gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + }; +}; + +&am33xx_pinmux { + bone_audio_cape_led_pins: pinmux_bone_audio_cape_led_pins { + pinctrl-single,pins = < + 0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a2.gpio1_18 */ + 0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a3.gpio1_19 */ + >; + }; + + bone_audio_cape_pins: bone_audio_cape_pins { + pinctrl-single,pins = < + 0x190 (PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */ + 0x194 (PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */ + 0x19c (PIN_INPUT_PULLUP | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 */ + 0x1ac (PIN_INPUT_PULLUP | MUX_MODE2) /* mcasp0_ahclkx.mcasp0_axr3 */ + >; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; + clock-frequency = <100000>; + + tlv320aic3106: tlv320aic3106 at 1b { + compatible = "ti,tlv320aic3106"; + reg = <0x1b>; + status = "okay"; + + /* Regulators */ + AVDD-supply = <&vmmcsd_fixed>; + IOVDD-supply = <&vmmcsd_fixed>; + DRVDD-supply = <&vmmcsd_fixed>; + DVDD-supply = <&vdd1v8_fixed>; + }; +}; + +&mcasp0 { + pinctrl-names = "default"; + pinctrl-0 = <&bone_audio_cape_pins>; + + status = "okay"; + + op-mode = <0>; /* MCASP_IIS_MODE */ + tdm-slots = <2>; + serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ + 0 0 2 1 + >; + tx-num-evt = <1>; + rx-num-evt = <1>; +};arch/arm/boot/dts/am335x-bone-common.dtsi +14
-0@@ -62,12 +62,26 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; }; + + vdd1v8_fixed: fixedregulator at 1 { + compatible = "regulator-fixed"; + regulator-name = "vdd1v8_fixed"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; }; &am33xx_pinmux { pinctrl-names = "default"; pinctrl-0 = <&clkout2_pin>; + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + 0x178 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.i2c2_sda */ + 0x17c (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ + >; + }; + user_leds_s0: user_leds_s0 { pinctrl-single,pins = < 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */
Signature · 2 lines
Regards, Nishanth Menon
Quoted 51 lines · Nishanth Menon
Quoted 50 lines · Jack Mitchell
From: Jack Mitchell <[email protected]>
Devicetree include file for setting up the am335x mcasp bus, i2c-2 bus, and audio codec required for a functioning BeagleBone Audio Cape.
Signed-off-by Jack Mitchell <[email protected]>Signed-off-by Matt Porter <[email protected]>--- arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi | 124 +++++++++++++++++++++ arch/arm/boot/dts/am335x-bone-common.dtsi | 14 +++ 2 files changed, 138 insertions(+) create mode 100644 arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsiarch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi new file +31
-0@@ -0,0 +1,124 @@ +/* + * Copyright (C) 2014 Jack Mitchell <[email protected]> + * + * 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. + * + * In order to enable the BeagleBone Audio Cape this dtsi must be + * incuded in the top level dts. On BeagleBone Black hardware the + * status of the HDMI dts node must also be set to "disabled". + * + * --- a/arch/arm/boot/dts/am335x-bone.dts + * +++ b/arch/arm/boot/dts/am335x-bone.dts + * @@ -9,6 +9,7 @@ + * + * #include "am33xx.dtsi" + * #include "am335x-bone-common.dtsi" + * +#include "am335x-bone-audio-cape-reva.dtsi" + * + * &ldo3_reg { + * regulator-min-microvolt = <1800000>; + * + * On BeagleBone Black hardware the status of the HDMI dts node must + * also be set to "disabled" + * + * --- a/arch/arm/boot/dts/am335x-boneblack.dts + * +++ b/arch/arm/boot/dts/am335x-boneblack.dts + * @@ -73,6 +74,6 @@ + * pinctrl-names = "default", "off"; + * pinctrl-0 = <&nxp_hdmi_bonelt_pins>; + * pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
Quoted 8 lines
arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi line 37
Quoted 6 lines
arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi new file +6
-0+ * - status = "okay"; + * + status = "disabled"; + * }; + * }; + */ +how about making the
audio-cape-reva.dtswhich includes and overrides parameters ofboneblack.dts?
Yeah, that might be a little cleaner. Black makes things unfortunately messy for these capes that were really intended for BBW :(
Quoted 5 lines
Further, I see a bunch of capes in
http://elinux.org/Beagleboard:BeagleBone_CapesAssuming that we dont want to discuss capebus all over again, is this the approach we'd like to consider in the interim?
I think that's a fair assumption...I'll note that there is work slowly in progress on a very minimal implementation DT overlays upstream. But that doesn't exist. We are simply interested in a sane way to use the hardware we own in mainline and this approach makes it possible to build a kernel+dtb from mainline that works for this configuration. If there's a better way to support this hardware *today* let's discuss it. One of the big benefits to having this upstream is that it's no longer out of sight out of mind. It should be managed alongside all the other am335x dts data.
Incidentally, I'm hoping to contribute a similar patch for the DVI cape I have here.
-Matt
Quoted 2 lines · Matt Porter
Quoted 1 line · Nishanth Menon
On 02/05/2014 07:48 AM, Jack Mitchell wrote:
[...]
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
+ * ---
a/arch/arm/boot/dts/am335x-boneblack.dts
+ * +++b/arch/arm/boot/dts/am335x-boneblack.dts
+ * @@ -73,6 +74,6 @@+ * pinctrl-names = "default", "off"; + * pinctrl-0 = <&nxp_hdmi_bonelt_pins>; + * pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;+ * - status = "okay";
+ * + status = "disabled";
+ * };
+ * };
+ */
+
Quoted 5 lines
Quoted 2 lines
how about making the
audio-cape-reva.dtswhich includes and overrides parameters ofboneblack.dts?Yeah, that might be a little cleaner. Black makes things unfortunately messy for these capes that were really intended for BBW :(
yes indeed - we might have to live with more dts in such a case.
Quoted 17 lines
Quoted 6 lines
Further, I see a bunch of capes in
http://elinux.org/Beagleboard:BeagleBone_CapesAssuming that we dont want to discuss capebus all over again, is this the approach we'd like to consider in the interim?
I think that's a fair assumption...I'll note that there is work slowly in progress on a very minimal implementation DT overlays upstream. But that doesn't exist. We are simply interested in a sane way to use the hardware we own in mainline and this approach makes it possible to build a kernel+dtb from mainline that works for this configuration. If there's a better way to support this hardware *today* let's discuss it. One of the big benefits to having this upstream is that it's no longer out of sight out of mind. It should be managed alongside all the other am335x dts data.
Quoted 2 lines
Incidentally, I'm hoping to contribute a similar patch for the DVI cape I have here.
If I am not mistaken, the capes are stackable (within reason), and are not exactly hotpluggable.. question pops up as to how do we handle multiple cape descriptions on the same board without having the user to create custom dts which includes each relevant cape dts he has on his/her bone? I wonder(without proper research, just thinking aloud) if u-boot can do some sort of merge of dtbs - assuming ofcourse eeprom data is used to detect the capes plugged on board?
Signature · 2 lines
Regards, Nishanth Menon
Quoted 43 lines · Nishanth Menon
Quoted 2 lines · Matt Porter
Quoted 1 line · Nishanth Menon
On 02/05/2014 07:48 AM, Jack Mitchell wrote:
[...]
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
+ * ---
a/arch/arm/boot/dts/am335x-boneblack.dts
+ * +++b/arch/arm/boot/dts/am335x-boneblack.dts
+ * @@ -73,6 +74,6 @@+ * pinctrl-names = "default", "off"; + * pinctrl-0 = <&nxp_hdmi_bonelt_pins>; + * pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;+ * - status = "okay";
+ * + status = "disabled";
+ * };
+ * };
+ */
+Quoted 5 lines
Quoted 2 lines
how about making the
audio-cape-reva.dtswhich includes and overrides parameters ofboneblack.dts?Yeah, that might be a little cleaner. Black makes things unfortunately messy for these capes that were really intended for BBW :(
yes indeed - we might have to live with more dts in such a case.
Quoted 17 lines
Quoted 6 lines
Further, I see a bunch of capes in
http://elinux.org/Beagleboard:BeagleBone_CapesAssuming that we dont want to discuss capebus all over again, is this the approach we'd like to consider in the interim?
I think that's a fair assumption...I'll note that there is work slowly in progress on a very minimal implementation DT overlays upstream. But that doesn't exist. We are simply interested in a sane way to use the hardware we own in mainline and this approach makes it possible to build a kernel+dtb from mainline that works for this configuration. If there's a better way to support this hardware *today* let's discuss it. One of the big benefits to having this upstream is that it's no longer out of sight out of mind. It should be managed alongside all the other am335x dts data.
Quoted 2 lines
Incidentally, I'm hoping to contribute a similar patch for the DVI cape I have here.
Quoted 7 lines
If I am not mistaken, the capes are stackable (within reason), and are not exactly hotpluggable.. question pops up as to how do we handle multiple cape descriptions on the same board without having the user to create custom dts which includes each relevant cape dts he has on his/her bone? I
wonder(without proper research, just thinking aloud)if u-boot can do some sort of merge of dtbs - assuming ofcourse eeprom data is used to detect the capes plugged on board?
Well covered in the original discussion. gcl summarizes options in
https://lkml.org/lkml/2012/11/5/615
Since then, the basic overlay support for the kernel is pretty much a done deal. It has a wide variety of users (FPGA folks) beyond this board specific case. The problem you describe about resource management and conflicts would probably need to be built on top of that. Pantelis had a PoC implementation with capebus/not-a-capebus but that's not part of what is being upstreamed. I'm not sure if there's anybody with enough time out of the Beagleboard community to upstream a resource manager on top of the basic overlay support that's in progress. However, it might make a nice GSoC2014 project. :)
-Matt