All of lore.kernel.org
 help / color / mirror / Atom feed
* Issues to access Compact Flash Card on MPC8360E
       [not found] <AANLkTi=ke8Yiy39dONFkMPpm5H8vhRy1jVyaKLuG8r4e@mail.gmail.com>
@ 2010-08-02 12:38 ` Atul Deshmukh
  2010-08-02 13:48   ` Anton Vorontsov
  0 siblings, 1 reply; 5+ messages in thread
From: Atul Deshmukh @ 2010-08-02 12:38 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]

Hi,

I would like to have your expert opinion on one of our design issue to
access the Compact Flash on MPC8360E.

I'm building an embedded system that will access Compact Flash card on
MPC8360E through local bus and not through PCMCIA.

The issue is how to access the CF card i.e. whether in memory mapped/io
mapped/True IDE mode?

Following are some concerned points...

1: If we use PC-Card ATA memory mapped mode then we have to stick with
PCMCIA specs and we also need PCMCIA bus on our board and have to use 'CF to
PCMCIA adapter'. But I don't have that much space on the board.So how can I
use CF card in PC-Card ATA memory mapped mode without using adapter and what
kernel drivers we can use for that?

2: The second approach is to use True IDE but in this case also we need IDE
socket.
Can we use CF card using its own 50 pin connector only without using any
adapter.What drivers we can use for True-IDE mode?



I read the CF specs and digged into kernel code for drivers and came up with
some findings which could be right or wrong..
Pls put on your thoughts on it and correct me if i'm wrong.

1: To access CF card in "PC-Card ATA memory mapped/IO mapped" mode we have
to use PCMCIA subsystem of kernel where we can use low level socket driver
that do resource windows allocation and other low level operations. We also
have to use linux provided Card Services (linux-kernel-source/drivers/
pcmcia/cs.c) and Driver Services (linux-kernel-source/drivers/pcmcia/ds.c)
but we have to write our own client driver and application driver to access
those serives.....Am I going right way????

2: To access CF card in True IDE mode we have to use
"linux-kernel-source/drivers/ata/pata_platform.c" and
"linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??

Your suggestions would be really helpful....



-- 
Regards,
Atul

[-- Attachment #2: Type: text/html, Size: 2089 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Issues to access Compact Flash Card on MPC8360E
  2010-08-02 12:38 ` Issues to access Compact Flash Card on MPC8360E Atul Deshmukh
@ 2010-08-02 13:48   ` Anton Vorontsov
  2010-08-02 14:14     ` Atul Deshmukh
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Vorontsov @ 2010-08-02 13:48 UTC (permalink / raw)
  To: Atul Deshmukh; +Cc: linuxppc-dev

On Mon, Aug 02, 2010 at 06:08:14PM +0530, Atul Deshmukh wrote:
[...]
> 2: To access CF card in True IDE mode we have to use
> "linux-kernel-source/drivers/ata/pata_platform.c" and
> "linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??

CF IDE support was already implemented for MPC8349EmITX boards
with a bit of help from UPM (User-Programmable Machine), so
you can do the same for MPC8360.

UPM is programmed in U-Boot, u-boot/include/configs/MPC8349ITX.h
(CONFIG_SYS_BR3_PRELIM stuff), and
u-boot/board/freescale/mpc8349itx/mpc8349itx.c (UPMATable).

For linux part, see arch/powerpc/boot/dts/mpc8349emitx.dts (pata
node), and drivers/ata/pata_of_platform.c.

For HW side, you can find MPC8349EmITX schematics on Freescale
site (last time I checked, no registration was required).

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Issues to access Compact Flash Card on MPC8360E
  2010-08-02 13:48   ` Anton Vorontsov
@ 2010-08-02 14:14     ` Atul Deshmukh
  2010-08-02 17:59       ` Anton Vorontsov
  0 siblings, 1 reply; 5+ messages in thread
From: Atul Deshmukh @ 2010-08-02 14:14 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 3256 bytes --]

