2008-09-10 15:28:48     SSM2602 on BF527 Configured for SPORT0 on Port F

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-09-10 15:28:48     SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 61910   

 

Good day all,

 

I am trying to get the audio out to function on the BF527-EZKIT with the SPORT0 configured to use Port F. The board has been configured as follows(format of 'Item'.'Pin'):

 

    All switches on SW17 and SW20 set to OFF.

    JP3 shorted

    PPI.11 shorted to SW20.7 (DAC Data)

    PPI.12 shorted to SW20.8 (RL Sync)

    PPI.13 shorted to SW17.4 (Clock)

    All else same as when working on SPORT0 on Port G

 

The software is 2008R1.5-rc14 configured for SSM2602 ASOC driver on SPORT0 with SPORT0 configured for Port F.

 

I have poked around in the kernel sound/soc/blackfin files and associated headers. I have found only the portmux.h definitions affected by configuring for Port F. All else appears same, even if SPORT1 were to be selected (Both GPIO and Register mappings appear intact).

 

When running in this configuration I can see the clock on PPI.13 and the Right-Left frame sync signal on PPI.12. I do not see the data on PPI.11 though. I have been testing using tone, and when configured for SPORT0 on Port G (with switches set appropriately) audio is functioning fine (all three signals seen as well).

 

I think I must be missing a critical detail and so am looking for ideas or known issues surrounding this driver. What could be missing in the driver to prevent audio on SPORT0 configured for Port F?

 

In short: What am I missing?

QuoteReplyEditDelete

 

 

2008-09-11 03:03:56     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Mike Frysinger (UNITED STATES)

Message: 61926   

 

what audio hardware are you trying to use ?  the stuff that's already on the board or your own hardware ?

 

if it's only the on-board stuff, have you reviewed this page ?

http://docs.blackfin.uclinux.org/doku.php?id=ssm2602_setup

QuoteReplyEditDelete

 

 

2008-09-11 10:35:01     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 61992   

 

Mike,

 

I started with that page, and when following it using the hardware on the BF527-EZKIT audio works splendidly.

 

Then, because on our board using SPORT0 on Port F would be better for peripheral use in our application, we intentionally disconnected (via the switches) the codec pins from the Port G SPORT0 pins. We also (using lead wire with clips) connected the Port F SPORT0 pins to the codec (Yes the SSM2602 on the BF527). The kernel software was then reconfigured and rebuilt to use port F for SPORT 0.

 

When the modifications were complete the only thing that is not working is the actual clocking of audio PCM data to the codec by the core via SPORT0.

 

I have been digging into the code, and am looking for information to direct me where the problem might reside so as to focus my investigations. I am also looking for confirmation that there is no electrical property of the BF527 that would prevent functioning properly on SPORT 0 configured for Port F. The page you linked to has a prominent warning about an internal linkin of the Codec to SPORT 0 only and that SPORT1 is not suitable.

 

Does this warning and linkage also apply to SPORT0 on Port F?

QuoteReplyEditDelete

 

 

2008-09-11 11:03:59     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Mike Frysinger (UNITED STATES)

Message: 61995   

 

when you say you reconfigured the kernel software, you mean you changed the settings under:

Blackfin Processor Options -> BF527 Specific Configuration -> SPORT0 (PORTF)

 

or was there something else you did ?

 

as for electrical signals, i'll have to get someone else to comment on that

QuoteReplyEditDelete

 

 

2008-09-11 13:06:38     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 61996   

 

Mike,

 

Yes I changed the configuration through the menuconfig under Blackfin Processor Options -> BF527 Specific Configuration -> SPORT0 (PORTF).

 

I even followed this config option to the file portmux.h and found the compile definitions switching between the Port G and Port F pins. These looked good to me, but as I am relatively new to looking at kernel details I may have missed something. I worry that there is another place in the kernel code for the BF527 that needs similar treatment to properly configure the ports. Though my inspection of the PORTx_FER and PORTx_MUX registers appear correct. Again I may have missed something in reading the register definitions and port assignment tables in the HW reference and peripheral reference manuals.

 

 

 

 

QuoteReplyEditDelete

 

 

2008-09-11 13:24:39     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Mike Frysinger (UNITED STATES)

Message: 62000   

 

the kconfig/portmux.h logic is correct afaik.  otherwise, i assume you checked the SPORT0 TSCLK setting for PG10 vs PG14.

 

the guy who normally can check the electrical side is on vacation at the moment, so it might take a bit longer to have someone else look at it.

QuoteReplyEditDelete

 

 

2008-09-11 15:05:56     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62006   

 

Mike,

 

Thanks for the help on this.

 

