summaryrefslogtreecommitdiff
path: root/sys/dev/microcode/siop
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/microcode/siop')
-rw-r--r--sys/dev/microcode/siop/ncr53cxxx.c446
-rw-r--r--sys/dev/microcode/siop/siop.out399
-rw-r--r--sys/dev/microcode/siop/siop.ss30
3 files changed, 542 insertions, 333 deletions
diff --git a/sys/dev/microcode/siop/ncr53cxxx.c b/sys/dev/microcode/siop/ncr53cxxx.c
index 3ed99e86c75..d4f7c66b821 100644
--- a/sys/dev/microcode/siop/ncr53cxxx.c
+++ b/sys/dev/microcode/siop/ncr53cxxx.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ncr53cxxx.c,v 1.2 2001/03/01 17:14:27 krw Exp $ */
-/* $NetBSD: ncr53cxxx.c,v 1.5 2000/10/23 14:51:51 bouyer Exp $ */
+/* $OpenBSD: ncr53cxxx.c,v 1.3 2002/09/16 00:53:12 krw Exp $ */
+/* $NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $ */
/*
* Copyright (c) 1995,1999 Michael L. Hitch
@@ -62,6 +62,7 @@ void f_jump (void);
void f_call (void);
void f_return (void);
void f_int (void);
+void f_intfly (void);
void f_select (void);
void f_reselect (void);
void f_wait (void);
@@ -89,6 +90,7 @@ struct {
{"CALL", f_call},
{"RETURN", f_return},
{"INT", f_int},
+ {"INTFLY", f_intfly},
{"SELECT", f_select},
{"RESELECT", f_reselect},
{"WAIT", f_wait},
@@ -111,7 +113,7 @@ unsigned int npatches;
struct patchlist {
struct patchlist *next;
unsigned offset;
-};
+} *patches;
#define S_LABEL 0x0000
#define S_ABSOLUTE 0x0001
@@ -137,154 +139,149 @@ char *phases[] = {
struct ncrregs {
char *name;
- int addr[4];
+ int addr[5];
};
-#define ARCH710 1
-#define ARCH720 2
-#define ARCH810 3
-#define ARCH825 4
+#define ARCH700 1
+#define ARCH710 2
+#define ARCH720 3
+#define ARCH810 4
+#define ARCH825 5
struct ncrregs regs[] = {
- {"scntl0", {0x00, 0x00, 0x00, 0x00}},
- {"scntl1", {0x01, 0x01, 0x01, 0x01}},
- {"scntl2", {-1, 0x02, 0x02, 0x02}},
- {"scntl3", {-1, 0x03, 0x03, 0x03}},
- {"scid", {-1, 0x04, 0x04, 0x04}},
- {"sdid", {0x02, -1, -1, -1}},
- {"sien", {0x03, -1, -1, -1}},
- {"scid", {0x04, -1, -1, -1}},
- {"sxfer", {0x05, 0x05, 0x05, 0x05}},
- {"sdid", {-1, 0x06, 0x06, 0x06}},
- {"gpreg", {-1, 0x07, 0x07, 0x07}},
- {"sodl", {0x06, -1, -1, -1}},
- {"socl", {0x07, -1, -1, -1}},
- {"sfbr", {0x08, 0x08, 0x08, 0x08}},
- {"socl", {-1, 0x09, 0x09, 0x09}},
- {"ssid", {-1, 0x0a, 0x0a, 0x0a}},
- {"sidl", {0x09, -1, -1, -1}},
- {"sbdl", {0x0a, -1, -1, -1}},
- {"sbcl", {0x0b, 0x0b, 0x0b, 0x0b}},
- {"dstat", {0x0c, 0x0c, 0x0c, 0x0c}},
- {"sstat0", {0x0d, 0x0d, 0x0d, 0x0d}},
- {"sstat1", {0x0e, 0x0e, 0x0e, 0x0e}},
- {"sstat2", {0x0f, 0x0f, 0x0f, 0x0f}},
- {"dsa0", {0x10, 0x10, 0x10, 0x10}},
- {"dsa1", {0x11, 0x11, 0x11, 0x11}},
- {"dsa2", {0x12, 0x12, 0x12, 0x12}},
- {"dsa3", {0x13, 0x13, 0x13, 0x13}},
- {"istat", {-1, 0x14, 0x14, 0x14}},
- {"ctest0", {0x14, 0x18, 0x18, 0x18}},
- {"ctest1", {0x15, 0x19, 0x19, 0x19}},
- {"ctest2", {0x16, 0x1a, 0x1a, 0x1a}},
- {"ctest3", {0x17, 0x1b, 0x1b, 0x1b}},
- {"temp0", {-1, 0x1c, 0x1c, 0x1c}},
- {"temp1", {-1, 0x1d, 0x1d, 0x1d}},
- {"temp2", {-1, 0x1e, 0x1e, 0x1e}},
- {"temp3", {-1, 0x1f, 0x1f, 0x1f}},
- {"dfifo", {-1, 0x20, 0x20, 0x20}},
- {"ctest4", {0x18, 0x21, 0x21, 0x21}},
- {"ctest5", {0x19, 0x22, 0x22, 0x22}},
- {"ctest6", {0x20, 0x23, 0x23, 0x23}},
- {"ctest7", {0x21, -1, -1, -1}},
- {"temp0", {0x22, -1, -1, -1}},
- {"temp1", {0x23, -1, -1, -1}},
- {"temp2", {0x24, -1, -1, -1}},
- {"temp3", {0x25, -1, -1, -1}},
- {"dfifo", {0x26, -1, -1, -1}},
- {"istat", {0x27, -1, -1, -1}},
- {"ctest8", {0x28, -1, -1, -1}},
- {"lcrc", {0x29, -1, -1, -1}},
- {"dbc0", {0x2a, 0x24, 0x24, 0x24}},
- {"dbc1", {0x2b, 0x25, 0x25, 0x25}},
- {"dbc2", {0x2c, 0x26, 0x26, 0x26}},
- {"dcmd", {0x2d, 0x27, 0x27, 0x27}},
- {"dnad0", {0x2e, 0x28, 0x28, 0x28}},
- {"dnad1", {0x2f, 0x29, 0x29, 0x29}},
- {"dnad2", {0x30, 0x2a, 0x2a, 0x2a}},
- {"dnad3", {0x31, 0x2b, 0x2b, 0x2b}},
- {"dsp0", {0x32, 0x2c, 0x2c, 0x2c}},
- {"dsp1", {0x33, 0x2d, 0x2d, 0x2d}},
- {"dsp2", {0x34, 0x2e, 0x2e, 0x2e}},
- {"dsp3", {0x35, 0x2f, 0x2f, 0x2f}},
- {"dsps0", {0x36, 0x30, 0x30, 0x30}},
- {"dsps1", {0x37, 0x31, 0x31, 0x31}},
- {"dsps2", {0x38, 0x32, 0x32, 0x32}},
- {"dsps3", {0x39, 0x33, 0x33, 0x33}},
- {"scratch0", {0x40, -1, -1, -1}},
- {"scratch1", {0x41, -1, -1, -1}},
- {"scratch2", {0x42, -1, -1, -1}},
- {"scratch3", {0x43, -1, -1, -1}},
- {"scratcha0", { -1, 0x34, 0x34, 0x34}},
- {"scratcha1", { -1, 0x35, 0x35, 0x35}},
- {"scratcha2", { -1, 0x36, 0x36, 0x36}},
- {"scratcha3", { -1, 0x37, 0x37, 0x37}},
- {"dmode", {0x44, 0x38, 0x38, 0x38}},
- {"dien", {0x45, 0x39, 0x39, 0x39}},
- {"dwt", {0x46, 0x3a, -1, -1}},
- {"sbr", { -1, -1, 0x3a, 0x3a}},
- {"dcntl", {0x47, 0x3b, 0x3b, 0x3b}},
- {"addr0", {0x48, 0x3c, 0x3c, 0x3c}},
- {"addr1", {0x49, 0x3d, 0x3d, 0x3d}},
- {"addr2", {0x4A, 0x3e, 0x3e, 0x3e}},
- {"addr3", {0x4B, 0x3f, 0x3f, 0x3f}},
- {"sien0", { -1, 0x40, 0x40, 0x40}},
- {"sien1", { -1, 0x41, 0x41, 0x41}},
- {"sist0", { -1, 0x42, 0x42, 0x42}},
- {"sist1", { -1, 0x43, 0x43, 0x43}},
- {"slpar", { -1, 0x44, 0x44, 0x44}},
- {"swide", { -1, 0x45, -1, 0x45}},
- {"macntl", { -1, 0x46, 0x46, 0x46}},
- {"gpcntl", { -1, 0x47, 0x47, 0x47}},
- {"stime0", { -1, 0x48, 0x48, 0x48}},
- {"stime1", { -1, 0x49, 0x49, 0x49}},
- {"respid0", { -1, 0x4a, 0x4a, 0x4a}},
- {"respid1", { -1, 0x4b, -1, 0x4b}},
- {"stest0", { -1, 0x4c, 0x4c, 0x4c}},
- {"stest1", { -1, 0x4d, 0x4d, 0x4d}},
- {"stest2", { -1, 0x4e, 0x4e, 0x4e}},
- {"stest3", { -1, 0x4f, 0x4f, 0x4f}},
- {"sidl0", { -1, 0x50, 0x50, 0x50}},
- {"sidl1", { -1, 0x51, -1, 0x51}},
- {"sodl0", { -1, 0x54, 0x54, 0x54}},
- {"sodl1", { -1, 0x55, -1, 0x55}},
- {"sbdl0", { -1, 0x58, 0x58, 0x58}},
- {"sbdl1", { -1, 0x59, -1, 0x59}},
- {"scratchb0", { -1, 0x5c, 0x5c, 0x5c}},
- {"scratchb1", { -1, 0x5d, 0x5d, 0x5d}},
- {"scratchb2", { -1, 0x5e, 0x5e, 0x5e}},
- {"scratchb3", { -1, 0x5f, 0x5f, 0x5f}},
- {"scratchc0", { -1, -1, -1, 0x60}},
- {"scratchc1", { -1, -1, -1, 0x61}},
- {"scratchc2", { -1, -1, -1, 0x62}},
- {"scratchc3", { -1, -1, -1, 0x63}},
- {"scratchd0", { -1, -1, -1, 0x64}},
- {"scratchd1", { -1, -1, -1, 0x65}},
- {"scratchd2", { -1, -1, -1, 0x5e}},
- {"scratchd3", { -1, -1, -1, 0x67}},
- {"scratche0", { -1, -1, -1, 0x68}},
- {"scratche1", { -1, -1, -1, 0x69}},
- {"scratche2", { -1, -1, -1, 0x6a}},
- {"scratche3", { -1, -1, -1, 0x6b}},
- {"scratchf0", { -1, -1, -1, 0x6c}},
- {"scratchf1", { -1, -1, -1, 0x6d}},
- {"scratchf2", { -1, -1, -1, 0x6e}},
- {"scratchf3", { -1, -1, -1, 0x6f}},
- {"scratchg0", { -1, -1, -1, 0x70}},
- {"scratchg1", { -1, -1, -1, 0x71}},
- {"scratchg2", { -1, -1, -1, 0x72}},
- {"scratchg3", { -1, -1, -1, 0x73}},
- {"scratchh0", { -1, -1, -1, 0x74}},
- {"scratchh1", { -1, -1, -1, 0x75}},
- {"scratchh2", { -1, -1, -1, 0x7e}},
- {"scratchh3", { -1, -1, -1, 0x77}},
- {"scratchi0", { -1, -1, -1, 0x78}},
- {"scratchi1", { -1, -1, -1, 0x79}},
- {"scratchi2", { -1, -1, -1, 0x7a}},
- {"scratchi3", { -1, -1, -1, 0x7b}},
- {"scratchj0", { -1, -1, -1, 0x7c}},
- {"scratchj1", { -1, -1, -1, 0x7d}},
- {"scratchj2", { -1, -1, -1, 0x7e}},
- {"scratchj3", { -1, -1, -1, 0x7f}},
+ {"scntl0", {0x00, 0x00, 0x00, 0x00, 0x00}},
+ {"scntl1", {0x01, 0x01, 0x01, 0x01, 0x01}},
+ {"sdid", {0x02, 0x02, -1, -1, -1}},
+ {"sien", {0x03, 0x03, -1, -1, -1}},
+ {"scid", {0x04, 0x04, -1, -1, -1}},
+ {"scntl2", { -1, -1, 0x02, 0x02, 0x02}},
+ {"scntl3", { -1, -1, 0x03, 0x03, 0x03}},
+ {"scid", { -1, -1, 0x04, 0x04, 0x04}},
+ {"sxfer", {0x05, 0x05, 0x05, 0x05, 0x05}},
+ {"sodl", {0x06, 0x06, -1, -1, -1}},
+ {"socl", {0x07, 0x07, -1, -1, -1}},
+ {"sdid", { -1, -1, 0x06, 0x06, 0x06}},
+ {"gpreg", { -1, -1, 0x07, 0x07, 0x07}},
+ {"sfbr", {0x08, 0x08, 0x08, 0x08, 0x08}},
+ {"sidl", {0x09, 0x09, -1, -1, -1}},
+ {"sbdl", {0x0a, 0x0a, -1, -1, -1}},
+ {"socl", { -1, -1, 0x09, 0x09, 0x09}},
+ {"ssid", { -1, -1, 0x0a, 0x0a, 0x0a}},
+ {"sbcl", {0x0b, 0x0b, 0x0b, 0x0b, 0x0b}},
+ {"dstat", {0x0c, 0x0c, 0x0c, 0x0c, 0x0c}},
+ {"sstat0", {0x0d, 0x0d, 0x0d, 0x0d, 0x0d}},
+ {"sstat1", {0x0e, 0x0e, 0x0e, 0x0e, 0x0e}},
+ {"sstat2", {0x0f, 0x0f, 0x0f, 0x0f, 0x0f}},
+ {"dsa0", { -1, 0x10, 0x10, 0x10, 0x10}},
+ {"dsa1", { -1, 0x11, 0x11, 0x11, 0x11}},
+ {"dsa2", { -1, 0x12, 0x12, 0x12, 0x12}},
+ {"dsa3", { -1, 0x13, 0x13, 0x13, 0x13}},
+ {"ctest0", {0x14, 0x14, 0x18, 0x18, 0x18}},
+ {"ctest1", {0x15, 0x15, 0x19, 0x19, 0x19}},
+ {"ctest2", {0x16, 0x16, 0x1a, 0x1a, 0x1a}},
+ {"ctest3", {0x17, 0x17, 0x1b, 0x1b, 0x1b}},
+ {"ctest4", {0x18, 0x18, 0x21, 0x21, 0x21}},
+ {"ctest5", {0x19, 0x19, 0x22, 0x22, 0x22}},
+ {"ctest6", {0x1a, 0x1a, 0x23, 0x23, 0x23}},
+ {"ctest7", {0x1b, 0x1b, -1, -1, -1}},
+ {"temp0", {0x1c, 0x1c, 0x1c, 0x1c, 0x1c}},
+ {"temp1", {0x1d, 0x1d, 0x1d, 0x1d, 0x1d}},
+ {"temp2", {0x1e, 0x1e, 0x1e, 0x1e, 0x1e}},
+ {"temp3", {0x1f, 0x1f, 0x1f, 0x1f, 0x1f}},
+ {"dfifo", {0x20, 0x20, 0x20, 0x20, 0x20}},
+ {"istat", {0x21, 0x21, 0x14, 0x14, 0x14}},
+ {"ctest8", { -1, 0x22, -1, -1, -1}},
+ {"lcrc", { -1, 0x23, -1, -1, -1}},
+ {"dbc0", {0x24, 0x24, 0x24, 0x24, 0x24}},
+ {"dbc1", {0x25, 0x25, 0x25, 0x25, 0x25}},
+ {"dbc2", {0x26, 0x26, 0x26, 0x26, 0x26}},
+ {"dcmd", {0x27, 0x27, 0x27, 0x27, 0x27}},
+ {"dnad0", {0x28, 0x28, 0x28, 0x28, 0x28}},
+ {"dnad1", {0x29, 0x29, 0x29, 0x29, 0x29}},
+ {"dnad2", {0x2a, 0x2a, 0x2a, 0x2a, 0x2a}},
+ {"dnad3", {0x2b, 0x2b, 0x2b, 0x2b, 0x2b}},
+ {"dsp0", {0x2c, 0x2c, 0x2c, 0x2c, 0x2c}},
+ {"dsp1", {0x2d, 0x2d, 0x2d, 0x2d, 0x2d}},
+ {"dsp2", {0x2e, 0x2e, 0x2e, 0x2e, 0x2e}},
+ {"dsp3", {0x2f, 0x2f, 0x2f, 0x2f, 0x2f}},
+ {"dsps0", {0x30, 0x30, 0x30, 0x30, 0x30}},
+ {"dsps1", {0x31, 0x31, 0x31, 0x31, 0x31}},
+ {"dsps2", {0x32, 0x32, 0x32, 0x32, 0x32}},
+ {"dsps3", {0x33, 0x33, 0x33, 0x33, 0x33}},
+ {"scratch0", { -1, 0x34, -1, -1, -1}},
+ {"scratch1", { -1, 0x35, -1, -1, -1}},
+ {"scratch2", { -1, 0x36, -1, -1, -1}},
+ {"scratch3", { -1, 0x37, -1, -1, -1}},
+ {"scratcha0", { -1, -1, 0x34, 0x34, 0x34}},
+ {"scratcha1", { -1, -1, 0x35, 0x35, 0x35}},
+ {"scratcha2", { -1, -1, 0x36, 0x36, 0x36}},
+ {"scratcha3", { -1, -1, 0x37, 0x37, 0x37}},
+ {"dmode", {0x34, 0x38, 0x38, 0x38, 0x38}},
+ {"dien", {0x39, 0x39, 0x39, 0x39, 0x39}},
+ {"dwt", {0x3a, 0x3a, 0x3a, -1, -1}},
+ {"sbr", { -1, -1, -1, 0x3a, 0x3a}},
+ {"dcntl", {0x3b, 0x3b, 0x3b, 0x3b, 0x3b}},
+ {"addr0", { -1, 0x3c, 0x3c, 0x3c, 0x3c}},
+ {"addr1", { -1, 0x3d, 0x3d, 0x3d, 0x3d}},
+ {"addr2", { -1, 0x3e, 0x3e, 0x3e, 0x3e}},
+ {"addr3", { -1, 0x3f, 0x3f, 0x3f, 0x3f}},
+ {"sien0", { -1, -1, 0x40, 0x40, 0x40}},
+ {"sien1", { -1, -1, 0x41, 0x41, 0x41}},
+ {"sist0", { -1, -1, 0x42, 0x42, 0x42}},
+ {"sist1", { -1, -1, 0x43, 0x43, 0x43}},
+ {"slpar", { -1, -1, 0x44, 0x44, 0x44}},
+ {"swide", { -1, -1, 0x45, -1, 0x45}},
+ {"macntl", { -1, -1, 0x46, 0x46, 0x46}},
+ {"gpcntl", { -1, -1, 0x47, 0x47, 0x47}},
+ {"stime0", { -1, -1, 0x48, 0x48, 0x48}},
+ {"stime1", { -1, -1, 0x49, 0x49, 0x49}},
+ {"respid0", { -1, -1, 0x4a, 0x4a, 0x4a}},
+ {"respid1", { -1, -1, 0x4b, -1, 0x4b}},
+ {"stest0", { -1, -1, 0x4c, 0x4c, 0x4c}},
+ {"stest1", { -1, -1, 0x4d, 0x4d, 0x4d}},
+ {"stest2", { -1, -1, 0x4e, 0x4e, 0x4e}},
+ {"stest3", { -1, -1, 0x4f, 0x4f, 0x4f}},
+ {"sidl0", { -1, -1, 0x50, 0x50, 0x50}},
+ {"sidl1", { -1, -1, 0x51, -1, 0x51}},
+ {"sodl0", { -1, -1, 0x54, 0x54, 0x54}},
+ {"sodl1", { -1, -1, 0x55, -1, 0x55}},
+ {"sbdl0", { -1, -1, 0x58, 0x58, 0x58}},
+ {"sbdl1", { -1, -1, 0x59, -1, 0x59}},
+ {"scratchb0", { -1, -1, 0x5c, 0x5c, 0x5c}},
+ {"scratchb1", { -1, -1, 0x5d, 0x5d, 0x5d}},
+ {"scratchb2", { -1, -1, 0x5e, 0x5e, 0x5e}},
+ {"scratchb3", { -1, -1, 0x5f, 0x5f, 0x5f}},
+ {"scratchc0", { -1, -1, -1, -1, 0x60}},
+ {"scratchc1", { -1, -1, -1, -1, 0x61}},
+ {"scratchc2", { -1, -1, -1, -1, 0x62}},
+ {"scratchc3", { -1, -1, -1, -1, 0x63}},
+ {"scratchd0", { -1, -1, -1, -1, 0x64}},
+ {"scratchd1", { -1, -1, -1, -1, 0x65}},
+ {"scratchd2", { -1, -1, -1, -1, 0x66}},
+ {"scratchd3", { -1, -1, -1, -1, 0x67}},
+ {"scratche0", { -1, -1, -1, -1, 0x68}},
+ {"scratche1", { -1, -1, -1, -1, 0x69}},
+ {"scratche2", { -1, -1, -1, -1, 0x6a}},
+ {"scratche3", { -1, -1, -1, -1, 0x6b}},
+ {"scratchf0", { -1, -1, -1, -1, 0x6c}},
+ {"scratchf1", { -1, -1, -1, -1, 0x6d}},
+ {"scratchf2", { -1, -1, -1, -1, 0x6e}},
+ {"scratchf3", { -1, -1, -1, -1, 0x6f}},
+ {"scratchg0", { -1, -1, -1, -1, 0x70}},
+ {"scratchg1", { -1, -1, -1, -1, 0x71}},
+ {"scratchg2", { -1, -1, -1, -1, 0x72}},
+ {"scratchg3", { -1, -1, -1, -1, 0x73}},
+ {"scratchh0", { -1, -1, -1, -1, 0x74}},
+ {"scratchh1", { -1, -1, -1, -1, 0x75}},
+ {"scratchh2", { -1, -1, -1, -1, 0x7e}},
+ {"scratchh3", { -1, -1, -1, -1, 0x77}},
+ {"scratchi0", { -1, -1, -1, -1, 0x78}},
+ {"scratchi1", { -1, -1, -1, -1, 0x79}},
+ {"scratchi2", { -1, -1, -1, -1, 0x7a}},
+ {"scratchi3", { -1, -1, -1, -1, 0x7b}},
+ {"scratchj0", { -1, -1, -1, -1, 0x7c}},
+ {"scratchj1", { -1, -1, -1, -1, 0x7d}},
+ {"scratchj2", { -1, -1, -1, -1, 0x7e}},
+ {"scratchj3", { -1, -1, -1, -1, 0x7f}},
};
int lineno;
@@ -311,6 +308,7 @@ void emit_symbols (void);
void list_symbols (void);
void errout (char *);
void define_symbol (char *, u_int32_t, short, short);
+void patch_label (void);
void close_script (void);
void new_script (char *);
void store_inst (void);
@@ -336,6 +334,7 @@ int
main (int argc, char *argv[])
{
int i;
+ struct patchlist *p;
if (argc < 2 || argv[1][0] == '-')
usage();
@@ -416,7 +415,7 @@ main (int argc, char *argv[])
if (outfp) {
time_t cur_time;
- fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.5 2000/10/23 14:51:51 bouyer Exp $\t*/\n");
+ fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $\t*/\n");
fprintf(outfp, "/*\n");
fprintf(outfp, " *\tDO NOT EDIT - this file is automatically generated.\n");
time(&cur_time);
@@ -458,6 +457,13 @@ main (int argc, char *argv[])
if (outfp && !partial_flag) {
fprintf (outfp, "\nu_int32_t INSTRUCTIONS = 0x%08x;\n", ninsts);
fprintf (outfp, "u_int32_t PATCHES = 0x%08x;\n", npatches);
+ fprintf (outfp, "u_int32_t LABELPATCHES[] = {\n");
+ p = patches;
+ while (p) {
+ fprintf (outfp, "\t0x%08x,\n", p->offset / 4);
+ p = p->next;
+ }
+ fprintf (outfp, "};\n\n");
}
list_symbols ();
exit(0);
@@ -466,6 +472,9 @@ main (int argc, char *argv[])
void setarch(char *val)
{
switch (atoi(val)) {
+ case 700:
+ arch = ARCH700;
+ break;
case 710:
arch = ARCH710;
break;
@@ -634,7 +643,7 @@ void define_symbol (char *name, u_int32_t value, short type, short flags)
if (p->offset > dsps)
errout ("Whoops\007");
else
- script[p->offset / 4] = dsps - p->offset - 4;
+ script[p->offset / 4] += dsps;
p = p->next;
}
}
@@ -654,6 +663,20 @@ void define_symbol (char *name, u_int32_t value, short type, short flags)
++nsymbols;
}
+void patch_label (void)
+{
+ struct patchlist *p, **h;
+
+ h = &patches;
+ while(*h)
+ h = &(*h)->next;
+ p = (struct patchlist *) malloc (sizeof (struct patchlist));
+ *h = p;
+ p->next = NULL;
+ p->offset = dsps + 4;
+ npatches++;
+}
+
void close_script ()
{
int i;
@@ -977,6 +1000,11 @@ void f_int (void)
transfer (0x98000000, 2);
}
+void f_intfly (void)
+{
+ transfer (0x98100000, 2);
+}
+
void f_select (void)
{
int t = tokenix;
@@ -1010,12 +1038,18 @@ void f_wait (void)
errout ("Expected SELECT or RESELECT");
++i;
if (reserved ("rel", i)) {
+ if (arch < ARCH710) {
+ errout ("Wrong arch for relative dsps");
+ return;
+ }
i += 2;
inst1 = evaluate (i) - dsps - 8;
inst0 |= 0x04000000;
}
- else
+ else {
inst1 = evaluate (i);
+ patch_label();
+ }
}
store_inst ();
}
@@ -1064,7 +1098,7 @@ void f_store (void)
void f_nop (void)
{
- inst0 = 0x10000000;
+ inst0 = 0x80000000;
inst1 = 0x00000000;
store_inst ();
}
@@ -1097,6 +1131,10 @@ void loadstore(int i)
else
errout ("expected ','");
if (reserved("from", i) || reserved("dsarel", i)) {
+ if (arch < ARCH710) {
+ errout ("Wrong arch for table indirect");
+ return;
+ }
i++;
inst0 |= 0x10000000;
}
@@ -1111,6 +1149,10 @@ void transfer (int word0, int type)
i = tokenix;
inst0 = word0;
if (type == 0 && reserved ("rel", i)) {
+ if (arch < ARCH710) {
+ errout ("Wrong arch for relative dsps");
+ return;
+ }
inst1 = evaluate (i + 2) - dsps - 8;
i += 4;
inst0 |= 0x00800000;
@@ -1118,6 +1160,8 @@ void transfer (int word0, int type)
else if (type != 1) {
inst1 = evaluate (i);
++i;
+ if (type == 0)
+ patch_label();
}
if (i >= ntokens) {
inst0 |= 0x00080000;
@@ -1181,6 +1225,10 @@ void select_reselect (int t)
{
inst0 |= 0x40000000; /* ATN may be set from SELECT */
if (reserved ("from", t)) {
+ if (arch < ARCH710) {
+ errout ("Wrong arch for table indirect");
+ return;
+ }
++t;
inst0 |= 0x02000000 | evaluate (t++);
}
@@ -1188,11 +1236,17 @@ void select_reselect (int t)
inst0 |= (evaluate (t++) & 0xff) << 16;
if (tokens[t++].type == ',') {
if (reserved ("rel", t)) {
+ if (arch < ARCH710) {
+ errout ("Wrong arch for relative dsps");
+ return;
+ }
inst0 |= 0x04000000;
inst1 = evaluate (t + 2) - dsps - 8;
}
- else
+ else {
inst1 = evaluate (t);
+ patch_label();
+ }
}
else
errout ("Expected separator");
@@ -1224,8 +1278,12 @@ void set_clear (u_int32_t code)
inst0 |= 0x0200;
++i;
}
+ else if (reserved ("carry", i)) {
+ inst0 |= 0x0400;
+ ++i;
+ }
else
- errout ("Expected ATN, ACK, or TARGET");
+ errout ("Expected ATN, ACK, TARGET or CARRY");
need_and = 1;
}
store_inst ();
@@ -1234,6 +1292,10 @@ void set_clear (u_int32_t code)
void block_move ()
{
if (reserved ("from", tokenix)) {
+ if (arch < ARCH710) {
+ errout ("Wrong arch for table indirect");
+ return;
+ }
inst1 = evaluate (tokenix+1);
inst0 |= 0x10000000 | inst1; /*** ??? to match Zeus script */
tokenix += 2;
@@ -1273,8 +1335,14 @@ void register_write ()
if (reserved ("to", tokenix+1))
op = 0;
+ else if (reserved ("shl", tokenix+1))
+ op = 1;
+ else if (reserved ("shr", tokenix+1))
+ op = 5;
else if (tokens[tokenix+1].type == '|')
op = 2;
+ else if (reserved ("xor", tokenix+1))
+ op = 3;
else if (tokens[tokenix+1].type == '&')
op = 4;
else if (tokens[tokenix+1].type == '+')
@@ -1283,8 +1351,16 @@ void register_write ()
op = 8;
else
errout ("Unknown register operator");
- if (op && reserved ("to", tokenix+3) == 0)
- errout ("Register command expected TO");
+ switch (op) {
+ case 2:
+ case 3:
+ case 4:
+ case 6:
+ case 8:
+ if (reserved ("to", tokenix+3) == 0)
+ errout ("Register command expected TO");
+ default:
+ }
reg = CheckRegister (tokenix);
if (reg < 0) { /* Not register, must be data */
data = evaluate (tokenix);
@@ -1297,24 +1373,45 @@ void register_write ()
#if 0
fprintf (listfp, "Move data to register: %02x %d\n", data, reg);
#endif
- }
- else if (op) { /* A register read/write operator */
- data = evaluate (tokenix+2);
- if (tokenix+5 < ntokens) {
- if (!reserved("with", tokenix+5) ||
- !reserved("carry", tokenix+6)) {
- errout("Expected 'WITH CARRY'");
- } else if (op != 6) {
- errout("'WITH CARRY' only valid with '+'");
+ } else if (op) {
+ switch (op) {
+ case 2:
+ case 3:
+ case 4:
+ case 6:
+ case 8:
+ inst0 = 0;
+ /* A register read/write operator */
+ if (reserved("sfbr", tokenix+2)) {
+ if (arch < ARCH825)
+ errout("wrong arch for add with SFBR");
+ if (op == 8)
+ errout("can't substract SFBR");
+ inst0 |= 0x00800000;
+ data = 0;
+ } else
+ data = evaluate (tokenix+2);
+ if (tokenix+5 < ntokens) {
+ if (!reserved("with", tokenix+5) ||
+ !reserved("carry", tokenix+6)) {
+ errout("Expected 'WITH CARRY'");
+ } else if (op != 6) {
+ errout("'WITH CARRY' only valide "
+ "with '+'");
+ }
+ op = 7;
}
- op = 7;
- }
- if (op == 8) {
- data = -data;
- op = 6;
+ if (op == 8) {
+ data = -data;
+ op = 6;
+ }
+ inst0 |= (data & 0xff) << 8;
+ data = CheckRegister (tokenix+4);
+ break;
+ default:
+ data = CheckRegister (tokenix+2);
+ break;
}
- inst0 = (data & 0xff) << 8;
- data = CheckRegister (tokenix+4);
if (data < 0)
errout ("Expected register");
if (reg != data && reg != 8 && data != 8)
@@ -1339,9 +1436,10 @@ fprintf (listfp, "Move register to SFBR: %02x %d %d\n", inst0 >> 8, op, reg);
inst0 |= 0x70000000 | (op << 24) | (reg << 16);
}
}
- }
- else { /* register to register */
+ } else { /* register to register */
data = CheckRegister (tokenix+2);
+ if (data < 0)
+ errout ("Expected register");
if (reg == 8) /* move SFBR to reg */
inst0 = 0x6a000000 | (data << 16);
else if (data == 8) /* move reg to SFBR */
diff --git a/sys/dev/microcode/siop/siop.out b/sys/dev/microcode/siop/siop.out
index 810d6feb4bd..e64b8d9c951 100644
--- a/sys/dev/microcode/siop/siop.out
+++ b/sys/dev/microcode/siop/siop.out
@@ -1,29 +1,29 @@
-/* $NetBSD: ncr53cxxx.c,v 1.5 2000/10/23 14:51:51 bouyer Exp $ */
+/* $NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $ */
/*
* DO NOT EDIT - this file is automatically generated.
- * created from siop.ss on Tue Mar 27 13:58:43 2001
+ * created from siop.ss on Sun Sep 1 23:53:00 2002
*/
const u_int32_t siop_script[] = {
0x78340000, 0x00000000, /* 000 - 0 */
0x78350000, 0x00000000, /* 008 - 8 */
0x72370000, 0x00000000, /* 010 - 16 */
- 0x80840020, 0x00000300, /* 018 - 24 */
- 0x868b0000, 0x00000368, /* 020 - 32 */
- 0x878b0000, 0x000002e0, /* 028 - 40 */
- 0x808b0000, 0x000003f0, /* 030 - 48 */
- 0x818b0000, 0x00000388, /* 038 - 56 */
- 0x828b0000, 0x00000360, /* 040 - 64 */
- 0x838b0000, 0x00000368, /* 048 - 72 */
+ 0x80840020, 0x00000318, /* 018 - 24 */
+ 0x868b0000, 0x00000380, /* 020 - 32 */
+ 0x878b0000, 0x000002f8, /* 028 - 40 */
+ 0x808b0000, 0x00000408, /* 030 - 48 */
+ 0x818b0000, 0x000003a0, /* 038 - 56 */
+ 0x828b0000, 0x00000378, /* 040 - 64 */
+ 0x838b0000, 0x00000380, /* 048 - 72 */
0x98080000, 0x0000ffff, /* 050 - 80 */
0x741a4000, 0x00000000, /* 058 - 88 */
0x980c0000, 0x0000ff83, /* 060 - 96 */
- 0x7810ff00, 0x00000000, /* 068 - 104 */
- 0x7811ff00, 0x00000000, /* 070 - 112 */
- 0x7812ff00, 0x00000000, /* 078 - 120 */
- 0x7813ff00, 0x00000000, /* 080 - 128 */
- 0x78340000, 0x00000000, /* 088 - 136 */
- 0x78350000, 0x00000000, /* 090 - 144 */
- 0x80000000, 0x00000000, /* 098 - 152 */
+ 0x80000000, 0x00000000, /* 068 - 104 */
+ 0x7810ff00, 0x00000000, /* 070 - 112 */
+ 0x7811ff00, 0x00000000, /* 078 - 120 */
+ 0x7812ff00, 0x00000000, /* 080 - 128 */
+ 0x7813ff00, 0x00000000, /* 088 - 136 */
+ 0x78340000, 0x00000000, /* 090 - 144 */
+ 0x78350000, 0x00000000, /* 098 - 152 */
0x80000000, 0x00000000, /* 0a0 - 160 */
0x80000000, 0x00000000, /* 0a8 - 168 */
0x80000000, 0x00000000, /* 0b0 - 176 */
@@ -63,18 +63,18 @@ const u_int32_t siop_script[] = {
0x80000000, 0x00000000, /* 1c0 - 448 */
0x80000000, 0x00000000, /* 1c8 - 456 */
0x80000000, 0x00000000, /* 1d0 - 464 */
- 0x7810ff00, 0x00000000, /* 1d8 - 472 */
- 0x7811ff00, 0x00000000, /* 1e0 - 480 */
- 0x7812ff00, 0x00000000, /* 1e8 - 488 */
- 0x7813ff00, 0x00000000, /* 1f0 - 496 */
- 0x78360000, 0x00000000, /* 1f8 - 504 */
- 0x78372000, 0x00000000, /* 200 - 512 */
- 0x54000000, 0xfffffe48, /* 208 - 520 */
- 0x740a8f00, 0x00000000, /* 210 - 528 */
- 0x6a340000, 0x00000000, /* 218 - 536 */
- 0x800c00ff, 0x00000000, /* 220 - 544 */
- 0x800c00ff, 0x00000000, /* 228 - 552 */
- 0x800c00ff, 0x00000000, /* 230 - 560 */
+ 0x80000000, 0x00000000, /* 1d8 - 472 */
+ 0x7810ff00, 0x00000000, /* 1e0 - 480 */
+ 0x7811ff00, 0x00000000, /* 1e8 - 488 */
+ 0x7812ff00, 0x00000000, /* 1f0 - 496 */
+ 0x7813ff00, 0x00000000, /* 1f8 - 504 */
+ 0x78360000, 0x00000000, /* 200 - 512 */
+ 0x78372000, 0x00000000, /* 208 - 520 */
+ 0x80000000, 0x00000000, /* 210 - 528 */
+ 0x54000000, 0xfffffe38, /* 218 - 536 */
+ 0x80000000, 0x00000000, /* 220 - 544 */
+ 0x740a8f00, 0x00000000, /* 228 - 552 */
+ 0x6a340000, 0x00000000, /* 230 - 560 */
0x800c00ff, 0x00000000, /* 238 - 568 */
0x800c00ff, 0x00000000, /* 240 - 576 */
0x800c00ff, 0x00000000, /* 248 - 584 */
@@ -87,110 +87,112 @@ const u_int32_t siop_script[] = {
0x800c00ff, 0x00000000, /* 280 - 640 */
0x800c00ff, 0x00000000, /* 288 - 648 */
0x800c00ff, 0x00000000, /* 290 - 656 */
- 0x98080000, 0x0000ff80, /* 298 - 664 */
- 0x0f000001, 0x00000000, /* 2a0 - 672 */
- 0x6c350700, 0x00000000, /* 2a8 - 680 */
- 0x60000040, 0x00000000, /* 2b0 - 688 */
- 0x97030000, 0x00000000, /* 2b8 - 696 */
- 0x0f000001, 0x00000000, /* 2c0 - 704 */
+ 0x800c00ff, 0x00000000, /* 298 - 664 */
+ 0x800c00ff, 0x00000000, /* 2a0 - 672 */
+ 0x800c00ff, 0x00000000, /* 2a8 - 680 */
+ 0x98080000, 0x0000ff80, /* 2b0 - 688 */
+ 0x0f000001, 0x00000000, /* 2b8 - 696 */
+ 0x6c350700, 0x00000000, /* 2c0 - 704 */
0x60000040, 0x00000000, /* 2c8 - 712 */
- 0x6a370000, 0x00000000, /* 2d0 - 720 */
- 0x90040020, 0x00000000, /* 2d8 - 728 */
- 0x0f000001, 0x00000000, /* 2e0 - 736 */
- 0x60000040, 0x00000000, /* 2e8 - 744 */
- 0x6a360000, 0x00000000, /* 2f0 - 752 */
- 0x90080000, 0x00000000, /* 2f8 - 760 */
+ 0x97030000, 0x00000000, /* 2d0 - 720 */
+ 0x0f000001, 0x00000000, /* 2d8 - 728 */
+ 0x60000040, 0x00000000, /* 2e0 - 736 */
+ 0x6a370000, 0x00000000, /* 2e8 - 744 */
+ 0x90040020, 0x00000000, /* 2f0 - 752 */
+ 0x0f000001, 0x00000000, /* 2f8 - 760 */
0x60000040, 0x00000000, /* 300 - 768 */
- 0x7a340100, 0x00000000, /* 308 - 776 */
- 0x60000008, 0x00000000, /* 310 - 784 */
- 0x1f000030, 0x00000030, /* 318 - 792 */
- 0x808c0000, 0x00000218, /* 320 - 800 */
- 0x808c0002, 0xffffffd0, /* 328 - 808 */
- 0x808c0001, 0x00000218, /* 330 - 816 */
- 0x98040004, 0x0000ff01, /* 338 - 824 */
- 0x88880000, 0x000001d0, /* 340 - 832 */
- 0x74340100, 0x00000000, /* 348 - 840 */
- 0x808c0000, 0xfffffd10, /* 350 - 848 */
- 0x72350000, 0x00000000, /* 358 - 856 */
- 0x808c0000, 0xfffffd00, /* 360 - 864 */
- 0x98080000, 0x0000ff04, /* 368 - 872 */
- 0x60000040, 0x00000000, /* 370 - 880 */
- 0x80880000, 0xfffffca0, /* 378 - 888 */
- 0x58000008, 0x00000000, /* 380 - 896 */
+ 0x6a360000, 0x00000000, /* 308 - 776 */
+ 0x90080000, 0x00000000, /* 310 - 784 */
+ 0x60000040, 0x00000000, /* 318 - 792 */
+ 0x7a340100, 0x00000000, /* 320 - 800 */
+ 0x60000008, 0x00000000, /* 328 - 808 */
+ 0x1f000030, 0x00000030, /* 330 - 816 */
+ 0x808c0000, 0x00000218, /* 338 - 824 */
+ 0x808c0002, 0xffffffd0, /* 340 - 832 */
+ 0x808c0001, 0x00000218, /* 348 - 840 */
+ 0x98040004, 0x0000ff01, /* 350 - 848 */
+ 0x88880000, 0x000001d0, /* 358 - 856 */
+ 0x74340100, 0x00000000, /* 360 - 864 */
+ 0x808c0000, 0xfffffd00, /* 368 - 872 */
+ 0x72350000, 0x00000000, /* 370 - 880 */
+ 0x808c0000, 0xfffffcf0, /* 378 - 888 */
+ 0x98080000, 0x0000ff04, /* 380 - 896 */
0x60000040, 0x00000000, /* 388 - 904 */
- 0x1e000048, 0x00000048, /* 390 - 912 */
- 0x60000008, 0x00000000, /* 398 - 920 */
- 0x80880000, 0xfffffc78, /* 3a0 - 928 */
- 0x1a000050, 0x00000050, /* 3a8 - 936 */
- 0x80880000, 0xfffffc68, /* 3b0 - 944 */
- 0x1b000058, 0x00000058, /* 3b8 - 952 */
- 0x80880000, 0xfffffc58, /* 3c0 - 960 */
- 0x88880000, 0x000000b8, /* 3c8 - 968 */
- 0x7a340200, 0x00000000, /* 3d0 - 976 */
- 0x19000060, 0x00000060, /* 3d8 - 984 */
- 0x7e350100, 0x00000000, /* 3e0 - 992 */
- 0x7e100800, 0x00000000, /* 3e8 - 1000 */
- 0x7f110000, 0x00000000, /* 3f0 - 1008 */
- 0x7f120000, 0x00000000, /* 3f8 - 1016 */
- 0x7f130000, 0x00000000, /* 400 - 1024 */
- 0x818b0000, 0xffffffc8, /* 408 - 1032 */
- 0x88880000, 0x000000b8, /* 410 - 1040 */
- 0x7c34fd00, 0x00000000, /* 418 - 1048 */
- 0x80880000, 0xfffffbf8, /* 420 - 1056 */
- 0x88880000, 0x00000058, /* 428 - 1064 */
- 0x7a340200, 0x00000000, /* 430 - 1072 */
- 0x18000060, 0x00000060, /* 438 - 1080 */
- 0x7e350100, 0x00000000, /* 440 - 1088 */
- 0x7e100800, 0x00000000, /* 448 - 1096 */
- 0x7f110000, 0x00000000, /* 450 - 1104 */
- 0x7f120000, 0x00000000, /* 458 - 1112 */
- 0x7f130000, 0x00000000, /* 460 - 1120 */
- 0x808b0000, 0xffffffc8, /* 468 - 1128 */
- 0x88880000, 0x00000058, /* 470 - 1136 */
- 0x7c34fd00, 0x00000000, /* 478 - 1144 */
- 0x80880000, 0xfffffb98, /* 480 - 1152 */
- 0x72100000, 0x00000000, /* 488 - 1160 */
- 0x6a5c0000, 0x00000000, /* 490 - 1168 */
- 0x72110000, 0x00000000, /* 498 - 1176 */
- 0x6a5d0000, 0x00000000, /* 4a0 - 1184 */
- 0x72120000, 0x00000000, /* 4a8 - 1192 */
- 0x6a5e0000, 0x00000000, /* 4b0 - 1200 */
- 0x72130000, 0x00000000, /* 4b8 - 1208 */
- 0x6a5f0000, 0x00000000, /* 4c0 - 1216 */
- 0x90080000, 0x00000000, /* 4c8 - 1224 */
- 0x725c0000, 0x00000000, /* 4d0 - 1232 */
- 0x6a100000, 0x00000000, /* 4d8 - 1240 */
- 0x725d0000, 0x00000000, /* 4e0 - 1248 */
- 0x6a110000, 0x00000000, /* 4e8 - 1256 */
- 0x725e0000, 0x00000000, /* 4f0 - 1264 */
- 0x6a120000, 0x00000000, /* 4f8 - 1272 */
- 0x725f0000, 0x00000000, /* 500 - 1280 */
- 0x6a130000, 0x00000000, /* 508 - 1288 */
- 0x90080000, 0x00000000, /* 510 - 1296 */
- 0x7c027f00, 0x00000000, /* 518 - 1304 */
- 0x60000008, 0x00000000, /* 520 - 1312 */
- 0x60000040, 0x00000000, /* 528 - 1320 */
- 0x48000000, 0x00000000, /* 530 - 1328 */
- 0x90080000, 0x00000000, /* 538 - 1336 */
- 0x88880000, 0xffffffd0, /* 540 - 1344 */
- 0x98080000, 0x0000ff00, /* 548 - 1352 */
- 0x60000040, 0x00000000, /* 550 - 1360 */
- 0x1f000038, 0x00000038, /* 558 - 1368 */
- 0x98080000, 0x0000ff02, /* 560 - 1376 */
+ 0x80880000, 0xfffffc88, /* 390 - 912 */
+ 0x58000008, 0x00000000, /* 398 - 920 */
+ 0x60000040, 0x00000000, /* 3a0 - 928 */
+ 0x1e000048, 0x00000048, /* 3a8 - 936 */
+ 0x60000008, 0x00000000, /* 3b0 - 944 */
+ 0x80880000, 0xfffffc60, /* 3b8 - 952 */
+ 0x1a000050, 0x00000050, /* 3c0 - 960 */
+ 0x80880000, 0xfffffc50, /* 3c8 - 968 */
+ 0x1b000058, 0x00000058, /* 3d0 - 976 */
+ 0x80880000, 0xfffffc40, /* 3d8 - 984 */
+ 0x88880000, 0x000000b8, /* 3e0 - 992 */
+ 0x7a340200, 0x00000000, /* 3e8 - 1000 */
+ 0x19000060, 0x00000060, /* 3f0 - 1008 */
+ 0x7e350100, 0x00000000, /* 3f8 - 1016 */
+ 0x7e100800, 0x00000000, /* 400 - 1024 */
+ 0x7f110000, 0x00000000, /* 408 - 1032 */
+ 0x7f120000, 0x00000000, /* 410 - 1040 */
+ 0x7f130000, 0x00000000, /* 418 - 1048 */
+ 0x818b0000, 0xffffffc8, /* 420 - 1056 */
+ 0x88880000, 0x000000b8, /* 428 - 1064 */
+ 0x7c34fd00, 0x00000000, /* 430 - 1072 */
+ 0x80880000, 0xfffffbe0, /* 438 - 1080 */
+ 0x88880000, 0x00000058, /* 440 - 1088 */
+ 0x7a340200, 0x00000000, /* 448 - 1096 */
+ 0x18000060, 0x00000060, /* 450 - 1104 */
+ 0x7e350100, 0x00000000, /* 458 - 1112 */
+ 0x7e100800, 0x00000000, /* 460 - 1120 */
+ 0x7f110000, 0x00000000, /* 468 - 1128 */
+ 0x7f120000, 0x00000000, /* 470 - 1136 */
+ 0x7f130000, 0x00000000, /* 478 - 1144 */
+ 0x808b0000, 0xffffffc8, /* 480 - 1152 */
+ 0x88880000, 0x00000058, /* 488 - 1160 */
+ 0x7c34fd00, 0x00000000, /* 490 - 1168 */
+ 0x80880000, 0xfffffb80, /* 498 - 1176 */
+ 0x72100000, 0x00000000, /* 4a0 - 1184 */
+ 0x6a5c0000, 0x00000000, /* 4a8 - 1192 */
+ 0x72110000, 0x00000000, /* 4b0 - 1200 */
+ 0x6a5d0000, 0x00000000, /* 4b8 - 1208 */
+ 0x72120000, 0x00000000, /* 4c0 - 1216 */
+ 0x6a5e0000, 0x00000000, /* 4c8 - 1224 */
+ 0x72130000, 0x00000000, /* 4d0 - 1232 */
+ 0x6a5f0000, 0x00000000, /* 4d8 - 1240 */
+ 0x90080000, 0x00000000, /* 4e0 - 1248 */
+ 0x725c0000, 0x00000000, /* 4e8 - 1256 */
+ 0x6a100000, 0x00000000, /* 4f0 - 1264 */
+ 0x725d0000, 0x00000000, /* 4f8 - 1272 */
+ 0x6a110000, 0x00000000, /* 500 - 1280 */
+ 0x725e0000, 0x00000000, /* 508 - 1288 */
+ 0x6a120000, 0x00000000, /* 510 - 1296 */
+ 0x725f0000, 0x00000000, /* 518 - 1304 */
+ 0x6a130000, 0x00000000, /* 520 - 1312 */
+ 0x90080000, 0x00000000, /* 528 - 1320 */
+ 0x7c027f00, 0x00000000, /* 530 - 1328 */
+ 0x60000008, 0x00000000, /* 538 - 1336 */
+ 0x60000040, 0x00000000, /* 540 - 1344 */
+ 0x48000000, 0x00000000, /* 548 - 1352 */
+ 0x90080000, 0x00000000, /* 550 - 1360 */
+ 0x88880000, 0xffffffd0, /* 558 - 1368 */
+ 0x98080000, 0x0000ff00, /* 560 - 1376 */
0x60000040, 0x00000000, /* 568 - 1384 */
- 0x1f000040, 0x00000040, /* 570 - 1392 */
- 0x98080000, 0x0000ff03, /* 578 - 1400 */
- 0x10000000, 0x00000000, /* 580 - 1408 */
+ 0x1f000038, 0x00000038, /* 570 - 1392 */
+ 0x98080000, 0x0000ff02, /* 578 - 1400 */
+ 0x60000040, 0x00000000, /* 580 - 1408 */
+ 0x1f000040, 0x00000040, /* 588 - 1416 */
+ 0x98080000, 0x0000ff03, /* 590 - 1424 */
+ 0x80000000, 0x00000000, /* 598 - 1432 */
};
const u_int32_t lun_switch[] = {
0x7803ff00, 0x00000000, /* 000 - 0 */
0x7805ff00, 0x00000000, /* 008 - 8 */
- 0x7808ff00, 0x00000000, /* 010 - 16 */
- 0x80080000, 0x00000000, /* 018 - 24 */
- 0x88880000, 0xffffffd8, /* 020 - 32 */
- 0x72350000, 0x00000000, /* 028 - 40 */
- 0x98080000, 0x0000ff81, /* 030 - 48 */
+ 0x80080000, 0x00000000, /* 010 - 16 */
+ 0x88880000, 0xffffffe0, /* 018 - 24 */
+ 0x72350000, 0x00000000, /* 020 - 32 */
+ 0x98080000, 0x0000ff81, /* 028 - 40 */
};
const u_int32_t tag_switch[] = {
@@ -226,7 +228,15 @@ const u_int32_t load_dsa[] = {
0x43000028, 0x00000000, /* 040 - 64 */
0xc0000004, 0x00000000, 0x00000000, /* 048 - 72 */
0x80080000, 0x00000000, /* 054 - 84 */
- 0x10000000, 0x00000000, /* 05c - 92 */
+ 0x80000000, 0x00000000, /* 05c - 92 */
+};
+
+const u_int32_t siop_led_on[] = {
+ 0x7c07fe00, 0x00000000, /* 000 - 0 */
+};
+
+const u_int32_t siop_led_off[] = {
+ 0x7a070100, 0x00000000, /* 000 - 0 */
};
#define A_t_id 0x00000028
@@ -251,28 +261,30 @@ const u_int32_t load_dsa[] = {
#define A_flag_data 0x00000002
#define A_flag_data_mask 0x000000fd
#define Ent_waitphase 0x00000020
-#define Ent_send_msgout 0x00000380
-#define Ent_msgout 0x00000390
-#define Ent_msgin 0x00000310
-#define Ent_handle_msgin 0x00000320
-#define Ent_msgin_ack 0x00000370
-#define Ent_dataout 0x00000428
-#define Ent_datain 0x000003c8
-#define Ent_cmdout 0x000003a8
-#define Ent_status 0x000003b8
-#define Ent_disconnect 0x00000518
-#define Ent_reselect 0x000001d8
+#define Ent_send_msgout 0x00000398
+#define Ent_msgout 0x000003a8
+#define Ent_msgin 0x00000328
+#define Ent_handle_msgin 0x00000338
+#define Ent_msgin_ack 0x00000388
+#define Ent_dataout 0x00000440
+#define Ent_datain 0x000003e0
+#define Ent_cmdout 0x000003c0
+#define Ent_status 0x000003d0
+#define Ent_disconnect 0x00000530
+#define Ent_reselect 0x000001e0
#define Ent_reselected 0x00000000
-#define Ent_selected 0x00000370
-#define Ent_script_sched 0x00000068
-#define Ent_script_sched_slot0 0x00000098
-#define Ent_get_extmsgdata 0x00000568
-#define Ent_resel_targ0 0x00000220
-#define Ent_msgin_space 0x00000580
-#define Ent_lunsw_return 0x000002a0
+#define Ent_selected 0x00000388
+#define Ent_script_sched 0x00000070
+#define Ent_script_sched_slot0 0x000000a0
+#define Ent_get_extmsgdata 0x00000580
+#define Ent_resel_targ0 0x00000238
+#define Ent_msgin_space 0x00000598
+#define Ent_lunsw_return 0x000002b8
+#define Ent_led_on1 0x00000068
+#define Ent_led_on2 0x00000220
+#define Ent_led_off 0x00000210
#define E_abs_script_sched_slot0 0x00000000
u_int32_t E_abs_script_sched_slot0_Used[] = {
- 0x00000027,
0x00000029,
0x0000002b,
0x0000002d,
@@ -312,13 +324,11 @@ u_int32_t E_abs_script_sched_slot0_Used[] = {
0x00000071,
0x00000073,
0x00000075,
+ 0x00000077,
};
#define E_abs_targ0 0x00000000
u_int32_t E_abs_targ0_Used[] = {
- 0x00000089,
- 0x0000008b,
- 0x0000008d,
0x0000008f,
0x00000091,
0x00000093,
@@ -331,21 +341,24 @@ u_int32_t E_abs_targ0_Used[] = {
0x000000a1,
0x000000a3,
0x000000a5,
+ 0x000000a7,
+ 0x000000a9,
+ 0x000000ab,
};
#define E_abs_msgin 0x00000000
u_int32_t E_abs_msgin_Used[] = {
- 0x000000a9,
- 0x000000b1,
- 0x000000b9,
+ 0x000000af,
+ 0x000000b7,
+ 0x000000bf,
};
-#define Ent_lun_switch_entry 0x00000020
-#define Ent_resel_lun0 0x00000030
+#define Ent_lun_switch_entry 0x00000018
+#define Ent_resel_lun0 0x00000028
#define Ent_restore_scntl3 0x00000000
#define E_abs_lunsw_return 0x00000000
u_int32_t E_abs_lunsw_return_Used[] = {
- 0x00000007,
+ 0x00000005,
};
#define Ent_tag_switch_entry 0x00000000
@@ -403,5 +416,83 @@ u_int32_t E_ldsa_abs_slot_Used[] = {
};
-u_int32_t INSTRUCTIONS = 0x000000d6;
-u_int32_t PATCHES = 0x00000000;
+u_int32_t INSTRUCTIONS = 0x000000da;
+u_int32_t PATCHES = 0x0000004b;
+u_int32_t LABELPATCHES[] = {
+ 0x00000029,
+ 0x0000002b,
+ 0x0000002d,
+ 0x0000002f,
+ 0x00000031,
+ 0x00000033,
+ 0x00000035,
+ 0x00000037,
+ 0x00000039,
+ 0x0000003b,
+ 0x0000003d,
+ 0x0000003f,
+ 0x00000041,
+ 0x00000043,
+ 0x00000045,
+ 0x00000047,
+ 0x00000049,
+ 0x0000004b,
+ 0x0000004d,
+ 0x0000004f,
+ 0x00000051,
+ 0x00000053,
+ 0x00000055,
+ 0x00000057,
+ 0x00000059,
+ 0x0000005b,
+ 0x0000005d,
+ 0x0000005f,
+ 0x00000061,
+ 0x00000063,
+ 0x00000065,
+ 0x00000067,
+ 0x00000069,
+ 0x0000006b,
+ 0x0000006d,
+ 0x0000006f,
+ 0x00000071,
+ 0x00000073,
+ 0x00000075,
+ 0x00000077,
+ 0x0000008f,
+ 0x00000091,
+ 0x00000093,
+ 0x00000095,
+ 0x00000097,
+ 0x00000099,
+ 0x0000009b,
+ 0x0000009d,
+ 0x0000009f,
+ 0x000000a1,
+ 0x000000a3,
+ 0x000000a5,
+ 0x000000a7,
+ 0x000000a9,
+ 0x000000ab,
+ 0x00000005,
+ 0x00000003,
+ 0x00000005,
+ 0x00000007,
+ 0x00000009,
+ 0x0000000b,
+ 0x0000000d,
+ 0x0000000f,
+ 0x00000011,
+ 0x00000013,
+ 0x00000015,
+ 0x00000017,
+ 0x00000019,
+ 0x0000001b,
+ 0x0000001d,
+ 0x0000001f,
+ 0x00000021,
+ 0x0000000d,
+ 0x00000011,
+ 0x00000016,
+};
+
diff --git a/sys/dev/microcode/siop/siop.ss b/sys/dev/microcode/siop/siop.ss
index a33543ab2af..ab66276eb17 100644
--- a/sys/dev/microcode/siop/siop.ss
+++ b/sys/dev/microcode/siop/siop.ss
@@ -1,5 +1,5 @@
-; $OpenBSD: siop.ss,v 1.3 2001/04/15 06:01:32 krw Exp $
-; $NetBSD: siop.ss,v 1.12 2000/10/23 14:53:53 bouyer Exp $
+; $OpenBSD: siop.ss,v 1.4 2002/09/16 00:53:12 krw Exp $
+; $NetBSD: siop.ss,v 1.17 2002/07/26 14:11:34 wiz Exp $
;
; Copyright (c) 2000 Manuel Bouyer.
@@ -14,7 +14,7 @@
; documentation and/or other materials provided with the distribution.
; 3. All advertising materials mentioning features or use of this software
; must display the following acknowledgement:
-; This product includes software developed by Manuel Bouyer
+; This product includes software developed by Manuel Bouyer.
; 4. The name of the author may not be used to endorse or promote products
; derived from this software without specific prior written permission.
;
@@ -31,7 +31,7 @@
ARCH 720
-; offsets in sym_xfer
+; offsets in siop_common_xfer
ABSOLUTE t_id = 40;
ABSOLUTE t_msg_in = 48;
ABSOLUTE t_ext_msg_in = 56;
@@ -82,6 +82,9 @@ ENTRY get_extmsgdata;
ENTRY resel_targ0;
ENTRY msgin_space;
ENTRY lunsw_return;
+ENTRY led_on1;
+ENTRY led_on2;
+ENTRY led_off;
EXTERN abs_script_sched_slot0;
EXTERN abs_targ0;
EXTERN abs_msgin;
@@ -135,6 +138,10 @@ reselect_fail:
; check that host asserted SIGP, this'll clear SIGP in ISTAT
MOVE CTEST2 & 0x40 TO SFBR;
INT int_resfail, IF 0x00;
+; a NOP by default; patched with MOVE GPREG & 0xfe to GPREG on compile-time
+; option "SIOP_SYMLED"
+led_on1:
+ NOP;
script_sched:
; Clear DSA and init status
MOVE 0xff to DSA0;
@@ -198,7 +205,15 @@ reselect:
MOVE 0xff to DSA3;
MOVE 0x00 to SCRATCHA2; no tag
MOVE 0x20 to SCRATCHA3; simple tag msg, ignored by reselected:
+; a NOP by default; patched with MOVE GPREG | 0x01 to GPREG on compile-time
+; option "SIOP_SYMLED"
+led_off:
+ NOP;
WAIT RESELECT REL(reselect_fail)
+; a NOP by default; patched with MOVE GPREG & 0xfe to GPREG on compile-time
+; option "SIOP_SYMLED"
+led_on2:
+ NOP;
MOVE SSID & 0x8f to SFBR
MOVE SFBR to SCRATCHA0 ; save reselect ID
; find the right param for this target
@@ -354,7 +369,6 @@ PROC lun_switch:
restore_scntl3:
MOVE 0xff TO SCNTL3;
MOVE 0xff TO SXFER;
- MOVE 0xff TO SFBR;
JUMP abs_lunsw_return;
lun_switch_entry:
CALL REL(restore_scntl3);
@@ -408,3 +422,9 @@ ldsa_select:
JUMP ldsa_abs_selected;
ldsa_data:
NOP; contains data used by the MOVE MEMORY
+
+PROC siop_led_on:
+ MOVE GPREG & 0xfe TO GPREG;
+
+PROC siop_led_off:
+ MOVE GPREG | 0x01 TO GPREG;