Thanks a lot Anton,
>From the dts entry given below,

localbus@e0005000 {
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L251>
         #address-cells = <2>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L252>
               #size-cells = <1>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L253>
               compatible = "fsl,mpc8349e-localbus",
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L254>
                            "fsl,pq2pro-localbus";
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L255>
               reg = <0xe0005000 0xd8>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L256>
               ranges = <0x3 0x0 0xf0000000 0x210>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L257>
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L258>
               pata@3,0 {
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L259>
                       compatible = "fsl,mpc8349emitx-pata",
"ata-generic";
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L260>
                       reg = <0x3 0x0 0x10 0x3 0x20c 0x4>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L261>
                       reg-shift = <1>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L262>
                       pio-mode = <6>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L263>
                       interrupts = <23 0x8>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L264>
                      interrupt-parent = <&ipic>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L265>
               };
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L266>
       };


we can conclude that it uses ata-generic SATA/PATA controlelr driver which
controls PCI-based IDE-controller where we can plug in our CF card...Am I
right???
But in our design we don't use any controller we directly connects CF card
to local bus where UPM controls it..
Can you please explain how the interface is implemented in MPC8349..



On Mon, Aug 2, 2010 at 7:18 PM, linuxppc-dev@lists.ozlabs.org wrote:

> On Mon, Aug 02, 2010 at 06:08:14PM +0530, Atul Deshmukh wrote:
> [...]
> > 2: To access CF card in True IDE mode we have to use
> > "linux-kernel-source/drivers/ata/pata_platform.c" and
> > "linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??
>
> CF IDE support was already implemented for MPC8349EmITX boards
> with a bit of help from UPM (User-Programmable Machine), so
> you can do the same for MPC8360.
>
> UPM is programmed in U-Boot, u-boot/include/configs/MPC8349ITX.h
> (CONFIG_SYS_BR3_PRELIM stuff), and
> u-boot/board/freescale/mpc8349itx/mpc8349itx.c (UPMATable).
>
> For linux part, see arch/powerpc/boot/dts/mpc8349emitx.dts (pata
> node), and drivers/ata/pata_of_platform.c.
>
> For HW side, you can find MPC8349EmITX schematics on Freescale
> site (last time I checked, no registration was required).
>
> --
> Anton Vorontsov
> email: cbouatmailru@gmail.com
> irc://irc.freenode.net/bd2
>



-- 
Regards,
Atul

