From patchwork Wed May 16 13:37:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10403955 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 AC615601F7 for ; Wed, 16 May 2018 13:38:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B222287FE for ; Wed, 16 May 2018 13:38:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F75B28842; Wed, 16 May 2018 13:38:30 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB912287FE for ; Wed, 16 May 2018 13:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbeEPNi3 (ORCPT ); Wed, 16 May 2018 09:38:29 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:55781 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbeEPNi2 (ORCPT ); Wed, 16 May 2018 09:38:28 -0400 Received: from localhost.localdomain ([37.4.249.136]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MTP5b-1esIx23omN-00SOYS; Wed, 16 May 2018 15:37:40 +0200 From: Stefan Wahren To: Rob Herring , Mark Rutland , Jean Delvare , Guenter Roeck , Eric Anholt Cc: Florian Fainelli , Ray Jui , Scott Branden , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, Stefan Wahren Subject: [PATCH RFC 1/6] ARM: bcm2835: Add GET_THROTTLED firmware property Date: Wed, 16 May 2018 15:37:02 +0200 Message-Id: <1526477827-10859-2-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526477827-10859-1-git-send-email-stefan.wahren@i2se.com> References: <1526477827-10859-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:ts41mFpHfkI1oyzPnwuamAhrLh65RSfdtigfNyAOKRtlER/XCuo 7g9j9l02b/PgOoM5JCS15d+XqV2ff9bnsUx9AIGIE7h2YDMUW4EG5ceoyYAuaF5t0Iba+wL w6W87Ebv90DzWQ1/qfi3WxNfqr+lKYxPf42b0U8X+OsWx9P4usCW9CGH1nMLhVVLXEf3X0b MHrwrFUfvWxU3I+wbTyPQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:JbvV983n46Q=:0zQEdjwnNukAgDV6jP0IXu GjFBPei5wyXKmwleGfp/CC40oDlAyLJiNdoA31SNA2z1lWEK13AtpfOarw+VtO+kvaKETqrPH uJSGO4yeFe7/d8TLU/LFpd4JCE7xxd/0hSMLkQZ35T8pM9q8RSV5tUNlz+ST/yq0J9so6jqwf AjOp+SayObpN8sr2xhXHOdfthh44im80D2vf+lLt+x9qXlhj+KujcjsgcNwajdWNVCYoDCqIM BKaZS3WuHGpD2IwHenctncV+U9RucqxPtkzDQ+Q37lXwzUw0q4ZgeoJhj7d4IDgb/4ExFrMMW iSaNg0/zzHAklYLcFDAqsiwesTP1Ywks9nrsGcOHWOxLjQ/xILUifO+/hYfHkGGI5zoHApz8U 50M24LNhrOo0g/SRyfZHj7b0m0hElpy+mFu3k6YSnESTakmHkpOUj989f4aNcMYJiUn5ZcaGT j4BLauMVGnAtI+gLC0eV5eT5zMhvekpic0M/O/wWV6jkqjUMyW5cYyqwO5pCKb7sIittdGR+K 92UjZ+mu5w8r3PyVB4xCASoSxZ3lHGkD8E7IvKud8+AJ4BYORAgEmGBr0Uj1x8XpHz7nJ07cv oiEVHef/QDbcePJBnjURiV80Z8Og9d3S8+zFoNtcYMYglsA0tDBb5bwaxhNgORjYRrkfG0X8/ Dwdht8wAY1annsocW51zd3lLgFHw8pRF44S13s7Yd1A2Af+C9XzD69v6aFjwDzrA8/iw= Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.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: under-voltage 1: arm frequency capped 2: currently throttled 16: under-voltage 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,