From patchwork Thu Nov 7 08:41:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 21389 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A5538244F2 for ; Thu, 7 Nov 2013 08:41:53 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id aq17sf978020iec.11 for ; Thu, 07 Nov 2013 00:41:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=UKeee9H2VLSDioBMMMbOmvR6zPs2KccIio/xEE7qxZI=; b=WtABAGaJQBuR1Y5Odxp3EB2kBrouNnvWYbJdimNd0K2MIZm4Z+qGqR+NABV4+eKGNK 1ohdHObuOi0TeSvxEoNSBx1ZNqFxdI6rNXCn4RZMqCJthCLAPer8/Vn6Lomew57LWTzs gghLRvSFa/6uFvUtqLVzy1bwGbBdED7woPoFZd3LTkm4nCHK5RUgygI1VybcnNzVRCBc VNvh/Cn3t36oBb8zSyX7NNTyTuZap2DRclNFNVJfcLIDGtoIuXAeKNk0jnpKX6sb97+q K4KIUhoAUaCYMBx6h5Lx22gv5Uq8BZqjeW2yl3PLXOXEsb2Zu7Sb4Rp6m02qNw2fI3qJ bYIA== X-Gm-Message-State: ALoCoQldyWHnMk1a5o+kULEslD0gOHo/+/4UoMCc/xCuTO2YTi/g84DIzm+EcmiE9ydI4TnzgJ5Q X-Received: by 10.182.241.129 with SMTP id wi1mr2445095obc.10.1383813713309; Thu, 07 Nov 2013 00:41:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.133.100 with SMTP id pb4ls1033889qeb.44.gmail; Thu, 07 Nov 2013 00:41:53 -0800 (PST) X-Received: by 10.221.29.200 with SMTP id rz8mr74187vcb.33.1383813713173; Thu, 07 Nov 2013 00:41:53 -0800 (PST) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id jb3si1223563vdb.118.2013.11.07.00.41.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 00:41:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.48; Received: by mail-vb0-f48.google.com with SMTP id o19so141128vbm.7 for ; Thu, 07 Nov 2013 00:41:53 -0800 (PST) X-Received: by 10.220.74.69 with SMTP id t5mr5884153vcj.18.1383813713074; Thu, 07 Nov 2013 00:41:53 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp3838vcz; Thu, 7 Nov 2013 00:41:52 -0800 (PST) X-Received: by 10.66.253.169 with SMTP id ab9mr8399307pad.156.1383813711208; Thu, 07 Nov 2013 00:41:51 -0800 (PST) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx.google.com with ESMTPS id hk1si1831402pbb.281.2013.11.07.00.41.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 00:41:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.53 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id kx10so286231pab.12 for ; Thu, 07 Nov 2013 00:41:50 -0800 (PST) X-Received: by 10.68.161.2 with SMTP id xo2mr7626242pbb.179.1383813710778; Thu, 07 Nov 2013 00:41:50 -0800 (PST) Received: from localhost.localdomain ([140.206.182.114]) by mx.google.com with ESMTPSA id sd3sm3370827pbb.42.2013.11.07.00.41.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 00:41:49 -0800 (PST) From: Haojian Zhuang To: arnd@arndb.de, linux@arm.linux.org.uk, linus.walleij@linaro.org, olof@lixom.net, rob.herring@calxeda.com, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, mturquette@linaro.org, grant.likely@linaro.org, khilman@linaro.org, swarren@wwwdotorg.org, shaojie.sun@linaro.org, devicetree@vger.kernel.org Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v11 1/6] ARM: hi3xxx: add board support with device tree Date: Thu, 7 Nov 2013 16:41:26 +0800 Message-Id: <1383813691-31587-2-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1383813691-31587-1-git-send-email-haojian.zhuang@linaro.org> References: <1383813691-31587-1-git-send-email-haojian.zhuang@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: haojian.zhuang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add board support with device tree for Hisilicon Hi3620 SoC platform. Changelog: v11: 1. Add comments for iotable. v10: 1. Add .map_io() & debug_ll_io_init() back. Since debug_ll_io_init() is only called if .map_io() isn't assigned. Use .map_io() to setup static IO mapping that is used in clock driver. v3: 1. Remove .map_io() in DT machine descriptor. Since debug_ll_io_init() is called by default. 2. Remove .init_machine() in DT machine descriptor. Since of_platform_populate() is called by default in DT mode. v2: 1. Remove .init_irq() in DT machine descriptor. Since irqchip_init() is called by default in DT mode. Signed-off-by: Haojian Zhuang --- .../bindings/arm/hisilicon/hisilicon.txt | 10 ++++ arch/arm/Kconfig | 2 + arch/arm/Makefile | 1 + arch/arm/mach-hi3xxx/Kconfig | 12 +++++ arch/arm/mach-hi3xxx/Makefile | 5 ++ arch/arm/mach-hi3xxx/hi3xxx.c | 60 ++++++++++++++++++++++ 6 files changed, 90 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt create mode 100644 arch/arm/mach-hi3xxx/Kconfig create mode 100644 arch/arm/mach-hi3xxx/Makefile create mode 100644 arch/arm/mach-hi3xxx/hi3xxx.c diff --git a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt new file mode 100644 index 0000000..3be60c8 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt @@ -0,0 +1,10 @@ +Hisilicon Platforms Device Tree Bindings +---------------------------------------------------- + +Hi3716 Development Board +Required root node properties: + - compatible = "hisilicon,hi3716-dkb"; + +Hi4511 Board +Required root node properties: + - compatible = "hisilicon,hi3620-hi4511"; diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3f7714d..0118443 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -946,6 +946,8 @@ source "arch/arm/mach-footbridge/Kconfig" source "arch/arm/mach-gemini/Kconfig" +source "arch/arm/mach-hi3xxx/Kconfig" + source "arch/arm/mach-highbank/Kconfig" source "arch/arm/mach-integrator/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a37a50f..23fb0b0 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -155,6 +155,7 @@ machine-$(CONFIG_ARCH_EBSA110) += ebsa110 machine-$(CONFIG_ARCH_EP93XX) += ep93xx machine-$(CONFIG_ARCH_EXYNOS) += exynos machine-$(CONFIG_ARCH_GEMINI) += gemini +machine-$(CONFIG_ARCH_HI3xxx) += hi3xxx machine-$(CONFIG_ARCH_HIGHBANK) += highbank machine-$(CONFIG_ARCH_INTEGRATOR) += integrator machine-$(CONFIG_ARCH_IOP13XX) += iop13xx diff --git a/arch/arm/mach-hi3xxx/Kconfig b/arch/arm/mach-hi3xxx/Kconfig new file mode 100644 index 0000000..68bd26c --- /dev/null +++ b/arch/arm/mach-hi3xxx/Kconfig @@ -0,0 +1,12 @@ +config ARCH_HI3xxx + bool "Hisilicon Hi36xx/Hi37xx family" if ARCH_MULTI_V7 + select ARM_AMBA + select ARM_GIC + select ARM_TIMER_SP804 + select CACHE_L2X0 + select CLKSRC_OF + select GENERIC_CLOCKEVENTS + select PINCTRL + select PINCTRL_SINGLE + help + Support for Hisilicon Hi36xx/Hi37xx processor family diff --git a/arch/arm/mach-hi3xxx/Makefile b/arch/arm/mach-hi3xxx/Makefile new file mode 100644 index 0000000..d68ebb3 --- /dev/null +++ b/arch/arm/mach-hi3xxx/Makefile @@ -0,0 +1,5 @@ +# +# Makefile for Hisilicon Hi36xx/Hi37xx processors line +# + +obj-y += hi3xxx.o diff --git a/arch/arm/mach-hi3xxx/hi3xxx.c b/arch/arm/mach-hi3xxx/hi3xxx.c new file mode 100644 index 0000000..925af13 --- /dev/null +++ b/arch/arm/mach-hi3xxx/hi3xxx.c @@ -0,0 +1,60 @@ +/* + * (Hisilicon's Hi36xx/Hi37xx SoC based) flattened device tree enabled machine + * + * Copyright (c) 2012-2013 Hisilicon Ltd. + * Copyright (c) 2012-2013 Linaro Ltd. + * + * Author: Haojian Zhuang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include +#include +#include +#include + +#include +#include + +/* + * This table is only for optimization. Since ioremap() could always share + * the same mapping if it's defined as static IO mapping. + * + * Without this table, system could also work. The cost is some virtual address + * spaces wasted since ioremap() may be called multi times for the same + * IO space. + */ +static struct map_desc hi3620_io_desc[] __initdata = { + { + .pfn = __phys_to_pfn(0xfc802000), + .virtual = 0xfe802000, + .length = 0x1000, + .type = MT_DEVICE, + }, +}; + +static void __init hi3620_map_io(void) +{ + debug_ll_io_init(); + iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc)); +} + +static void __init hi3xxx_timer_init(void) +{ + of_clk_init(NULL); + clocksource_of_init(); +} + +static const char *hi3xxx_compat[] __initdata = { + "hisilicon,hi3620-hi4511", + NULL, +}; + +DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)") + .map_io = hi3620_map_io, + .init_time = hi3xxx_timer_init, + .dt_compat = hi3xxx_compat, +MACHINE_END