diff --git a/.github/styles/config/vocabularies/PSDK/accept.txt b/.github/styles/config/vocabularies/PSDK/accept.txt index 9611e6dcb..b6d854899 100644 --- a/.github/styles/config/vocabularies/PSDK/accept.txt +++ b/.github/styles/config/vocabularies/PSDK/accept.txt @@ -39,3 +39,6 @@ bdebstrap fdisk mmdebstrap umount +Isense +Vpredict +unmute diff --git a/configs/AM62DX/AM62DX_linux_toc.txt b/configs/AM62DX/AM62DX_linux_toc.txt index 4cd294bd0..b9b00a4f5 100644 --- a/configs/AM62DX/AM62DX_linux_toc.txt +++ b/configs/AM62DX/AM62DX_linux_toc.txt @@ -109,6 +109,7 @@ linux/How_to_Guides/Host/K3_Resource_Partitioning_Tool linux/How_to_Guides/Host/SYSFW_Trace_Parser linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customization linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux +linux/How_to_Guides/Target/How_to_connect_TAS67CD_AEC_daughter_card linux/How_to_Guides/Target/How_to_emmc_boot linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda #linux/How_to_Guides/Target/How_to_test_MCAN_on_AM62x diff --git a/source/images/AM62D_TAS67CD_AEC_mute_switches.png b/source/images/AM62D_TAS67CD_AEC_mute_switches.png new file mode 100644 index 000000000..7a5830e60 Binary files /dev/null and b/source/images/AM62D_TAS67CD_AEC_mute_switches.png differ diff --git a/source/images/AM62D_TAS67CD_AEC_setup.jpg b/source/images/AM62D_TAS67CD_AEC_setup.jpg new file mode 100644 index 000000000..2115163af Binary files /dev/null and b/source/images/AM62D_TAS67CD_AEC_setup.jpg differ diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst index ae1c7b4f4..609ae9148 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst @@ -1492,6 +1492,10 @@ Board-specific instructions root@am62dxx-evm:~# arecord -c 8 -r 48000 -f S32_LE test.wav + **TAS67CD-AEC daughter card** + + For the TAS67CD-AEC audio daughter card that connects to the Audio Expansion Connector (AEC) of the AM62D-EVM, refer to `TAS67CD-AEC daughter card setup <../../../How_to_Guides/Target/How_to_connect_TAS67CD_AEC_daughter_card.html>`__. + Potential issues ^^^^^^^^^^^^^^^^ diff --git a/source/linux/How_to_Guides/Target/How_to_connect_TAS67CD_AEC_daughter_card.rst b/source/linux/How_to_Guides/Target/How_to_connect_TAS67CD_AEC_daughter_card.rst new file mode 100644 index 000000000..a85b35d86 --- /dev/null +++ b/source/linux/How_to_Guides/Target/How_to_connect_TAS67CD_AEC_daughter_card.rst @@ -0,0 +1,188 @@ +.. _tas67cd-aec-daughter-card: + +*********************************** +TAS67CD-AEC daughter card setup +*********************************** + +AM62D-EVM includes 2 Audio Expansion Connectors (AEC1 and AEC2), which you can +use to connect to an audio daughter card such as TAS67CD-AEC. + +TAS67CD-AEC is a daughter card that carries two **TAS67524** 50W quad-channel +Class-D amplifiers, referred to as TAS0 and TAS1. Together, they expose 8 +channels of audio playback or 8 channels of active noise cancellation (ANC) +low-latency playback. They also provide optional sensing capture, with 8 +channels of Vpredict and 8 channels of Isense across the two amplifiers. + +Hardware connections +==================== + +To set up the hardware, connect the TAS67CD-AEC daughter card to the AEC1 +connector of the AM62D-EVM. Then connect the external PVDD supply through banana +plugs to the PVDD and GND terminals on the lower left of the daughter card, as +shown in the following figure: + +.. figure:: /images/AM62D_TAS67CD_AEC_setup.jpg + :align: center + :width: 80% + + TAS67CD-AEC daughter card connected to the AEC1 header of the AM62D-EVM + +Set the S1 RESET switch to PORZ instead of STATZ. All three LEDs on the lower +left corner of the daughter card must be lit for the card to operate properly. +The LEDs indicate the following: + +* **IOVDD**: 1.8V power rail that the AM62D-EVM supplies to the daughter card. + This LED lights when you power on the AM62D-EVM and connect it to the daughter + card. +* **PVDD**: The external power supply through the banana plugs. This LED lights + when you connect the external supply and it is within the operating range of + the daughter card (4.25V to 18.5V). +* **PORZ**: Power-on-reset signal. This LED lights when the ASoC codec driver + brings the amplifiers out of reset as part of its initialization sequence. + +The overlay defines the ``GPIO1`` pin of each amplifier as a mute input +(``ti,gpio1-function = "mute"``). Switch SW4 on the daughter card controls the +TAS0 mute, and switch SW2 controls the TAS1 mute. Set the switch to HIGH to +unmute and LOW to mute. You can also adjust the overlay to use any other +supported ``gpio1-function``. + +.. figure:: /images/AM62D_TAS67CD_AEC_mute_switches.png + :align: center + :width: 40% + + Status LEDs and GPIO1 (mute) switches of TAS0 and TAS1 on the daughter card. HIGH to unmute. + +Overlay enablement +================== + +The SDK includes the overlay :file:`k3-am62d-evm-tas67cd-aec.dtbo` to enable +the daughter card on the AM62D-EVM. + +#. Follow the :ref:`How to enable DT overlays in Linux ` + guide for steps on building and adding the overlay in your SD card. + + (You can skip this step if the overlay is already present in + :file:`/boot/dtb/ti` under the root partition of your SD card) + +#. Enable the overlay by updating the ``name_overlays`` variable in the + :file:`uEnv.txt` file under the BOOT partition on your SD card. + + .. code-block:: text + + name_overlays=ti/k3-am62d-evm-tas67cd-aec.dtbo + +#. Reboot the board. The ASoC driver registers the card as ``TAS67CD-AEC``, which + you can check with :command:`aplay` and :command:`arecord`: + + .. code-block:: console + + root@am62dxx-evm:~# aplay -l + root@am62dxx-evm:~# arecord -l + +.. note:: + + This overlay uses the AEC1 connector, as AEC2 shares the same McASP2 pins + with the onboard TAD5212 DACs and PCM6240 ADCs. An AEC2 overlay is not + provided, but you can create one by modifying the AEC1 overlay to use McASP2 + instead and disabling the onboard TAD5212 and PCM6240 nodes. + +Overlay configuration +===================== + +The overlay uses the following AM62D-EVM resources: + +.. list-table:: + :header-rows: 1 + :widths: 25 75 + + * - Resource + - Configuration + * - Audio interface + - McASP1 on AEC1, ``dsp_b`` format, 16 time-division multiplexing (TDM) slots, McASP is bit clock and frame provider + * - Clock + - McASP routes from CDCE6214 output 1 (``&cdce6214 3``) + * - Control + - I2C2: TAS0 at ``0x70``, TAS1 at ``0x71`` + * - Playback data + - AXR0 (shared by TAS0 and TAS1) + * - Capture data + - AXR2 (TAS0 sense data), AXR3 (TAS1 sense data) + * - Standby GPIOs + - TAS0: GPIO0_33, TAS1: GPIO0_34 + * - Supplies + - DVDD from the EVM PMIC ``buck3`` (1.8 V). PVDD comes from an external supply, which also feeds VBAT + +Each amplifier exposes three digital audio interfaces (DAIs): audio playback, +ANC low-latency playback, and a feedback capture DAI that returns real-time +voltage (Vpredict) and current (Isense) sense data. The playback and capture +streams share the same SCLK and FSYNC pair in the TAS67524, so both use the same +16-slot TDM layout. Capture uses only 8 of the 16 slots. The following table +summarizes the slot assignment: + +.. list-table:: + :header-rows: 1 + :widths: 20 40 40 + + * - Slots + - Playback + - Capture + * - 0-3 + - TAS0 audio (AXR0) + - Vpredict (AXR2: TAS0, AXR3: TAS1) + * - 4-7 + - TAS1 audio (AXR0) + - Isense (AXR2: TAS0, AXR3: TAS1) + * - 8-11 + - TAS0 ANC low-latency (AXR0) + - Not used + * - 12-15 + - TAS1 ANC low-latency (AXR0) + - Not used + +For the purpose of evaluation, the overlay routes both normal playback and ANC +low-latency playback to different TDM slots on the same AXR0 pin. To use ANC +low-latency playback, enable the low-latency playback (LLP) mode and the +``ANC Path`` switch with :command:`amixer`. + +Audio card topology +------------------- + +The card is an ``audio-graph-card2`` DPCM sound card. One front-end playback +stream on McASP1 fans out to the audio and ANC back-end DAIs of both +amplifiers, and the feedback back-end DAIs of both amplifiers fan in to one +front-end capture stream. The overlay source and a description of each node are +in the DPCM example under :ref:`DPCM topology `. + +Playing audio on the TAS67CD-AEC daughter card +============================================== + +Make sure that you set the mute switches of TAS0 and TAS1 to HIGH. The +``TAS67CD-AEC`` card exposes two PCM devices, both on McASP1. The kernel numbers +the PCM devices in the order of the front-ends (FE) in the ``links`` property of +the sound card node. FE0 handles playback, so ``hw:,0`` is the playback +device. FE1 handles capture, so ``hw:,1`` is the capture device. The audio, +ANC and feedback DAIs of the amplifiers are internal back-ends. +:command:`aplay -l` and :command:`arecord -l` do not list them. + +#. Play back a .WAV or raw PCM file on the TAS67CD-AEC playback device by using + :command:`aplay`: + + .. code-block:: console + + root@am62dxx-evm:~# aplay -D hw:,0 + + Replace ```` with the card number or ID that :command:`aplay -l` + shows for the ``TAS67CD-AEC`` card. + + You can also check out the :ref:`Audio Linux Driver Guide ` + for more information about using :command:`aplay`. + +#. To record the voltage and current feedback data from both amplifiers, use + :command:`arecord` on the TAS67CD-AEC capture device: + + .. code-block:: console + + root@am62dxx-evm:~# arecord -D hw:,1 -c -r 48000 -f feedback.wav + + The capture sampling rate must match the ongoing playback rate. Vpredict is + only available at 48 kHz. diff --git a/source/linux/How_to_Guides_Developer_Notes.rst b/source/linux/How_to_Guides_Developer_Notes.rst index da025d99f..62c8ddd9c 100644 --- a/source/linux/How_to_Guides_Developer_Notes.rst +++ b/source/linux/How_to_Guides_Developer_Notes.rst @@ -26,6 +26,7 @@ Developer Notes How_to_Guides/Target/How_to_test_MCAN_on_AM62x How_to_Guides/Target/How_to_enable_DT_overlays_in_linux How_to_Guides/Target/How_to_playback_audio_over_HDMI + How_to_Guides/Target/How_to_connect_TAS67CD_AEC_daughter_card How_to_Guides/Target/How_to_enable_Microtips_LVDS_Panel How_to_Guides/Target/How_to_visualize_statistics_data How_to_Guides/Target/How_to_Use_K3Conf_Tool