From patchwork Thu Oct 11 22:05:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joachim Eastwood X-Patchwork-Id: 1584391 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 94E77DFABE for ; Thu, 11 Oct 2012 22:08:21 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TMQtS-0004m0-Q8; Thu, 11 Oct 2012 22:06:14 +0000 Received: from mail-la0-f49.google.com ([209.85.215.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TMQtD-0004gl-Sa for linux-arm-kernel@lists.infradead.org; Thu, 11 Oct 2012 22:06:00 +0000 Received: by mail-la0-f49.google.com with SMTP id z14so1547253lag.36 for ; Thu, 11 Oct 2012 15:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Jie8v5NxT1HpzHNrs52eq8/ikWEqCZac1Z53Qxj+ar4=; b=gejE1ryQVncqjnyc+BTUKXZ25xBZS4Ti4JgaalGoIFTwd5ISFmpnVG6IZ32hsR+3iX 80Sfnce+6d/4WJR+01Ur3yvIy1mPZFE7OzOwLqYsJfxO1n2Pc3sJLLryGVp4sQ2MMWdq 1C2XoYMoVHRXNnsDZxsTy7pKQjEQa1hHef45zYRjhT3z05lLt7yMIJ6VMyb7GFDgxI+v W06vzWhAAlziQbRCrCSkhoODyiULFMYgoKCSi+JEgJV6Gl7ufZCeOQKDKSl32cwgS7rJ yRHXgeWp7Om0hsZwxwXP5XxQdJFGkwDeG/X8fH9s5ScmuItEX8BpN8wb6y+y3zFEY5wJ Y3ew== Received: by 10.112.99.168 with SMTP id er8mr912770lbb.36.1349993159483; Thu, 11 Oct 2012 15:05:59 -0700 (PDT) Received: from localhost.localdomain ([90.149.223.57]) by mx.google.com with ESMTPS id m6sm21903lbh.10.2012.10.11.15.05.57 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 15:05:58 -0700 (PDT) From: Joachim Eastwood To: nicolas.ferre@atmel.com Subject: [PATCH 3/4] ARM: AT91: Add AT91RM9200 support to DT board Date: Fri, 12 Oct 2012 00:05:25 +0200 Message-Id: <1349993126-9519-3-git-send-email-manabian@gmail.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1349993126-9519-1-git-send-email-manabian@gmail.com> References: <1349993126-9519-1-git-send-email-manabian@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (manabian[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Joachim Eastwood , plagnioj@jcrosoft.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Joachim Eastwood --- Hi, This patch has some potential issues. Before this patch board-dt would fail building when only AT91RM9200 was enabled because at91sam926x_timer symbol would be missing. This patch uses the at91rm9200_timer which will fail if AT91RM9200 is not enabled. Any thoughts on solving this? As mention above this bug exists in mainline now. I had to create a new at91rm9200_dt_initialize since at91_dt_initialize will panic when it tries to add rstc and shdwc. Is it okay to add at91rm9200_dt_initialize or should we fix at91_dt_rstc and at91_dt_shdwc to not panic when DT nodes are not found? regards Joachim Eastwood arch/arm/mach-at91/board-dt.c | 15 +++++++++++++++ arch/arm/mach-at91/generic.h | 1 + arch/arm/mach-at91/setup.c | 14 ++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c index e8f45c4..0e73317 100644 --- a/arch/arm/mach-at91/board-dt.c +++ b/arch/arm/mach-at91/board-dt.c @@ -45,11 +45,26 @@ static void __init at91_dt_device_init(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } +static const char *at91rm9200_dt_board_compat[] __initdata = { + "atmel,at91rm9200", + NULL +}; + static const char *at91_dt_board_compat[] __initdata = { "atmel,at91sam9", NULL }; +DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") + .timer = &at91rm9200_timer, + .map_io = at91_map_io, + .handle_irq = at91_aic_handle_irq, + .init_early = at91rm9200_dt_initialize, + .init_irq = at91_dt_init_irq, + .init_machine = at91_dt_device_init, + .dt_compat = at91rm9200_dt_board_compat, +MACHINE_END + DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") /* Maintainer: Atmel */ .timer = &at91sam926x_timer, diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index f496506..9bb5ce5 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h @@ -20,6 +20,7 @@ extern void __init at91_init_sram(int bank, unsigned long base, extern void __init at91rm9200_set_type(int type); extern void __init at91_initialize(unsigned long main_clock); extern void __init at91x40_initialize(unsigned long main_clock); +extern void __init at91rm9200_dt_initialize(void); extern void __init at91_dt_initialize(void); /* Interrupts */ diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index da9881b..2c1fdd4 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c @@ -338,6 +338,7 @@ static void at91_dt_rstc(void) } static struct of_device_id ramc_ids[] = { + { .compatible = "atmel,at91rm9200-sdramc" }, { .compatible = "atmel,at91sam9260-sdramc" }, { .compatible = "atmel,at91sam9g45-ddramc" }, { /*sentinel*/ } @@ -436,6 +437,19 @@ end: of_node_put(np); } +void __init at91rm9200_dt_initialize(void) +{ + at91_dt_ramc(); + + /* Init clock subsystem */ + at91_dt_clock_init(); + + /* Register the processor-specific clocks */ + at91_boot_soc.register_clocks(); + + at91_boot_soc.init(); +} + void __init at91_dt_initialize(void) { at91_dt_rstc();