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: 30427 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 40BED20671 for ; Tue, 20 May 2014 12:53:26 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf1653999obc.3 for ; Tue, 20 May 2014 05:53:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=PQEivl22Z7drNKBFJWAuxrcKlaVl6KqWmQNPs974oxw=; b=QXhvbMXtoOK+pYANqcdA6pEdNJPW+leeWddMcz07HVXAMeNOoIPSk6q/wgJwuj/4xR RnXZyWQGsnPq12MpE0MVjgR14P67coFQ1Q7gDtfCIhT0MtAwNoNDZ71Q7tpAL8OFNeUv iXC9zqI6BlEJ79tkK9Ofszlb7suwqY60XcHKaAFvQJSTKeqxLYek5BDMHS8237ayRd7N OBorIWs0DxbQUknm+AiA0Po4Ld5Ake/Y/7bLcMKf+ftTBtpAJ9MFLUX7wcQwvItN4Zrr HApxdBVps0UDg59k2QGgpvoPZzaR5Q7KyV7fOmUUk9mj/yBKhYuC5KKZTWDBc6m+LQ2B 9yZA== X-Gm-Message-State: ALoCoQkT+OnTTRSZmEgHkONTkxdInALwcspz5XjBbWudvHz5zj03KCSkYKXlRqseCUY4rRVmjChz X-Received: by 10.182.176.8 with SMTP id ce8mr12422944obc.7.1400590405785; Tue, 20 May 2014 05:53:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.67 with SMTP id g61ls249150qgg.12.gmail; Tue, 20 May 2014 05:53:25 -0700 (PDT) X-Received: by 10.52.95.135 with SMTP id dk7mr2968587vdb.38.1400590405632; Tue, 20 May 2014 05:53:25 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id gq7si4920698vdc.32.2014.05.20.05.53.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 05:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id pa12so518910veb.12 for ; Tue, 20 May 2014 05:53:25 -0700 (PDT) X-Received: by 10.221.64.80 with SMTP id xh16mr3469986vcb.35.1400590405562; Tue, 20 May 2014 05:53:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp28046vcb; Tue, 20 May 2014 05:53:25 -0700 (PDT) X-Received: by 10.66.240.197 with SMTP id wc5mr50617083pac.78.1400590404743; Tue, 20 May 2014 05:53:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rb13si24512481pac.77.2014.05.20.05.53.24; Tue, 20 May 2014 05:53:24 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753344AbaETMxR (ORCPT + 27 others); Tue, 20 May 2014 08:53:17 -0400 Received: from mail-ig0-f175.google.com ([209.85.213.175]:48507 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149AbaETMwp (ORCPT ); Tue, 20 May 2014 08:52:45 -0400 Received: by mail-ig0-f175.google.com with SMTP id uq10so4785020igb.14 for ; Tue, 20 May 2014 05:52:45 -0700 (PDT) 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 */