From patchwork Mon Mar 8 17:18:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12123027 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,UPPERCASE_50_75, 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 B2332C433DB for ; Mon, 8 Mar 2021 17:20:35 +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 368756522C for ; Mon, 8 Mar 2021 17:20:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 368756522C 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=eMEKwbbfKTGXzwLUzy0YLbFrUaEW916sM1+auIdDcLE=; b=bKjos9+TataUP8LiV7aPNnVYz usJX07tGDaT7YVT5WDSEYs1NvrhrGjfUmXoAlCSHv/gpGAGF4Yun43PsTewi4vIBlPIrsvbSm1CDl n+xOUPKz+tE6pG019kzxVgowdopWR4ERY/zBCjhHoVsGtPa8mEWvegBHR/OXLaK5CGU6U7t6AQoDG vLVMcPtTQ4z/Q5ym7OZphgNkKZzvwQCoam0H89RSGWw1q4otLYowatr4TRXzMJEQAdqvR0bGAF27W +nEv8UPoixik3xO76cnFl8c5acs45pZarrkMbZMyBq/yPCZEJXufTRKbT/L1QWMaI7Lod7J9JxM3M HOeJ6zyQA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJJWy-001Jju-78; Mon, 08 Mar 2021 17:18:56 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJJWj-001JYM-6W; Mon, 08 Mar 2021 17:18:43 +0000 Received: by mail-ed1-x52e.google.com with SMTP id h10so15884895edl.6; Mon, 08 Mar 2021 09:18:35 -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=r9qTSZ8pXkbJjsf87TrGpRoyj07qm0gGBH/J86fk7+Y=; b=BLmR99duGmJJ0gfn5ATU+9mnhp/peA1yLufD1JIV/qJYRIsqXjxNUjdEs81EsZLBuk aGJQjYXR6ZEnqaF65TJ91SQMlzSyPpWvK4rRiwENkcC+VsHEMjGuXLAy3yvKPsF2iGhW YKH0Z/6V5B5qMevFVMSlHo8uYRvqyTudIV/ezT2fblT7MLRO7ZuCY+ueXsSQoAJeFGhB mICHtwiDGgvgYjrJNxiuIkmP+UF+dQ0LQfDClrC/tGV507WQ9Pm20Kd6o/M1trFikBWW +zfvQ7IWOMFmJgPaWmSnXBGb7I6k+fyXIubNqVgN9dOKkbwuwyG497pK/y3WGx9CCGvV 16ww== 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=r9qTSZ8pXkbJjsf87TrGpRoyj07qm0gGBH/J86fk7+Y=; b=N+81CsyAMH0nRSMI8JLC3Vk9RtB6kP7aTrnSYYuFa0T4KC/yjF53JOVPZmzCAJTVFb RhGCnBp/NDyJAlOZOWIg8m4bgbFkvNSqv/oN/dQ0gVzP0rXuCt0Kj55Z6c44K/qBZARA pweHXuc+FWl+1ARIKaOatcJGJpfMp/g2asYdU74cCu8cjvoAAjA7HUfNyO+mNm+zadV3 gK9V6tVKTk9zF3f0t0GBZ4WzatURNrKWobBI/vBeI7CsO0Z2ZWpOAlZ55IoKfVtFQyKR Dyo4bOQq0FOJl5QQo2+Ok87i+i/C3k1o8mdmjFPdL7MYbYzDVm5xIJNlqA0Ocmnk2xzN kYsg== X-Gm-Message-State: AOAM533VmXeRJYiZVzN/Cn5sN9//u8oWaB8v0b7DLAo+MPdwoX1oGSYl 2rNxTZbzBgwsptYlJUGzEhs= X-Google-Smtp-Source: ABdhPJzutZpnRgcMtQ6TaXSnRWL6adNIER4UuJX8pHUQwy0XQo4hywqUx28dNQ1uWy0ALzfg2letOg== X-Received: by 2002:a05:6402:1d39:: with SMTP id dh25mr23701758edb.282.1615223914890; Mon, 08 Mar 2021 09:18:34 -0800 (PST) Received: from localhost.localdomain ([81.18.95.223]) by smtp.gmail.com with ESMTPSA id r5sm7457714eds.49.2021.03.08.09.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:18:34 -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 1/6] clk: actions: Fix UART clock dividers on Owl S500 SoC Date: Mon, 8 Mar 2021 19:18:26 +0200 Message-Id: <3d3118fc3e0973cc1cbbdbb98b643f0c82dd74fc.1615221459.git.cristian.ciocaltea@gmail.com> 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_171841_385693_468F31E8 X-CRM114-Status: GOOD ( 10.62 ) 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 Use correct divider registers for the Actions Semi Owl S500 SoC's UART clocks. Fixes: ed6b4795ece4 ("clk: actions: Add clock driver for S500 SoC") Signed-off-by: Cristian Ciocaltea Reviewed-by: Manivannan Sadhasivam --- drivers/clk/actions/owl-s500.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/actions/owl-s500.c b/drivers/clk/actions/owl-s500.c index 61bb224f6330..75b7186185b0 100644 --- a/drivers/clk/actions/owl-s500.c +++ b/drivers/clk/actions/owl-s500.c @@ -305,7 +305,7 @@ static OWL_COMP_FIXED_FACTOR(i2c3_clk, "i2c3_clk", "ethernet_pll_clk", 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), - OWL_DIVIDER_HW(CMU_UART1CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), + OWL_DIVIDER_HW(CMU_UART0CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), CLK_IGNORE_UNUSED); static OWL_COMP_DIV(uart1_clk, "uart1_clk", uart_clk_mux_p, @@ -317,31 +317,31 @@ static OWL_COMP_DIV(uart1_clk, "uart1_clk", uart_clk_mux_p, static OWL_COMP_DIV(uart2_clk, "uart2_clk", uart_clk_mux_p, OWL_MUX_HW(CMU_UART2CLK, 16, 1), OWL_GATE_HW(CMU_DEVCLKEN1, 8, 0), - OWL_DIVIDER_HW(CMU_UART1CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), + OWL_DIVIDER_HW(CMU_UART2CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), CLK_IGNORE_UNUSED); static OWL_COMP_DIV(uart3_clk, "uart3_clk", uart_clk_mux_p, OWL_MUX_HW(CMU_UART3CLK, 16, 1), OWL_GATE_HW(CMU_DEVCLKEN1, 19, 0), - OWL_DIVIDER_HW(CMU_UART1CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), + OWL_DIVIDER_HW(CMU_UART3CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), CLK_IGNORE_UNUSED); static OWL_COMP_DIV(uart4_clk, "uart4_clk", uart_clk_mux_p, OWL_MUX_HW(CMU_UART4CLK, 16, 1), OWL_GATE_HW(CMU_DEVCLKEN1, 20, 0), - OWL_DIVIDER_HW(CMU_UART1CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), + OWL_DIVIDER_HW(CMU_UART4CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), CLK_IGNORE_UNUSED); static OWL_COMP_DIV(uart5_clk, "uart5_clk", uart_clk_mux_p, OWL_MUX_HW(CMU_UART5CLK, 16, 1), OWL_GATE_HW(CMU_DEVCLKEN1, 21, 0), - OWL_DIVIDER_HW(CMU_UART1CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), + OWL_DIVIDER_HW(CMU_UART5CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), CLK_IGNORE_UNUSED); static OWL_COMP_DIV(uart6_clk, "uart6_clk", uart_clk_mux_p, OWL_MUX_HW(CMU_UART6CLK, 16, 1), OWL_GATE_HW(CMU_DEVCLKEN1, 18, 0), - OWL_DIVIDER_HW(CMU_UART1CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), + OWL_DIVIDER_HW(CMU_UART6CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), CLK_IGNORE_UNUSED); static OWL_COMP_DIV(i2srx_clk, "i2srx_clk", i2s_clk_mux_p, From patchwork Mon Mar 8 17:18:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12123029 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=ham 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 10625C433E0 for ; Mon, 8 Mar 2021 17:20:38 +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 80E2F6522C for ; Mon, 8 Mar 2021 17:20:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80E2F6522C 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=RQ2UKmBMtvTqCui5Q8A0LwJLN/70xF5cIj0s8JhbxqY=; b=ZhAzhCuRRt/SxX23oRXVsGS98 tgrTq0wQplGyOj9/4rL/mBFDPi2omTW+EeUDoZEk6zKRXdPRr0mzFhJr4NocuavdFBCr24Wnj6qQG QCRmkI4bSpNboyHBGimzCQW3oRM3/RgL9qjQm/RdC8MznUjPbS3rLSzxhDrbIPqfZ6Vm+EN5gqYG1 A8pvSK/akw+4eTYaD9zxF7Z838ueYbeMjTkqTS4/odj4S8Yanttq9FAJ5bXDWIoOKH1936fw6pfHp vjLyMc03iqUavqB4ILjHna/FIvU1We4h6+2VXv+2oXCveW9NCU1blQvV/vgD/iQKyO0YKXLGM+Cdw zh4yqtTvw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJJXA-001Jpy-1O; Mon, 08 Mar 2021 17:19:08 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJJWk-001JZX-1a; Mon, 08 Mar 2021 17:18:44 +0000 Received: by mail-ej1-x62f.google.com with SMTP id dx17so21917482ejb.2; Mon, 08 Mar 2021 09:18:36 -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=RYsjPradGS8ApOPyI0o2lRWvUZqCfCUNgbBO342kp4Q=; b=WFVDT5yLvxXAwsyNBe5017cELXgSwobsqxLtI0ALi9P7YAmc7XBwB0th17LXaLunBf P9fxgX4AvBZtq1g4Nf5j5x6uXTWC0Beo/qC5XrwVyknkSP5VGiUJVNLnoaOwC7topATX tvZFMvD/X35InooOJDakHU5BvAC5XjGHyWq9lPA6rhDySRI13rvP/yRz3hEQkT2OLHKI YGV7y4O2fko4r1jZYVI1OvT9bJAFqtxGYTSCnn8QaI/P5dVtNlPbeqwE5GGRVVH2QX7k wqn+2fERuy7TAw6zn9klJP5SVCIHKHt5YVon7Yib5chHjPEv+/oxMeYt3zUbKupQjywX dAng== 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=RYsjPradGS8ApOPyI0o2lRWvUZqCfCUNgbBO342kp4Q=; b=anagpLbXwqQbFzDorkK/rTlPHWcIH4s/UJUcw3zKjhyJZ42l01d26KaqiTktJHX6Ms 8XcpFdWydRXpvgToSGfZDnMH4Yw0b/MkFcrbQCo1mFTstix2DGrCMLEvLqRgobxN7LDZ FH45s+weTe6W9qUnfbgxSiAyh160ZD0ttuvKm0m56RCt1WmrYTk9D86svKLXfE0sjJsN jXOJjf9VUF3VuUTn9FDedCzbho5/wnNllRhJnqyg4hk1obeQ2KFfjJqiN759sCS3SDx2 bvbI6kSL5Or+zM+di5dW9n4Qbqc2qBYIKlMuq6c/1xbHAdkY9WLTqixBOSGMdr5VkrX+ TxnA== X-Gm-Message-State: AOAM533Xxj1484LEn4Njl1PjlEUXvkCy9d/xoHEAzXKKEd8zn0MY/NJN YOjTnmrTVJwvlfBRAq5vg5w= X-Google-Smtp-Source: ABdhPJwOXycXsakFZ72cmFhDJv2CT4lqQGXyjHAmlC9rE9RmeAhJg7UTiveMAZKyG17GFOGn7fRiAQ== X-Received: by 2002:a17:906:90d8:: with SMTP id v24mr15741412ejw.547.1615223916111; Mon, 08 Mar 2021 09:18:36 -0800 (PST) Received: from localhost.localdomain ([81.18.95.223]) by smtp.gmail.com with ESMTPSA id r5sm7457714eds.49.2021.03.08.09.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:18:35 -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 2/6] clk: actions: Fix SD clocks factor table on Owl S500 SoC Date: Mon, 8 Mar 2021 19:18:27 +0200 Message-Id: <973b08fe414321ba4ade096a4917cadc2013426e.1615221459.git.cristian.ciocaltea@gmail.com> 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_171842_982888_4D424698 X-CRM114-Status: GOOD ( 11.78 ) 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 Drop the unsupported entries in the factor table used for the SD[0-2] clocks definitions on the Actions Semi Owl S500 SoC. Fixes: ed6b4795ece4 ("clk: actions: Add clock driver for S500 SoC") Signed-off-by: Cristian Ciocaltea --- drivers/clk/actions/owl-s500.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/clk/actions/owl-s500.c b/drivers/clk/actions/owl-s500.c index 75b7186185b0..69cd959205f5 100644 --- a/drivers/clk/actions/owl-s500.c +++ b/drivers/clk/actions/owl-s500.c @@ -127,8 +127,6 @@ static struct clk_factor_table sd_factor_table[] = { { 12, 1, 13 }, { 13, 1, 14 }, { 14, 1, 15 }, { 15, 1, 16 }, { 16, 1, 17 }, { 17, 1, 18 }, { 18, 1, 19 }, { 19, 1, 20 }, { 20, 1, 21 }, { 21, 1, 22 }, { 22, 1, 23 }, { 23, 1, 24 }, - { 24, 1, 25 }, { 25, 1, 26 }, { 26, 1, 27 }, { 27, 1, 28 }, - { 28, 1, 29 }, { 29, 1, 30 }, { 30, 1, 31 }, { 31, 1, 32 }, /* bit8: /128 */ { 256, 1, 1 * 128 }, { 257, 1, 2 * 128 }, { 258, 1, 3 * 128 }, { 259, 1, 4 * 128 }, @@ -137,8 +135,6 @@ static struct clk_factor_table sd_factor_table[] = { { 268, 1, 13 * 128 }, { 269, 1, 14 * 128 }, { 270, 1, 15 * 128 }, { 271, 1, 16 * 128 }, { 272, 1, 17 * 128 }, { 273, 1, 18 * 128 }, { 274, 1, 19 * 128 }, { 275, 1, 20 * 128 }, { 276, 1, 21 * 128 }, { 277, 1, 22 * 128 }, { 278, 1, 23 * 128 }, { 279, 1, 24 * 128 }, - { 280, 1, 25 * 128 }, { 281, 1, 26 * 128 }, { 282, 1, 27 * 128 }, { 283, 1, 28 * 128 }, - { 284, 1, 29 * 128 }, { 285, 1, 30 * 128 }, { 286, 1, 31 * 128 }, { 287, 1, 32 * 128 }, { 0, 0, 0 }, }; From patchwork Mon Mar 8 17:18:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12123035 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 C7E79C433E0 for ; Mon, 8 Mar 2021 17:21:27 +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 4DB60650E0 for ; Mon, 8 Mar 2021 17:21:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DB60650E0 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=UABW6H3JTayGI0uBVHY7TDB4rCGGcofSTn9x1UhNTmo=; b=gsFxU3LlVzKWWPzB68Igv3TpN mL2M829ACxniBfHoVxSw+T37WAQM30OdrwxSRW/bnrlE/UknLW3v13nGb7ghXVAyw7MbmXKOR+yYt IhoLvUv8BZQ6eU/Rhxh16p3lxsDFHbgbdTMqGrPSbH5Euy50XIxaoGxW1Cns+BsQFQOJNTKrvPNkH dALmNZUtCjbPqG7MKz6qIx9mNuOMCwawQa64Xpf/uLX0I3iFPiwsI0rYhrf1laLV7or+zWIT+a8lI M7Y1/4heOjk7JIgpkD9Q8ydHeNI5yKXIB7IthpVd3Zb+yYvp9wDFGW7sgVvKbwtuQhxmMIyquzhe0 d/2kwrOag==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJJXy-001KJP-Tv; Mon, 08 Mar 2021 17:19:59 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJJWk-001JZo-CS; Mon, 08 Mar 2021 17:18:46 +0000 Received: by mail-ed1-x532.google.com with SMTP id dm26so15804088edb.12; Mon, 08 Mar 2021 09:18:37 -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=AICUc7/WIpyKcr6PZSNCmOkXDiStUBOvDovzIM4PHc0=; b=IMMOE+olayuWnwpdCosd+VnWOE+l5I/V8Swj7e5oJkoyfsBmKklQvkxaIXB24/cqza Il0R5JV5EOjUSPNh6KegfM6VcSp+3ZTTxw49dbTjTbr2jac3vyNCCd/oVNgrjrXnEFXt iNZz/PHd5wXjSwRci3u7yVnR66TkEfB4c4L+Hx9gQ5UaH85Frm8UBjFe+RcQS9AN5v5p v+cKvzraES7nJ8QCc1p9gWogLcO5aOG5mRY4rYgB2YDSvFLuDc/dEZR2D5AVlx3AM1/d WATsI1ifLp6N0T937G8SY2IOZ2uPTUhjUquPjWUjROcTPnpxuO5BGDGqg5gYwVzOdSVD pJnA== 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=AICUc7/WIpyKcr6PZSNCmOkXDiStUBOvDovzIM4PHc0=; b=R6xt+CmUzjwqbgtJV24iWd0ofpAa0BPJ6zFTrFCfbKWGNAOLmvAqN0LpUMnrK5r14m 1Pgcdp8VsLz4p4Bb7pARzlGPia6beJafKlILc3hgQCRLFgD/XLOzBM/QLTBf/ou/QV0A cd6ttxeeW0q0Q+yEzfnt2OcxgOr7nq8xJoIrGHWUFiRBZJmKuo18xfiXzG3fAXeUp/UT iROPUoBVOvE832BqnWvVlTtbxRgQKHKAW6YR2+RdFCF7HMB7z7oG3UugKuou7Cjis82S +HeHsJfFMB7pM24DPCjdVu4VhVFUaLBkkdsfLpgkQsh37egqy0m9LFKu4htOJkvFDlHU HhGQ== X-Gm-Message-State: AOAM531TOTAmBY6VS69sXvooZ23aM0nOBy5NLe1vkVpa/ESu5hSW8Glz QcIpnFM+VcWVbjzEGgUi2cQ= X-Google-Smtp-Source: ABdhPJwOMKO9OQ4XcBludL34Vaqc3ppmltZZNdItDdPx/DWvUQePT23vy6WJGJ2swzkRpwvmxbWUUg== X-Received: by 2002:aa7:cf17:: with SMTP id a23mr23943922edy.30.1615223917333; Mon, 08 Mar 2021 09:18:37 -0800 (PST) Received: from localhost.localdomain ([81.18.95.223]) by smtp.gmail.com with ESMTPSA id r5sm7457714eds.49.2021.03.08.09.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:18:36 -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 3/6] clk: actions: Fix bisp_factor_table based clocks on Owl S500 SoC Date: Mon, 8 Mar 2021 19:18:28 +0200 Message-Id: <13576ddb604a9097603d95cd2605275c20fb2f56.1615221459.git.cristian.ciocaltea@gmail.com> 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_586231_46A37812 X-CRM114-Status: GOOD ( 15.92 ) 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 The following clocks of the Actions Semi Owl S500 SoC have been defined to use a shared clock factor table 'bisp_factor_table[]': DE[1-2], VCE, VDE, BISP, SENSOR[0-1] There are several issues involved in this approach: * 'bisp_factor_table[]' describes the configuration of a regular 8-rates divider, so its usage is redundant. Additionally, judging by the BISP clock context, it is incomplete since it maps only 8 out of 12 possible entries. * The clocks mentioned above are not identical in terms of the available rates, therefore cannot rely on the same factor table. Specifically, BISP and SENSOR* are standard 12-rate dividers so their configuration should rely on a proper clock div table, while VCE and VDE require a factor table that is a actually a subset of the one needed for DE[1-2] clocks. Let's fix this by implementing the following: * Add new factor tables 'de_factor_table' and 'hde_factor_table' to properly handle DE[1-2], VCE and VDE clocks. * Add a common div table 'std12rate_div_table' for BISP and SENSOR[0-1] clocks converted to OWL_COMP_DIV. * Drop the now unused 'bisp_factor_table[]'. Additionally, since SENSOR[0-1] are not gated, unset the OWL_GATE_HW configuration and drop the CLK_IGNORE_UNUSED flag in their definitions. Fixes: ed6b4795ece4 ("clk: actions: Add clock driver for S500 SoC") Signed-off-by: Cristian Ciocaltea --- drivers/clk/actions/owl-s500.c | 48 ++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/drivers/clk/actions/owl-s500.c b/drivers/clk/actions/owl-s500.c index 69cd959205f5..abe8874353de 100644 --- a/drivers/clk/actions/owl-s500.c +++ b/drivers/clk/actions/owl-s500.c @@ -138,9 +138,16 @@ static struct clk_factor_table sd_factor_table[] = { { 0, 0, 0 }, }; -static struct clk_factor_table bisp_factor_table[] = { - { 0, 1, 1 }, { 1, 1, 2 }, { 2, 1, 3 }, { 3, 1, 4 }, - { 4, 1, 5 }, { 5, 1, 6 }, { 6, 1, 7 }, { 7, 1, 8 }, +static struct clk_factor_table de_factor_table[] = { + { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 }, + { 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 }, + { 8, 1, 12 }, + { 0, 0, 0 }, +}; + +static struct clk_factor_table hde_factor_table[] = { + { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 }, + { 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 }, { 0, 0, 0 }, }; @@ -154,6 +161,13 @@ static struct clk_div_table rmii_ref_div_table[] = { { 0, 0 }, }; +static struct clk_div_table std12rate_div_table[] = { + { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, + { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 8 }, + { 8, 9 }, { 9, 10 }, { 10, 11 }, { 11, 12 }, + { 0, 0 }, +}; + static struct clk_div_table i2s_div_table[] = { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 }, @@ -189,39 +203,39 @@ static OWL_DIVIDER(rmii_ref_clk, "rmii_ref_clk", "ethernet_pll_clk", CMU_ETHERNE /* factor clocks */ static OWL_FACTOR(ahb_clk, "ahb_clk", "h_clk", CMU_BUSCLK1, 2, 2, ahb_factor_table, 0, 0); -static OWL_FACTOR(de1_clk, "de_clk1", "de_clk", CMU_DECLK, 0, 3, bisp_factor_table, 0, 0); -static OWL_FACTOR(de2_clk, "de_clk2", "de_clk", CMU_DECLK, 4, 3, bisp_factor_table, 0, 0); +static OWL_FACTOR(de1_clk, "de_clk1", "de_clk", CMU_DECLK, 0, 4, de_factor_table, 0, 0); +static OWL_FACTOR(de2_clk, "de_clk2", "de_clk", CMU_DECLK, 4, 4, de_factor_table, 0, 0); /* composite clocks */ static OWL_COMP_FACTOR(vce_clk, "vce_clk", hde_clk_mux_p, OWL_MUX_HW(CMU_VCECLK, 4, 2), OWL_GATE_HW(CMU_DEVCLKEN0, 26, 0), - OWL_FACTOR_HW(CMU_VCECLK, 0, 3, 0, bisp_factor_table), + OWL_FACTOR_HW(CMU_VCECLK, 0, 3, 0, hde_factor_table), 0); static OWL_COMP_FACTOR(vde_clk, "vde_clk", hde_clk_mux_p, OWL_MUX_HW(CMU_VDECLK, 4, 2), OWL_GATE_HW(CMU_DEVCLKEN0, 25, 0), - OWL_FACTOR_HW(CMU_VDECLK, 0, 3, 0, bisp_factor_table), + OWL_FACTOR_HW(CMU_VDECLK, 0, 3, 0, hde_factor_table), 0); -static OWL_COMP_FACTOR(bisp_clk, "bisp_clk", bisp_clk_mux_p, +static OWL_COMP_DIV(bisp_clk, "bisp_clk", bisp_clk_mux_p, OWL_MUX_HW(CMU_BISPCLK, 4, 1), OWL_GATE_HW(CMU_DEVCLKEN0, 14, 0), - OWL_FACTOR_HW(CMU_BISPCLK, 0, 3, 0, bisp_factor_table), + OWL_DIVIDER_HW(CMU_BISPCLK, 0, 4, 0, std12rate_div_table), 0); -static OWL_COMP_FACTOR(sensor0_clk, "sensor0_clk", sensor_clk_mux_p, +static OWL_COMP_DIV(sensor0_clk, "sensor0_clk", sensor_clk_mux_p, OWL_MUX_HW(CMU_SENSORCLK, 4, 1), - OWL_GATE_HW(CMU_DEVCLKEN0, 14, 0), - OWL_FACTOR_HW(CMU_SENSORCLK, 0, 3, 0, bisp_factor_table), - CLK_IGNORE_UNUSED); + { 0 }, + OWL_DIVIDER_HW(CMU_SENSORCLK, 0, 4, 0, std12rate_div_table), + 0); -static OWL_COMP_FACTOR(sensor1_clk, "sensor1_clk", sensor_clk_mux_p, +static OWL_COMP_DIV(sensor1_clk, "sensor1_clk", sensor_clk_mux_p, OWL_MUX_HW(CMU_SENSORCLK, 4, 1), - OWL_GATE_HW(CMU_DEVCLKEN0, 14, 0), - OWL_FACTOR_HW(CMU_SENSORCLK, 8, 3, 0, bisp_factor_table), - CLK_IGNORE_UNUSED); + { 0 }, + OWL_DIVIDER_HW(CMU_SENSORCLK, 8, 4, 0, std12rate_div_table), + 0); static OWL_COMP_FACTOR(sd0_clk, "sd0_clk", sd_clk_mux_p, OWL_MUX_HW(CMU_SD0CLK, 9, 1), From patchwork Mon Mar 8 17:18:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12123031 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 ED23DC433DB for ; Mon, 8 Mar 2021 17:20:52 +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 4A9E965215 for ; Mon, 8 Mar 2021 17:20:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A9E965215 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=2ry4rzcJ6v3xcBZHy7FscjgTlqxtvMICvUuGv62DMsk=; b=AslwGfXYT6xSz3m9yL4VwnIs9 XzvHSXzmy45g5DOD0fRHB0EHA7QheH6iQ1kG/aa5KmsfGfLSp0zqpp8gaztjsKSCr6mSRKTOsDOfq YqY0wH5yVxq/0KhbNTqhrbma4xImDc1l3uXytByBW4dRrFk1g45jZKqmLrdv+tZtH9V2F+9sbAfgJ G/akqbGHfpjl1O6LX8cg4uj8ApMp+Sl4KGGATl40D/XpxxzARS2z4U83KqJOIT4ErwcuPud1ZeQ6s OmrmzPLHlvBNH3EsFtJa+QFFIPKaHvVU24YRECU0ppKUQfq4OaJe1BV3/gQRAyo2tpNcw6dPCj5Sl nz2q2U6uQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJJXJ-001Jvx-UV; Mon, 08 Mar 2021 17:19:18 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJJWk-001JaT-Nd; Mon, 08 Mar 2021 17:18:45 +0000 Received: by mail-ed1-x52d.google.com with SMTP id bd6so15821118edb.10; Mon, 08 Mar 2021 09:18:38 -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=WuSqF/+tR6w6hB+x1Uu0uM7BqIArmfrJ4/0Ov0bZDcg=; b=CpHy2AxxZkQOKJ5vTL78ALTyJudnco/llkKoO+8MqNTeBkjnGuHWSaoPaLdYocS9rf oq5zB6pxphbbon1105jB9I1Yw8kithmLe2sfHZpPvTt3NJXAE4cJYswwhV+X1TS9FtJR YFFQslhp2dGlq83xnUI1K59HCnDRBtpQ96tcKVLLc7m8YjsxGfd1UMY5xHUKkftxJbQT Jz9jdwPoS20gIxu6jRRj36ywdUfnQFRnUFNGSfaV+fiZgPpA5aSWoRyemLRSoXm9npp8 9dwF8iv6m7SjAvw4azcDLVsCi2+COQc0k0peRMbTHLoglVHIsD4OLgI+qLAsmlsPEcQ6 IusA== 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=WuSqF/+tR6w6hB+x1Uu0uM7BqIArmfrJ4/0Ov0bZDcg=; b=KxLFs76iqPaQm1/U8h303Qy11pbGtaJEwoo3zlrCKwUdTjc5GUZ1J1IpuXqvwO7P29 11Vu/pq31ycsCRYsYm2uVW/ZYC34WyW+aQw0i6QuopRLVuJixxLrVL+t8vdsO+ko/SGJ LxydOj6y1HnPWh1x/UxZZTc6cXg+IEka6N9kopOgpArWMpBC7sfZrZHNk8o26q5+NrvQ MNEFL3ELX5+0uEiDVcsGxNNTgqA9YJ16II7Kk3RlxE1jmsDhl3BImqaWbYqpzj1K1HV2 vpnBwS0PXLTmZnqAD9f0yb93VQ6eWj2eoem43TIORcJkHnFMon4YbWABAik+GoItAlxv DD6Q== X-Gm-Message-State: AOAM533qO1uy9wp+utzzFvFi28IW3uiUvtJ4c+mTFRmoviAe7l8mj1Ln Ybxc/lXuP2qkwTejPVJqwf0= X-Google-Smtp-Source: ABdhPJxIgTkVrCZhhOdRhVmRIDyXrXzryucFllf5C3GVfJFvElo0nySIC4woACC7JO0Vw0m0JmihLw== X-Received: by 2002:a05:6402:270e:: with SMTP id y14mr23067927edd.283.1615223918506; Mon, 08 Mar 2021 09:18:38 -0800 (PST) Received: from localhost.localdomain ([81.18.95.223]) by smtp.gmail.com with ESMTPSA id r5sm7457714eds.49.2021.03.08.09.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:18:38 -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 4/6] clk: actions: Fix AHPPREDIV-H-AHB clock chain on Owl S500 SoC Date: Mon, 8 Mar 2021 19:18:29 +0200 Message-Id: <58225ced4893018792d581c0476a0f1c70e08907.1615221459.git.cristian.ciocaltea@gmail.com> 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_511903_A6168D1A X-CRM114-Status: GOOD ( 15.48 ) 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 There are a few issues with the setup of the Actions Semi Owl S500 SoC's clock chain involving AHPPREDIV, H and AHB clocks: * AHBPREDIV clock is defined as a muxer only, although it also acts as a divider. * H clock is defined as a standard divider, although the raw value zero is not supported. * AHB is defined as a multi-rate factor clock, but it is actually just a fixed pass clock. Let's provide the following fixes: * Change AHBPREDIV clock to an ungated OWL_COMP_DIV definition. * Add a clock div table 'h_div_table' for the H clock to drop the unsupported 0 rate and use the correct register shift value in the OWL_DIVIDER definition. * Drop the unneeded 'ahb_factor_table[]' and change AHB clock to an ungated OWL_COMP_FIXED_FACTOR definition. Fixes: ed6b4795ece4 ("clk: actions: Add clock driver for S500 SoC") Signed-off-by: Cristian Ciocaltea --- drivers/clk/actions/owl-s500.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/clk/actions/owl-s500.c b/drivers/clk/actions/owl-s500.c index abe8874353de..b9e434173b4f 100644 --- a/drivers/clk/actions/owl-s500.c +++ b/drivers/clk/actions/owl-s500.c @@ -151,9 +151,9 @@ static struct clk_factor_table hde_factor_table[] = { { 0, 0, 0 }, }; -static struct clk_factor_table ahb_factor_table[] = { - { 1, 1, 2 }, { 2, 1, 3 }, - { 0, 0, 0 }, +static struct clk_div_table h_div_table[] = { + { 1, 2 }, { 2, 3 }, { 3, 4 }, + { 0, 0 }, }; static struct clk_div_table rmii_ref_div_table[] = { @@ -184,7 +184,6 @@ static struct clk_div_table nand_div_table[] = { /* mux clock */ static OWL_MUX(dev_clk, "dev_clk", dev_clk_mux_p, CMU_DEVPLL, 12, 1, CLK_SET_RATE_PARENT); -static OWL_MUX(ahbprediv_clk, "ahbprediv_clk", ahbprediv_clk_mux_p, CMU_BUSCLK1, 8, 3, CLK_SET_RATE_PARENT); /* gate clocks */ static OWL_GATE(gpio_clk, "gpio_clk", "apb_clk", CMU_DEVCLKEN0, 18, 0, 0); @@ -197,16 +196,25 @@ static OWL_GATE(timer_clk, "timer_clk", "hosc", CMU_DEVCLKEN1, 27, 0, 0); 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, 12, 2, NULL, 0, 0); +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(rmii_ref_clk, "rmii_ref_clk", "ethernet_pll_clk", CMU_ETHERNETPLL, 1, 1, rmii_ref_div_table, 0, 0); /* factor clocks */ -static OWL_FACTOR(ahb_clk, "ahb_clk", "h_clk", CMU_BUSCLK1, 2, 2, ahb_factor_table, 0, 0); static OWL_FACTOR(de1_clk, "de_clk1", "de_clk", CMU_DECLK, 0, 4, de_factor_table, 0, 0); static OWL_FACTOR(de2_clk, "de_clk2", "de_clk", CMU_DECLK, 4, 4, de_factor_table, 0, 0); /* composite clocks */ +static OWL_COMP_DIV(ahbprediv_clk, "ahbprediv_clk", ahbprediv_clk_mux_p, + OWL_MUX_HW(CMU_BUSCLK1, 8, 3), + { 0 }, + OWL_DIVIDER_HW(CMU_BUSCLK1, 12, 2, 0, NULL), + 0); + +static OWL_COMP_FIXED_FACTOR(ahb_clk, "ahb_clk", "h_clk", + { 0 }, + 1, 1, CLK_SET_RATE_PARENT); + static OWL_COMP_FACTOR(vce_clk, "vce_clk", hde_clk_mux_p, OWL_MUX_HW(CMU_VCECLK, 4, 2), OWL_GATE_HW(CMU_DEVCLKEN0, 26, 0), From patchwork Mon Mar 8 17:18:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12123033 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=ham 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 1DD97C433DB for ; Mon, 8 Mar 2021 17:20:58 +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 A95226522D for ; Mon, 8 Mar 2021 17:20:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A95226522D 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=xQULaeuJIg92OWXPjkXGLse2rhKiA0LxQSO96yaJqDc=; b=QOhQtNsX/IaOxjNbtj1vVQEWt MHMoI7MXRkn+w1QQ9GpAxcW71L0bxYmjCWpSb/mDxJEzh1gYP/5agRFekTlwY7XzMt971NnNX+SMC dyxpfCJW3urfMgTWi4csTa0BeC1F3a5YDSs5vPVeat7nBCfAv0GRcXIjBu8AYXnpe5IaZrxMr/Jit xBtVJRNwzWZv3hrBwuhorWs9TDm4F9BYsRZrF+i4FdRCluEjUQmCYrIeYuu0LJyHvmd0L0F0JBZvT /kvgcP86saYociMT6e4WWRLVSSL55ZjCRzTvOwi+qlUHvi9pkQ2nFKuizI7njYAR6DLQx0llTUStH SZif1U+Rg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJJXU-001K0j-A2; Mon, 08 Mar 2021 17:19:28 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJJWk-001Jb4-C9; Mon, 08 Mar 2021 17:18:46 +0000 Received: by mail-ej1-x62a.google.com with SMTP id p7so10476472eju.6; Mon, 08 Mar 2021 09:18:40 -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=wbKnutjFeuKN2eCb9zbjA189ugDvCI2YrROp3wTICT4=; b=VM+O3J7thF6KXIkr30kOwBkv0Tc38k1Jvlm6YNjLzz50+bz8wX6MSYf8T4MSnRTTqO b7+q+W4OaSbimhETBoMAHrau0LXQN1NNupJRRPiPM+HWG49PQjhpyKtZQxrZejeMWkXO xOPpSsEsw7ILsAzhl/rjTymtk37vwlPjjHzi3qxBwRcWygjPBnxr02KPQEn1RWo9aan1 hIzPfJE1BN9VPYJziNywKBHUoBqp7GlM0OYaQ4TseZuf0+ntg92PISjgIL24qjWXTOGO bO6mSrV18HnVUm7RNsms02cNSZFnr0r0DEcVIKfZIVpviGaDQO8kwXiIo4IWceEOwskr KqfA== 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=wbKnutjFeuKN2eCb9zbjA189ugDvCI2YrROp3wTICT4=; b=HNLlY4wueEAlS6vU+pPahmV27Ni8uMXUXiOMv98GyoqAJgGTSw7SUbrfPmQ/S07Ba1 eaDnDR58K6jh9Z112eAveISfQMa8pb7RejK8QlxwE7wKRaeowyoqWGHWj4J9W23ZccYJ au59oKBJnPAo9BM8lnA3SUUUYcvPIJhDf1Ayww6JBrDb83kHZVRNWoPEQncxpiwtlCIt nP0zuRZo/c0cuJq3jbGCA4MtlOBX0T06EpfNOKYlpiwZQFuJHwQQH6P1+K4wIBLGc+Qk itk5X5UobtZU8j8BUCb6C5OTlxdjDguNi1baWr5sM60QlqjeYpB3O+43Qh5bkXL1YmWQ plGw== X-Gm-Message-State: AOAM533TEE9oWAaMWRaFbeIR8u4nUmV9nLOgyFDYAtkjg61XFvMq0RZT U2j0vVYbn5XnAmmmFCicOth4K/x5krc= X-Google-Smtp-Source: ABdhPJylZIODIf2YTYVcYrnYaUyYSLxrDdQA9Fl2UhMyGSt1EURUu8O3OE+j5LPAzBL/4gweoILfBQ== X-Received: by 2002:a17:906:3899:: with SMTP id q25mr15845840ejd.157.1615223919714; Mon, 08 Mar 2021 09:18:39 -0800 (PST) Received: from localhost.localdomain ([81.18.95.223]) by smtp.gmail.com with ESMTPSA id r5sm7457714eds.49.2021.03.08.09.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:18:39 -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 5/6] dt-bindings: clock: Add NIC and ETHERNET bindings for Actions S500 SoC Date: Mon, 8 Mar 2021 19:18:30 +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_507096_DA94C030 X-CRM114-Status: GOOD ( 10.98 ) 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 the missing NIC and ETHERNET clock bindings constants for Actions Semi Owl S500 SoC. Signed-off-by: Cristian Ciocaltea Acked-by: Rob Herring --- include/dt-bindings/clock/actions,s500-cmu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/dt-bindings/clock/actions,s500-cmu.h b/include/dt-bindings/clock/actions,s500-cmu.h index a250a52a6192..a237eb26accb 100644 --- a/include/dt-bindings/clock/actions,s500-cmu.h +++ b/include/dt-bindings/clock/actions,s500-cmu.h @@ -74,10 +74,12 @@ #define CLK_RMII_REF 54 #define CLK_GPIO 55 -/* system clock (part 2) */ +/* additional clocks */ #define CLK_APB 56 #define CLK_DMAC 57 +#define CLK_NIC 58 +#define CLK_ETHERNET 59 -#define CLK_NR_CLKS (CLK_DMAC + 1) +#define CLK_NR_CLKS (CLK_ETHERNET + 1) #endif /* __DT_BINDINGS_CLOCK_S500_CMU_H */ 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, };