[-- Attachment #2: Type: text/html, Size: 4886 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Issues to access Compact Flash Card on MPC8360E
  2010-08-02 14:14     ` Atul Deshmukh
@ 2010-08-02 17:59       ` Anton Vorontsov
  2010-08-03 10:11         ` Atul Deshmukh
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Vorontsov @ 2010-08-02 17:59 UTC (permalink / raw)
  To: Atul Deshmukh; +Cc: linuxppc-dev

On Mon, Aug 02, 2010 at 07:44:22PM +0530, Atul Deshmukh wrote:
> Thanks a lot Anton,
> From the dts entry given below,
> 
> localbus@e0005000 {
>          #address-cells = <2>;
>                #size-cells = <1>;
>                compatible = "fsl,mpc8349e-localbus",
>                             "fsl,pq2pro-localbus";
>                reg = <0xe0005000 0xd8>;
>                ranges = <0x3 0x0 0xf0000000 0x210>;
>                pata@3,0 {
>                        compatible = "fsl,mpc8349emitx-pata",
> "ata-generic";
>                        reg = <0x3 0x0 0x10 0x3 0x20c 0x4>;
>                        reg-shift = <1>;
>                        pio-mode = <6>;
>                        interrupts = <23 0x8>;
>                       interrupt-parent = <&ipic>;
>                };
>        };
> 
> 
> we can conclude that it uses ata-generic SATA/PATA controlelr driver which

How did you come to this conclusion? From the node above it's IMHO
pretty clear that IDE (PATA) is on the localbus.

The driver is drivers/ata/pata_of_platform.c.

> controls PCI-based IDE-controller where we can plug in our CF card...Am I
> right???

Nope, no PCI involved. CF is almost* directly connected to
the localbus.

> But in our design we don't use any controller we directly connects CF card
> to local bus where UPM controls it..

Yes, that's exactly how CF is done on MPC8349EmITX boards.

> Can you please explain how the interface is implemented in MPC8349..

Via localbus + UPM.

* 'almost' is because there are some buffers and inverters, see
  schematics:
  http://www.freescale.com/files/32bit/hardware_tools/schematics/MPC8349EMITXESCH.pdf

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Issues to access Compact Flash Card on MPC8360E
  2010-08-02 17:59       ` Anton Vorontsov
@ 2010-08-03 10:11         ` Atul Deshmukh
  0 siblings, 0 replies; 5+ messages in thread
From: Atul Deshmukh @ 2010-08-03 10:11 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]

Thanks a lot Anton,

I was confused with "ata-generic" entry at pata@3.0 node.
Now the things are pretty much clear..
Earlier we thought that IORD and IOWR pins would be from GPIO, so thought
had to do bit-banging. But after going through the schematics, we come to
know that pins could be from LGPL0/1.

On Mon, Aug 2, 2010 at 11:29 PM, Anton Vorontsov <cbouatmailru@gmail.com>wrote:

> On Mon, Aug 02, 2010 at 07:44:22PM +0530, Atul Deshmukh wrote:
> > Thanks a lot Anton,
> > From the dts entry given below,
> >
> > localbus@e0005000 {
> >          #address-cells = <2>;
> >                #size-cells = <1>;
> >                compatible = "fsl,mpc8349e-localbus",
> >                             "fsl,pq2pro-localbus";
> >                reg = <0xe0005000 0xd8>;
> >                ranges = <0x3 0x0 0xf0000000 0x210>;
> >                pata@3,0 {
> >                        compatible = "fsl,mpc8349emitx-pata",
> > "ata-generic";
> >                        reg = <0x3 0x0 0x10 0x3 0x20c 0x4>;
> >                        reg-shift = <1>;
> >                        pio-mode = <6>;
> >                        interrupts = <23 0x8>;
> >                       interrupt-parent = <&ipic>;
> >                };
> >        };
> >
> >
> The driver is drivers/ata/pata_of_platform.c.
>
> > controls PCI-based IDE-controller where we can plug in our CF card...Am I
> > right???
>
> Nope, no PCI involved. CF is almost* directly connected to
> the localbus.
>
> > But in our design we don't use any controller we directly connects CF
> card
> > to local bus where UPM controls it..
>
> Yes, that's exactly how CF is done on MPC8349EmITX boards.
>
> > Can you please explain how the interface is implemented in MPC8349..
>
> Via localbus + UPM.
>
> * 'almost' is because there are some buffers and inverters, see
>  schematics:
>
> http://www.freescale.com/files/32bit/hardware_tools/schematics/MPC8349EMITXESCH.pdf
>
> --
> Anton Vorontsov
> email: cbouatmailru@gmail.com
> irc://irc.freenode.net/bd2
>



-- 
Regards,
Atul

[-- Attachment #2: Type: text/html, Size: 3067 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-03 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AANLkTi=ke8Yiy39dONFkMPpm5H8vhRy1jVyaKLuG8r4e@mail.gmail.com>
2010-08-02 12:38 ` Issues to access Compact Flash Card on MPC8360E Atul Deshmukh
2010-08-02 13:48   ` Anton Vorontsov
2010-08-02 14:14     ` Atul Deshmukh
2010-08-02 17:59       ` Anton Vorontsov
2010-08-03 10:11         ` Atul Deshmukh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.