Simplify CRIME rev. calculation (we don't appear to need the low nibble).
This commit is contained in:
parent
c3e2d898b4
commit
30d29f647c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: crime.c,v 1.10 2003/01/06 06:19:40 rafal Exp $ */
|
||||
/* $NetBSD: crime.c,v 1.11 2003/01/10 20:39:22 rafal Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang
|
||||
@ -93,16 +93,12 @@ crime_attach(parent, self, aux)
|
||||
{
|
||||
struct mainbus_attach_args *ma = aux;
|
||||
u_int64_t crm_id;
|
||||
int id, rev;
|
||||
|
||||
crm_id = bus_space_read_8(ma->ma_iot, ma->ma_ioh, 0);
|
||||
|
||||
id = (crm_id & 0xf0) >> 4;
|
||||
rev = crm_id & 0x0f;
|
||||
|
||||
aprint_naive(": system ASIC");
|
||||
|
||||
switch (id) {
|
||||
switch ((crm_id & CRIME_ID_IDBITS) >> CRIME_ID_IDSHIFT) {
|
||||
case 0x0b:
|
||||
aprint_normal(": rev 1.5");
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: crimereg.h,v 1.5 2002/12/28 16:40:48 pooka Exp $ */
|
||||
/* $NetBSD: crimereg.h,v 1.6 2003/01/10 20:39:22 rafal Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang
|
||||
@ -41,7 +41,7 @@
|
||||
/* Offset 0x00 -- revision register */
|
||||
#define CRIME_REV (CRIME_BASE+0x000)
|
||||
#define CRIME_ID_IDBITS 0xf0
|
||||
#define CRIME_ID_IDVALUE 0xa0
|
||||
#define CRIME_ID_IDSHIFT 4
|
||||
#define CRIME_ID_REV 0x0f
|
||||
#define CRIME_REV_PETTY 0x0
|
||||
#define CRIME_REV_11 0x11
|
||||
|
Loading…
Reference in New Issue
Block a user