I have checked the TSCLK settings as well. They are also under the control of CONFIG_BF527_SPORT0_PORTF and when it is defined the decision between PG10 and PG14 is irrelevant as on Port F TSCLK uses PF5. Yes the logic looks good for TSCLK on Port F as well as Port G.

 

I will try tracing the specific settings in my configured version at the office tomorrow and see what it yields. I have low hopes for finding the problem this way though. As you indicated the kconfig/portmux.h logic seems correct.

 

I look forward to reading what the HW guy has to say when he returns from vacation.

 

I will post the results of looking at the config settings tommorow as well.

QuoteReplyEditDelete

 

 

2008-09-12 15:51:47     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62078   

 

Mike,

 

I traced the various config options through the code to no avail. I have no new information from this front.

 

 

 

I did however think to try a HW change. This is not an intuitive setup so I want to detail the setup for you again.

 

The setup for this new test is as follows:

 

    All switches on SW17 and SW20 set to OFF except SW20.1 is set to ON.

    JP3 shorted

    PPI.12 shorted to SW20.8 (RL Sync)

    PPI.13 shorted to SW17.4 (Clock)

    All else same as when working on SPORT0 on Port G

 

The software is 2008R1.5-rc14 configured for SSM2602 ASOC driver on SPORT0 with SPORT0 configured for Port F.

 

Please make special note that PPI.11 shorted to SW20.7 (DAC Data) was removed. Logically, when combined with the SW20.1 setting, makes a hybrid connection where clock and  and data are wired to SPORT0 on Port F and the right-left synch is wired to Port G.

 

With this hybrib (and "wrong") configuration data is transfering to the codec and audio is present.

 

This leads me to think that something in the i2s or PCM code might need a configuration shift based on SPORT0 port. That is unless the problem is in the HW. Please pass this information along to the HW guy and let me know what you think about the potential for an issue in the i2s or PCM code.

QuoteReplyEditDelete

 

 

2008-09-16 07:33:50     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62242   

 

Mike,

 

Any update on thoughts as to SW effect on the single SPORT signal shift discussed above?

QuoteReplyEditDelete

 

 

2008-09-18 08:17:33     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62383   

 

Mike,

 

I really need your opinion please. Should I continue looking at the codec software driver in uCLinux or is it likely the HW. I am asking again as I need to info to push forward on my project. Please let me know your opinion.

QuoteReplyEditDelete

 

 

2008-09-19 03:01:45     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Cliff Cai (CHINA)

Message: 62418   

 

Hi Brian,

 

Please make note that SPORT0 is mapped to PF0~PF5(PPI.0~PPI.5),PF8~PF13(PPI.8~PPI.13) is mapped to SPORT1.

 

Cliff

 

 

 

 

QuoteReplyEditDelete

 

 

2008-09-22 11:26:15     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62511   

 

Cliff,

 

I am aware of that. I think the confusion is a difference of reference point. I am refering to pins on the PPI header on the BF527 (P8 on silkscreen). The mapping is below:

 

PPI Header Pin => PF Pin

 

PPI(P8).11 => PF3

 

PPI(P8).12 => PF4

 

PPI(P8).13 => PF5

 

This is according to the schematic included in the BF527-EZKIT manual. I was very careful to ensure the connections went to the correct pins on the BF527 in each of my test cases. I have used the BF527-EZKIT as reference since we both have access to that hardware.

 

If you relook at my configuration information using the PPI header as your pin reference I think you will agree that my logical and physical connections match. If you find a discrepency I would be glad to hear of it and re-run my testing with appropriate corrections.

 

Can you answer me whether anyone has made the SSM2602 function from any other configuration than SPORT 0 on Port G?

QuoteReplyEditDelete

 

 

2008-09-22 15:30:10     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Christopher Harrsen (UNITED STATES)

Message: 62517   

 

Hi Brian,

 

I believe you are correct. I have not been able to sucessfully move SPORT0 to port F on the BF527 EZ-KIT. Everything works fine when SPORT0 is configured for Port G.

 

Hi Cliff -- Do you know if anyone has been able to successfully accomplish this task?

 

Thanks,

 

 

Chris

QuoteReplyEditDelete

 

 

2008-09-22 19:50:34     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Robin Getz (UNITED STATES)

Message: 62520   

 

Chris/Brian:

 

The EZKit was not designed with this flexibility in mind - so one one has done it.

 

The kit uses sport 0A for audio, the sport 0A can be disconnected.  Sport 0 (without A) is multiplexed with other signals which may have pull-ups or pulldowns or even actively driven signals. I don't think it will function properly without alot of effort.

 

-Robin

QuoteReplyEditDelete

 

 

2008-09-23 11:05:37     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Christopher Harrsen (UNITED STATES)

Message: 62558   

 

Hi Robin,

 

