+/*
+ * Determine our CPU type and look for internal HP-IB
+ * (really only care about detecting 320 (no DIO-II) right now).
+ */
+ lea _machineid,a0
+ movl #0x808,d0
+ movc d0,cacr | clear and disable on-chip cache(s)
+ movl #0x200,d0 | data freeze bit
+ movc d0,cacr | only exists on 68030
+ movc cacr,d0 | read it back
+ tstl d0 | zero?
+ jeq is68020 | yes, we have 68020
+ movl #0x808,d0
+ movc d0,cacr | clear data freeze bit again
+ movl #0x80,MMUCMD | set magic cookie
+ movl MMUCMD,d0 | read it back
+ btst #7,d0 | cookie still on?
+ jeq not370 | no, 360 or 375
+ movl #4,a0@ | consider a 370 for now
+ movl #0,MMUCMD | clear magic cookie
+ movl MMUCMD,d0 | read it back
+ btst #7,d0 | still on?
+ jeq ihpibcheck | no, a 370
+ movl #5,a0@ | yes, must be a 340
+ jra ihpibcheck
+not370:
+ movl #3,a0@ | type is at least a 360
+ movl #0,MMUCMD | clear magic cookie2
+ movl MMUCMD,d0 | read it back
+ btst #16,d0 | still on?
+ jeq ihpibcheck | no, a 360
+ movl #6,a0@ | yes, must be a 345/375/400
+ jra ihpibcheck
+is68020:
+ movl #1,a0@ | consider a 330 for now
+ movl #1,MMUCMD | a 68020, write HP MMU location
+ movl MMUCMD,d0 | read it back
+ btst #0,d0 | zero?
+ jeq ihpibcheck | yes, a 330
+ movl #0,a0@ | no, consider a 320 for now
+ movl #0x80,MMUCMD | set magic cookie
+ movl MMUCMD,d0 | read it back
+ btst #7,d0 | cookie still on?
+ jeq ihpibcheck | no, just a 320
+ movl #2,a0@ | yes, a 350
+ihpibcheck:
+ movl #0,MMUCMD | make sure MMU is off