Received: by mail.netbsd.org (Postfix, from userid 605) id 67B1114A417; Sat, 17 Oct 2015 15:30:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 6A71714A412 for ; Sat, 17 Oct 2015 15:30:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at NetBSD.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.NetBSD.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id TMlbjApFL4Ac for ; Sat, 17 Oct 2015 15:30:14 +0000 (UTC) Received: from cvs.netbsd.org (cvs.NetBSD.org [IPv6:2001:4f8:3:7:2e0:81ff:fe30:95bd]) by mail.netbsd.org (Postfix) with ESMTP id 5E75D14A403 for ; Sat, 17 Oct 2015 15:30:14 +0000 (UTC) Received: by cvs.netbsd.org (Postfix, from userid 500) id 5835498; Sat, 17 Oct 2015 15:30:14 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sat, 17 Oct 2015 15:30:14 +0000 From: "Manuel Bouyer" Subject: CVS commit: src/sys/arch To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20151017153014.5835498@cvs.netbsd.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Manuel Bouyer" Mail-Followup-To: source-changes-d@NetBSD.org Module Name: src Committed By: bouyer Date: Sat Oct 17 15:30:14 UTC 2015 Modified Files: src/sys/arch/arm/allwinner: awin_board.c awin_reg.h awin_var.h src/sys/arch/evbarm/awin: awin_machdep.c src/sys/arch/evbarm/conf: BPI CUBIEBOARD Log Message: Implement CPU frequency switching for A20. This requires adjusting the CPU voltage, so enable the axp20x driver for A20 boards. In evbarm/awin/awin_machdep.c, the DCDC powering up the CPU cores needs to be defined for each board. The board machine-dependant code (at this time, only awin_machdep.c) has to provide a awin_set_mpu_volt() function which calls the right PMU driver to change the CPU core voltage. The CPU frequency/voltage table in awin_board.c comes from various sources: linux kernel, device tree and fex scripts, and experiments on olimex lime2 and cubieboard 2. The following sysctls are provided (compatible with estd): machdep.frequency.min,machdep.frequency.max: writable lower and upper bounds of the useable frequencies. Affects machdep.frequency.available. Lower bound defaults to 700Mhz, as does linux. Upper bound defaults to 960Mhz, which is the boot frequency on the boards I tested. There is a 1008Mhz entry available, but requires an out of spec CPU voltage (more than 1.4V) so it's not available by default. machdep.frequency.available: list of available frequencies. This is the CPU frequency/voltage table, bound by machdep.frequency.{min,max}. machdep.frequency.current: current CPU speed. Write a new value to change the CPU speed, only values from machdep.frequency.available are accepted. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/allwinner/awin_board.c cvs rdiff -u -r1.79 -r1.80 src/sys/arch/arm/allwinner/awin_reg.h cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/allwinner/awin_var.h cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/awin/awin_machdep.c cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/BPI cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/conf/CUBIEBOARD Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.