From 30d29f647c58f53831be4c7e7e5cfebf3755e720 Mon Sep 17 00:00:00 2001 From: rafal Date: Fri, 10 Jan 2003 20:39:22 +0000 Subject: [PATCH] Simplify CRIME rev. calculation (we don't appear to need the low nibble). --- sys/arch/sgimips/dev/crime.c | 8 ++------ sys/arch/sgimips/dev/crimereg.h | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/arch/sgimips/dev/crime.c b/sys/arch/sgimips/dev/crime.c index cbc161d8c8f3..fe82fe12e650 100644 --- a/sys/arch/sgimips/dev/crime.c +++ b/sys/arch/sgimips/dev/crime.c @@ -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; diff --git a/sys/arch/sgimips/dev/crimereg.h b/sys/arch/sgimips/dev/crimereg.h index cc4e76b94767..4e3ef46582f5 100644 --- a/sys/arch/sgimips/dev/crimereg.h +++ b/sys/arch/sgimips/dev/crimereg.h @@ -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