From patchwork Sun Jul 21 00:23:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 2830867 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 577159F3EB for ; Sun, 21 Jul 2013 00:53:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 500C620158 for ; Sun, 21 Jul 2013 00:53:28 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A3E620154 for ; Sun, 21 Jul 2013 00:53:27 +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 1V0htY-0003QC-46; Sun, 21 Jul 2013 00:53:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V0htV-00044a-I5; Sun, 21 Jul 2013 00:53:01 +0000 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V0htQ-00042u-Ju for linux-arm-kernel@lists.infradead.org; Sun, 21 Jul 2013 00:52:58 +0000 Received: by mail-ea0-f169.google.com with SMTP id h15so3077694eak.14 for ; Sat, 20 Jul 2013 17:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:user-agent:date:from:to:cc:subject:references :content-disposition; bh=lChvxTaf6JUT8ma3ljcB5qxks5tV8YlX9bhDBfsQArg=; b=03y+A7bwjfwMa+NNhB1Xox0cPMVje6opF0XMNELcowAmFZcZQR94Z5MJPQMOlRh9RZ LnnAazxtYxD04riyMzXWK2D3Ny9H6yt6IWRycZIkezQRk9uuRuBX/KIbM7nCyC1AtXgk 3aMde8u5rE3k4Vm+yzb+BlxU7oCa85hY/WC4AWy7fiRpH1ab1eyEu7E7AMrvNoI7Mzr+ +jQjG2Qccvsooi9NmeugXBA6mDNxOzX7Xs4hOYVw0i2axPIJlT0qTRSdSPVV7eFXYsU1 yD5HnRtlilLi7PV+nVREzlCNucmk8axRlFku0n1gfnaexa1MvtCbUx8SZCfZk5ynk+c0 bqxA== X-Received: by 10.15.51.202 with SMTP id n50mr21408679eew.39.1374367953803; Sat, 20 Jul 2013 17:52:33 -0700 (PDT) Received: from shock.dandreoli.com (j115181.upc-j.chello.nl. [24.132.115.181]) by mx.google.com with ESMTPSA id n42sm39097667eeh.15.2013.07.20.17.52.31 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Jul 2013 17:52:32 -0700 (PDT) Received: by shock.dandreoli.com (Postfix, from userid 1000) id AD4FF340216; Sun, 21 Jul 2013 02:27:14 +0200 (CEST) Message-Id: <20130721002714.459727324@gmail.com> User-Agent: quilt/0.60-1 Date: Sun, 21 Jul 2013 02:23:24 +0200 From: Domenico Andreoli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/5] ARM: bcm4760: Add stub clock driver References: <20130721002320.730568671@gmail.com> Content-Disposition: inline; filename=arm-bcm476x-add-stub-clock-driver.patch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130720_205256_810936_E64D67AB X-CRM114-Status: GOOD ( 16.52 ) X-Spam-Score: -1.9 (-) Cc: Olof Johansson , Mike Turquette , Russell King , Arnd Bergmann , Domenico Andreoli 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=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Domenico Andreoli Minimal clock support required for the BCM4760 SoCs boot. Cc: Mike Turquette Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Domenico Andreoli --- arch/arm/mach-bcm/bcm4760.c | 2 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-bcm4760.c | 35 +++++++++++++++++++++++++++++++++++ include/linux/clk/bcm4760.h | 22 ++++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 drivers/clk/clk-bcm4760.c create mode 100644 include/linux/clk/bcm4760.h Index: b/arch/arm/mach-bcm/bcm4760.c =================================================================== --- a/arch/arm/mach-bcm/bcm4760.c +++ b/arch/arm/mach-bcm/bcm4760.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -60,6 +61,7 @@ static void __init bcm4760_init(void) int err; bcm4760_system_rev(); + bcm4760_init_clocks(); err = of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); if (err) { Index: b/drivers/clk/Makefile =================================================================== --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-composit # SoCs specific obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o +obj-$(CONFIG_ARCH_BCM4760) += clk-bcm4760.o obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o Index: b/drivers/clk/clk-bcm4760.c =================================================================== --- /dev/null +++ b/drivers/clk/clk-bcm4760.c @@ -0,0 +1,35 @@ +/* + * Broadcom BCM4760 based ARM11 SoCs clocks + * + * Copyright (C) 2012 Domenico Andreoli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include + +void __init bcm4760_init_clocks(void) +{ + struct clk *clk; + + clk = clk_register_fixed_rate(NULL, "pclk", NULL, CLK_IS_ROOT, 78000000); + if (IS_ERR(clk)) + pr_err("pclk not registered\n"); + + if (clk_register_clkdev(clk, NULL, "c0000.uart0")) + pr_err("uart0 clk alias not registered\n"); + if (clk_register_clkdev(clk, NULL, "c1000.uart1")) + pr_err("uart1 clk alias not registered\n"); + if (clk_register_clkdev(clk, NULL, "b2000.uart2")) + pr_err("uart2 clk alias not registered\n"); +} Index: b/include/linux/clk/bcm4760.h =================================================================== --- /dev/null +++ b/include/linux/clk/bcm4760.h @@ -0,0 +1,22 @@ +/* + * Broadcom BCM4760 based ARM11 SoCs clocks + * + * Copyright (C) 2012 Domenico Andreoli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _LINUX_CLK_BCM4760_H +#define _LINUX_CLK_BCM4760_H + +void __init bcm4760_init_clocks(void); + +#endif