From patchwork Fri May 25 19:24:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10428387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B6256038C for ; Fri, 25 May 2018 19:28:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7743B297C1 for ; Fri, 25 May 2018 19:28:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C236297C4; Fri, 25 May 2018 19:28:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DE5AC297C1 for ; Fri, 25 May 2018 19:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=enflNeGX9qV9pADc7pUTodc7VaS/uO9YRvjdgoIWiEk=; b=nA6dR35RR8t77pQjfXko2XiRVh nN9nNAXj/H0aMZX9AoViVUeN+xdoMrw9tSQpKAQ/y+C4q+U8a+spNnwwx1O1iNk0b4MAa5+i1oy2K 2sdJA73zsH4SDJjEZ604eszohl5qjVW3kJLBM3vengbTs5nILPvxiJQvzZg7iCnDlcf3ZiaiVlJBh aFsXoYsFWZ6zdzDkR56JzmJWm6PXBbtC9qtDcCAGZdomAqshb6AXxvbApOMYl/ydCWOxysMUTl6Ue CMhaZisrJUseTK7LrCVIYO0Y/eApogtIN06X6xLk3KrOavGsMNjgCfjOrRmTSEhjHmDSwXUbRoBfF tlAfn5Gg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fMINU-0002yG-1X; Fri, 25 May 2018 19:27:52 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fMILt-00025u-6H; Fri, 25 May 2018 19:26:22 +0000 Received: from localhost.localdomain ([37.4.249.126]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M7Jw6-1gJEK62t4I-00x6qw; Fri, 25 May 2018 21:25:28 +0200 From: Stefan Wahren To: Jean Delvare , Guenter Roeck , Jonathan Corbet , Eric Anholt Subject: [PATCH V3 1/6] ARM: bcm2835: Add GET_THROTTLED firmware property Date: Fri, 25 May 2018 21:24:34 +0200 Message-Id: <1527276279-23876-2-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527276279-23876-1-git-send-email-stefan.wahren@i2se.com> References: <1527276279-23876-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:JVrwRR+YyQetXwmn2tKAdJZ8C9pR9X40IGxDmPOdAZulmxCP7kf BnfYP5f0D9wefYDB6LVkxzaqVRISjFMM0Ib5iHw34OXc2DG6GzJ1vl1aOgJxyOMsMPcQmSY JBtfTZ+jlqv9sBMb38+Udb/Z5NqrqxtNGwGupNAAiDaL5qUDmvdhT6e/YbOv2J3+AupBctJ BD3gbU5MWhohdytJ6QehA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Z//C3WpaqZI=:gZqhMOyi6YvnnwwDepL7KV htoi7Mu6bcmma2uJEtSCenwp5egbtiDe4Fzy8dodQ2Vdb33yiEeUzwrlc0RPrEdp8AEC4aYTr ZmuezwwbuVh1XYtMrrHTo0dmpFbXcTakg0/EJ8BFLlgAFBvmnHKHfmoM+X88OAft7FVBal7YS shDSkM//qS2rncf4KihR0PZAPi/EVjtEkA82xy9hYVF9br6CwvrBNGLJ/Qylw7eR5TUDKwkYJ BMbMA34iUpZyF6mORCX/cnrLkhe9x7qXhKQlEn1dvPYXS25lJPHaOGWD6s/WsBbRgfRl2qSfc U3nEBuKI4UIhq+VW3bIh4DdD/qfTTUeWs2EUYls8Ko/8m30sfNa166QuQGEIqm3Ts3YshVYER Bn1aJLfQuBJLxpxjtuwcXCKDfhrhJiNDSxr4qe2Xnhkd8rRy0hrAvXd5To9tb3aZeopsPPOE2 p4t7LPJtJzycTNUFv86QT+032uMgq72ka0clpXsW5HftuR1U8IrMDiIQTrb0iFkLjIzur4VnP EvE0DTagQzCi/BevL5ETesLtqnb1SxeJ2b0apobhm273SYawZVhZsG4h48e4zcgjNqQi3eK0b yx1uI1VeD0g9jsXrTLEk65XpYbrycU5PTrLv4k4cJDrxlIhyV/seqHX7uVmWTKp8rcipJYLnw HqZ6z8AWd2BG3iPypy5IzFjdxZbtqDW26fZY5/ZUIrrNkz8jWutLfcjLwSVUkAlA1gs0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180525_122613_562355_A1D33359 X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hwmon@vger.kernel.org, Stefan Wahren , Florian Fainelli , Scott Branden , linux-doc@vger.kernel.org, Ray Jui , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Recent Raspberry Pi firmware provides a mailbox property to detect under-voltage conditions. Here is the current definition. The u32 value returned by the firmware is divided into 2 parts: - lower 16-bits are the live value - upper 16-bits are the history or sticky value Bits: 0: undervoltage 1: arm frequency capped 2: currently throttled 16: undervoltage has occurred 17: arm frequency capped has occurred 18: throttling has occurred Signed-off-by: Stefan Wahren --- include/soc/bcm2835/raspberrypi-firmware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h index 8ee8991..c4a5c9e 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -75,6 +75,7 @@ enum rpi_firmware_property_tag { RPI_FIRMWARE_GET_EDID_BLOCK = 0x00030020, RPI_FIRMWARE_GET_CUSTOMER_OTP = 0x00030021, RPI_FIRMWARE_GET_DOMAIN_STATE = 0x00030030, + RPI_FIRMWARE_GET_THROTTLED = 0x00030046, RPI_FIRMWARE_SET_CLOCK_STATE = 0x00038001, RPI_FIRMWARE_SET_CLOCK_RATE = 0x00038002, RPI_FIRMWARE_SET_VOLTAGE = 0x00038003,