Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/stand/boot Add patches for Mr.Coffee with OBP2.
details: https://anonhg.NetBSD.org/src/rev/ca9a023ebd4c
branches: trunk
changeset: 517973:ca9a023ebd4c
user: uwe <uwe%NetBSD.org@localhost>
date: Thu Nov 22 04:18:28 2001 +0000
description:
Add patches for Mr.Coffee with OBP2.
Miscellaneous cosmetic changes.
diffstat:
sys/arch/sparc/stand/boot/prompatch.c | 58 +++++++++++++++++++++++++++++-----
1 files changed, 49 insertions(+), 9 deletions(-)
diffs (112 lines):
diff -r 122cc37914bb -r ca9a023ebd4c sys/arch/sparc/stand/boot/prompatch.c
--- a/sys/arch/sparc/stand/boot/prompatch.c Thu Nov 22 04:10:07 2001 +0000
+++ b/sys/arch/sparc/stand/boot/prompatch.c Thu Nov 22 04:18:28 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prompatch.c,v 1.2 2001/09/26 20:53:09 eeh Exp $ */
+/* $NetBSD: prompatch.c,v 1.3 2001/11/22 04:18:28 uwe Exp $ */
/*
* Copyright (c) 2001 Valeriy E. Ushakov
@@ -52,15 +52,37 @@
};
+/*
+ * Patches for JavaStation 1 with OBP 2.x
+ */
+static struct patch_entry patch_js1_obp2[] = {
+
+/*
+ * Give "su" (com port) "interrupts" property.
+ */
+{ "su: adding \"interrupts\"",
+ "\" /obio/su\" open-dev"
+ " d# 13 \" interrupts\" integer-attribute"
+ " close-dev"
+},
+
+/*
+ * TODO: Create "8042" (pckbc) node.
+ * Delete "zs"
+ */
+
+{ NULL, NULL }
+};
+
/*
* Patches for JavaStation 1 with OBP 3.* (OpenFirmware).
* PROM in these machines is crippled in many ways.
*/
-static struct patch_entry patch_js1_of[] = {
+static struct patch_entry patch_js1_ofw[] = {
/*
- * JS1/OF has no cpu node in the device tree. Create one to save us a
+ * JS1/OFW has no cpu node in the device tree. Create one to save us a
* _lot_ of headache in cpu.c and mainbus_attach. Mostly copied from
* OBP2. While clock-frequency is usually at the root node, add it
* here for brevity as kernel checks cpu node for this property anyway.
@@ -128,12 +150,13 @@
},
{ NULL, NULL }
-}; /* patch_js1_of */
+}; /* patch_js1_ofw */
static struct prom_patch prom_patch_tab[] = {
- { "SUNW,JDM1", PROM_OPENFIRM, patch_js1_of },
+ { "SUNW,JavaStation-1", PROM_OBP_V2, patch_js1_obp2 },
+ { "SUNW,JDM1", PROM_OPENFIRM, patch_js1_ofw },
{ NULL, 0, NULL }
};
@@ -141,8 +164,7 @@
/*
* Check if this machine needs tweaks to its PROM. It's simpler to
* fix PROM than to invent workarounds in the kernel code. We do this
- * patching in the secondary boot to avoid wasting space in the
- * kernel.
+ * patching in the secondary boot to avoid wasting space in the kernel.
*/
void
prom_patch(void)
@@ -151,6 +173,9 @@
char *propval;
struct prom_patch *p;
+ if (prom_version() == PROM_OLDMON)
+ return; /* don't bother - no forth in this */
+
propval = PROM_getpropstringA(prom_findroot(), "name",
namebuf, sizeof(namebuf));
if (propval == NULL)
@@ -160,9 +185,24 @@
if (p->promvers == prom_version()
&& strcmp(p->name, namebuf) == 0) {
struct patch_entry *e;
+ const char *promstr = "???";
- printf("Patching PROM v%d for %s\n",
- p->promvers, p->name);
+ switch (prom_version()) {
+ case PROM_OBP_V0:
+ promstr = "OBP0";
+ break;
+ case PROM_OBP_V2:
+ promstr = "OBP2";
+ break;
+ case PROM_OBP_V3:
+ promstr = "OBP3";
+ break;
+ case PROM_OPENFIRM:
+ promstr = "OFW";
+ break;
+ }
+
+ printf("Patching %s for %s\n", promstr, p->name);
for (e = p->patches; e->message != NULL; ++e) {
printf("%s", e->message);
prom_interpret(e->patch);
Home |
Main Index |
Thread Index |
Old Index