From patchwork Tue May 22 11:21:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10418069 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 8F59060224 for ; Tue, 22 May 2018 11:24:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D1FE28BF0 for ; Tue, 22 May 2018 11:24:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71B4628BF7; Tue, 22 May 2018 11:24:54 +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 D87D928BF0 for ; Tue, 22 May 2018 11:24:53 +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=JfH+QiShX3o/XeQ9ATbABoz7GR 5NdTMUU9DmFE/iGtON//2jZhV1SLbvsJqo1c5rvtVZsZ7VGBzK2OG4rv0hY91Lnao3twWZb9/9dTV eHcj3AE24LAE+FxwWHr0yJF7RrytY8v5nQaOgTUhF44Y8WB66j4O9adRb2otSrUHd8xgUeF8Ayc8/ BD/3/rlI+YA8Ysod+Vsg7UfqJtvxqto8JpEGUmcrhb5cnOKtQozOozNvEPR0I3SLHdEbSfm+Lvi+u 54gSo2sIPxO6zWI4Oe3xi0TAYZRTWXPFV5szKCBR94ZzfpWa2NMbEQGSsUQp0BsLA+Oijw6rE2Qzq OW1xypYQ==; 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 1fL5PL-00031r-Ie; Tue, 22 May 2018 11:24:47 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fL5OE-0002O3-UH; Tue, 22 May 2018 11:23:55 +0000 Received: from localhost.localdomain ([37.4.249.136]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MVq96-1frxDm0ADg-00X7DJ; Tue, 22 May 2018 13:22:26 +0200 From: Stefan Wahren To: Rob Herring , Mark Rutland , Jean Delvare , Guenter Roeck , Jonathan Corbet , Eric Anholt Subject: [PATCH RFC V2 1/6] ARM: bcm2835: Add GET_THROTTLED firmware property Date: Tue, 22 May 2018 13:21:47 +0200 Message-Id: <1526988112-4021-2-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526988112-4021-1-git-send-email-stefan.wahren@i2se.com> References: <1526988112-4021-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:lJuRb1m8S68CU4yIMOgECTRo1RGsBHZKgzMcxhtbCFFWhNRa32G gKUwZGrAUlZqoc84YsLSaCrLwA6EmpKBbRGHFpPFxXYfUqT2F95zaYGPHQvFl6NM9Tj9wBL Cojq7VOHPHp+P7Gt6t37Kt0jgUnW2UN6arKFWnwB1suP2qUyUdbYs7h3uxYLnXrnW9Zu6Vx wib7sNHlrcI8cUwZIDY9w== X-UI-Out-Filterresults: notjunk:1; V01:K0:eVpaUIc70kk=:pVnJ3jUN06k0OgTszgVO6f xEfqrsRokOSoWKhMdjE92e2xNcKJew6hNBQ10nigJ0N6H6F1IOHZOfK/3LlKuC9yQkITJhSxO Kd+tKpfdeeFOvpAfpFyxlBNE4PYTL5U37c6GPNFzjf5PCTTF4lTISyVFEXRVIZ3BTms9f3QHw h6l8o3CZaX4sxNs/rk6AIqT337BAd7Y8Ta96SSL2xectwU/BCQu5LblxdAd4QIYRW7zaMKjJR A22a4RX8Jl4Op4BsvxyfSTfmPN8sBcHsVVBk/raSWw7lNLVj1xXs22HqO5m97hKMZ7TT7s4W6 7u3h/MfNimTsFsgFBt9rUPaDjZ7v5vBpYgRAlkzC58A1cgNYi/aoStytLNOO5PQ61ifWttRXL aWXBnUyCKf6+Q1H2hdHS9f4d9hyJJfPg4qHZfldTGXazDE+ZR6CC7xDVnddShx5eCixfoJ0Vb r3fJCg8X5aAy/VF1vZBsVEOcgFsVoX8UR9YyepL3gI4VRIQAxtPdNRsGzhm4NAJLuCsSZC56x QqiXf9d0V+5oUBh8iWgGg+61xNC2rnTgnCA2T+BMZ2mBFbJisMkqKLlfEY0HjREHrv3LzPHqC tjymieL2YYMeTCeeyshlnp7rzs7jApTjhFoaN2F0PkYCxk+y/czH4RH5ejLeTWpk8ypX+xnP4 gBVwFDFdkpQZoovyyYvxn372y0V9JiCKsuD2MWC/FkAbAovP9yt4chONrFYFNkdck1K4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180522_042339_823267_ED8F0175 X-CRM114-Status: GOOD ( 14.05 ) 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 , linux-doc@vger.kernel.org, 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: 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,