From owner-svn-src-head@FreeBSD.ORG Sun Mar 27 08:44:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 264FA1065673; Sun, 27 Mar 2011 08:44:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F122E8FC12; Sun, 27 Mar 2011 08:44:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2R8iRxF051533; Sun, 27 Mar 2011 08:44:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2R8iROR051530; Sun, 27 Mar 2011 08:44:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103270844.p2R8iROR051530@svn.freebsd.org> From: Adrian Chadd Date: Sun, 27 Mar 2011 08:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220052 - in head/sys: conf mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2011 08:44:28 -0000 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);