From patchwork Mon Mar 8 17:18:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12123037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66E42C433DB for ; Mon, 8 Mar 2021 17:21:28 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2F9665215 for ; Mon, 8 Mar 2021 17:21:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2F9665215 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VNu3twuTFow++PE0jjDHucOVyvEsOVzzopCbpLOoSdw=; b=PVIhqaLov8Hl+akFCwxk/Eg96 I5aglRJL/mqZUNj9FaFFJmvx9CaKLdoE2On6dSuDa8CmmiyP2octMjljWAkhFz+nIV9zXCSYPGK90 0Wuwy/RoZCXSxbXb2qKNErBozMRbj4BT93Jcb9etXr79GxVRGgVaAaG5QZ+ax8EwygDiiqP/pmKKO axnqRDgIYRiKnRTZ0OYM8/O7frNABHUUAIwN1bs11ajR601ow3DjjlDujpyrw587DwG9l9OY+KuZH /CR/gCQkMSkG2B4s1CjlYA8LwKcNtQ9LiWlSij2W6fTKcySFl86IoqHncB87IytvgLoEcaxqxOT7f L7KsjkfEw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJJXg-001K80-Tq; Mon, 08 Mar 2021 17:19:41 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJJWk-001Jbj-KY; Mon, 08 Mar 2021 17:18:46 +0000 Received: by mail-ej1-x62e.google.com with SMTP id p8so21891071ejb.10; Mon, 08 Mar 2021 09:18:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zzFrV0h6kVmKH1KeRdOBV+T1cKCv+zoyF5GXtMVqnnc=; b=ZQyoED8Al2WlCMa63tJ2iUBGTkn6FbGYK99zvJRff783x9xVm/8yW0VLVTLrguXtOj sQOF0DJQeyPfA2PRg3yl4xbLZ5Oxbfd+wNinbTmeJZmXcslYuy+OALUth8VQXtDSRDnM br/qBffboudOn0i9xgaDQ768B9hcGHn0v7S62dkPTGrE8Et3A36y6kv7v3kFk0GSlW7o T+xgU4FBEX8IiNpvzV91jzTS8GjcL+gYJFRIi13K7OwhW6WByGjw/ExM/NZkT67F2463 tE8nXy52o+yspmVfIXWEcZpZfl7Rv6cMrthIl5YsXFruLoi1Fm+9A9vUAld6dPNHYHFo HhuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zzFrV0h6kVmKH1KeRdOBV+T1cKCv+zoyF5GXtMVqnnc=; b=Azr5u8FrNfeGLcWTGWweNi/YuTx+Qf5TlCq9/Bn4FFR0dogx4ZTzrPMYaerRv3I/MA nCduMdDqpOrl9DYfDggc9Zr64jiq2q/dEeUnuP28bdCiFDlTkwjOwczeDxr8V1ikflxw 5neZ7jPXKskjtItJs8zWVHm8jdJ/AYYz3veZfddZGYg1L0YisVHV4ne5Ze2npg7p2bQU xOpCK8ZiYGRxqPQwhbZENW4KldGD7X1VlZeQv/ood67322FmPQfLFy3RipWH8ZYLWyQV GudoDQN+/PObQ0EptABi36Dgi1DQpqdfgSaN+tyKk+5A94qOsGbh1yj/vII9FGkRdJqS Hnrg== X-Gm-Message-State: AOAM531fZQt/KAu6UG952YZ0rSQGfxI801c5sM/GHR81lEu6Ub4L+sMQ zDaCuRbjFaNZz0HUwOSOL3s= X-Google-Smtp-Source: ABdhPJx3YyHgQFJnJBXBqefgst1l9luX/FPnqHCg0y1wY3vUhcY2J78XRbFsb9ys29+/mYuMKaUN2g== X-Received: by 2002:a17:906:1746:: with SMTP id d6mr16488844eje.36.1615223920915; Mon, 08 Mar 2021 09:18:40 -0800 (PST) Received: from localhost.localdomain ([81.18.95.223]) by smtp.gmail.com with ESMTPSA id r5sm7457714eds.49.2021.03.08.09.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:18:40 -0800 (PST) From: Cristian Ciocaltea To: Stephen Boyd , Rob Herring , Manivannan Sadhasivam , =?utf-8?q?Andreas?= =?utf-8?q?_F=C3=A4rber?= , Michael Turquette , Edgar Bernardi Righi Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 6/6] clk: actions: Add NIC and ETHERNET clock support for Actions S500 SoC Date: Mon, 8 Mar 2021 19:18:31 +0200 Message-Id: X-Mailer: git-send-email 2.30.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210308_171843_587655_6AB14DFF X-CRM114-Status: GOOD ( 12.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for the missing NIC and ETHERNET clocks in the Actions Semi Owl S500 SoC clock driver. Additionally, change APB clock parent from AHB to the newly added NIC. Signed-off-by: Cristian Ciocaltea --- drivers/clk/actions/owl-s500.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/clk/actions/owl-s500.c b/drivers/clk/actions/owl-s500.c index b9e434173b4f..0ccc9619b302 100644 --- a/drivers/clk/actions/owl-s500.c +++ b/drivers/clk/actions/owl-s500.c @@ -112,6 +112,7 @@ static const char * const bisp_clk_mux_p[] = { "display_pll_clk", "dev_clk" }; static const char * const sensor_clk_mux_p[] = { "hosc", "bisp_clk" }; static const char * const sd_clk_mux_p[] = { "dev_clk", "nand_pll_clk" }; static const char * const pwm_clk_mux_p[] = { "losc", "hosc" }; +static const char * const nic_clk_mux_p[] = { "dev_clk", "display_pll_clk", "nand_pll_clk", "ddr_pll_clk" }; static const char * const ahbprediv_clk_mux_p[] = { "dev_clk", "display_pll_clk", "nand_pll_clk", "ddr_pll_clk" }; static const char * const uart_clk_mux_p[] = { "hosc", "dev_pll_clk" }; static const char * const de_clk_mux_p[] = { "display_pll_clk", "dev_clk" }; @@ -197,7 +198,7 @@ static OWL_GATE(hdmi_clk, "hdmi_clk", "hosc", CMU_DEVCLKEN1, 3, 0, 0); /* divider clocks */ static OWL_DIVIDER(h_clk, "h_clk", "ahbprediv_clk", CMU_BUSCLK1, 2, 2, h_div_table, 0, 0); -static OWL_DIVIDER(apb_clk, "apb_clk", "ahb_clk", CMU_BUSCLK1, 14, 2, NULL, 0, 0); +static OWL_DIVIDER(apb_clk, "apb_clk", "nic_clk", CMU_BUSCLK1, 14, 2, NULL, 0, 0); static OWL_DIVIDER(rmii_ref_clk, "rmii_ref_clk", "ethernet_pll_clk", CMU_ETHERNETPLL, 1, 1, rmii_ref_div_table, 0, 0); /* factor clocks */ @@ -205,6 +206,12 @@ static OWL_FACTOR(de1_clk, "de_clk1", "de_clk", CMU_DECLK, 0, 4, de_factor_table static OWL_FACTOR(de2_clk, "de_clk2", "de_clk", CMU_DECLK, 4, 4, de_factor_table, 0, 0); /* composite clocks */ +static OWL_COMP_DIV(nic_clk, "nic_clk", nic_clk_mux_p, + OWL_MUX_HW(CMU_BUSCLK1, 4, 3), + { 0 }, + OWL_DIVIDER_HW(CMU_BUSCLK1, 16, 2, 0, NULL), + 0); + static OWL_COMP_DIV(ahbprediv_clk, "ahbprediv_clk", ahbprediv_clk_mux_p, OWL_MUX_HW(CMU_BUSCLK1, 8, 3), { 0 }, @@ -320,6 +327,10 @@ static OWL_COMP_FIXED_FACTOR(i2c3_clk, "i2c3_clk", "ethernet_pll_clk", OWL_GATE_HW(CMU_DEVCLKEN1, 31, 0), 1, 5, 0); +static OWL_COMP_FIXED_FACTOR(ethernet_clk, "ethernet_clk", "ethernet_pll_clk", + OWL_GATE_HW(CMU_DEVCLKEN1, 22, 0), + 1, 20, 0); + static OWL_COMP_DIV(uart0_clk, "uart0_clk", uart_clk_mux_p, OWL_MUX_HW(CMU_UART0CLK, 16, 1), OWL_GATE_HW(CMU_DEVCLKEN1, 6, 0), @@ -454,6 +465,8 @@ static struct owl_clk_common *s500_clks[] = { &apb_clk.common, &dmac_clk.common, &gpio_clk.common, + &nic_clk.common, + ðernet_clk.common, }; static struct clk_hw_onecell_data s500_hw_clks = { @@ -513,6 +526,8 @@ static struct clk_hw_onecell_data s500_hw_clks = { [CLK_APB] = &apb_clk.common.hw, [CLK_DMAC] = &dmac_clk.common.hw, [CLK_GPIO] = &gpio_clk.common.hw, + [CLK_NIC] = &nic_clk.common.hw, + [CLK_ETHERNET] = ðernet_clk.common.hw, }, .num = CLK_NR_CLKS, };