[U-Boot-Users] Problems on IDE

Rodolfo Giometti giometti at enneenne.com
Tue Mar 25 18:50:38 CET 2008


Hello,

on my custom board (PXA270) I have an IDE bus on DoM (mapped at
0x14400000) and an IDE bus on PCMCIA/CF (mapped at 0x20000000).

The DoM works while CF not. Here my output (please, note that I
modified a bit the cmd_ide code in order to remove a device from
Standby Mode):

equantum> pinit on
CF Card CFA 128MB CHH 5.0
            Fixed Disk Card
            IDE interface 
            [silicon] [unique] [single] [sleep] [standby] [idle] [low power]
equantum> ide reset

Reset IDE: Bus 0: ide_outb (dev= 0, port= 0x1f6, val= 0xe0) : @ 0x144003ec
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0x50
OK Bus 1: ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x200001f6
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x51
OK 
  Device 0: ide_outb (dev= 0, port= 0x1f6, val= 0xe0) : @ 0x144003ec
ide_inb (dev= 0, port= 0x1f2) : @ 0x144003e4 -> 0x01
ide_inb (dev= 0, port= 0x1f3) : @ 0x144003e6 -> 0x01
ide_inb (dev= 0, port= 0x1f4) : @ 0x144003e8 -> 0x00
ide_outb (dev= 0, port= 0x1f7, val= 0xec) : @ 0x144003ee
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0xd0
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0x58
in input data base for read is 144001f0
Model: PQI IDE DiskOnModule Firm: N050316D Ser#: OD4M0G000015
            Type: Hard Disk
            Capacity: 499.5 MB = 0.4 GB (1023120 x 512)
ide_read dev 0 start 0, blocks 1 buffer at A2EFF91C
ide_outb (dev= 0, port= 0x1f6, val= 0xe0) : @ 0x144003ec
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0x50
ide_outb (dev= 0, port= 0x1f7, val= 0xe5) : @ 0x144003ee
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0x50
ide_inb (dev= 0, port= 0x1f2) : @ 0x144003e4 -> 0xff
Powersaving FF
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0x50
ide_outb (dev= 0, port= 0x1f2, val= 0x01) : @ 0x144003e4
ide_outb (dev= 0, port= 0x1f3, val= 0x00) : @ 0x144003e6
ide_outb (dev= 0, port= 0x1f4, val= 0x00) : @ 0x144003e8
ide_outb (dev= 0, port= 0x1f5, val= 0x00) : @ 0x144003ea
ide_outb (dev= 0, port= 0x1f6, val= 0xe0) : @ 0x144003ec
ide_outb (dev= 0, port= 0x1f7, val= 0x20) : @ 0x144003ee
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0xd0
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0x58
in input data base for read is 144001f0
ide_inb (dev= 0, port= 0x1f7) : @ 0x144003ee -> 0x50
  Device 1: ide_outb (dev= 1, port= 0x1f6, val= 0xf0) : @ 0x144001f6
ide_inb (dev= 1, port= 0x1f2) : @ 0x144001f2 -> 0x00
ide_outb (dev= 1, port= 0x1f7, val= 0xec) : @ 0x144001f7
ide_inb (dev= 1, port= 0x1f7) : @ 0x144001f7 -> 0x00
Retrying...
ide_outb (dev= 1, port= 0x1f6, val= 0xf0) : @ 0x144001f6
ide_outb (dev= 1, port= 0x1f7, val= 0x08) : @ 0x144001f7
ide_outb (dev= 1, port= 0x1f6, val= 0xf0) : @ 0x144001f6
ide_inb (dev= 1, port= 0x1f2) : @ 0x144001f2 -> 0x00
ide_outb (dev= 1, port= 0x1f7, val= 0xec) : @ 0x144001f7
ide_inb (dev= 1, port= 0x1f7) : @ 0x144001f7 -> 0x00
Retrying...
ide_outb (dev= 1, port= 0x1f6, val= 0xf0) : @ 0x144001f6
ide_outb (dev= 1, port= 0x1f7, val= 0x08) : @ 0x144001f7
ide_outb (dev= 1, port= 0x1f6, val= 0xf0) : @ 0x144001f6
not available
  Device 2: ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x200001f6
ide_inb (dev= 2, port= 0x1f2) : @ 0x200001f2 -> 0x01
ide_inb (dev= 2, port= 0x1f3) : @ 0x200001f3 -> 0x01
ide_inb (dev= 2, port= 0x1f4) : @ 0x200001f4 -> 0x00
ide_outb (dev= 2, port= 0x1f7, val= 0xec) : @ 0x200001f7
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0xd0
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x58
in input data base for read is 200001f0
Model: 128MB CHH  Firm: Rev 1.00 Ser#: 0524700CA802470033
            Type: Removable Hard Disk
            Capacity: 122.2 MB = 0.1 GB (250368 x 512)
