2008-07-28 05:21:01 How to update IDE driver to pata?
Wei Jiang (CHINA)
Message: 59465
Dear all,
My uClinux version is 2008R1-released, hardware: bf561.
I have a SATA-harddisk, it can work with 08r1 and old IDE driver followed by this doc:
http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:ide-blackfin.
I want to update the driver with "PATA platform" working mode. I follow the PATA platform doc(http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:pata_platform) but failed.
My custom board also has a logic chip with the ide driver. Maybe the logic code should be changed too?
Did anyone sucess to drive a SATA harddisk with PATA platform? If so, please give me some advices.
Thanks to all.
Wei Jiang
QuoteReplyEditDelete
2008-07-28 05:41:25 Re: How to update IDE driver to pata?
Mike Frysinger (UNITED STATES)
Message: 59466
all of the PATA settings are in the boards file. the Blackfin chip on the cf-ide-nand card does not need any glue logic to tiddle the CPLD, so if you need something like that, you'll have to write your own PATA driver.
QuoteReplyEditDelete
2008-07-28 05:50:25 Re: How to update IDE driver to pata?
Sonic Zhang (CHINA)
Message: 59468
Are your logic chip compatibe with the NAND_CF_IDE daughter board from ADI? If yes, this pata platform driver should work. If not, you need to debug by yourself.
QuoteReplyEditDelete
2008-07-28 06:43:23 Re: How to update IDE driver to pata?
Wei Jiang (CHINA)
Message: 59476
Mike, we used the CPLD to "The CPLD is mainly used to perform address decoding, and to insert three additional bus setup cycles".
And the same logic works well in old IDE-driver, means my menuconfig with:
| | --- ATA/ATAPI/MFM/RLL support | |
| | (4) Max IDE interfaces (NEW) | |
| | <*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support | |
| | --- Please see Documentation/ide.txt for help/info on IDE drives | |
| | [*] Support for SATA (deprecated; conflicts with libata SATA driver) | |
| | <*> Include IDE/ATA-2 DISK support | |
| | [*] legacy /proc/ide/ support (NEW) | |
| | --- IDE chipset support/bugfixes | |
| | <*> generic/default IDE chipset support (NEW) | |
| | [*] IDE support on Blackfin CPU (DEPRECATED; see help) (NEW) | |
| | IDE Interface Address Mapping (see help) (Linear 16-bit mapping w| |
| | (0x28000040) IDE register base address (NEW) | |
| | (0x28000038) IDE register alternate address (NEW) | |
| | (120) IDE IRQ_PFx number (NEW) | |
| | (4) Address Stride / IDE GAP (NEW) | |
I won't how can I enable the PATA platform to drive my hard disk. I thought it should be OK as the old ide driver in "drivers/ide" works well.
Now my "dmesg" only show this two lines with no other information:
scsi0 : pata_platform
ata1: PATA max PIO0 mmio cmd 0x28000040 ctl 0x28000038 irq 120..
And no dev/sda* and no partitions in /etc/partitions..
QuoteReplyEditDelete
2008-07-28 06:59:08 Re: How to update IDE driver to pata?
Mike Frysinger (UNITED STATES)
Message: 59478
there is no kernel configuration anymore. all of the settings are in the board resources file. you can see the bf537-stamp for an example of working settings for the cf-ide-nand card. there shouldnt be any other differences.
QuoteReplyEditDelete
2008-07-28 07:14:14 Re: How to update IDE driver to pata?
Wei Jiang (CHINA)
Message: 59481
Dear Mike,
thanks for your reply.
Of course I add source in myboard.c as this:
#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
#define PATA_INT 120
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 = 0x28000040,
.end = 0x2800005F,
.flags = IORESOURCE_MEM,
},
{
.start = 0x28000038,
.end = 0x2800003F,
.flags = IORESOURCE_MEM,
},
{
.start = PATA_INT,
.end = PATA_INT,
.flags = IORESOURCE_IRQ, },
};
QuoteReplyEditDelete
2008-07-28 07:45:13 Re: How to update IDE driver to pata?
Mike Frysinger (UNITED STATES)
Message: 59486
do not use hardcoded numbers ... use the symbolic defines like we do in our bf537 -stamp
QuoteReplyEditDelete
2008-07-28 08:11:02 Re: How to update IDE driver to pata?
Wei Jiang (CHINA)
Message: 59491
Mike, do you mean the INT? It's IRQ_PF47(IRQ num = 120) according to our hardware.
Can bf537-stamp attch a SATA hard disk with a CompactFlash / IDE ATA / NAND Flash – Multifunction interface card?
Thank you for your kindly reply..
QuoteReplyEditDelete
2008-07-28 11:22:31 Re: How to update IDE driver to pata?
Mike Frysinger (UNITED STATES)
Message: 59496
if you're hooking up to PF47 on the Blackfin, then you should use IRQ_PF47 ... i'm not saying it will fix your troubles, but hardcoding to 120 may cause hard to find breakage in the future if the defined number changes
i imagine if you take a SATA drive and use the right kind of connector to use it in IDE mode, it'd work ...
QuoteReplyEditDelete
2008-07-28 22:30:26 Re: How to update IDE driver to pata?
Wei Jiang (CHINA)
Message: 59501
Dear Mike and sonic:
Thank you so much for your kindly reply.
Now My hard disk works! I read the old ide driver again ang found I set the wrong ioport_shift. It should be 2 not 1 according to my hardware.
I can read and write my hard disk now, but still seems something wrong. It wait a long period when boot the kernrl, and show some infomartion include "fail". just this:
scsi0 : pata_platform
ata1: PATA max PIO0 mmio cmd 0x28000040 ctl 0x28000038 irq 120
---wait too long about 10 secs
ata1.00: qc timeout (cmd 0x27)
ata1.00: failed to read native max address (err_mask=0x4)
ata1.00: HPA support seems broken, will skip HPA handling
ata1: failed to recover some devices, retrying in 5 secs
ata1.00: configured for PIO
scsi 0:0:0:0: Direct-Access ATA Hitachi HTS54251 BB2O PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0.
I will try to fix this problems. As this is the first time I meet the pata_platform driver, if you have suggestions, please tell me.
Thanks again! Sorry for my pool English, hahaha:)
Wei Jiang
QuoteReplyEditDelete
2009-05-14 09:47:27 Re: How to update IDE driver to pata?
Konstantin Hartwich (GERMANY)
Message: 74068
hi
what kind of controller did you use to interface to your SATA harddisk?
greets