• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » ARM® Processors » Sitara™ ARM® » AM3x Sitara ARM Processors Forum » am335x: S/PDIF support in Linux
Share
Sitara™ ARM®
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

am335x: S/PDIF support in Linux

This question is not answered
rfc2217
Posted by rfc2217
on Feb 22 2013 09:27 AM
Expert1375 points

I'm trying to get S/PDIF on McASP1 working. According to your PSP kernel DIT should be supported (sound/soc/davinci/davinci-mcasp.c). So far all I can hear is noise. I found a checklist (22.3.8.3.2 Transmit DIT Clock and Frame Sync Generation) and there are differences in XFMT settings. According to the documentation rotation should be 0x0 or 0x2 depending on data alignment (left/right), but the driver had 0x6. The mask is also different. The user data registers won't be touched.

What is the proper S/PDIF configuration for am335x? Is there any reference hardware that is working with S/PDIF?

Yegor

spdif am335x sound dit mcasp
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • rfc2217
    Posted by rfc2217
    on Feb 25 2013 02:46 AM
    Expert1375 points

    So far I've made following settings:

    created new struct snd_platform_data for S/PDIF

    static struct snd_platform_data am335x_evm_alekto2_snd_spdif_data1 = {
            .tx_dma_offset  = 0x46400000,   /* McASP1 */
            /*.rx_dma_offset        = 0x46400000,*/
            .op_mode        = DAVINCI_MCASP_DIT_MODE,
            .num_serializer = ARRAY_SIZE(am335x_evm_spdif_serializer_direction1),
            .tdm_slots      = 2,
            .serial_dir     = am335x_evm_spdif_serializer_direction1,
            .asp_chan_q     = EVENTQ_2,
            .version        = MCASP_VERSION_3,
            .txnumevt       = 32,
    };

    Made changes regarding TRM to McASP register settings:

    - clock is derived from 24MHz

    - for 48000Hz divide the clock to get 6MHz (128 * 48000)

    /* S/PDIF */
    static void davinci_hw_dit_param(struct davinci_audio_dev *dev)
    {
            /* Set the PDIR for Serialiser as output */
            mcasp_set_bits(dev->base + DAVINCI_MCASP_PDIR_REG, AFSX);

            /* TXMASK for 16 bits */
            mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, 0x0000FFFF);

            /* Set the TX format : 0 bit right rotation, 32 bit slot, Pad 0
               and LSB first */
            mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
                                                    TXROT(0) | TXSSZ(15));

            /* Set TX frame synch : DIT Mode, 1 bit width, internal, rising edge */
            mcasp_set_reg(dev->base + DAVINCI_MCASP_TXFMCTL_REG,
                                                    AFSXE | FSXMOD(0x180));

            /* Set the TX tdm : for all the slots */
            mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, 0xFFFFFFFF);

            /* Set the TX clock controls : div = 1 and internal */
            mcasp_set_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG,
                                                    ACLKXE | TX_ASYNC);

            mcasp_clr_bits(dev->base + DAVINCI_MCASP_XEVTCTL_REG, TXDATADMADIS);

            /* Only 44100 and 48000 are valid, both have the same setting */
            mcasp_set_bits(dev->base + DAVINCI_MCASP_AHCLKXCTL_REG, AHCLKXE | AHCLKXDIV(3));

            /* Enable the DIT */
            mcasp_set_bits(dev->base + DAVINCI_MCASP_TXDITCTL_REG, DITEN);
    }

    What about DIT Channel Status and User Data Register Files (DITCSRA0-5, DITUDRA0-5)? Haven't seen them being configured in the driver source code.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • rfc2217
    Posted by rfc2217
    on Feb 28 2013 02:29 AM
    Expert1375 points

    We made measurements and it looks like one byte is missing. We send 0x55ff and as you can see from the osci picture only 0xff was really transfered:

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use