Subject: RE: IDE driver problem

From: "Liu Hongming (Alan)" <[email-masked]>
Date: Wed, 25 Feb 2004 20:11:54 +0800

Thanks for your tips.

I have found out where the problem is. Since my hardware has
endian issue, fs/partition/msdos.c could not handle partition table
correctly. I have changed a little(still having much to change),and it 
really works now.

-----Original Message-----
From: Alan Cox [mailto:[email-masked]]
Sent: Wednesday, February 25, 2004 6:10 AM
To: Liu Hongming (Alan)
Cc: [email-masked]
Subject: Re: IDE driver problem

On Maw, 2004-02-24 at 05:09, Liu Hongming (Alan) wrote:
> Hi All,
> 
> I am porting IDE drivers(Since my hardware has endian issue),
> and now it could work,however it has some abnormal problems:

Sounds like your partition data reading is wrong. Print out the
partition table bases and see if they are all zero

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 25 Feb 2004 18:13:15 +0100

> correctly. I have changed a little(still having much to change),and it 

I'm not sure what you call endian issue here.  The PC style partition
table code we've used for years on big endian systems without problems.

  Ralf

---

From: Geert Uytterhoeven <[email-masked]>
Date: Wed, 25 Feb 2004 18:38:17 +0100 (MET)

> table code we've used for years on big endian systems without problems.

I guess his hardware has a byteswapped IDE bus, like on Atari, Q40/Q60 and
Tivo.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email-masked]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 25 Feb 2004 19:16:45 +0100

> I guess his hardware has a byteswapped IDE bus, like on Atari, Q40/Q60 and

Oh, those.  I fear every possible way to hookup the IDE bus in a more or
particularly less intelligent way to a system has already been found out
there ...

  Ralf

---

From: Alan Cox <[email-masked]>
Date: Wed, 25 Feb 2004 21:47:35 +0000

> particularly less intelligent way to a system has already been found out

You would be suprised. You can do PIO IDE on just about anything. I
think the most grotesque I've seen is bitbanged IDE PIO on GPIO ports

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 25 Feb 2004 22:53:10 +0100

> think the most grotesque I've seen is bitbanged IDE PIO on GPIO ports

And I thought the ISA bus accessible only through an address / data
register pair was gross ;-)

  Ralf

---

From: Atsushi Nemoto <[email-masked]>
Date: Thu, 26 Feb 2004 11:08:08 +0900 (JST)

>>>>> On Wed, 25 Feb 2004 19:16:45 +0100, Ralf Baechle <[email-masked]> said:
>>> I'm not sure what you call endian issue here.  The PC style
>>> partition table code we've used for years on big endian systems
>>> without problems.
>> 
>> I guess his hardware has a byteswapped IDE bus, like on Atari,
>> Q40/Q60 and Tivo.

ralf> Oh, those.  I fear every possible way to hookup the IDE bus in a
ralf> more or particularly less intelligent way to a system has
ralf> already been found out there ...

Since 2.4.21, I need following changes in asm-mips/ide.h to work
generic PCI IDE on my big-endian platform (which uses
CONFIG_SWAP_IO_SPACE) again.  This is a same hack used until 2.4.20.
CONFIG_IDE_USE_RAW_IO is a flag in my local configuration.

The 2.4.21 IDE subsystem introduced hwif->OUTW, hwif->OUTSW, etc. but
I could not found a way to override them for generic PCI IDE
controllers.  So I still need the hack.

#if defined(CONFIG_IDE_USE_RAW_IO) && defined(__MIPSEB__)

/* get rid of defs from io.h - ide has its private and conflicting versions */
#ifdef insw
#undef insw
#endif
#ifdef outsw
#undef outsw
#endif
#ifdef insl
#undef insl
#endif
#ifdef outsl
#undef outsl
#endif

#define insw(port, addr, count) raw_insw(port, addr, count)
#define insl(port, addr, count) raw_insl(port, addr, count)
#define outsw(port, addr, count) raw_outsw(port, addr, count)
#define outsl(port, addr, count) raw_outsl(port, addr, count)

static inline void raw_insw(unsigned long port, void *addr, unsigned int count)
{
	while (count--) {
		*(u16 *)addr = *(volatile u16 *)(mips_io_port_base + port);
		addr += 2;
	}
}

static inline void raw_outsw(unsigned long port, void *addr, unsigned int count)
{
	while (count--) {
		*(volatile u16 *)(mips_io_port_base + (port)) = *(u16 *)addr;
		addr += 2;
	}
}

static inline void raw_insl(unsigned long port, void *addr, unsigned int count)
{
	while (count--) {
		*(u32 *)addr = *(volatile u32 *)(mips_io_port_base + port);
		addr += 4;
	}
}

static inline void raw_outsl(unsigned long port, void *addr, unsigned int count)
{
	while (count--) {
		*(volatile u32 *)(mips_io_port_base + (port)) = *(u32 *)addr;
		addr += 4;
	}
}

#endif