2009-04-14 13:00:51     Compact Flash on a custom BF561 - problems using pcmcia driver

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

2009-04-14 13:00:51     Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 72644   

 

Hi, we have been trying to make use of the pcmcia compact flash driver in the uClinux dist. The driver compiles and is loaded correctly by the kernel it would seem (we have used debug messages to prove that the init function is being used.)

 

However, when uClinux boots we do not see the:

 

Blackfin CompactFlash/PCMCIA Socket Driver

bfin_cf_pcmcia: on irq 54

 

 

...messages as described in the docs (   docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin_cf_pcmcia )

 

We have not included the user-space pcmcia utilities... could this be a reason for the driver not to be working? (Are any driver dependencies not being included as a result?)

 

I'm not sure what other information you might need to know in order to help, so I'll just wait for any questions.

 

 

 

Thanks in advance

 

John Redford.

QuoteReplyEditDelete

 

 

2009-04-14 19:02:36     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Mike Frysinger (UNITED STATES)

Message: 72655   

 

did you declare resources for the pcmcia driver ?  if you dont, then the driver will never load.

QuoteReplyEditDelete

 

 

2009-04-15 06:02:28     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 72680   

 

Thanks for the reply.

 

No I did not declare resources for the pcmcia driver so I guess that isn't good.

 

I cannot find any documentation regarding the start and end addresses of the pcmcia resources for the bf561 ezkit, so I'm not sure what values to use...

 

I took a look at the bf537 generic_board.c and have copied the structures into the bf561 generic_board.c, however I do not know what the .start and .end addresses for the IO Port and attribute memory should be. I know that our card detect is on PF24, but I'm not sure what the 3rd section is used for (IRQ_PF4 in this case).

 

Please could you help me choose which resources to use in order to get the PCMCIA driver working on our bf561?

 

Thanks in advance,

 

John R.

 

 

 

#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)

static struct resource bfin_pcmcia_cf_resources[] = {

        {

                .start = 0x20310000, /* IO PORT */

                .end = 0x20312000,

                .flags = IORESOURCE_MEM,

        }, {

                .start = 0x20311000, /* Attribute Memory */

                .end = 0x20311FFF,

                .flags = IORESOURCE_MEM,

        }, {

                .start = IRQ_PF4,

                .end = IRQ_PF4,

                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

        }, {

                .start = 6, /* Card Detect PF6 */

                .end = 6,

                .flags = IORESOURCE_IRQ,

        },

};

 

static struct platform_device bfin_pcmcia_cf_device = {

        .name = "bfin_cf_pcmcia",

        .id = -1,

        .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),

        .resource = bfin_pcmcia_cf_resources,

};

#endif

 

QuoteReplyEditDelete

 

 

2009-04-15 12:01:48     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 72702   

 

Also, I meant to check that I am actually editing the correct file...

 

/uClinux-dist-2008R1.5-RC3/linux-2.6.x/arch/blackfin/mach-bf561/boards/generic_board.c

 

Is this the correct place to declare the resources for the pcmcia driver?

 

 

 

Thanks,

 

John R.

QuoteReplyEditDelete

 

 

2009-04-16 03:51:30     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 72729    >Is this the correct place to declare the resources for the pcmcia

driver?

 

I don't know - this depends - did you select generic board as you system

type.

Or do you use the BF561-EZKIT system type?

 

Can you explain what hardware you are using?

 

-Michael

 

 

QuoteReplyEditDelete

 

 

2009-04-17 03:54:09     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 72769   

 

We are using the BF561-EZKIT system type when compiling uClinux (however, we have a custom board with a BF561, which is mostly setup to be like the ezkit.)

 

We have two compact flash connectors on the board - one on ASYNC memory bank 1 and the other on ASYNC memory bank 2. The card detect  PFs being used are 24 & 25 and these are pulled high.

 

The 'ready PFs' are 12 for Compact Flash 1 and 45 for Compact Flash 2.

 

The 'wait PFs' are 13 for Compact Flash 1 and 46 for Compact Flash 2.

 

I realise the resource declaration for pcmcia driver should be in dist/linux-2.6.x/arch/blackfin/mach-bf561/boards/ezkit.c, but this does not seem to work. I know the driver's init function is being called, but the probe function is never being called.

 

Are my board resources correct?

 

