Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Mar 2011 08:44:27 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220052 - in head/sys: conf mips/atheros
Message-ID:  <201103270844.p2R8iROR051530@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun Mar 27 08:44:27 2011
New Revision: 220052
URL: http://svn.freebsd.org/changeset/base/220052

Log:
  Add an option - AR71XX_REALMEM - which overrides the amount of
  memory detected from Redboot, or overrides the "otherwise" case
  if no Redboot information was found.
  
  Some AR71XX platforms don't use Redboot (eg TP-LINK devices using
  UBoot; some later Ubiquiti devices which apparently also use
  UBoot) and at least one plain out lies - the Ubiquiti LS-SR71A
  Redboot says there's 16mb of RAM when in fact there's 32mb.
  
  A more "clean" solution will be needed at a later date.

Modified:
  head/sys/conf/options
  head/sys/mips/atheros/ar71xx_machdep.c

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Sun Mar 27 08:32:47 2011	(r220051)
+++ head/sys/conf/options	Sun Mar 27 08:44:27 2011	(r220052)
@@ -872,3 +872,9 @@ SDP		opt_ofed.h
 SDP_DEBUG	opt_ofed.h
 IPOIB_DEBUG	opt_ofed.h
 IPOIB_CM	opt_ofed.h
+
+# At least one of the AR71XX ubiquiti boards has a Redboot configuration
+# that "lies" about the amount of RAM it has. Until a cleaner method is
+# defined, this option will suffice in overriding what Redboot says.
+AR71XX_REALMEM    opt_global.h
+

Modified: head/sys/mips/atheros/ar71xx_machdep.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_machdep.c	Sun Mar 27 08:32:47 2011	(r220051)
+++ head/sys/mips/atheros/ar71xx_machdep.c	Sun Mar 27 08:44:27 2011	(r220052)
@@ -180,6 +180,20 @@ platform_start(__register_t a0 __unused,
 	if (realmem == 0)
 		realmem = btoc(32*1024*1024);
 
+	/*
+	 * Allow build-time override in case Redboot lies
+	 * or in other situations (eg where there's u-boot)
+	 * where there isn't (yet) a convienent method of
+	 * being told how much RAM is available.
+	 *
+	 * This happens on at least the Ubiquiti LS-SR71A
+	 * board, where redboot says there's 16mb of RAM
+	 * but in fact there's 32mb.
+	 */
+#if	defined(AR71XX_REALMEM)
+		realmem = btoc(MIPS_REALMEM);
+#endif
+
 	/* phys_avail regions are in bytes */
 	phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end);
 	phys_avail[1] = ctob(realmem);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103270844.p2R8iROR051530>