Subject: Re: Bootloader on RiscOS - specifying podule info
To: Stephen Hobbs <stevehobbs@enterprise.net>
From: Mark Brinicombe <mark@causality.com>
List: port-arm32
Date: 12/19/1999 17:40:21
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-1859195616-945654021=:24698
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Sun, 19 Dec 1999, Stephen Hobbs wrote:

> Hi folks,
> 
> Given that there is a method for disabling podules at boot time (podule.x diable),
> is there a way to specify that a podule slot has a particular card in it?
At the moment no.
> For instance, I have a Cumana SCSI card with a PowerROM, which makes it useless for NetBSD.
> If I could override the auto-detect then I could use card...
> 
> Also, where ROMs are not SA compatible, I have had to remove the ROMs, but can still use
> the cards under RiscOS by softloading the modules. Fine until booting BSD, when the podule
> is once again invisible to the system...
> 
> I had a quick look in the bootloader code but found nothing, so I guess it's not available.
> Where abouts would something like that need to be added?
Ok the thing to do would be to pass specify something like say

podule?=xxxxyyyy

where ? is the podule number, xxxx is the the vendor ID and yyyy is the
product id.
The podulebus code would need to pass this option in the bootargs and
use it to override. A simple implementation could be done in podulebus.c
at the point at which the the disable is checked for. This would allow
cards with a powerrom to be overriden with the original vendor/product ID.
This mechanism could also be used for the podule disable in order to
simplify the number of options having to be parsed.
What is more work is using this mechanism to replace IDs lost due to the
ROM being removed for SA110 compatibility. It would work for some cards
and not others. Some drivers e.g. ether3 would work ok but some drivers
rely on some of the extra information in the podule header which would
need fallback defaults etc. e.g. interrupt mask and bits if the ROM
provides interrupts services.

You might like to try the attached patch to
arch/arm32/podulebus/podulebus.c that should do this override. I have not
tested it as I don't have an RPC to hand for a few weeks but it does
compile. If it works I'll commit it.

Cheers,
				Mark

PS. The ideal way of handling the powerroms would be if there was a method
of identifing the actual card without using the ID. e.g. other data in the
rom etc. but I have never been able to get any information from alsystems
on how this can be acheived and the person I spoke to was not sure if you
could.


--0-1859195616-945654021=:24698
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="podulebus.c.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.NEB.4.10.9912191740210.24698@pain.brini.com>
Content-Description: Patch for podulebus.c to podule ID override
Content-Disposition: attachment; filename="podulebus.c.patch"

KioqIHBvZHVsZWJ1cy5jLm9yaWcJTW9uIFNlcCAyMSAxOTozNjoyMiAxOTk4
DQotLS0gcG9kdWxlYnVzLmMJU3VuIERlYyAxOSAxNzozMzozNSAxOTk5DQoq
KioqKioqKioqKioqKioNCioqKiA1MTMsNTE5ICoqKioNCiAgCWludCBlYXNp
X3RpbWU7DQogIAlpbnQgYml0Ow0KICAjZW5kaWYNCiEgCWludCBib29sZWFu
Ow0KICAJY2hhciBhcmdzdHJpbmdbMjBdOw0KICANCiAgI2lmIDANCi0tLSA1
MTMsNTE5IC0tLS0NCiAgCWludCBlYXNpX3RpbWU7DQogIAlpbnQgYml0Ow0K
ICAjZW5kaWYNCiEgCXVuc2lnbmVkIGludCB2YWx1ZTsNCiAgCWNoYXIgYXJn
c3RyaW5nWzIwXTsNCiAgDQogICNpZiAwDQoqKioqKioqKioqKioqKioNCioq
KiA1NzQsNTg1ICoqKioNCiAgCWZvciAobG9vcCA9IDA7IGxvb3AgPCBNQVhf
UE9EVUxFUytNQVhfTkVUU0xPVFM7ICsrbG9vcCkgew0KICAJCXNwcmludGYo
YXJnc3RyaW5nLCAicG9kdWxlJWQuZGlzYWJsZSIsIGxvb3ApOw0KICAJCWlm
IChnZXRfYm9vdGNvbmZfb3B0aW9uKGJvb3RfYXJncywgYXJnc3RyaW5nLA0K
ISAJCSAgICBCT09UT1BUX1RZUEVfQk9PTEVBTiwgJmJvb2xlYW4pKSB7DQoh
IAkJCWlmIChib29sZWFuKSB7DQogIAkJCQlpZiAocG9kdWxlc1tsb29wXS5z
bG90dHlwZSAhPSBTTE9UX05PTkUpDQogIAkJCQkJcHJpbnRmKCJwb2R1bGUl
ZDogRGlzYWJsZWRcbiIsIGxvb3ApOw0KICA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