linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* MTD and Adapter ROMs
@ 2001-09-07  3:19 Ricky Beam
  2001-09-07 10:13 ` David Woodhouse
  0 siblings, 1 reply; 6+ messages in thread
From: Ricky Beam @ 2001-09-07  3:19 UTC (permalink / raw)
  To: Linux Kernel Mail List

Has anyone tried adapting any of the MTD code to allow read/write access to
adapter EEPROMs like the netboot ROM on some network cards -- or more to the
point, HPT adapter cards?

I could wire up an "insmod this and it'll flash all your controllers" module
but that's just too evil for even me to do.

And what's with Linux turning off the ROM on every PCI device?

--Ricky



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

* Re: MTD and Adapter ROMs
  2001-09-07  3:19 MTD and Adapter ROMs Ricky Beam
@ 2001-09-07 10:13 ` David Woodhouse
  2001-09-07 14:04   ` Ricky Beam
  0 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2001-09-07 10:13 UTC (permalink / raw)
  To: Ricky Beam; +Cc: Linux Kernel Mail List


jfbeam@bluetopia.net said:
> Has anyone tried adapting any of the MTD code to allow read/write
> access to adapter EEPROMs like the netboot ROM on some network cards
> -- or more to the point, HPT adapter cards? 

Should be relatively simple if you just provide the appropriate 'map' 
driver to access the flash and set the Vpp line when asked.

See drivers/mtd/maps/l440gx.c in my tree.

There's also the code at http://www.freiburg.linux.de/~stepan/bios/
which possibly ought to be merged with the MTD code.

--
dwmw2



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

* Re: MTD and Adapter ROMs
  2001-09-07 10:13 ` David Woodhouse
@ 2001-09-07 14:04   ` Ricky Beam
  2001-09-07 14:14     ` David Woodhouse
  0 siblings, 1 reply; 6+ messages in thread
From: Ricky Beam @ 2001-09-07 14:04 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Mail List

On Fri, 7 Sep 2001, David Woodhouse wrote:
>jfbeam@bluetopia.net said:
>> Has anyone tried adapting any of the MTD code to allow read/write
>> access to adapter EEPROMs like the netboot ROM on some network cards
>> -- or more to the point, HPT adapter cards?
>
>Should be relatively simple if you just provide the appropriate 'map'
>driver to access the flash and set the Vpp line when asked.
>
>See drivers/mtd/maps/l440gx.c in my tree.
>
>There's also the code at http://www.freiburg.linux.de/~stepan/bios/
>which possibly ought to be merged with the MTD code.

Well, just having documentation on how all the spooge in drivers/mtd
actually goes together would go along way to helping people use it.  The
flash chip is an SST 39SF010.  It will appear somewhere in PCI memory
space once I reenable the adapter ROM.  It is a JEDEC compilant device.
I have some code from SST for programming it, but I'd rather go the
general route instead of the one-shot flash-and-run module.

I was playing with the physmap driver but that kept oppsing the machine.
That was with 2.4.7 tho'.

