From owner-svn-src-all@freebsd.org Fri Apr 22 16:16:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA2FB194EE; Fri, 22 Apr 2016 16:16:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D2471B8F; Fri, 22 Apr 2016 16:16:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3MGFxr9088376; Fri, 22 Apr 2016 16:15:59 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3MGFxCM088374; Fri, 22 Apr 2016 16:15:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604221615.u3MGFxCM088374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 22 Apr 2016 16:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298477 - in head/sys: conf riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 16:16:00 -0000 Author: br Date: Fri Apr 22 16:15:58 2016 New Revision: 298477 URL: https://svnweb.freebsd.org/changeset/base/298477 Log: Clear the DDR memory. This should be done by bootloaders, but they have no such feature yet. This fixes operation on Rocket Core and lowRISC. Modified: head/sys/conf/options.riscv head/sys/riscv/riscv/locore.S Modified: head/sys/conf/options.riscv ============================================================================== --- head/sys/conf/options.riscv Fri Apr 22 15:12:05 2016 (r298476) +++ head/sys/conf/options.riscv Fri Apr 22 16:15:58 2016 (r298477) @@ -2,3 +2,4 @@ RISCV opt_global.h VFP opt_global.h +DDR_CLEAR_SIZE opt_global.h Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Fri Apr 22 15:12:05 2016 (r298476) +++ head/sys/riscv/riscv/locore.S Fri Apr 22 16:15:58 2016 (r298477) @@ -126,6 +126,17 @@ _start: csrr a0, mhartid bnez a0, mpentry +#if defined(DDR_CLEAR_SIZE) + /* Clear DDR memory */ + la t0, _end + li t1, DDR_CLEAR_SIZE +1: + sd zero, 0(t0) + addi t0, t0, 8 + bltu t0, t1, 1b + /* End */ +#endif + /* Build event queue for current core */ build_ring