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: 10403961 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 C512C60155 for ; Wed, 16 May 2018 13:38:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2D4828949 for ; Wed, 16 May 2018 13:38:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A717828970; Wed, 16 May 2018 13:38:45 +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 B2046288FD for ; Wed, 16 May 2018 13:38:40 +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=OPkgoLAjJxEPgg4pEI8MRM3H+HmwyX40WuWZtO+CbSQ=; b=C4l+V1KA1xoZj4vk/KlRS5g73J SbmqMBEw7PSB39XwjUknkHrA/UaEW/dS5g6XtEzh9ZPpKV2n68R7lztgmB2c/avpuoQ7HQ1PjRuFZ 3Ty2eUEzbD7MzrDqIFaI6aFYkQnsywD5C/o6QXMoNHc3r69le6CGa6V2hBanYd31aFnpUkoZyHRd0 I9y2zFtEe1kcKcootR5EGmXBpJ7cZapYweP7/emP9PjdYF3YQvByjYiLqbteW3RBdmt3GZCwyKS1o HEH66/Kgs7GOJEtLIgAMjPLKVcV2Ktgau0YykiM7lDdXnljLBH25duXGwJzJlHxjK26CqEjJ+tdLW 94Rt4Flw==; 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 1fIwdP-00080Z-GI; Wed, 16 May 2018 13:38:27 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIwdK-0007r2-Lg; Wed, 16 May 2018 13:38:24 +0000 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 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180516_063823_041799_1DD9217D X-CRM114-Status: GOOD ( 15.08 ) 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, devicetree@vger.kernel.org, Florian Fainelli , Scott Branden , Ray Jui , Stefan Wahren , 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: 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,