2008-11-05 16:33:36     ATAPI and Compact Flash

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

2008-11-05 16:33:36     ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64714   

 

Has anyone tested using compact flash (in True IDE mode) over the ATAPI interface on the bf548?  If so, what driver did you use?  The pata_bf54x or one of the older ones perhaps?

QuoteReplyEditDelete

 

 

2008-11-05 21:01:11     Re: ATAPI and Compact Flash

Mike Frysinger (UNITED STATES)

Message: 64725   

 

i havent seen any mention of people attempting to glue a CF interface onto the ATAPI interface on the BF54x ...

QuoteReplyEditDelete

 

 

2008-11-06 09:24:12     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64770   

 

Shoot.  Our board does exactly that -- going by the HWR we hooked it up a CF card in True IDE mode to the ATAPI interface.  I had read a bit on the wiki about drivers supporting True IDE mode and incorrectly assumed it would work over the ATAPI interface pretty much like the hard drive on the ezkit.

 

CF is pretty critical to our board, so I'm going to have to get this working somehow.  Any pointers on where to start?  Could the pata driver that the ezkit uses be easily modified to do this?

QuoteReplyEditDelete

 

 

2008-11-06 09:35:22     Re: ATAPI and Compact Flash

Michael Hennerich (GERMANY)

Message: 64771   

 

A CF card in TRUE IDE MODE (/ATA_SEL Low during reset) should behave identical to an IDE HDD.

So I see no reason why it shouldn’t work using the BF548 PATA driver.

 

-Michael

 

QuoteReplyEditDelete

 

 

2008-11-06 09:45:50     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64772   

 

Thanks Michael!  That's very reassuring.  I was psyching myself out and getting worried that I'd have to write a lot of new code.  It's probably a schematic error on our end that's preventing the pata driver from recognizing the card.  Time for me to start debugging the board now that I know it should work!

 

 

 

Thanks again.

QuoteReplyEditDelete

 

 

2008-11-06 22:57:45     Re: ATAPI and Compact Flash

Sonic Zhang (CHINA)

Message: 64789   

 

You need to run the ATAPI driver in PIO mode.

QuoteReplyEditDelete

 

 

2008-11-07 10:17:29     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64841   

 

Hi Sonic.  Thanks for the tip.  I've disabled DMA support (not defined CONFIG_PATA_BF54X_DMA) in my kernel config, but my device still doesn't show up under /dev.

 

Here's what I see on boot up:

 

register bfin atapi driver

scsi0 : pata-bf54x

ata1: PATA max PIO4 cmd 0x00000000 ctl 0xffc03800 bmdma 0x00000000 irq 68

successfully returning from bfin_atapi_probe

 

 

I added that last printk at the end of bfin_atapi_probe just to make sure it completed.  I'm not too familiar with the ata and scsi frameworks, so I'm having a hard time tracking down what branch of code follows the call to bfin_atapi_probe.

 

Could you describe the general control flow of the driver initialization?  What happens after probing?

 

I've double checked our schematic and layout and things look ok to me (though it will be checked again by someone else) so my goal now is to try and find out where in the pata driver things break down --hopefully that will lead me to whatever board error is present.

QuoteReplyEditDelete

 

 

2008-11-07 14:11:12     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64851   

 

Sonic, I don't need the info I requested earlier.  I have tracked this down to the fact that the calls to ata_dev_try_classify appear to be returning ATA_DEV_NONE instead of ATA_DEV_ATAPI.  This basically says to there is no ATAPI device connected and so the ata framework basically just stops.

 

It appears that reading the ATAPI status register on the CF card is returning bogus data.  To me this would most likely be caused by an hardware issue with our board which I'll continue to look into.

QuoteReplyEditDelete

 

 

2008-11-07 14:26:42     Re: ATAPI and Compact Flash

Michael Hennerich (GERMANY)

Message: 64853   

 

Is CF ATA_SEL asserted low before and after reset?

 

-Michael

QuoteReplyEditDelete

 

 

2008-11-07 14:43:43     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64856   

 

We have ATA_SEL pulled to ground through a 10k resistor.  Is that correct?

QuoteReplyEditDelete

 

 

2008-11-07 14:55:46     Re: ATAPI and Compact Flash

Michael Hennerich (GERMANY)

Message: 64857   

 

I would meassure the voltage level.

 

Assuming the internal pull up is also 10k - then you are in trouble ...

 

-Michael

QuoteReplyEditDelete

 

 

2008-11-07 14:56:31     Re: ATAPI and Compact Flash

Michael Hennerich (GERMANY)

Message: 64859   

 

It's safe to gound that pin.

 

-Michael

QuoteReplyEditDelete

 

 

2008-11-07 15:12:44     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64860   

 

Cool.  I'll take out the 10k and go straight to ground.  It's an 0402 package so it may take me a bit   -- shouldn't have gone that small for our first rev!

 

 

 

 

QuoteReplyEditDelete

 

 

2008-11-07 15:50:38     Re: ATAPI and Compact Flash

Michael Hennerich (GERMANY)

Message: 64863   

 

Kyle,

 

should be easy to desolder tiny packages - just place a solder bouble via the exposed pads.

 

If this dossn't fix you problem. Post your CF Socket pin mappings as well as all other connected terminals.

 

-Michael

QuoteReplyEditDelete

 

 

2008-11-07 16:20:48     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64865   

 

Unfortunately it didn't end up fixing the problem.  I've attached a PDF of the schematic which includes the pin mappings.  I really appreciate the help!

 

CF-ATAPI.pdf

QuoteReplyEditDelete

 

 

2008-11-09 23:18:10     Re: ATAPI and Compact Flash

Sonic Zhang (CHINA)

Message: 64897   

 

You can set break in functions of bfin_pata_ops to see if they are invoked properly.

 

 

QuoteReplyEditDelete

 

 

2008-11-10 07:05:51     Re: ATAPI and Compact Flash

Michael Hennerich (GERMANY)

Message: 64923   

 

Kyle,

 

The BUS SWITCHES U9, U10 are unnecessary.

The EZKIT schematics just uses them since most IDE HDD are 5V IO.

Compact flash cards can be either 5V or 3.3V IO depending on the Card Supply Voltage.

 

Looking at you schematics:

 

U11 (NC7SV38P5X) appears to be a NAND gate.

However you should have a NOR gate here.

 

This causes the bus switches to be turn off (disabled) while they should be active.

 

Regards,

Michael

 

QuoteReplyEditDelete

 

 

2008-11-10 17:26:31     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 64976   

 

That's a great catch on the bus switches.  We have tried gounding the active low enables but thing are still not working -- trying to read the status register on the CF card is unsuccessful.

 

I'll update the thread if any new information comes to light.

 

We're making slowly progress...thanks to all who have helped.

QuoteReplyEditDelete

 

 

2008-12-02 14:14:31     Re: ATAPI and Compact Flash

Kyle Schlansker (UNITED STATES)

Message: 66177   

 

So, after a long cycle of debugging it turned out to be that we shorted the two chip select signals while removing one of the logic gates.

 

Thanks again for everyone's help, and for the record and thread closure:

 

 

 

Compact Flash in TrueIDE mode connected to the ATAPI interface on the BF548 works great  using the pata driver in PIO mode.

QuoteReplyEditDelete

 

 

2008-12-02 14:24:39     Re: ATAPI and Compact Flash

Michael Hennerich (GERMANY)

Message: 66178   

 

Good to hear that you root caused the issue.

BTW - latest u-boot trunk now also supports PATA/ATAPI and MMC/SD.

 

-Michael

Attachments

    Outcomes