From 5cc64236967671a792f4bb23a2fd0a1c83b7dcaf Mon Sep 17 00:00:00 2001 From: reinoud Date: Fri, 2 Mar 2001 01:46:57 +0000 Subject: [PATCH] Fixed the bug that crept into giving support for moving IOMDs during startup. Initially I gave it the type `int *iomd_base' but some macro's defined in iomdreg.h calculated with the value asuming it to be an int ... thus all the registers offsets were multiplied by four and that can only mean trouble ! The kernel boots again ever happily. Sorry for the inconvenience... it was a good bug hunt though! --- sys/arch/arm32/iomd/iomd.c | 6 +++--- sys/arch/arm32/iomd/iomdvar.h | 5 +++-- sys/arch/arm32/riscpc/rpc_machdep.c | 12 ++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/arch/arm32/iomd/iomd.c b/sys/arch/arm32/iomd/iomd.c index ab139523396a..f56319663524 100644 --- a/sys/arch/arm32/iomd/iomd.c +++ b/sys/arch/arm32/iomd/iomd.c @@ -1,4 +1,4 @@ -/* $NetBSD: iomd.c,v 1.7 2001/02/25 23:59:48 reinoud Exp $ */ +/* $NetBSD: iomd.c,v 1.8 2001/03/02 01:46:57 reinoud Exp $ */ /* * Copyright (c) 1996-1997 Mark Brinicombe. @@ -91,8 +91,8 @@ struct cfattach iomd_ca = { extern struct bus_space iomd_bs_tag; -int iomd_found; -int *iomd_base = (int *) IOMD_BASE; +int iomd_found; +u_int32_t iomd_base = IOMD_BASE; /* Declare prototypes */ diff --git a/sys/arch/arm32/iomd/iomdvar.h b/sys/arch/arm32/iomd/iomdvar.h index 44a6aa8d8626..0fb90b3ad0a6 100644 --- a/sys/arch/arm32/iomd/iomdvar.h +++ b/sys/arch/arm32/iomd/iomdvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: iomdvar.h,v 1.2 2001/02/27 20:23:11 reinoud Exp $ */ +/* $NetBSD: iomdvar.h,v 1.3 2001/03/02 01:46:57 reinoud Exp $ */ /* * Copyright (c) 1997 Mark Brinicombe. @@ -119,5 +119,6 @@ union iomd_attach_args { /* * IOMD_BASE register variable */ -extern int *iomd_base; +extern u_int32_t iomd_base; + /* End of iomdvar.h */ diff --git a/sys/arch/arm32/riscpc/rpc_machdep.c b/sys/arch/arm32/riscpc/rpc_machdep.c index c99e5486cbed..c57342cdc93d 100644 --- a/sys/arch/arm32/riscpc/rpc_machdep.c +++ b/sys/arch/arm32/riscpc/rpc_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_machdep.c,v 1.42 2001/02/27 20:23:12 reinoud Exp $ */ +/* $NetBSD: rpc_machdep.c,v 1.43 2001/03/02 01:46:57 reinoud Exp $ */ /* * Copyright (c) 2000-2001 Reinoud Zandijk. @@ -112,8 +112,8 @@ videomemory_t videomemory; /* Video memory descriptor */ char *boot_args = NULL; char *boot_file = NULL; -extern int *vidc_base; -extern int *iomd_base; +extern int *vidc_base; +extern u_int32_t iomd_base; vm_offset_t physical_start; vm_offset_t physical_freestart; @@ -452,7 +452,7 @@ initarm_new_bootloader(bootconf) videomemory.vidm_type = VIDEOMEM_TYPE_DRAM ; vidc_base = (int *) VIDC_HW_BASE; - iomd_base = (int *) IOMD_HW_BASE; + iomd_base = IOMD_HW_BASE; /* * Initialise the physical console @@ -832,7 +832,7 @@ initarm_new_bootloader(bootconf) bootconfig.display_start = VMEM_VBASE; }; vidc_base = (int *) VIDC_BASE; - iomd_base = (int *) IOMD_BASE; + iomd_base = IOMD_BASE; physcon_display_base(VMEM_VBASE); vidcrender_reinit(); @@ -1275,7 +1275,7 @@ initarm_old_bootloader(bootconf) videomemory.vidm_type = VIDEOMEM_TYPE_DRAM; }; vidc_base = (int *) VIDC_BASE; - iomd_base = (int *) IOMD_BASE; + iomd_base = IOMD_BASE; /* * Initialise the physical console