Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/allwinner Fix (I hope) ram size calculation.
details: https://anonhg.NetBSD.org/src/rev/9aff9f654867
branches: trunk
changeset: 332206:9aff9f654867
user: matt <matt%NetBSD.org@localhost>
date: Thu Sep 11 08:01:31 2014 +0000
description:
Fix (I hope) ram size calculation.
diffstat:
sys/arch/arm/allwinner/awin_board.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (30 lines):
diff -r 84fbbd3be6eb -r 9aff9f654867 sys/arch/arm/allwinner/awin_board.c
--- a/sys/arch/arm/allwinner/awin_board.c Thu Sep 11 07:59:14 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_board.c Thu Sep 11 08:01:31 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_board.c,v 1.18 2014/09/11 02:16:15 jmcneill Exp $ */
+/* $NetBSD: awin_board.c,v 1.19 2014/09/11 08:01:31 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.18 2014/09/11 02:16:15 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.19 2014/09/11 08:01:31 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -231,8 +231,9 @@
const uint32_t dcr = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
AWIN_DRAM_OFFSET + AWIN_DRAM_DCR_REG);
- psize_t memsize = __SHIFTOUT(dcr, AWIN_DRAM_DCR_IO_WIDTH);
- memsize <<= __SHIFTOUT(dcr, AWIN_DRAM_DCR_CHIP_DENSITY) + 28 - 3;
+ psize_t memsize = (__SHIFTOUT(dcr, AWIN_DRAM_DCR_BUS_WIDTH) + 1)
+ / __SHIFTOUT(dcr, AWIN_DRAM_DCR_IO_WIDTH);
+ memsize *= 1 << (__SHIFTOUT(dcr, AWIN_DRAM_DCR_CHIP_DENSITY) + 28 - 3);
#ifdef VERBOSE_INIT_ARM
printf("sdram_config = %#x, memsize = %uMB\n", dcr,
(u_int)(memsize >> 20));
Home |
Main Index |
Thread Index |
Old Index