From patchwork Thu Jan 22 16:03:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 5686381 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 661B09F358 for ; Thu, 22 Jan 2015 16:05:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F19620034 for ; Thu, 22 Jan 2015 16:05:13 +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 43E23202B8 for ; Thu, 22 Jan 2015 16:05:12 +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 1YEKE3-00015h-A1; Thu, 22 Jan 2015 16:03:19 +0000 Received: from eusmtp01.atmel.com ([212.144.249.242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEKDx-0000Kg-TX for linux-arm-kernel@lists.infradead.org; Thu, 22 Jan 2015 16:03:14 +0000 Received: from tenerife.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.2.347.0; Thu, 22 Jan 2015 17:02:47 +0100 From: Nicolas Ferre To: Alexandre Belloni , Boris BREZILLON Subject: [PATCH] ARM: at91: fix PM initialization for newer SoCs Date: Thu, 22 Jan 2015 17:03:04 +0100 Message-ID: <1421942584-2364-1-git-send-email-nicolas.ferre@atmel.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1421333971-7581-5-git-send-email-alexandre.belloni@free-electrons.com> References: <1421333971-7581-5-git-send-email-alexandre.belloni@free-electrons.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150122_080314_333446_61FAC6B2 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: -0.7 (/) Cc: Nicolas Ferre , Ludovic Desroches , Jean-Christophe PLAGNIOL-VILLARD , linux-kernel@vger.kernel.org, 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: , 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Newer SoCs: at91sam9x5, at91sam9n12, sama5d3 and sama5d4 embed a DDR controller and have a different PMC status register layout than the at91sam9g45. Create another at91_sam9x5_pm_init() function to match this compatibility. Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/board-dt-sam9.c | 20 ++++++++++++++++++++ arch/arm/mach-at91/board-dt-sama5.c | 2 +- arch/arm/mach-at91/pm.c | 7 +++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c index 0fe1ced608c5..c8252ddac6f0 100644 --- a/arch/arm/mach-at91/board-dt-sam9.c +++ b/arch/arm/mach-at91/board-dt-sam9.c @@ -61,3 +61,23 @@ DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") .init_machine = sam9g45_dt_device_init, .dt_compat = at91_9g45_board_compat, MACHINE_END + +static void __init sam9x5_dt_device_init(void) +{ + at91_sam9x5_pm_init(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + +static const char *at91_9x5_board_compat[] __initconst = { + "atmel,at91sam9x5", + "atmel,at91sam9n12", + NULL +}; + +DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9") + /* Maintainer: Atmel */ + .map_io = at91_map_io, + .init_early = at91_dt_initialize, + .init_machine = sam9x5_dt_device_init, + .dt_compat = at91_9x5_board_compat, +MACHINE_END diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c index 44d372a22a29..b7338966c8ab 100644 --- a/arch/arm/mach-at91/board-dt-sama5.c +++ b/arch/arm/mach-at91/board-dt-sama5.c @@ -28,7 +28,7 @@ static void __init sama5_dt_device_init(void) { - at91_sam9260_pm_init(); + at91_sam9x5_pm_init(); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 81f2f12d3cc1..87c1fd8aa1b6 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -306,3 +306,10 @@ void __init at91_sam9g45_pm_init(void) at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; return at91_pm_init(); } + +void __init at91_sam9x5_pm_init(void) +{ + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP; + at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR; + return at91_pm_init(); +}