From patchwork Sat Jan 28 22:33:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92763 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp789335obz; Sat, 28 Jan 2017 14:35:13 -0800 (PST) X-Received: by 10.84.194.37 with SMTP id g34mr21826883pld.105.1485642913357; Sat, 28 Jan 2017 14:35:13 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id o61si8230414pld.201.2017.01.28.14.35.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Jan 2017 14:35:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cXbaR-0001p1-Ag; Sat, 28 Jan 2017 22:35:11 +0000 Received: from mail-lf0-f47.google.com ([209.85.215.47]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cXbaM-0008Pi-Ki for linux-arm-kernel@lists.infradead.org; Sat, 28 Jan 2017 22:35:09 +0000 Received: by mail-lf0-f47.google.com with SMTP id v186so178314912lfa.1 for ; Sat, 28 Jan 2017 14:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=GyaDuzEGCazxzeJ9NobDoZ1u/hs2zPDRsjiWhdGvyTk=; b=WQlJNr/obTo6f1XbWtlYCCTjEN8K7Eym5nDj0GHlJz5VN81NaJWXMzRipzCrXJae/L brJJQPs+beFNriUEpKtulb0n7bDy/DOOMuhTrp4zVi9ANu30ZiZlBhN6RCnQpSiHpx5o H0V3gMLRoXZ0V818Nz6TvU6sG+co3m+0YZeWU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GyaDuzEGCazxzeJ9NobDoZ1u/hs2zPDRsjiWhdGvyTk=; b=oVEXey8VCdfh/AXxagFOAdRBzOk3477nRJMg2njS5X52y8xRSATNIvpM7in3/hnp3u Rhfz63/Pz8SGTskD8ycLyVtMNf0WjOTqHXhUFQHsd0ubm5lhkydyV4ScAW+I29phkTtL vHcUwB4xsWUTrHNMvSCnuBFS3qZ7CEE5jJ5IEfCpVE4JNi+Z74vSlcx27+A4FUmLXWHI V8dtmPQ0HBYn7LRwjnA9hqHpjrVTg9N+4a/tLG6hi89Jfjuvt/FTebxn0xgK4PCjI33n PB8+MDtXdRP53XKqdPUdGnZtJ4eETT7aSvs2/HArrCSe66KEt9xLdWK9HmUFni5CgLvs ajYg== X-Gm-Message-State: AIkVDXIcYHSRoWTUfwCeTrPywQVKGxmsnEhDq9+v8TOvClfbb1qlsAjxEzy45ngPFcqRYQii X-Received: by 10.46.75.26 with SMTP id y26mr5350719lja.76.1485642821491; Sat, 28 Jan 2017 14:33:41 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id e19sm1540780ljb.38.2017.01.28.14.33.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Jan 2017 14:33:40 -0800 (PST) From: Linus Walleij To: Hans Ulli Kroll , Florian Fainelli , linux-arm-kernel@lists.infradead.org, Arnd Bergmann Subject: [PATCH 12/22 v2] ARM: gemini: DT for the Cortina Gemini SoC platforms Date: Sat, 28 Jan 2017 23:33:32 +0100 Message-Id: <20170128223332.25098-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170128_143506_878132_BAAB3C15 X-CRM114-Status: GOOD ( 18.07 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.47 listed in wl.mailspike.net] -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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@openwrt.org, Janos Laube , Linus Walleij , Paulius Zaleckas MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This adds initial and compulsory device tree support to the Gemini ARMv4 platform. We are selecting a bunch of "absolute minimals" for getting a working system up with just device tree: - We select USE_OF for natural reasons or nothing works. - We select CLKSRC_OF and GEMINI_TIMER so we get timekeeping from the clocksource. - We select GPIO_GEMINI because these are used as irqchips, and for a generic driver it is not reasonable for those to have to select every possible irqchip in the world to work, the platform should simply provide the available irqchips. - We select a UART that can be exprected to work with SERIAL_OF_PLATFORM which is the name for an 8250 OF-probed serial port. - We select the syscon-based reset controller: it's not fun when "reboot" doesn't work because of Kconfig, so we just select POWER_RESET and POWER_RESET_SYSCON. - We perhaps a bit controversiallt select ARM_APPENDED_DTB, because this platform is using the ancient RedBoot, and can *NOT* be expected to upgrade its bootloaders. Appended device tree is simply how these devices have to work with device tree. Cc: Janos Laube Cc: Paulius Zaleckas Cc: Hans Ulli Kroll Cc: Florian Fainelli Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Just use CONFIG_DEBUG_UART_PHYS / CONFIG_DEBUG_UART_VIRT directly in the iomap, works like a charm and saves more hardcoded constants. We have to add an ifedf for debugging but that should be fine. --- arch/arm/Kconfig | 8 ++++++++ arch/arm/mach-gemini/Makefile | 2 +- arch/arm/mach-gemini/board-dt.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-gemini/board-dt.c -- 2.9.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 63e61bf5aab0..b4a42d599e2c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -355,11 +355,19 @@ config ARM_SINGLE_ARMV7M config ARCH_GEMINI bool "Cortina Systems Gemini" + select ARM_APPENDED_DTB # Old Redboot bootloaders deployed select CLKSRC_MMIO + select CLKSRC_OF select CPU_FA526 + select GEMINI_TIMER select GENERIC_CLOCKEVENTS + select GPIO_GEMINI select GPIOLIB select MULTI_IRQ_HANDLER + select POWER_RESET + select POWER_RESET_SYSCON + select SERIAL_OF_PLATFORM + select USE_OF help Support for the Cortina Systems Gemini family SoCs diff --git a/arch/arm/mach-gemini/Makefile b/arch/arm/mach-gemini/Makefile index 7963a77be637..11f07fb6ec3d 100644 --- a/arch/arm/mach-gemini/Makefile +++ b/arch/arm/mach-gemini/Makefile @@ -4,7 +4,7 @@ # Object file lists. -obj-y := irq.o mm.o time.o devices.o gpio.o idle.o reset.o +obj-y := irq.o mm.o time.o devices.o gpio.o idle.o reset.o board-dt.o # Board-specific support obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o diff --git a/arch/arm/mach-gemini/board-dt.c b/arch/arm/mach-gemini/board-dt.c new file mode 100644 index 000000000000..208ea99cdc47 --- /dev/null +++ b/arch/arm/mach-gemini/board-dt.c @@ -0,0 +1,38 @@ +/* + * Gemini Device Tree boot support + */ +#include +#include +#include + +#include +#include + +#ifdef CONFIG_DEBUG_GEMINI +/* This is needed for LL-debug/earlyprintk/debug-macro.S */ +static struct map_desc gemini_io_desc[] __initdata = { + { + .virtual = CONFIG_DEBUG_UART_VIRT, + .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS), + .length = SZ_4K, + .type = MT_DEVICE, + }, +}; + +static void __init gemini_map_io(void) +{ + iotable_init(gemini_io_desc, ARRAY_SIZE(gemini_io_desc)); +} +#else +#define gemini_map_io NULL +#endif + +static const char *gemini_board_compat[] = { + "cortina,gemini", + NULL, +}; + +DT_MACHINE_START(GEMINI_DT, "Gemini (Device Tree)") + .map_io = gemini_map_io, + .dt_compat = gemini_board_compat, +MACHINE_END