From patchwork Fri Sep 21 15:20:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Brandt X-Patchwork-Id: 10610475 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 94946112B for ; Fri, 21 Sep 2018 15:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85C5B2E49F for ; Fri, 21 Sep 2018 15:21:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 797942E4AB; Fri, 21 Sep 2018 15:21:16 +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=unavailable 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 97C452E49F for ; Fri, 21 Sep 2018 15:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390338AbeIUVKf (ORCPT ); Fri, 21 Sep 2018 17:10:35 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:31807 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390076AbeIUVKf (ORCPT ); Fri, 21 Sep 2018 17:10:35 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 22 Sep 2018 00:21:11 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id AB60C89C33; Sat, 22 Sep 2018 00:21:11 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.54,285,1534777200"; d="scan'208";a="293152789" Received: from unknown (HELO rtamta01.rta.renesas.com) ([143.103.48.75]) by relmlii2.idc.renesas.com with ESMTP; 22 Sep 2018 00:21:10 +0900 Received: from ubuntu.localdomain (unknown [143.103.58.47]) by rtamta01.rta.renesas.com (Postfix) with ESMTP id 322401FE; Fri, 21 Sep 2018 15:21:06 +0000 (UTC) From: Chris Brandt To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Simon Horman , Chris Brandt Subject: [PATCH 0/2] clk: renesas: r7s9210: Add support for early clocks Date: Fri, 21 Sep 2018 10:20:52 -0500 Message-Id: <20180921152054.117774-1-chris.brandt@renesas.com> X-Mailer: git-send-email 2.16.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The OSTM timer driver for RZ/A2 uses TIMER_OF_DECLARE which requires the ostm module clocks to be registers early in boot. This series add early clock support to cpg-mssr Here are some notes I took: * Switched to using of_iomap(cpg_np, 0) instead of platform_get_resource(pdev, IORESOURCE_MEM, 0) * All devm_xxx calls were replaced with the traditinal functions because 'dev' is not available for early probe * some functions are still using dev_dbg and dev_err for messages, but in early init, dev is set to NULL so it doesn't crash, the messages just look like this: (NULL device *): Core clock extal at 24000000 Hz (NULL device *): clock (1, 35) is ostm1 at 66000000 Hz * np was added to priv np is saved because dev->of_node doesn't exist during early init and we need to avoid using 'dev' for any function that will run during early init * all .init functions (r8xxxx_cpg_mssr_init) for the SoCs do not use dev, except for r8a7791_cpg_mssr_init for the lines: struct device_node *np = dev->of_node; of_device_is_compatible(np, "renesas,r8a7793-cpg-mssr") But, so if early clock support was every needed for r8a7791 or r8a7793, that line will need to be changed. * In r7s9210-cpg-mssr.c, I moved updating the clock ratio table to a separate function (r7s9210_update_table) because it looks cleaner. Chris Brandt (2): clk: renesas: cpg-mssr: Add early clock support clk: renesas: r7s9210: Convert some clocks to early drivers/clk/renesas/r7s9210-cpg-mssr.c | 141 +++++++++++++++++++++------------ drivers/clk/renesas/renesas-cpg-mssr.c | 106 ++++++++++++++++++++----- drivers/clk/renesas/renesas-cpg-mssr.h | 6 ++ 3 files changed, 181 insertions(+), 72 deletions(-)