Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/omap + Add some GPMC_CONFIG7 macros and replace...
details: https://anonhg.NetBSD.org/src/rev/c37d379816c1
branches: trunk
changeset: 757399:c37d379816c1
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Sat Aug 28 04:03:51 2010 +0000
description:
+ Add some GPMC_CONFIG7 macros and replace magic-number to it.
+ Indent.
diffstat:
sys/arch/arm/omap/omap2_gpmcreg.h | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diffs (45 lines):
diff -r 1bc67492fea9 -r c37d379816c1 sys/arch/arm/omap/omap2_gpmcreg.h
--- a/sys/arch/arm/omap/omap2_gpmcreg.h Sat Aug 28 04:00:35 2010 +0000
+++ b/sys/arch/arm/omap/omap2_gpmcreg.h Sat Aug 28 04:03:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_gpmcreg.h,v 1.3 2010/07/10 11:50:49 ahoka Exp $ */
+/* $NetBSD: omap2_gpmcreg.h,v 1.4 2010/08/28 04:03:51 kiyohara Exp $ */
/*
* Copyright (c) 2007 Microsoft
* All rights reserved.
@@ -198,6 +198,12 @@
#define GPMC_CONFIG7_BASEADDRESS __BITS(5,0)
#define GPMC_CONFIG7_CSVALID __BIT(6)
#define GPMC_CONFIG7_MASKADDRESS __BITS(11,8)
+#define GPMC_CONFIG7(m, b) (((m) << 8) | (((b) >> 24) & 0x3f))
+#define GPMC_CONFIG7_MASK_256M 0x0
+#define GPMC_CONFIG7_MASK_128M 0x8
+#define GPMC_CONFIG7_MASK_64M 0xc
+#define GPMC_CONFIG7_MASK_32M 0xe
+#define GPMC_CONFIG7_MASK_16M 0xf
static __inline ulong
omap_gpmc_config7_addr(uint32_t r)
@@ -213,16 +219,16 @@
uint mask;
ulong size;
} gpmc_config7_size_tab[5] = {
- { 0x0, (256 << 20) }, /* 256 MB */
- { 0x8, (128 << 20) }, /* 128 MB */
- { 0xc, ( 64 << 20) }, /* 64 MB */
- { 0xe, ( 32 << 20) }, /* 32 MB */
- { 0xf, ( 16 << 20) }, /* 16 MB */
+ { GPMC_CONFIG7_MASK_256M, (256 << 20) },
+ { GPMC_CONFIG7_MASK_128M, (128 << 20) },
+ { GPMC_CONFIG7_MASK_64M, ( 64 << 20) },
+ { GPMC_CONFIG7_MASK_32M, ( 32 << 20) },
+ { GPMC_CONFIG7_MASK_16M, ( 16 << 20) },
};
mask = ((r) & GPMC_CONFIG7_MASKADDRESS) >> 8;
for (i=0; i < 5; i++) {
if (gpmc_config7_size_tab[i].mask == mask)
- return gpmc_config7_size_tab[i].size;
+ return gpmc_config7_size_tab[i].size;
}
return 0;
}
Home |
Main Index |
Thread Index |
Old Index