In trying to replicate the issue Brian is seeing on his actual HW I am using the BF527 EZ-KIT. At this point, I am just trying to see the PPID3 (DT0PRI), PPID4 (TFS0), and PPID5 (TSCLK0) signals toggle on the PPI connector. The only configuration option I am changing when building the image is SPORT0 from PORTG to PORTF.  This does not seem to work so we were wondering if anyone else has had success running SPORT0 on PORTF.

 

Thanks,

 

Chris

QuoteReplyEditDelete

 

 

2008-09-23 11:59:31     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Mike Frysinger (UNITED STATES)

Message: 62566   

 

only the default configuration has been tested

QuoteReplyEditDelete

 

 

2008-09-24 13:53:42     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62641   

 

Robin,

 

What other things should I be looking out for? We have tried this same shift on our internally designed board that does not have many of the EZKIT elements. The bahavior was the same as on the EZKIT.

 

We do not mind doing extra work to get things working optimally for us. Either SW or HW. I just need some guidance on where to look, and what to be looking for.

 

Again, thanks to all for the help here.

 

QuoteReplyEditDelete

 

 

2008-09-24 16:08:47     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Robin Getz (UNITED STATES)

Message: 62652   

 

Brian:

 

Can you check the MMR settings? (turn on MMR tree)

 

https://docs.blackfin.uclinux.org/doku.php?id=kernel_debugging

 

 

QuoteReplyEditDelete

 

 

2008-09-25 08:18:04     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62707   

 

Robin,

 

I have the MMR tree turnrd on. What particular registers do you want me to fetch?

 

 

QuoteReplyEditDelete

 

 

2008-09-25 09:40:46     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Robin Getz (UNITED STATES)

Message: 62708   

 

Brian:

 

Look at whatever registers are needed.

 

I think there are some GPIO setup, muxing setup, - then compare this against the Port G Multiplexing Scheme (table 8-3) in the HRM.

 

-Robin

QuoteReplyEditDelete

 

 

2008-09-25 14:43:21     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62722   

 

Robin,

 

I found something interresting. Here are the values from reading the PORTx_FER and PORTx_MUX gegisters for Ports F and G:

 

PORTF_MUX: 0x0801

 

    1:0 => 01 => 2nd Function => DR0PRI / RFS0 / RSCLK0 / DT0PRI / TFS0 / TSCLK0 / DT0SEC / DR0SEC

    3:2 => 00 => 1st Function => DR1PRI / RSCLK1

    5:4 => 00 => 1st Function => RFS1

    7:6 => 00 => 1st Function => TFS1

    9:8 => 00 => 1st Function => DT1PRI / TSCLK1

    11:10 => 10 => 3rd Function => UART1TX / UART1RX

    13:12 => Reserved

    15:14 => Reserved

 

PORTG_MUX: 0x1002

 

    1:0 => 10 => 3rd Function => SPI SSEL1/SPI SCK/SPI MOSI/SPI/MISO

    3:2 => 00 => 1st Function => TMR1/PPI FS2/DT0PRI

    5:4 => 00 => 1st Function => TMR3/TMR4

    7:6 => 00 => 1st Function =>TMR5

    9:8 => 00 => 1st Function => TMR6

    11:10 => 00 => 1st Function => TMR7/DMAR1/DMAR0

    13:12 => 01 => 2nd Function => RMII MDC/RMII PHYINT

    15:14 => Reserved

 

PORTF_FER: 0xc02f

 

PORTG_FER: 0xc01e

 

Given the MUX decodes it looks like the functions are properly set for SPORT 0 to be on PORT F. Also, none of the settings have SPORT 0 signals muxed to PORT G.

 

The PORTF_FER even has the pins (5:3) set to 101b, which should be 111b for the DT0PRI, TFS0 and TSCLK0 signals respectively.

 

It looks like the PORTF_FER register is set incorrectly. Where in the pin handling code should I be looking to find such an error?

QuoteReplyEditDelete

 

 

2008-09-25 15:17:51     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Michael Hennerich (GERMANY)

Message: 62724   

 

>The PORTF_FER even has the pins (5:3) set to 101b, which should be 111b for the DT0PRI, TFS0 and TSCLK0 signals respectively.

>It looks like the PORTF_FER register is set incorrectly. Where in the pin handling code should I be looking to find such an error?

 

This is not a bug in the generic pinmuxing code.

The sound driver simply doesn't request P_SPORT0_TFS see below:

You may want to add P_SPORT0_TFS to see if it fixes your problem

 

-Michael

 

File: sound/soc/blackfin/bf5xx-i2s.c

static int bf5xx_i2s_probe(struct platform_device *pdev)

