Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm32/podulebus Add support for a boot argument pod...



details:   https://anonhg.NetBSD.org/src/rev/d0503eca6871
branches:  trunk
changeset: 480373:d0503eca6871
user:      mark <mark%NetBSD.org@localhost>
date:      Mon Jan 10 04:01:17 2000 +0000

description:
Add support for a boot argument podule?=mmmmpppp to enable the manufacturer
and product IDs for a podule to be overriden. The IDs are specified in hex.
A value of "ffff" means disable and replaces the podule?.disable option.
This allows podules whose IDs have been changed e.g. by PowerROMs to still
have the correct driver attached.
Based on my original patch but tided up and debugged by Stephen Hobbs.

diffstat:

 sys/arch/arm32/podulebus/podulebus.c |  36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diffs (63 lines):

diff -r 1c9d6687054e -r d0503eca6871 sys/arch/arm32/podulebus/podulebus.c
--- a/sys/arch/arm32/podulebus/podulebus.c      Mon Jan 10 03:53:20 2000 +0000
+++ b/sys/arch/arm32/podulebus/podulebus.c      Mon Jan 10 04:01:17 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: podulebus.c,v 1.32 1998/08/28 03:19:34 mark Exp $ */
+/* $NetBSD: podulebus.c,v 1.33 2000/01/10 04:01:17 mark Exp $ */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -513,7 +513,7 @@
        int easi_time;
        int bit;
 #endif
-       int boolean;
+       unsigned int value;
        char argstring[20];
 
 #if 0
@@ -572,14 +572,42 @@
        /* Look for drivers to attach */
 
        for (loop = 0; loop < MAX_PODULES+MAX_NETSLOTS; ++loop) {
+#if 1
+               /* Provide backwards compat for a while */
                sprintf(argstring, "podule%d.disable", loop);
                if (get_bootconf_option(boot_args, argstring,
-                   BOOTOPT_TYPE_BOOLEAN, &boolean)) {
-                       if (boolean) {
+                   BOOTOPT_TYPE_BOOLEAN, &value)) {
+                       if (value) {
                                if (podules[loop].slottype != SLOT_NONE)
                                        printf("podule%d: Disabled\n", loop);
                                continue;
                        }
+               }
+#endif
+               sprintf(argstring, "podule%d=", loop);
+               if (get_bootconf_option(boot_args, argstring,
+                   BOOTOPT_TYPE_HEXINT, &value)) {
+                       /* Override the ID */
+                       podules[loop].manufacturer = value >> 16;
+                       podules[loop].product = value & 0xffff;
+                       /* Any old description is now wrong */
+                       podules[loop].description[0] = 0;
+                       if (value != 0xffff) {
+                               printf("podule%d: ID overriden man=%04x prod=%04x\n",
+                                   loop, podules[loop].manufacturer,
+                                   podules[loop].product);
+                               podules[loop].slottype = SLOT_POD;
+                               pa.pa_podule_number = loop;
+                               pa.pa_podule = &podules[loop];
+                               pa.pa_iot = &podulebus_bs_tag;
+                               config_found_sm(self, &pa, podulebusprint,
+                                   podulebussubmatch);
+                               continue;
+                       }
+                       if (value == 0xffff) {
+                               printf("podule%d: Disabled\n", loop);
+                               continue;
+                       }
                }
                
                if (podules[loop].slottype != SLOT_NONE) {



Home | Main Index | Thread Index | Old Index