ide_read dev 2 start 0, blocks 1 buffer at A2EFF91C
ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x200001f6
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0xd0
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x51
ide_outb (dev= 2, port= 0x1f7, val= 0xe5) : @ 0x200001f7
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0xd0
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x50
ide_inb (dev= 2, port= 0x1f2) : @ 0x200001f2 -> 0x00
Powersaving 00
ide_outb (dev= 2, port= 0x1f7, val= 0xe3) : @ 0x200001f7
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0xd0
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x50
ide_outb (dev= 2, port= 0x1f7, val= 0xe5) : @ 0x200001f7
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x50
ide_inb (dev= 2, port= 0x1f2) : @ 0x200001f2 -> 0xff
Powersaving FF
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x50
ide_outb (dev= 2, port= 0x1f2, val= 0x01) : @ 0x200001f2
ide_outb (dev= 2, port= 0x1f3, val= 0x00) : @ 0x200001f3
ide_outb (dev= 2, port= 0x1f4, val= 0x00) : @ 0x200001f4
ide_outb (dev= 2, port= 0x1f5, val= 0x00) : @ 0x200001f5
ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x200001f6
ide_outb (dev= 2, port= 0x1f7, val= 0x20) : @ 0x200001f7
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0xd0
ide_inb (dev= 2, port= 0x1f7) : @ 0x200001f7 -> 0x51
ide_inb (dev= 2, port= 0x1f1) : @ 0x200001f1 -> 0x10
Error (no IRQ) dev 2 blk 0: status 0x51/0x10
  Device 3: ide_outb (dev= 3, port= 0x1f6, val= 0xf0) : @ 0x200001f6
ide_inb (dev= 3, port= 0x1f2) : @ 0x200001f2 -> 0x00
ide_outb (dev= 3, port= 0x1f7, val= 0xec) : @ 0x200001f7
ide_inb (dev= 3, port= 0x1f7) : @ 0x200001f7 -> 0xd0
ide_inb (dev= 3, port= 0x1f7) : @ 0x200001f7 -> 0x58
in input data base for read is 200001f0
Model: 128MB CHH  Firm: Rev 1.00 Ser#: 0524700CA802470033
            Type: Removable Hard Disk
            Capacity: 122.2 MB = 0.1 GB (250368 x 512)
ide_read dev 3 start 0, blocks 1 buffer at A2EFF91C
ide_outb (dev= 3, port= 0x1f6, val= 0xf0) : @ 0x200001f6
ide_inb (dev= 3, port= 0x1f7) : @ 0x200001f7 -> 0x00
ide_outb (dev= 3, port= 0x1f7, val= 0xe5) : @ 0x200001f7
ide_inb (dev= 3, port= 0x1f7) : @ 0x200001f7 -> 0x50
ide_inb (dev= 3, port= 0x1f2) : @ 0x200001f2 -> 0xff
Powersaving FF
ide_inb (dev= 3, port= 0x1f7) : @ 0x200001f7 -> 0x50
ide_outb (dev= 3, port= 0x1f2, val= 0x01) : @ 0x200001f2
ide_outb (dev= 3, port= 0x1f3, val= 0x00) : @ 0x200001f3
ide_outb (dev= 3, port= 0x1f4, val= 0x00) : @ 0x200001f4
ide_outb (dev= 3, port= 0x1f5, val= 0x00) : @ 0x200001f5
ide_outb (dev= 3, port= 0x1f6, val= 0xf0) : @ 0x200001f6
ide_outb (dev= 3, port= 0x1f7, val= 0x20) : @ 0x200001f7
ide_inb (dev= 3, port= 0x1f7) : @ 0x200001f7 -> 0xd0
ide_inb (dev= 3, port= 0x1f7) : @ 0x200001f7 -> 0x51
ide_inb (dev= 3, port= 0x1f1) : @ 0x200001f1 -> 0x10
Error (no IRQ) dev 3 blk 0: status 0x51/0x10

As you can see device 0 is correctly recognized, device 1 is not
present, and device 2 doesn't work while device 3, which is not
present, gives answers similar to device 2!

Device 2 is recognized but when the system tries to read the first
sector it gets an error!

Note also that on Linux the CF works correctly, so the PCMCIA memory
settings should be ok.

Here my board configuration:

#define CONFIG_PXA_PCMCIA 1
#define CONFIG_PXA_IDE 1

#define CFG_IDE_MAXBUS          2
#define CFG_IDE_MAXDEVICE       4

#define CONFIG_PCMCIA_SLOT_A 1  /* just to keep build system happy */

#define CFG_PCMCIA_MEM_ADDR     0x28000000
#define CFG_PCMCIA_MEM_SIZE     0x04000000

/* Memory configuration */
#define CFG_MECR_VAL            0x00000002
#define CFG_MCMEM0_VAL          0x00010504
#define CFG_MCMEM1_VAL          0x00014511
#define CFG_MCATT0_VAL          0x00010504
#define CFG_MCATT1_VAL          0x00014511
#define CFG_MCIO0_VAL           0x00004715
#define CFG_MCIO1_VAL           0x00014511

#define CFG_ATA_BASE_ADDR       0x14000000
#define CFG_ATA_IDE0_OFFSET     0x00400000      /* for the DOM */
#define CFG_ATA_IDE1_OFFSET     0x0c000000      /* for the PCMCIA */

/* IDE device 0 is accessed at 16-bit only (A0 is not used)
 * while device 1 is accessed at 8-bit
 */
#define CFG_ATA_PORT_ADDR(dev, port)    (((dev) < 1) ? ((port) << 1) : (port))

/* Offset for data I/O */
#define CFG_ATA_DATA_OFFSET     0x1f0

/* Offset for normal register accesses */
#define CFG_ATA_REG_OFFSET      0x1f0

/* Offset for alternate registers */
#define CFG_ATA_ALT_OFFSET      0x3f0

/* We have ATAPI support */
#define CONFIG_ATAPI 1

Does someone know what's wrong?

Thanks,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127




More information about the U-Boot mailing list