From patchwork Mon Oct 27 23:09:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 5166731 Return-Path: X-Original-To: patchwork-linux-pm@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 2B3C99F3ED for ; Mon, 27 Oct 2014 23:12:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52E3D2015D for ; Mon, 27 Oct 2014 23:12:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4BC3A20155 for ; Mon, 27 Oct 2014 23:12:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752863AbaJ0XKA (ORCPT ); Mon, 27 Oct 2014 19:10:00 -0400 Received: from down.free-electrons.com ([37.187.137.238]:55598 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752833AbaJ0XJ6 (ORCPT ); Mon, 27 Oct 2014 19:09:58 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id 522E346E3; Tue, 28 Oct 2014 00:10:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (128-79-216-6.hfc.dyn.abo.bbox.fr [128.79.216.6]) by mail.free-electrons.com (Postfix) with ESMTPSA id DF3B846E4; Tue, 28 Oct 2014 00:10:05 +0100 (CET) From: Alexandre Belloni To: Nicolas Ferre , Sebastian Reichel Cc: Jean-Christophe Plagniol-Villard , Dmitry Eremin-Solenikov , David Woodhouse , Maxime Ripard , Boris Brezillon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Alexandre Belloni Subject: [PATCH v2 3/8] ARM: at91: sam9: probe the RAMC driver from pdata Date: Tue, 28 Oct 2014 00:09:32 +0100 Message-Id: <1414451377-11053-4-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414451377-11053-1-git-send-email-alexandre.belloni@free-electrons.com> References: <1414451377-11053-1-git-send-email-alexandre.belloni@free-electrons.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Probe the atmel-sdramc driver from the board files, using platform_data. Signed-off-by: Alexandre Belloni --- arch/arm/mach-at91/Kconfig | 2 +- arch/arm/mach-at91/at91sam9260.c | 15 +++++++++++++++ arch/arm/mach-at91/at91sam9261.c | 15 +++++++++++++++ arch/arm/mach-at91/at91sam9263.c | 15 +++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 0e6d548b70d9..db38e1d4b4fa 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -48,7 +48,7 @@ config SOC_AT91SAM9 select CPU_ARM926T select GENERIC_CLOCKEVENTS select MEMORY if USE_OF - select ATMEL_SDRAMC if USE_OF + select ATMEL_SDRAMC config SOC_SAMA5 bool diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index aab1f969a7c3..d5a6df9ce570 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c @@ -378,6 +378,20 @@ static struct platform_device rstc_device = { .num_resources = ARRAY_SIZE(rstc_resources), }; +static struct resource ramc_resources[] = { + [0] = { + .start = AT91SAM9260_BASE_SDRAMC, + .end = AT91SAM9260_BASE_SDRAMC + SZ_512 - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device ramc_device = { + .name = "at91-sam9260-ramc", + .resource = ramc_resources, + .num_resources = ARRAY_SIZE(ramc_resources), +}; + static struct resource shdwc_resources[] = { [0] = { .start = AT91SAM9260_BASE_SHDWC, @@ -394,6 +408,7 @@ static struct platform_device shdwc_device = { static void __init at91sam9260_register_devices(void) { + platform_device_register(&ramc_device); platform_device_register(&rstc_device); platform_device_register(&shdwc_device); } diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index a8bd35963332..1b23a023cca6 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c @@ -337,6 +337,20 @@ static struct platform_device rstc_device = { .num_resources = ARRAY_SIZE(rstc_resources), }; +static struct resource ramc_resources[] = { + [0] = { + .start = AT91SAM9261_BASE_SDRAMC, + .end = AT91SAM9261_BASE_SDRAMC + SZ_512 - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device ramc_device = { + .name = "at91-sam9260-ramc", + .resource = ramc_resources, + .num_resources = ARRAY_SIZE(ramc_resources), +}; + static struct resource shdwc_resources[] = { [0] = { .start = AT91SAM9261_BASE_SHDWC, @@ -353,6 +367,7 @@ static struct platform_device shdwc_device = { static void __init at91sam9261_register_devices(void) { + platform_device_register(&ramc_device); platform_device_register(&rstc_device); platform_device_register(&shdwc_device); } diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index fbff228cc63e..55c0c212fde1 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c @@ -360,6 +360,20 @@ static struct platform_device rstc_device = { .num_resources = ARRAY_SIZE(rstc_resources), }; +static struct resource ramc_resources[] = { + [0] = { + .start = AT91SAM9263_BASE_SDRAMC0, + .end = AT91SAM9263_BASE_SDRAMC0 + SZ_512 - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device ramc_device = { + .name = "at91-sam9260-ramc", + .resource = ramc_resources, + .num_resources = ARRAY_SIZE(ramc_resources), +}; + static struct resource shdwc_resources[] = { [0] = { .start = AT91SAM9263_BASE_SHDWC, @@ -376,6 +390,7 @@ static struct platform_device shdwc_device = { static void __init at91sam9263_register_devices(void) { + platform_device_register(&ramc_device); platform_device_register(&rstc_device); platform_device_register(&shdwc_device); }