From 62645f43bafbf1766a4038fd78b34599f22d669f Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 10 Jan 2000 04:01:17 +0000 Subject: [PATCH] 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. --- sys/arch/arm32/podulebus/podulebus.c | 36 ++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/sys/arch/arm32/podulebus/podulebus.c b/sys/arch/arm32/podulebus/podulebus.c index e52cd43be0bc..518422f0a637 100644 --- a/sys/arch/arm32/podulebus/podulebus.c +++ b/sys/arch/arm32/podulebus/podulebus.c @@ -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 @@ podulebusattach(parent, self, aux) int easi_time; int bit; #endif - int boolean; + unsigned int value; char argstring[20]; #if 0 @@ -572,14 +572,42 @@ podulebusattach(parent, self, aux) /* 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) {