From patchwork Wed Feb 26 00:15:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 3720091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 083F39F2ED for ; Wed, 26 Feb 2014 01:19:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E9C4201D3 for ; Wed, 26 Feb 2014 01:19:07 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 D13702018E for ; Wed, 26 Feb 2014 01:19:05 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WISDF-0005IP-RQ; Wed, 26 Feb 2014 00:19:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WISCQ-0004Qf-U3; Wed, 26 Feb 2014 00:18:10 +0000 Received: from mail-ie0-f181.google.com ([209.85.223.181]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WISAl-0004Dn-OF for linux-arm-kernel@lists.infradead.org; Wed, 26 Feb 2014 00:16:37 +0000 Received: by mail-ie0-f181.google.com with SMTP id lx4so64136iec.12 for ; Tue, 25 Feb 2014 16:16:06 -0800 (PST) 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=YKstLmEIXBxrEOLcRCGS8wSTbGTzfvNyI17/1X8wZPs=; b=Fv6S/dauptKu2cvswL9SvMAl8lKDLyvKEFSrfqJWvpZl6qSRuakxPsBRZe/AmtPLcc jzY6NjrkRCFmxlC7kpQzdrtN6V921kWy2B5mGoTEwOf7Ws9ZOk1zP+4M5N8SkWAfX8dk zxU0emQ6LwzC7CMKo0v6+blEaxYYWWVf7POaH1MIMPQLh2jSJBD9sgoM4TOIMEsSwQvy zM8k9TVaUK+Y6Ce4VCV8ajefsR89MyowvikZx3oJXGiTkmv8XVpEfBYMWL41NDu6Qxll Fcsk4vkDw0215HZ9/mhU+lrA0Vl0tJOrwL0tgdtTe5s+/u9Kj5au21Lplpho9PJcpkD4 dSsw== X-Gm-Message-State: ALoCoQnE7wVIzpTDqlW4/nhAcoMFEC78/3fIEV8LWOddcrGfo4b5QS6vQjTpbRB9/k9KKfHmfCA7 X-Received: by 10.42.114.82 with SMTP id f18mr2757044icq.56.1393373766557; Tue, 25 Feb 2014 16:16:06 -0800 (PST) Received: from localhost.localdomain (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id om7sm91459igb.10.2014.02.25.16.16.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 16:16:06 -0800 (PST) From: Alex Elder To: mturquette@linaro.org, mporter@linaro.org, bcm@fixthebug.org, galak@codeaurora.org, ijc+devicetree@hellion.org.uk, mark.rutland@arm.com, pawel.moll@arm.com, robh+dt@kernel.org Subject: [PATCH v2 11/12] clk: bcm281xx: define a bus clock Date: Tue, 25 Feb 2014 18:15:51 -0600 Message-Id: <1393373752-30875-12-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393373752-30875-1-git-send-email-elder@linaro.org> References: <1393373752-30875-1-git-send-email-elder@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140225_191627_917888_5C330718 X-CRM114-Status: GOOD ( 14.93 ) X-Spam-Score: 0.5 (/) Cc: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, 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=-1.1 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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 71a65a4..d0d3dde 100644 --- a/drivers/clk/bcm/clk-bcm281xx.c +++ b/drivers/clk/bcm/clk-bcm281xx.c @@ -321,8 +321,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), @@ -341,9 +350,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 e009694..57591b1 100644 --- a/include/dt-bindings/clock/bcm281xx.h +++ b/include/dt-bindings/clock/bcm281xx.h @@ -60,6 +60,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 */