linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Can not get PATA to work for Compact Flash with 2.6.28 kernel
@ 2009-01-30 22:23 Lixin Yao
  2009-02-02 14:59 ` Steven A. Falco
  0 siblings, 1 reply; 9+ messages in thread
From: Lixin Yao @ 2009-01-30 22:23 UTC (permalink / raw)
  To: linuxppc-dev

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

I use a San Disk compact flash (CF) card on a board with MPC8248
processor. The CF is connected to data and address bus of the processor
and operates in TRUE IDE mode. The registers are memory mapped. I can
read the file system on the CF in u-boot (1.3.4). U-boot can identify
the CF and mount file system correctly.

The hardware is known good hardware.

I use 2.6.28 kernel and configured support for PATA for the CF.

Here is the setup in DTS file:

localbus@f0010100 {
#address-cells = <2>;
#size-cells = <1>;
compatible = "fsl,mpc8248-localbus",
"fsl,pq2-localbus",
"simple-bus";
reg = <0xf0010100 0x40>;
ranges = <0x3 0x0 0x30000000 0x10000
0x4 0x0 0x40000000 0x10000>;

pata@3,0 {
compatible = "fsl,tr5000v2-pata", "ata-generic";
reg = <0x3 0x0 0x10 0x4 0x0 0x10>;
reg-shift = <1>;
pio-mode = <3>;
// interrupts = <23 0x8>;
// interrupt-parent = <&PIC>;
};
};


Here are some of the related CONFIG items:
#
# UBI - Unsorted block images
#
# CONFIG_MTD_UBI is not set
CONFIG_OF_DEVICE=y
CONFIG_OF_I2C=y
CONFIG_OF_SPI=y
CONFIG_OF_GPIO=y
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_BLK_DEV_HD is not set
# CONFIG_MISC_DEVICES is not set
#CONFIG_HAVE_IDE=y
#CONFIG_IDE=y

#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y
CONFIG_ATA=y
CONFIG_ATA_SFF=y
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y

Here is the output at console:

Kernel command line: console=ttyCPM0,38400 root=/dev/nfs rw
nfsroot=10.15.34.196
:/home/lyao01/work/target_idu_nccv3
ip=172.20.16.150:10.15.34.196:172.20.16.1:25
5.255.255.0:tr5000v2:eth0ff
......
NET: Registered protocol family 16
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NTFS driver 2.1.29 [Flags: R/O].
msgmni has been set to 119
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered (default)
f0011a80.serial: ttyCPM0 at MMIO 0xc500ea80 (irq = 16) is a CPM UART
brd: module loaded
loop: module loaded
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
eth0: fs_enet: 00:00:c3:ff:7a:af
CPM2 Bitbanged MII: probed
ata_host_alloc: ENTER
ata_port_alloc: ENTER
__ata_port_freeze: ata4294967295 port frozen
scsi0 : pata_platform
ata1: PATA max PIO3 no IRQ, using PIO polling mmio cmd 0x30000000 ctl
0x40000000
ata_host_register: probe begin
ata_port_schedule_eh: port EH scheduled
ata_scsi_error: ENTER
ata_port_flush_task: ENTER
ata_eh_link_autopsy: ENTER
ata_eh_recover: ENTER
__ata_port_freeze: ata1 port frozen
ata_sff_softreset: ENTER
ata_sff_softreset: about to softreset, devmask=0
ata_bus_softreset: ata1: bus reset via SRST
ata_sff_softreset: EXIT, classes[0]=9 [1]=9
ata_eh_thaw_port: ata1 port thawed
ata_std_postreset: ENTER
ata_std_postreset: EXIT
ata_sff_postreset: EXIT, no device
ata_eh_revalidate_and_attach: ENTER
ata_eh_recover: EXIT, rc=0
ata_scsi_error: EXIT
ata_host_register: host probe begin
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
ics1893_config_init() successful
ADDRCONF(NETDEV_UP): eth0: link is not ready
ics1893_config_init() successful
IP-Config: Complete:
device=eth0, addr=172.20.16.150, mask=255.255.255.0, gw=172.20.16.1,
host=tr5000v2, domain=, nis-domain=(none),
bootserver=10.15.34.196, rootserver=10.15.34.196, rootpath=
Looking up port of RPC 100003/2 on 10.15.34.196
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Looking up port of RPC 100005/1 on 10.15.34.196
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 164k init
### Application running ...
#


The San Disk Compact Flash is not discovered.

I appreciate any insights or suggestions.

Lixin Yao
Harris Stratex Networks Inc
RTP, North Carolina, USA


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

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Can not get PATA to work for Compact Flash with 2.6.28 kernel
@ 2009-02-02 20:14 Aaron Pace
  0 siblings, 0 replies; 9+ messages in thread
From: Aaron Pace @ 2009-02-02 20:14 UTC (permalink / raw)
  To: linuxppc-dev, Lixin.Yao

>
> I use a San Disk compact flash (CF) card on a board with MPC8248
> processor. The CF is connected to data and address bus of the processor
> and operates in TRUE IDE mode. The registers are memory mapped. I can
> read the file system on the CF in u-boot (1.3.4). U-boot can identify
> the CF and mount file system correctly.
<snip>

I have just gone through solving a problem that sounds very similar
(using several flash cards).
We also have a flash card wired up in true IDE mode.  The problem that
I ran into is that any time the Interrupt Enable (bit 1) or Software
Reset(bit 2) bits were set in the control register, the flash would
show an error in the status register (bit 0), and was not recoverable
except by toggling the power to the card.
To work around this, write a driver based on the PATA driver, but
replace (or at least examine) each and every element of the
ata_port_operations struct you are using, replacing any function which
soft resets or enables interrupts.

> ata_host_alloc: ENTER
> ata_port_alloc: ENTER
> __ata_port_freeze: ata4294967295 port frozen
> scsi0 : pata_platform
> ata1: PATA max PIO3 no IRQ, using PIO polling mmio cmd 0x30000000 ctl
> 0x40000000
> ata_host_register: probe begin
> ata_port_schedule_eh: port EH scheduled
> ata_scsi_error: ENTER
> ata_port_flush_task: ENTER
> ata_eh_link_autopsy: ENTER
> ata_eh_recover: ENTER
> __ata_port_freeze: ata1 port frozen
> ata_sff_softreset: ENTER
> ata_sff_softreset: about to softreset, devmask=0
> ata_bus_softreset: ata1: bus reset via SRST
> ata_sff_softreset: EXIT, classes[0]=9 [1]=9
> ata_eh_thaw_port: ata1 port thawed
> ata_std_postreset: ENTER
> ata_std_postreset: EXIT
> ata_sff_postreset: EXIT, no device
> ata_eh_revalidate_and_attach: ENTER
> ata_eh_recover: EXIT, rc=0
> ata_scsi_error: EXIT

The above sequence of ATA calls you are seeing is essentially
identical to what I ran into -- part of the registration attempted to
either enable interrupts or soft reset the card, the error bit stuck
high, and everything went downhill from there.
Hope that helps.

-Aaron Pace

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

end of thread, other threads:[~2009-02-04 14:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30 22:23 Can not get PATA to work for Compact Flash with 2.6.28 kernel Lixin Yao
2009-02-02 14:59 ` Steven A. Falco
2009-02-02 15:52   ` Lixin Yao
2009-02-02 16:37     ` Steven A. Falco
2009-02-02 20:39       ` Lixin Yao
2009-02-02 21:51         ` Steven A. Falco
2009-02-02 22:00           ` Lixin Yao
2009-02-04 14:26             ` Steven A. Falco
  -- strict thread matches above, loose matches on Subject: below --
2009-02-02 20:14 Aaron Pace

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).