From patchwork Tue May 20 12:52:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 4209391 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA3A3BEEAB for ; Tue, 20 May 2014 12:55:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE86D2020F for ; Tue, 20 May 2014 12:55:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3932C2020A for ; Tue, 20 May 2014 12:55:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WmjXk-0007zy-Gi; Tue, 20 May 2014 12:53:20 +0000 Received: from mail-ie0-f180.google.com ([209.85.223.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WmjXU-0007pt-H5 for linux-arm-kernel@lists.infradead.org; Tue, 20 May 2014 12:53:05 +0000 Received: by mail-ie0-f180.google.com with SMTP id tp5so378340ieb.11 for ; Tue, 20 May 2014 05:52:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=io6thhJW2IPxeDO1dobJjU24JcDANUi7miIDs6nqCUM=; b=ImszcJnqmCV/AXpXcxSCJ6x9CSJ+OBB5EpH4OXwrH1OkqYWhxoBH2LT/pp5/ey3NuZ jp/95qRfqcAl0bPU9o9RBuJOMrX2zSoboHtQlqlwUhgW2Od+2thsnmpJc8Jwd6j4XapK A7MnZOBeEnVhGaAfGqDhxlaPhqlIu8DRhm8eTirHHS7xiV3RXC9oLl0+P0ZKggigKyw2 vp1HhnjWBPNoNIuuhEM3+9pwI2re+LJPO3SsC4sVBt3pXAzN7x1xdxGW0fK51WB+x+jA 5UZy+RE2lxYkBZxJh05UoOfGvODemucWw3UUPYpUuyJQYa8Ch9t/Lr46SNA97IwQfkUx FtKQ== X-Gm-Message-State: ALoCoQlIgwfJWDd+tI32XSq087lSQMeMNa1Uzy6ywS0YJCZ/sTKZvwrrCrUoLBP9zSml+tB2+Oji X-Received: by 10.43.53.73 with SMTP id vp9mr10232329icb.61.1400590365323; Tue, 20 May 2014 05:52:45 -0700 (PDT) Received: from localhost.localdomain (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id kw1sm28775309igb.4.2014.05.20.05.52.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 May 2014 05:52:44 -0700 (PDT) From: Alex Elder To: mturquette@linaro.org, mporter@linaro.org, bcm@fixthebug.org, devicetree@vger.kernel.org Subject: [PATCH v2 4/5] clk: bcm281xx: define a bus clock Date: Tue, 20 May 2014 07:52:41 -0500 Message-Id: <1400590362-11177-5-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400590362-11177-1-git-send-email-elder@linaro.org> References: <1400590362-11177-1-git-send-email-elder@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140520_055304_618539_DBBB93F7 X-CRM114-Status: GOOD ( 12.78 ) X-Spam-Score: -0.7 (/) Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Define the bus clock "bsc3_apb". This bus clock has to be managed using the CCU policy mechanism, so add the definitions required for that to the clock and its CCU. This one bus clock in particular is defined because it is needed by peripheral clock "bsc3". Our boot loader does not properly activate "bsc3_apb", and as a result, "bsc3" isn't able to function properly. With "bsc3_apb" specified as a prerequisite clock for "bsc3", the latter works correctly. For now only this one bus clock is defined, because it allows correct operation of "bsc3". Others can be added later as needed (and this patch serves to show how that's done). Signed-off-by: Alex Elder --- drivers/clk/bcm/clk-bcm281xx.c | 13 ++++++++++++- include/dt-bindings/clock/bcm281xx.h | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/clk/bcm/clk-bcm281xx.c b/drivers/clk/bcm/clk-bcm281xx.c index 502a487..b937fc9 100644 --- a/drivers/clk/bcm/clk-bcm281xx.c +++ b/drivers/clk/bcm/clk-bcm281xx.c @@ -309,8 +309,17 @@ static struct peri_clk_data pwm_data = { .trig = TRIGGER(0x0afc, 15), }; +static struct bus_clk_data bsc3_apb_data = { + .policy = POLICY(0x0048, 4), + .gate = HW_SW_GATE(0x0484, 16, 0, 1), +}; + static struct ccu_data slave_ccu_data = { BCM281XX_CCU_COMMON(slave, SLAVE), + .policy = { + .enable = CCU_LVM_EN(0x0034, 0), + .control = CCU_POLICY_CTL(0x000c, 0, 1, 2), + }, .kona_clks = { [BCM281XX_SLAVE_CCU_UARTB] = KONA_CLK(slave, uartb, peri), @@ -329,9 +338,11 @@ static struct ccu_data slave_ccu_data = { [BCM281XX_SLAVE_CCU_BSC2] = KONA_CLK(slave, bsc2, peri), [BCM281XX_SLAVE_CCU_BSC3] = - KONA_CLK(slave, bsc3, peri), + KONA_CLK_PREREQ(slave, bsc3, peri, bsc3_apb), [BCM281XX_SLAVE_CCU_PWM] = KONA_CLK(slave, pwm, peri), + [BCM281XX_SLAVE_CCU_BSC3_APB] = + KONA_CLK(slave, bsc3_apb, bus), [BCM281XX_SLAVE_CCU_CLOCK_COUNT] = LAST_KONA_CLK, }, }; diff --git a/include/dt-bindings/clock/bcm281xx.h b/include/dt-bindings/clock/bcm281xx.h index a763460..99f4aad 100644 --- a/include/dt-bindings/clock/bcm281xx.h +++ b/include/dt-bindings/clock/bcm281xx.h @@ -72,6 +72,7 @@ #define BCM281XX_SLAVE_CCU_BSC2 7 #define BCM281XX_SLAVE_CCU_BSC3 8 #define BCM281XX_SLAVE_CCU_PWM 9 -#define BCM281XX_SLAVE_CCU_CLOCK_COUNT 10 +#define BCM281XX_SLAVE_CCU_BSC3_APB 10 +#define BCM281XX_SLAVE_CCU_CLOCK_COUNT 11 #endif /* _CLOCK_BCM281XX_H */