I think it'll be as "simple" as adding the ID to jedec.c.  Load chips/*,
maps/hpt-rom (doctored physmap to enable the rom and use it's location),
and then see if I can get mtdchar to drive the mess.

--Ricky

PS: Never use the PoS "load.exe" from HPT.  It's apparently designed for a
    4MHz 286.  The delay loops are VERY wrong on any modern processor.  A
    PII 233 fails to properly write 10% of the bytes.



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

* Re: MTD and Adapter ROMs
  2001-09-07 14:04   ` Ricky Beam
@ 2001-09-07 14:14     ` David Woodhouse
  2001-09-07 15:37       ` Ricky Beam
  0 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2001-09-07 14:14 UTC (permalink / raw)
  To: Ricky Beam; +Cc: Linux Kernel Mail List


jfbeam@bluetopia.net said:
>  Well, just having documentation on how all the spooge in drivers/mtd
> actually goes together would go along way to helping people use it.

Bah. That takes all the fun out of it.

> The flash chip is an SST 39SF010.  It will appear somewhere in PCI
> memory space once I reenable the adapter ROM.  It is a JEDEC compilant
> device. I have some code from SST for programming it, but I'd rather
> go the general route instead of the one-shot flash-and-run module. 


>  I think it'll be as "simple" as adding the ID to jedec.c.  Load chips/
> *, maps/hpt-rom (doctored physmap to enable the rom and use it's
> location), and then see if I can get mtdchar to drive the mess.

Basically right. Once your map driver has successfully probed the chip and 
registered the MTD device, you should be able to open /dev/mtd0 and read, 
write and ioctl(MEMERASE) it. Not necessarily in that order.

--
dwmw2



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

* Re: MTD and Adapter ROMs
  2001-09-07 14:14     ` David Woodhouse
@ 2001-09-07 15:37       ` Ricky Beam
  2001-09-07 15:43         ` David Woodhouse
  0 siblings, 1 reply; 6+ messages in thread
From: Ricky Beam @ 2001-09-07 15:37 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Mail List

On Fri, 7 Sep 2001, David Woodhouse wrote:
>jfbeam@bluetopia.net said:
>>  Well, just having documentation on how all the spooge in drivers/mtd
>> actually goes together would go along way to helping people use it.
>
>Bah. That takes all the fun out of it.

Well, you explain where the f*** module "cfi" is located.  It took me a
few hours to figure out what module is, in fact, "cfi".


>>  I think it'll be as "simple" as adding the ID to jedec.c.  Load chips/
>> *, maps/hpt-rom (doctored physmap to enable the rom and use it's
>> location), and then see if I can get mtdchar to drive the mess.
>
>Basically right. Once your map driver has successfully probed the chip and
>registered the MTD device, you should be able to open /dev/mtd0 and read,
>write and ioctl(MEMERASE) it. Not necessarily in that order.

The question becomes, what section of the rom should not be erased?  If I
erase the entire 128k and then reset the system before getting a good image
back in there, I'm betting it'll disappear from the bus.  It's already
screwed up to the point it no longer shows up in PCI space as itself -- which
was entertaining to see the bad BIOS post and then not find itself :-)

00:03.0 Class ff80: 11ff:00ff (rev 03)
 (that's supposed to be 1103:0004)

I'm sure the HPT users of the world will love me if I manage to flash the
SOB from linux.

--Ricky



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

* Re: MTD and Adapter ROMs
  2001-09-07 15:37       ` Ricky Beam
@ 2001-09-07 15:43         ` David Woodhouse
  0 siblings, 0 replies; 6+ messages in thread
From: David Woodhouse @ 2001-09-07 15:43 UTC (permalink / raw)
  To: Ricky Beam; +Cc: Linux Kernel Mail List


jfbeam@bluetopia.net said:
>  Well, you explain where the f*** module "cfi" is located.  It took me
> a few hours to figure out what module is, in fact, "cfi". 

Heh, sorry about that. It's been fixed in my tree for a while - I should 
send Linus an update.

>  The question becomes, what section of the rom should not be erased?
> If I erase the entire 128k and then reset the system before getting a
> good image back in there, I'm betting it'll disappear from the bus.
> It's already screwed up to the point it no longer shows up in PCI
> space as itself -- which was entertaining to see the bad BIOS post and
> then not find itself :-)

Can't answer that. Try applying BIOS upgrades and downgrades, and seeing 
which ranges of the chip actually change?

> 00:03.0 Class ff80: 11ff:00ff (rev 03)
>  (that's supposed to be 1103:0004)

Looks like it's a pair of 8-bit flash devices side-by-side on a 16-bit bus, 
and you've managed to erase just one of them.


--
dwmw2



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

end of thread, other threads:[~2001-09-07 15:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-07  3:19 MTD and Adapter ROMs Ricky Beam
2001-09-07 10:13 ` David Woodhouse
2001-09-07 14:04   ` Ricky Beam
2001-09-07 14:14     ` David Woodhouse
2001-09-07 15:37       ` Ricky Beam
2001-09-07 15:43         ` David Woodhouse

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).