From patchwork Tue Oct 21 06:49:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 5110781 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 D5850C11AC for ; Tue, 21 Oct 2014 06:52:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC1DA20149 for ; Tue, 21 Oct 2014 06:52:28 +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 EC4C02012F for ; Tue, 21 Oct 2014 06:52:27 +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 1XgTGw-0006J1-FP; Tue, 21 Oct 2014 06:50:22 +0000 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgTGS-0004zM-5u for linux-arm-kernel@lists.infradead.org; Tue, 21 Oct 2014 06:49:54 +0000 Received: from mirror2.csie.ntu.edu.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (Authenticated sender: b93043) by smtp.csie.ntu.edu.tw (Postfix) with ESMTPSA id B18B420531; Tue, 21 Oct 2014 14:49:29 +0800 (CST) Received: by mirror2.csie.ntu.edu.tw (Postfix, from userid 1000) id 8F88C5F987; Tue, 21 Oct 2014 14:49:29 +0800 (CST) From: Chen-Yu Tsai To: Lee Jones , Samuel Ortiz , Maxime Ripard , =?UTF-8?q?Emilio=20L=C3=B3pez?= , Mike Turquette Subject: [RFC 2/3] mfd: sun6i-prcm: Add support for PRCM found on Allwinner A80 SoC Date: Tue, 21 Oct 2014 14:49:26 +0800 Message-Id: <1413874167-6479-3-git-send-email-wens@csie.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413874167-6479-1-git-send-email-wens@csie.org> References: <1413874167-6479-1-git-send-email-wens@csie.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141020_234953_262274_0976BE39 X-CRM114-Status: GOOD ( 11.14 ) X-Spam-Score: -2.1 (--) Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-3.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 This patch adds support for the PRCM on the A80 SoC. There is little to no document for this at the moment. Only register offsets are available. However with some testing, the clock and reset controls seem to be the similar to the ones on the A31. One thing that needs verifying is whether the apbs divider is the same as the A31 or the A23. The lowest divider is different between those 2 implementations. Signed-off-by: Chen-Yu Tsai --- drivers/mfd/sun6i-prcm.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c index 283ab8d..4589acb 100644 --- a/drivers/mfd/sun6i-prcm.c +++ b/drivers/mfd/sun6i-prcm.c @@ -33,6 +33,22 @@ static const struct resource sun6i_a31_apb0_clk_res[] = { }, }; +static const struct resource sun9i_a80_cpus_clk_res[] = { + { + .start = 0x10, + .end = 0x13, + .flags = IORESOURCE_MEM, + }, +}; + +static const struct resource sun9i_a80_apbs_clk_res[] = { + { + .start = 0x1c, + .end = 0x1f, + .flags = IORESOURCE_MEM, + }, +}; + static const struct resource sun6i_a31_apb0_gates_clk_res[] = { { .start = 0x28, @@ -97,6 +113,33 @@ static const struct mfd_cell sun8i_a23_prcm_subdevs[] = { }, }; +static const struct mfd_cell sun9i_a80_prcm_subdevs[] = { + { + .name = "sun6i-a31-ar100-clk", + .of_compatible = "allwinner,sun6i-a31-ar100-clk", + .num_resources = ARRAY_SIZE(sun9i_a80_cpus_clk_res), + .resources = sun9i_a80_cpus_clk_res, + }, + { + .name = "sun8i-a23-apb0-clk", + .of_compatible = "allwinner,sun8i-a23-apb0-clk", + .num_resources = ARRAY_SIZE(sun9i_a80_apbs_clk_res), + .resources = sun9i_a80_apbs_clk_res, + }, + { + .name = "sun6i-a31-apb0-gates-clk", + .of_compatible = "allwinner,sun9i-a80-apbs-gates-clk", + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_gates_clk_res), + .resources = sun6i_a31_apb0_gates_clk_res, + }, + { + .name = "sun6i-a31-apb0-clock-reset", + .of_compatible = "allwinner,sun6i-a31-clock-reset", + .num_resources = ARRAY_SIZE(sun6i_a31_apb0_rstc_res), + .resources = sun6i_a31_apb0_rstc_res, + }, +}; + static const struct prcm_data sun6i_a31_prcm_data = { .nsubdevs = ARRAY_SIZE(sun6i_a31_prcm_subdevs), .subdevs = sun6i_a31_prcm_subdevs, @@ -107,6 +150,11 @@ static const struct prcm_data sun8i_a23_prcm_data = { .subdevs = sun8i_a23_prcm_subdevs, }; +static const struct prcm_data sun9i_a80_prcm_data = { + .nsubdevs = ARRAY_SIZE(sun9i_a80_prcm_subdevs), + .subdevs = sun9i_a80_prcm_subdevs, +}; + static const struct of_device_id sun6i_prcm_dt_ids[] = { { .compatible = "allwinner,sun6i-a31-prcm", @@ -116,6 +164,10 @@ static const struct of_device_id sun6i_prcm_dt_ids[] = { .compatible = "allwinner,sun8i-a23-prcm", .data = &sun8i_a23_prcm_data, }, + { + .compatible = "allwinner,sun9i-a80-prcm", + .data = &sun9i_a80_prcm_data, + }, { /* sentinel */ }, };