From owner-freebsd-arm@FreeBSD.ORG Sat May 10 18:16:55 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E484B634; Sat, 10 May 2014 18:16:54 +0000 (UTC) Received: from mail.bitblocks.com (ns1.bitblocks.com [173.228.5.8]) by mx1.freebsd.org (Postfix) with ESMTP id B156BB85; Sat, 10 May 2014 18:16:54 +0000 (UTC) Received: from [192.168.125.21] (iphone1.bitblocks.com [192.168.125.21]) by mail.bitblocks.com (Postfix) with ESMTP id B2DFDB82A; Sat, 10 May 2014 11:07:42 -0700 (PDT) References: <22E12094-E6B2-42F9-94AB-014A702D17F2@FreeBSD.org> In-Reply-To: <22E12094-E6B2-42F9-94AB-014A702D17F2@FreeBSD.org> Mime-Version: 1.0 (1.0) Message-Id: <7D5EE653-922D-4AF8-92A9-56344148FC7F@bitblocks.com> X-Mailer: iPhone Mail (11D201) From: Bakul Shah Subject: Re: Fast cycle counter for ARM chips with SCC - patch for review. Date: Sat, 10 May 2014 11:07:38 -0700 To: Mark R V Murray Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: freebsd-arm X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 18:16:55 -0000 FYI: BCM2835 has a built in h/w RNG (using a reverse biased transistor as an= entropy source). Access to it was enabled in the RPi firmware around Jan 30= , 2013. FWIW, it passes rngtest as well as FreeBSD's /dev/random (on x86/amd= 64) does. For the spec. see http://pastehtml.com/view/crkxyohmp.rtxt Referenced from this thread: http://www.raspberrypi.org/forums/viewtopic.php= ?f=3D29&t=3D19334&p=3D273944#p273944 > On May 10, 2014, at 10:39 AM, Mark R V Murray wrote: >=20 > Hi * >=20 > This patch makes the ARM6 kernels that have an SCC coprocessor (RPI and WA= NDBOARD have them) get a MUCH better implementation of get_cyclecount(9), bu= t not a perfect one. The incrementing rate is good (+- 1 per instruction), b= ut its only 32 bits. Later, if there is interest, I may wish to fix that wit= h an overflow interrupt, but for now its easily good enough for the kernel e= ntropy harvesting service. Also, its MUUUCH more efficient; a simple read ra= ther can calling the internal kernel binuptime(9) clock. >=20 > Comments, please? I=E2=80=99m keen to commit. >=20 > M > --=20 > Mark R V Murray > >=20