Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbarm/beagle Fix probing error on BBONE due to wro...
details: https://anonhg.NetBSD.org/src/rev/7c7401595e42
branches: trunk
changeset: 786677:7c7401595e42
user: matt <matt%NetBSD.org@localhost>
date: Mon May 06 23:12:53 2013 +0000
description:
Fix probing error on BBONE due to wrong value being used in u-boot to
program the DDR controller.
diffstat:
sys/arch/evbarm/beagle/beagle_machdep.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r d3228eb5a47c -r 7c7401595e42 sys/arch/evbarm/beagle/beagle_machdep.c
--- a/sys/arch/evbarm/beagle/beagle_machdep.c Mon May 06 23:09:34 2013 +0000
+++ b/sys/arch/evbarm/beagle/beagle_machdep.c Mon May 06 23:12:53 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: beagle_machdep.c,v 1.40 2013/04/30 05:39:44 matt Exp $ */
+/* $NetBSD: beagle_machdep.c,v 1.41 2013/05/06 23:12:53 matt Exp $ */
/*
* Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.40 2013/04/30 05:39:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.41 2013/05/06 23:12:53 matt Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@@ -715,7 +715,14 @@
am335x_memprobe(void)
{
const vaddr_t emif_base = OMAP_EMIF_VBASE;
- const uint32_t sdram_config = *(const volatile uint32_t *)(emif_base + EMIF_SDRAM_CONFIG);
+ uint32_t sdram_config = *(const volatile uint32_t *)(emif_base + EMIF_SDRAM_CONFIG);
+ /*
+ * The original bbone's u-boot misprograms the EMIF so correct it
+ * if we detect if it has the wrong value.
+ */
+ if (sdram_config == 0x41805332)
+ sdram_config -= __SHIFTOUT(1, SDRAM_CONFIG_RSIZE);
+
const u_int ibank = __SHIFTOUT(sdram_config, SDRAM_CONFIG_IBANK);
const u_int rsize = 9 + __SHIFTOUT(sdram_config, SDRAM_CONFIG_RSIZE);
const u_int pagesize = 8 + __SHIFTOUT(sdram_config, SDRAM_CONFIG_PAGESIZE);
Home |
Main Index |
Thread Index |
Old Index