{

int ret;

u16 sport_req[][7] = {

{ P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,

P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0},

{ P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,

P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0},

};

 

if (peripheral_request_list(&sport_req[sport_num][0], "soc-audio")) {

pr_err("Requesting Peripherals failed\n");

return -EFAULT;

}

 

QuoteReplyEditDelete

 

 

2008-09-25 15:45:56     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Christopher Harrsen (UNITED STATES)

Message: 62725   

 

Michael,

 

If I am not using the sound driver and just want to configure SPORT0 for port F I get the following values:

 

PORTF_MUX = 0x0800

 

PORTF_FER = 0xC0FF

 

The PORTF_MUX does not seem to be getting set correctly.

 

Regards,

 

Chris

QuoteReplyEditDelete

 

 

2008-09-25 15:51:23     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Mike Frysinger (UNITED STATES)

Message: 62726   

 

post the code you're testing with

QuoteReplyEditDelete

 

 

2008-09-25 15:58:42     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Michael Hennerich (GERMANY)

Message: 62727   

 

MUX and FER regs only get set during calls to peripheral_request_list or peripheral_request function calls.

 

The Config option only influences the P_SPORTx_XXX defines.

 

-Michael

 

#if defined(CONFIG_BF527_SPORT0_PORTF)

#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))

#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))

#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))

#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))

#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))

#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))

#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))

#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))

#elif defined(CONFIG_BF527_SPORT0_PORTG)

#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))

#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1))

#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(1))

#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1))

#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(1))

#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(1))

#if defined(CONFIG_BF527_SPORT0_TSCLK_PG10)

#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(1))

#elif defined(CONFIG_BF527_SPORT0_TSCLK_PG14)

#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))

#endif

#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))

#endif 

QuoteReplyEditDelete

 

 

2008-09-25 16:20:16     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Christopher Harrsen (UNITED STATES)

Message: 62729   

 

Hi Mike,

 

When I am configuring my kernel build,

 

Under Blackfin Processor Options -> BF527 Specific Configuration -> Alternative Muxing Scheme

 

I put SPORT0 on PORTF and UART1 on PORTF. After booting the image I read the registers listed in my prior post.

 

I need PORTF_FER = 0x..FF.

 

        /* Local Variables. */

        unsigned char *buffer = NULL;

        int sport, i;

        int *data;

 

        memset(&config, 0, sizeof (struct sport_config));

        config.fsync = 1;

        config.word_len = 16;

        config.dma_enabled = 1;

 

        sport = open ("/dev/sport0", O_RDWR, 0);

        if (sport < 0) {

            fprintf (stderr, "Failed to open ", sport);

        return -1;

        }

 

 

        if (write (sport, buffer, BUF_LEN) != BUF_LEN) {

          perror ("/dev/sport0");

          free(buffer);

          close(sport);

          return -1;

       }

 

Regards,

 

Chris

QuoteReplyEditDelete

 

 

2008-09-25 18:08:01     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Mike Frysinger (UNITED STATES)

Message: 62733   

 

the ALSA soc SPORT driver is independent of the SPORT char driver.  a bug in how one requests SPORT pins would not affect the other.

QuoteReplyEditDelete

 

 

2008-09-26 04:51:33     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Cliff Cai (CHINA)

Message: 62782   

 

PG15(P_SPORT0_TFS) has been requested by bfin_mac. I think for Port F,there is no such problem.

 

--Cliff

QuoteReplyEditDelete

 

 

2008-09-26 23:39:48     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62823   

 

Michael,

 

I will try adding the TFS additions on Monday and report back my findings. Thank you for the reply. I have been swamped this week and was unable to spend the time looking for the cause of the FER register error.

 

 

QuoteReplyEditDelete

 

 

2008-09-29 11:29:20     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62897   

 

All,

 

I have made modifications to include the TFS pin in bf5xx-i2s.c (see attached diff for specifics) and tested on SPORT 0 using Port F. I also included the SPORT 1 changes and tested them as well.

 

The ssm2602 produces audio when connected to SPORT 0 using Port F. Also, SPORT 1 produces audio as well. To be honest I used two prototypew boards we have here (based on, but not BF527-EZKITs). I have not tested SPORT 0 on Port G on the BF527 yet. Once I do I will place the diff on the patch tracker.

 

ssm2602-i2s.diff

QuoteReplyEditDelete

 

 

2008-09-29 16:46:52     Re: SSM2602 on BF527 Configured for SPORT0 on Port F

Brian Wenholz (UNITED STATES)

Message: 62904   

 

Testing is completed, and did require added complexity to preserve the BF527-EZKIT functionality while adding the fix.

 

I have submitted patch tracker 4448 with the updated patch file.

 

As far as I am concerned the issue is closed and resolved with many thanks to all who helped.

Attachments

Outcomes