#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)

static struct resource bfin_pcmcia_cf_resources[] = {

        {

                .start = 0x24000000, /* IO PORT */

                .end = 0x24002000,

                .flags = IORESOURCE_MEM,

        }, {

                .start = 0x24001000, /* Attribute Memory */

                .end = 0x24001FFF,

                .flags = IORESOURCE_MEM,

        }, {

                .start = IRQ_PF12,

                .end = IRQ_PF12,

                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

        }, {

                .start = 24, /* Card Detect PF24 */

                .end = 24,

                .flags = IORESOURCE_IRQ,

        },

};

 

static struct platform_device bfin_pcmcia_cf_device = {

        .name = "bfin_cf_pcmcia",

        .id = -1,

        .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),

        .resource = bfin_pcmcia_cf_resources,

};

#endif

 

 

Thanks in advance,

 

John R.

QuoteReplyEditDelete

 

 

2009-04-17 04:07:58     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 72772    >The 'ready PFs' are 12 for Compact Flash 1 and 45 for Compact Flash 2.

>The 'wait PFs' are 13 for Compact Flash 1 and 46 for Compact Flash 2.

 

I don't know what you mean here - the PCMCIA driver only cares about IRQ and CardDetect and some address mappings.

 

>I know the driver's

>init function is being called, but the probe function is never being called.

 

Did you put &bfin_pcmcia_cf_device into array ezkit_devices[] ???

You need to do that...

 

