From patchwork Tue Jun 4 17:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 10975837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74BC014B6 for ; Tue, 4 Jun 2019 17:33:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F36F287ED for ; Tue, 4 Jun 2019 17:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52CF7287F2; Tue, 4 Jun 2019 17:33:56 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 EB967287F2 for ; Tue, 4 Jun 2019 17:33:55 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=6brCVm1c8xSJmy1J/s0O0B+AbOQ7rKWkAhtHC1954cM=; b=YzuvbT5WEgNxby K4N6WNRl5vodNq2HPRwxCajhI+5Ey6QjW/802EN09W8mcj6wYDd9QhvhEdLRYoZPX5ndr04x7WY1n T13mEDy9vaHOJ0R2dygbs/XPCqkAwV4pqVp0tt2VvJugkNvK4T+BW/+vxNivSITZwppjljhTn3ZJU 6wDsSavmanOPgn6100SGDECkBnKugXVSjCddabqBt9Pc1YsH3OTQ2IWYBeF6we2NKN+vIBO6o91lN PoKW6SaRt7N4Zt6H2EmRu+u4jlscwhc7QYbpBS2SmGq3QMId+6uyJtOx5bxMyCQ4EAIpixgpcNNtS 4QiPMadiXf0J+nek/ZBQ==; 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 1hYDJn-0001ir-38; Tue, 04 Jun 2019 17:33:51 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYDJj-0001TE-GZ; Tue, 04 Jun 2019 17:33:49 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F3163AE05; Tue, 4 Jun 2019 17:33:42 +0000 (UTC) From: Nicolas Saenz Julienne To: stefan.wahren@i2se.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 0/4] cpufreq support for the Raspberry Pi Date: Tue, 4 Jun 2019 19:32:18 +0200 Message-Id: <20190604173223.4229-1-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_103347_698519_87D42FD8 X-CRM114-Status: GOOD ( 11.79 ) 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: f.fainelli@gmail.com, ptesarik@suse.com, sboyd@kernel.org, viresh.kumar@linaro.org, mturquette@baylibre.com, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, eric@anholt.net, bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-clk@vger.kernel.org, mbrugger@suse.de, ssuloev@orpaltech.com 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 Hi all, this series aims at adding cpufreq support to the Raspberry Pi family of boards. The previous revision can be found at: https://lkml.org/lkml/2019/5/20/431 The series first factors out 'pllb' from clk-bcm2385 and creates a new clk driver that operates it over RPi's firmware interface[1]. We are forced to do so as the firmware 'owns' the pll and we're not allowed to change through the register interface directly as we might race with the over-temperature and under-voltage protections provided by the firmware. Next it creates a minimal cpufreq driver that populates the CPU's opp table, and registers cpufreq-dt. Which is needed as the firmware controls the max and min frequencies available. This was tested on a RPi3b+ and RPI2b which are the boards I have access to. Until this is tested broadly the cpufreq driver takes care of filtering out the rest of boards. That's all, kind regards, Nicolas [1] https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface --- Changes since RFC: - Addressed Viresh's comments in cpufreq driver - Addressed Stefan's comments in both cpufreq & clk drivers - Moved all firmware clk operations into it's own driver Nicolas Saenz Julienne (4): clk: bcm2835: remove pllb clk: bcm283x: add driver interfacing with Raspberry Pi's firmware clk: bcm2835: register Raspberry Pi's firmware clk device cpufreq: add driver for Raspbery Pi drivers/clk/bcm/Makefile | 1 + drivers/clk/bcm/clk-bcm2835.c | 40 ++-- drivers/clk/bcm/clk-raspberrypi.c | 316 ++++++++++++++++++++++++++ drivers/cpufreq/Kconfig.arm | 8 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/raspberrypi-cpufreq.c | 84 +++++++ 6 files changed, 423 insertions(+), 27 deletions(-) create mode 100644 drivers/clk/bcm/clk-raspberrypi.c create mode 100644 drivers/cpufreq/raspberrypi-cpufreq.c