From: Ryan Bradetich <rbradetich@uswest.net>
To: parisc-linux@lists.parisc-linux.org
Subject: [parisc-linux] [RFC] Patch to handle parisc-device quirks/bugs.
Date: 17 Nov 2002 12:05:09 -0700 [thread overview]
Message-ID: <1037559910.26816.9.camel@beavis> (raw)
Hello parisc-linux hackers,
I have written a small patch to handle a case on the E35 where
the device is mis-reported. Specifically, the upper port of the
HP-PB bus converter is reported as:
U2-IOA BC GSC+ Port
This is obviously wrong since U2 connects runway to GSC and this
bus converer is attempting to connect GSC to HP-PB. The correct
bus converter is:
Gecko BOA BC GSC+ Port
The following patch fixes this problem by adding a HP hardare
quirks table, and fixing up the device early on in the discovery
process so everything else just works.
My question about the patch is is the interface generic enough.
The one thing I do not like is depending upon the HPA of the
device to determine the quirk, but I could not think of a
different/better way to handle this.
Thoughts?
- Ryan
Index: arch/parisc/kernel/drivers.c
===================================================================
RCS file: /var/cvs/linux-2.5/arch/parisc/kernel/drivers.c,v
retrieving revision 1.5
diff -u -p -r1.5 drivers.c
--- arch/parisc/kernel/drivers.c 16 Nov 2002 17:54:08 -0000 1.5
+++ arch/parisc/kernel/drivers.c 17 Nov 2002 18:54:37 -0000
@@ -416,6 +416,8 @@ alloc_pa_dev(unsigned long hpa, struct h
dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) |
(iodc_data[5] << 8) | iodc_data[6];
dev->hpa = hpa;
+
+ parisc_hardware_quirks(dev);
name = parisc_hardware_description(&dev->id);
if (name) {
strncpy(dev->name, name, sizeof(dev->name)-1);
Index: arch/parisc/kernel/hardware.c
===================================================================
RCS file: /var/cvs/linux-2.5/arch/parisc/kernel/hardware.c,v
retrieving revision 1.4
diff -u -p -r1.4 hardware.c
--- arch/parisc/kernel/hardware.c 3 Nov 2002 01:52:48 -0000 1.4
+++ arch/parisc/kernel/hardware.c 17 Nov 2002 18:54:38 -0000
@@ -1289,6 +1289,21 @@ char *cpu_name_version[][2] = {
[pcxw2] { "PA8700 (PCX-W2)", "2.0" }
};
+static struct hp_hardware_quirk {
+ unsigned long hpa;
+ struct parisc_device_id quirk;
+ struct parisc_device_id real;
+} hp_hardware_quirk_list[] __initdata = {
+ /* E35 - Gecko BOA GSC Bus Converter is reported */
+ /* as a U2 GSC Bus converter. */
+ { 0xfffb8000, {HPHW_BCPORT, 0, 0x501, 0x0000c },
+ {HPHW_BCPORT, 0, 0x500, 0x0000c }},
+
+ /* NULL terminated list */
+ { 0x0, { HPHW_FAULTY, 0, 0x00, 0x0 },
+ { HPHW_FAULTY, 0, 0x00, 0x0 }},
+};
+
const char * __init
parisc_hardware_description(struct parisc_device_id *id)
{
@@ -1343,3 +1358,21 @@ parisc_get_cpu_type(unsigned long hversi
return pcx; /* not reached: */
}
+
+void __init parisc_hardware_quirks(struct parisc_device *dev)
+{
+ struct hp_hardware_quirk *list;
+
+ for(list = hp_hardware_quirk_list; list->hpa; list++) {
+ if((dev->hpa == list->hpa) &&
+ (dev->id.hw_type == list->quirk.hw_type) &&
+ (dev->id.hversion == list->quirk.hversion) &&
+ (dev->id.sversion == list->quirk.sversion))
+ {
+ dev->id.hw_type = list->real.hw_type;
+ dev->id.hversion = list->real.hversion;
+ dev->id.sversion = list->real.sversion;
+ return;
+ }
+ }
+}
Index: include/asm-parisc/hardware.h
===================================================================
RCS file: /var/cvs/linux-2.5/include/asm-parisc/hardware.h,v
retrieving revision 1.3
diff -u -p -r1.3 hardware.h
--- include/asm-parisc/hardware.h 20 Jul 2002 15:52:25 -0000 1.3
+++ include/asm-parisc/hardware.h 17 Nov 2002 18:54:38 -0000
@@ -131,6 +131,7 @@ struct bc_module {
/* hardware.c: */
extern const char *parisc_hardware_description(struct parisc_device_id *id);
extern enum cpu_type parisc_get_cpu_type(unsigned long hversion);
+extern void parisc_hardware_quirks(struct parisc_device *dev);
struct pci_dev;
next reply other threads:[~2002-11-17 19:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-17 19:05 Ryan Bradetich [this message]
2002-11-17 19:33 ` [parisc-linux] [RFC] Patch to handle parisc-device quirks/bugs Grant Grundler
2002-11-17 19:56 ` Ryan Bradetich
2002-11-17 20:00 ` Matthew Wilcox
2002-11-17 20:22 ` Ryan Bradetich
2002-11-17 20:48 ` Grant Grundler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1037559910.26816.9.camel@beavis \
--to=rbradetich@uswest.net \
--cc=parisc-linux@lists.parisc-linux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.