static struct platform_device *ezkit_devices[] __initdata = {

 

-- snip --

#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)

&bfin_pcmcia_cf_device,

#endif

 

-- snip --

 

>Are my board resources correct?

 

Only YOU or God may tell if this is correct

 

> {

 

> .start = 0x24000000, /* IO PORT */

 

> .end = 0x24002000,

 

> .flags = IORESOURCE_MEM,

 

> }, {

 

> .start = 0x24001000, /* Attribute Memory */

 

> .end = 0x24001FFF,

 

> .flags = IORESOURCE_MEM,

 

> }, {

 

> .start = IRQ_PF12,

 

> .end = IRQ_PF12,

 

> .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,

 

> }, {

 

 

QuoteReplyEditDelete

 

 

2009-04-17 06:53:58     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 72774   

 

Thanks, that's all I was missing... I didnt put &bfin_pcmcia_cf_device into array ezkit_devices.

 

QuoteReplyEditDelete

 

 

2009-04-17 06:59:53     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 72775    >Thanks, that's all I was missing... I didnt put &bfin_pcmcia_cf_device

into array ezkit_devices.

 

Good news.

 

I assume you know that you need some glue logic between Blackfin's

Async. Memory Bus and the CF Card socket, in order to make the PCCard IO

mode work?

 

Do you really need PCMCIA, or are you just interested in interfacing

memory cards?

Then I would recommend using the PATA IDE Platfrom driver, instead of

the PCMCIA + IDE Card Service driver.

 

PATA IDE Platfrom driver, allows you to utilize CF cards in TRUE IDE

Mode, as well as in Common Memory Mode without interrupt.

 

 

-Michael

 

 

QuoteReplyEditDelete

 

 

2009-04-20 04:50:28     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 72852   

 

Hi Michael, thanks for the support...

 

We are only interested in interfacing memory cards... our custom bf561 has 2 card sockets though, which might prove tricky some time soon. (Async bank 1 and 2)

 

I'm not really aware of the logic required between the Async bus and CF card socket, in order for the IO mode to work.

 

In fact, I am seeing some strange behaviour... When I boot uClinux, a message is printed when the driver's probe function is successfully called, but also printed is:

 

pccard: PCMCIA card inserted into slot 0

pcmcia: registering new device pcmcia0.0

 

 

However, there is no card present. Then when I actually insert a card, it says

 

pccard: card ejected from slot 0

 

John R.

QuoteReplyEditDelete

 

 

2009-04-20 07:07:46     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 72861    I guess its inverted logic in the card detect logic.

The PCMCIA driver targets the logic programmed into PLD on the CF-IDE-NAND Extender card.

 

Without some glue logic you won't be able to communicate with the CF Card in IO Mode.

 

Can you explain how you connected the CF Card to Blackfin's External Bus Interface Unit (EBIU)?

 

-Michael

 

 

QuoteReplyEditDelete

 

 

2009-04-20 11:13:51     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 72893   

 

Hi Michael,

 

Thanks again for your ongoing support and patience.  I've fixed the inverted logic problem by redefining the implementation of the bfin_cf_present function. Now the status of the card presence is correctly reported by the driver during boot up and when I insert and eject a CF card.

 

Our custom PCB has connected the CF memory card socket to the BF561's EBIU bus using Common Mode Memory Interfacing as per the Analog Devices document EE-196 as follows:

 

  www.analog.com/static/imported-files/application_notes/EE196.pdf

 

Now that I better understand the architecture, your previous comment concerns me:

 

"I assume you know that you need some glue logic between Blackfin's

Async. Memory Bus and the CF Card socket, in order to make the PCCard IO

mode work?"

 

Was your reference to "PCCard IO mode" comparable to "PC Card ATA using I/O mode"?  If so, given that our custom PCB uses "PC Card ATA using Common Memory Mode" then I assume that we do not need glue logic as support by EE-196?  You also mentioned:

 

"...I would recommend using the PATA IDE Platfrom driver, instead of the PCMCIA + IDE Card Service driver.  PATA IDE Platfrom driver, allows you to utilize CF cards in TRUE IDEMode, as well as in Common Memory Mode without interrupt."

 

No, we don't need explicit PCMCIA support, just CF memory card interfacing using Common Memory Mode without interrupt. Therefore, I have enabled the PATA platform driver support as per the menuconfig screenshot shown under "for new libata driver" on the following page:

 

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin_cf_pcmcia&s[]=pcmcia

 

I assume that the "new libata driver" is the same as the "PATA IDE Platfrom driver" you mentioned?  I also updated the platform resources in ezkit.c to hook in the PATA driver.  However, even though the PATA driver successfully loads as shown in the kernel log by:

 

pccard: PCMCIA card inserted into slot 0

pcmcia: registering new device pcmcia0.0

scsi0 : pata_pcmcia

ata1: PATA max PIO0 cmd 0x24000000 ctl 0x2400000e bmdma 0x00000000 irq 118

 

the /dev/sda1 device node is not created, ie the "ata1: PATA max..." line is the last entry in the log.  Could this problem now be related to the manner in which I declared the PATA resources?  The CF card is connected to EBUI Asynchronous bank 1, so whilst I know that the base address for this is 0x24000000, I'm not 100% sure what addresses should be declared in the platform resources - could you please advise?

 

#define PATA_INT        55

 

static struct pata_platform_info bfin_pata_platform_data = {

        .ioport_shift = 1,

        .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,

};

 

static struct resource bfin_pata_resources[] = { //Modified - JJR 20.04.09

        {

                .start = 0x24314020,

                .end = 0x2431403F,

                .flags = IORESOURCE_MEM,

        },

        {

                .start = 0x2431401C,

                .end = 0x2431401F,

                .flags = IORESOURCE_MEM,

        },

        {

                .start = PATA_INT,

                .end = PATA_INT,

                .flags = IORESOURCE_IRQ,

        },

};

 

static struct platform_device bfin_pata_device = {

        .name = "pata_platform",

        .id = -1,

        .num_resources = ARRAY_SIZE(bfin_pata_resources),

        .resource = bfin_pata_resources,

        .dev = {

                .platform_data = &bfin_pata_platform_data,

        }

};

 

 

Sorry for this post being so long - I have tried to describe all the facts for you to review in one pass.

 

Cheers,

John R

 

 

QuoteReplyEditDelete

 

 

2009-04-20 14:13:31     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Robin Getz (UNITED STATES)

Message: 72900   

 

John:

 

The rule of thumb is ignore all documents on analog.com, except for datasheets and HRMs. Most of the Blackfin Application/EE notes will not work in a Linux environment - and can be very misleading.

 

-Robin

QuoteReplyEditDelete

 

 

2009-04-21 07:27:59     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 72939    >Now that I better understand the architecture, your previous comment concerns me:

 

>"I assume you know that you need some glue logic between Blackfin's

 

>Async. Memory Bus and the CF Card socket, in order to make the PCCard IO

 

>mode work?"

 

>Was your reference to "PCCard IO mode" comparable to "PC Card ATA using I/O mode"? If so, given that

>our custom PCB uses "PC Card ATA using Common Memory Mode" then I assume that we do not need glue

>logic as support by EE-196?

 

 

The PCMCIA driver requires access to attribute memory and PCCard IO Space. PC Card IO uses dedicated Read and Write strobes /IORD and /IOWR.

These strobes are not connected in your setup described in EE-196.

 

So it's useless making the PCMCIA driver work.

You have to go for the Common Memory Mode, using the pata_platfrom driver.

  docs.blackfin.uclinux.org/doku.php?id=hw:cards:cf-ide-nand#cf_common_memory_example_using_pata_platform_driver

 

> You also mentioned:

>"...I would recommend using the PATA IDE Platfrom driver, instead of the PCMCIA + IDE Card Service

>driver. PATA IDE Platfrom driver, allows you to utilize CF cards in TRUE IDEMode, as well as in

>Common Memory Mode without interrupt."

 

>No, we don't need explicit PCMCIA support, just CF memory card interfacing using Common Memory Mode

>without interrupt. Therefore, I have enabled the PATA platform driver support as per the menuconfig

>screenshot shown under "for new libata driver" on the following page:

 

>  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin_cf_pcmcia&s[]=pcmcia

 

>I assume that the "new libata driver" is the same as the "PATA IDE Platfrom driver" you mentioned?

 

No -

Take a look here:

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:pata_platform

 

This is the one you need.

 

>CF card is connected to EBUI Asynchronous bank 1, so whilst I know that the base address for this is

>0x24000000, I'm not 100% sure what addresses should be declared in the platform resources - could you

>please advise?

 

Try to use this config below:

 

static struct pata_platform_info bfin_pata_platform_data = {

.ioport_shift = 0,

};

/* CompactFlash Storage Card Memory Mapped Adressing

* /REG = A11 = 1

*/

static struct resource bfin_pata_resources[] = {

{

.start = 0x24000800,

.end = 0x24000807,

.flags = IORESOURCE_MEM,

},

{

.start = 0x2400080E, /* Device Ctl */

.end = 0x2400080E,

.flags = IORESOURCE_MEM,

},

};

#endif

 

static struct platform_device bfin_pata_device = {

.name = "pata_platform",

.id = -1,

.num_resources = ARRAY_SIZE(bfin_pata_resources),

.resource = bfin_pata_resources,

.dev = {

.platform_data = &bfin_pata_platform_data,

}

};

 

-Michael

 

QuoteReplyEditDelete

 

 

2009-04-21 13:35:51     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73012   

 

Hi Michael, I tried to use the config you suggested, but I receive the following messages on kernel bootup:

 

pata_platform pata_platform: invalid number of resources

pata_platform: probe of pata_platform failed with error -22

 

I have removed the PCMCIA CF driver from the uClinux dist compile menuconfig.

 

Im going to read the 2x uClinux docs again later, so i'll post again if I find anything that could be wrong.

 

Any ideas why I would get those 2 error messages?

 

Thanks again,

John R.

QuoteReplyEditDelete

 

 

2009-04-21 13:58:56     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 73013    Are you sure that you have the platform config exactly like I posed?

Do you use svn trunk?

 

This error means that ARRAY_SIZE(bfin_pata_resources) does not match

what the driver expects.

 

-Michael

 

QuoteReplyEditDelete

 

 

2009-04-22 04:56:29     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73052   

 

The config I used was exactly as you suggested. I am not using the svn trunk, I'm still using 2008R1.5-RC3.

 

I noticed in other board configs, the pata resources declared are slightly different (they have 1 extra element):

 

/////////////// BF537 code from stamp.c ///////////////

#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)

#define PATA_INT        55

 

static struct pata_platform_info bfin_pata_platform_data = {

        .ioport_shift = 1,

        .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,

};

 

static struct resource bfin_pata_resources[] = {

        {

                .start = 0x20314020,

                .end = 0x2031403F,

                .flags = IORESOURCE_MEM,

        },

        {

                .start = 0x2031401C,

                .end = 0x2031401F,

                .flags = IORESOURCE_MEM,

        },

        {

                .start = PATA_INT,

                .end = PATA_INT,

                .flags = IORESOURCE_IRQ,

        },

};

 

static struct platform_device bfin_pata_device = {

        .name = "pata_platform",

        .id = -1,

        .num_resources = ARRAY_SIZE(bfin_pata_resources),

        .resource = bfin_pata_resources,

        .dev = {

                .platform_data = &bfin_pata_platform_data,

        }

};

#endif

 

 

Should I be using the 3rd element (        {

                                                                           .start = PATA_INT,

                                                                           .end = PATA_INT,

                                                                           .flags = IORESOURCE_IRQ,

                                                                         },       )

 

... and if so, what is PATA_INT ?

 

 

Cheers,

John R.

QuoteReplyEditDelete

 

 

2009-04-22 05:10:30     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 73053    This is why I asked if you using SVN trunk or not.

The pata_platfrom driver in 2008R1 required the CARD IDE IRQ, while the latest driver doesn't.

 

>Should I be using the 3rd element ( {

 

> .start = PATA_INT,

 

> .end = PATA_INT,

 

> .flags = IORESOURCE_IRQ,

 

> }, )

 

>... and if so, what is PATA_INT ?

 

PATA_INT is the Card IRQ - If I remember correctly there is no IDE IRQ in CF common memory mode available, since this pin is then called READY with a different function.

 

Update to our SVN trunk now, for development.

We're going to make the release shortly anyways.

 

-Michael

 

 

 

 

 

QuoteReplyEditDelete

 

 

2009-04-22 06:38:14     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73055   

 

Ok so I will get the SVN trunk.

 

Quick question though - I have never used the SVN trunk before - would it be more sensible to get only the pata_platform driver, or the entire uClinux dist from svn. Bearing in mind we already have our configs etc setup for the current dist.

 

If its just the driver, then how do you get hold of just that driver?

 

Thanks in advance

John R.

QuoteReplyEditDelete

 

 

2009-04-22 06:46:49     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 73056    For now - I would use svn trunk entirely.

Once we released 2009R1 (current svn trunk) I would move to the 2009R1

release branch.

 

I don't think it's possible to just get the updated pata_platfrom.c

file, since it also requires pieces in other files, belonging to the

driver stack.

 

-Michael

 

QuoteReplyEditDelete

 

 

2009-04-24 10:33:21     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73164   

 

I have built a separate dev environment for use with the svn trunk distribution & toolchain. It took a while to setup because there were lots of missing libraries

 

Anyway, I have managed to compile the uClinux using the pata / scsi config settings as described in the doc:

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:pata_platform

 

The pata driver resources have been setup as in your previous post, but we are still not seeing a card detected...

 

smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>

eth0: SMC91C11xFD (rev 2) at 2c010300 IRQ 82 [nowait]

eth0: Ethernet addr: 00:e0:22:22:22:22

Driver 'sd' needs updating - please use bus_type methods

Driver 'sr' needs updating - please use bus_type methods

scsi0 : pata_platform

ata1: PATA max PIO0 no IRQ, using PIO polling mmio cmd 0x24000800 ctl 0x2400080e

 

 

Is there anything I'm possibly forgetting? is the 'Driver 'sX' needs updating'  warning related to the pata driver?

 

Thanks in advance for any ideas,

John R.

QuoteReplyEditDelete

 

 

2009-04-24 11:04:25     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73166   

 

I have just recompiled the ezkit.c with pata driver resources:

 

#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)

 

static struct pata_platform_info bfin_pata_platform_data = {

        .ioport_shift = 1,

};

 

//static struct pata_platform_info bfin_pata_platform_data;

static struct resource bfin_pata_resources[] = {

        {

                .start = 0x24000800,

                .end = 0x24000807,

                .flags = IORESOURCE_MEM,

        },

        {

                .start = 0x2400080e, /*Device Ctl*/

                .end = 0x2400080e,

                .flags = IORESOURCE_MEM,

        },

};

 

static struct platform_device bfin_pata_device = {

        .name = "pata_platform",

        .id = -1,

        .num_resources = ARRAY_SIZE(bfin_pata_resources),

        .resource = bfin_pata_resources,

        .dev = {

                .platform_data = &bfin_pata_platform_data,

        }

};

 

#endif

 

I changed the ioport_shift to '1' from '0' because I noticed that in the AD Engineer-to-Engineer Notw EE-196 the register addresses on the async bank don't increment by 1 each time, but rather 2.

 

Interestingly I now get the following output:

 

Driver 'sd' needs updating - please use bus_type methods

Driver 'sr' needs updating - please use bus_type methods

scsi0 : pata_platform

ata1: PATA max PIO0 no IRQ, using PIO polling mmio cmd 0x24000800 ctl 0x2400080e

ata1.01: qc timeout (cmd 0xec)

ata1.01: failed to IDENTIFY (I/O error, err_mask=0x4)

ata1.01: qc timeout (cmd 0xec)

ata1.01: failed to IDENTIFY (I/O error, err_mask=0x4)

 

 

I'm not sure if this is the correct path to go down?

 

John R.

QuoteReplyEditDelete

 

 

2009-04-24 11:29:02     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 73168    Did you connect both /CE1 and /CE2 to /AMS1 ?

 

-Michael

 

 

QuoteReplyEditDelete

 

 

2009-04-24 11:35:47     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73169   

 

Yes, both CE1 and CE2 are connected to AMS1.

QuoteReplyEditDelete

 

 

2009-04-24 13:12:54     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Mike Frysinger (UNITED STATES)

Message: 73174   

 

you can ignore the "Driver 'sr' needs updating - please use bus_type methods" messages

QuoteReplyEditDelete

 

 

2009-04-27 04:17:59     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73272   

 

So should I be using 'ioport_shift' or is that behaviour just coincidence?

 

Michael -- How did you decide upon the resource addresses? Please could you give me a clue as to where you found that information for the bf561?

 

We do not know what to try next in order to interface with our CF card.

 

Cheers,

John R.

QuoteReplyEditDelete

 

 

2009-04-27 04:48:39     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 73273    >So should I be using 'ioport_shift' or is that behaviour just

coincidence?

 

I would say in your configuration ioport_shift = 0 is the right one.

However you would need to implement /CE1 /CE2 byte steering.

Take a look at CF spec. "Table 20: CompactFlash Storage Card Registers

and Memory Space Decoding"

 

You have wired /CE1 /CE2 together resulting in only 16-bit accesses.

I would connect:

Blackfin A1(aka ABE3) to CF_A0

Blackfin A2 to CF_A1

Blackfin A3 to CF_A2

Blackfin A4 to CF_A3

Blackfin A11 to CF_REG

 

And then use ioport_shift = 1.

 

>Michael -- How did you decide upon the resource addresses? Please could

you give me a clue as to

>where you found that information for the bf561?

 

My hint was based on the idea CF connected to AMS1 and CF_REG connected

to BF A11.

 

>We do not know what to try next in order to interface with our CF card.

 

Try above configuration.

 

-Michael

 

QuoteReplyEditDelete

 

 

2009-04-27 08:52:19     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

John Redford (UNITED KINGDOM)

Message: 73284   

 

On our custom PCB, the CF pins CE1 and CE2 are hardwired together to AMS1 and A0 is tied to ground, forcing us to use 16-bit accesses - this cannot be changed.

 

Hence, does the PATA platform driver support 16-bit accesses without modification? If not, could you please suggest what needs to be modified in the driver to support this?

 

Cheers,

John R.

 

 

QuoteReplyEditDelete

 

 

2009-04-27 10:11:01     Re: Compact Flash on a custom BF561 - problems using pcmcia driver

Michael Hennerich (GERMANY)

Message: 73290    John,

 

Two things:

 

1) The kernel makes 8-bit access to IDE registers except for the data register which is 16-bit.

2) The CF card in Common Memory mode uses /CE1 and /CE2 for byte steering.

 

If you wire /CE1 and /CE2 together and the kernel writes for example Cylinder Low REG it will also clear the Cylinder High REG by this access.

 

The code in EE-196 implicitly takes care of this by writing Cylinder Low REG and Cylinder High REG together. This is not how Linux it makes. And I'm afraid to say this can't be changed without major software changes.

 

You have two options:

 

1) If you like to use the CF card in Common memory mode:

 

Leave the Address strobe mapping as is.

 

But you need to qualify:

/CE1 with Blackfin ABE0 (and AMSx)

And

/CE2 with Blackfin ABE1 (and AMSx)

 

 

2) Interface the CF Card in True IDE Mode:

 

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:ide-blackfin

 

-Michael

Attachments

    Outcomes