From patchwork Wed Mar 14 13:04:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 7283 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DB01523DEE for ; Wed, 14 Mar 2012 13:05:16 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id A3080A18743 for ; Wed, 14 Mar 2012 13:05:16 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so3119093iag.11 for ; Wed, 14 Mar 2012 06:05:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=5W/9V1u0gKGo6eeNvhkCcXx8IQTaN/qYA7d896ehh48=; b=ehV4YITdTJ1YuMu3qfdx0k8aP/RdfkFr0zNR3+ZWD6loXimbLuJxmJIVSGgnbf2UVv VC8cp34RHCDoGGz+SMUNRdSPs3VdDFrgpFpdHzR57Nr7nXWZz1Mmo5YIr/AKJY4PF7xn pqWIw9tAlz2kAUTjeC6t7fGDx2SbqSzM/yAaHmG9l7GRzIs+mTtEUrxrPL+qMmH+T9qN X1btnV5n9gailWTZRGAJOvt38HsMGaG9nxUPkWSaerbv8b1OExrOT5x7CfF+T/lPcTwj HZpjdJs28qFmQnmNOxmqI2Qe/Mi66fd1bPCu/s3bD7WYguebG8NeetApjjHt9KpIOkqP ct1Q== Received: by 10.50.158.133 with SMTP id wu5mr11702182igb.50.1331730316437; Wed, 14 Mar 2012 06:05:16 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp9538ibg; Wed, 14 Mar 2012 06:05:15 -0700 (PDT) Received: by 10.180.102.129 with SMTP id fo1mr6231160wib.6.1331730313926; Wed, 14 Mar 2012 06:05:13 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id n6si5405177wic.47.2012.03.14.06.05.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 06:05:13 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-we0-f178.google.com with SMTP id a13so2183990wer.37 for ; Wed, 14 Mar 2012 06:05:13 -0700 (PDT) Received: by 10.180.102.129 with SMTP id fo1mr6231089wib.6.1331730313430; Wed, 14 Mar 2012 06:05:13 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id fi4sm11477024wib.4.2012.03.14.06.05.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 06:05:12 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org Cc: linus.walleij@linaro.org, arnd@arndb.de, niklas.hernaeus@stericsson.com, Lee Jones , Niklas Hernaeus Subject: [PATCH 02/10] ARM: ux500: Initial Device Tree support for Snowball Date: Wed, 14 Mar 2012 13:04:58 +0000 Message-Id: <1331730306-11461-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1331730306-11461-1-git-send-email-lee.jones@linaro.org> References: <1331730306-11461-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlhh7cw+V3BX1lfE/5PuTKJYwHC8ChrbeWSBKSPqDvBDYFSkL+WWjX1h+TcjLDahR/ck0h/ From: Arnd Bergmann This provides very basic Device Tree support for ST-Ericsson's low-cost development platform, Snowball. If Device Tree for ux500 is enabled and the correct board is configured within the Device Tree blob, the correct *_init_machine() will be called. This patch is based on some original work completed by: Niklas Hernaeus Signed-off-by: Arnd Bergmann Signed-off-by: Lee Jones Signed-off-by: Niklas Hernaeus --- arch/arm/boot/dts/snowball.dts | 31 +++++++++++++++++++++++++++++++ arch/arm/mach-ux500/Makefile.boot | 1 + arch/arm/mach-ux500/board-mop500.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/snowball.dts diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts new file mode 100644 index 0000000..ebcff9a --- /dev/null +++ b/arch/arm/boot/dts/snowball.dts @@ -0,0 +1,31 @@ +/* + * Copyright 2011 ST-Ericsson AB + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +/dts-v1/; + +/ { + model = "Calao Systems Snowball platform with device tree"; + compatible = "calaosystems,snowball-a9500"; + + #address-cells = <1>; + #size-cells = <1>; + + memory { + reg = <0x00000000 0x20000000>; + }; + + soc-u9500 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + }; +}; diff --git a/arch/arm/mach-ux500/Makefile.boot b/arch/arm/mach-ux500/Makefile.boot index ff0a4b5..dd5cd00 100644 --- a/arch/arm/mach-ux500/Makefile.boot +++ b/arch/arm/mach-ux500/Makefile.boot @@ -2,3 +2,4 @@ params_phys-y := 0x00000100 initrd_phys-y := 0x00800000 +dtb-$(CONFIG_MACH_SNOWBALL) += snowball.dtb diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 04afcdf..0fb5dfd 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -30,6 +30,9 @@ #include #include +#include +#include + #include #include #include @@ -738,3 +741,34 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") .handle_irq = gic_handle_irq, .init_machine = snowball_init_machine, MACHINE_END + +#ifdef CONFIG_MACH_UX500_DT +static void __init u8500_init_machine(void) +{ + if (of_machine_is_compatible("calaosystems,snowball-a9500")) + return snowball_init_machine(); + else if (of_machine_is_compatible("st-ericsson,hrefv60+")) + return hrefv60_init_machine(); + else if (of_machine_is_compatible("st-ericsson,mop500")) + return mop500_init_machine(); +} + +static const char * u8500_dt_board_compat[] = { + "calaosystems,snowball-a9500", + "st-ericsson,hrefv60+", + "st-ericsson,u8500", + "st-ericsson,mop500", + NULL, +}; + + +DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") + .map_io = u8500_map_io, + .init_irq = ux500_init_irq, + /* we re-use nomadik timer here */ + .timer = &ux500_timer, + .handle_irq = gic_handle_irq, + .init_machine = u8500_init_machine, + .dt_compat = u8500_dt_board_compat, +MACHINE_END +#endif