From patchwork Wed Dec 11 07:54:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 3322811 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DDC6E9F37C for ; Wed, 11 Dec 2013 07:56:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9FDC2040F for ; Wed, 11 Dec 2013 07:56:28 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 D0BFB2026D for ; Wed, 11 Dec 2013 07:56:27 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqeeF-0003Ka-GQ; Wed, 11 Dec 2013 07:55:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vqee7-0002KR-EO; Wed, 11 Dec 2013 07:55:51 +0000 Received: from mail-pd0-f181.google.com ([209.85.192.181]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vqedt-0002HV-Gc for linux-arm-kernel@lists.infradead.org; Wed, 11 Dec 2013 07:55:40 +0000 Received: by mail-pd0-f181.google.com with SMTP id p10so9019083pdj.12 for ; Tue, 10 Dec 2013 23:55:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rcIsRTiqBBH2yWUXR+Es9Cc3wYB0m39IEMTJE/ewmcM=; b=QqiFUvKblWOXgmzxnOHSRpPL+zsUwzgL8xslhOFnWRwIjSbmYTdj96NLOZ3YPwNG2y 7RjMn/6QRu+gAgfAarrz5NxmMl89nHTRNVGwApIe6VZxf6kadyotYlhuPtClMqo7zbQ6 EgbLiB+cMYDrQN/B8MIIiohbbLkrYX+pVQ5YBwaXvBnxuBUIHVF6r0Zd25enuVIN7lgx 8BapHOrq8p5c2cunUPrvCRE/fgc+viCk9Nsam6FUw83xcj4hnHIztN5yQEQHmYTMb7X5 ZzUJpsMSr1VuG3lOo8aRby3IFs0FwYNwYUMSu+izQtsB1L1o1rx/MK6dHl3ZtA4P98wt qepg== X-Gm-Message-State: ALoCoQkyoc9nfyONjRb3Kr+YNNFQPEoIGATzVR94DxT0MivSslYGhHukoWzICNhcXr2+kMq+n88m X-Received: by 10.66.146.199 with SMTP id te7mr104175pab.106.1386748514435; Tue, 10 Dec 2013 23:55:14 -0800 (PST) Received: from localhost.localdomain ([140.206.182.114]) by mx.google.com with ESMTPSA id qz9sm30647313pbc.3.2013.12.10.23.55.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 23:55:13 -0800 (PST) From: Haojian Zhuang To: olof@lixom.net, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, patches@linaro.org, khilman@linaro.org Subject: [PATCH v12 01/08] ARM: hi3xxx: add board support with device tree Date: Wed, 11 Dec 2013 15:54:50 +0800 Message-Id: <1386748497-11290-2-git-send-email-haojian.zhuang@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386748497-11290-1-git-send-email-haojian.zhuang@gmail.com> References: <1386748497-11290-1-git-send-email-haojian.zhuang@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131211_025537_899912_18016791 X-CRM114-Status: GOOD ( 17.96 ) X-Spam-Score: -1.9 (-) Cc: Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Haojian Zhuang 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 | 6 +++ 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, 86 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..21a7336 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt @@ -0,0 +1,6 @@ +Hisilicon Platforms Device Tree Bindings +---------------------------------------------------- + +Hi4511 Board +Required root node properties: + - compatible = "hisilicon,hi3620-hi4511"; diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c1f1a7e..75eb5323 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -925,6 +925,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 c99b108..dfbafa3 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -156,6 +156,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