summaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorMichael Broughton <mbobowik@telusplanet.net>2006-12-04 17:27:29 +1000
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-04 08:26:12 -0800
commit552984050958fc0f51bff38948d0bf4d31ea2b03 (patch)
tree525c285442d1ef0c7c4f47cd796fa4add8a5e979 /arch/m68knommu
parent1bddcc50c27c8ca39a62a1d37e3928707be8f850 (diff)
downloadop-kernel-dev-552984050958fc0f51bff38948d0bf4d31ea2b03.zip
op-kernel-dev-552984050958fc0f51bff38948d0bf4d31ea2b03.tar.gz
[PATCH] m68knommu: auto detect memory size on M5208EVB board
Here is a small patch to automatically detect the DRAM size on m520x. It was generated against 2.6.17-uc0, and tested on an Intec 5208 dev board. Signed-off-by: Michael Broughton <mbobowik@telusplanet.net> Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r--arch/m68knommu/platform/5307/head.S20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/5307/head.S b/arch/m68knommu/platform/5307/head.S
index f2edb64..b9aa0ca 100644
--- a/arch/m68knommu/platform/5307/head.S
+++ b/arch/m68knommu/platform/5307/head.S
@@ -64,6 +64,26 @@
negl %d0 /* negate bits */
.endm
+#elif defined(CONFIG_M520x)
+.macro GET_MEM_SIZE
+ clrl %d0
+ movel MCF_MBAR+MCFSIM_SDCS0, %d2 /* Get SDRAM chip select 0 config */
+ andl #0x1f, %d2 /* Get only the chip select size */
+ beq 3f /* Check if it is enabled */
+ addql #1, %d2 /* Form exponent */
+ moveql #1, %d0
+ lsll %d2, %d0 /* 2 ^ exponent */
+3:
+ movel MCF_MBAR+MCFSIM_SDCS1, %d2 /* Get SDRAM chip select 1 config */
+ andl #0x1f, %d2 /* Get only the chip select size */
+ beq 4f /* Check if it is enabled */
+ addql #1, %d2 /* Form exponent */
+ moveql #1, %d1
+ lsll %d2, %d1 /* 2 ^ exponent */
+ addl %d1, %d0 /* Total size of SDRAM in d0 */
+4:
+.endm
+
#else
#error "ERROR: I don't know how to probe your boards memory size?"
#endif
OpenPOWER on IntegriCloud