From patchwork Sun Jan 22 12:22:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92159 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp804955qgi; Sun, 22 Jan 2017 04:25:50 -0800 (PST) X-Received: by 10.237.35.1 with SMTP id h1mr20482380qtc.276.1485087950500; Sun, 22 Jan 2017 04:25:50 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id a11si8734710qte.23.2017.01.22.04.25.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jan 2017 04:25:50 -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 1cVHDQ-0006kr-0u; Sun, 22 Jan 2017 12:25:48 +0000 Received: from mail-lf0-f43.google.com ([209.85.215.43]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVHBk-0004C9-1M for linux-arm-kernel@lists.infradead.org; Sun, 22 Jan 2017 12:24:05 +0000 Received: by mail-lf0-f43.google.com with SMTP id z134so80647011lff.3 for ; Sun, 22 Jan 2017 04:23: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=1l2n12xeqE6eRc74cFgPS/YjUX7kxaVZ6LHhkWeSkVw=; b=bAn6rf4EGLjZlGaF0t1Z9zTP2RDKgc9C+2Y38Jp5RPdjWN3k5njRi/G9EadEvb++YW wEo/+nXpOe5knmEkIYRW01VuAKm0sMq9qfa9ycCvKBVuxLdxsvFI8yLrwkuIGoyz34yV YXcJq4RlR7or7s9vJvZjH2W2xzC9yxNowYRlA= 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=1l2n12xeqE6eRc74cFgPS/YjUX7kxaVZ6LHhkWeSkVw=; b=OqLwr0asAO1GoZW8Xx73rcZ8vNJJE+//LfwHwXWPQbovX/Ru05wrcv4bODu9tTSUUW iqxQsAbceFqgS2pqFfWnPhP0UfJcEzMFENun2aflmmXxEEY3ikaVzJQniw9ev4IkkOAE jyHNUKAdCoGhSrCJEhGGeRdnYpZ0mg5qPHjrxj9qH/q3cDW8yvIhgD6V0oUct+rz766O MQCmTpa9dMeuo09iMBmMqJucRUO9zHkfAI631CIFQHEF+JBLjAVIyttDBVk/ohGO43gO JAO8UpYziadTWGTmF79OB37enk6JF5mWyIsyMImJg3zOQqYUP5YCZHBJXbJEsurbS2v5 BrTA== X-Gm-Message-State: AIkVDXIVOLByF8t+YCx29W/f0B8eSazEg3IeY3MkwCq9pvSwJoVNAiz6v4DMWA0xJQ4Yqn6n X-Received: by 10.25.77.83 with SMTP id a80mr7823483lfb.140.1485087762321; Sun, 22 Jan 2017 04:22:42 -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 s28sm5355927ljd.20.2017.01.22.04.22.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jan 2017 04:22:41 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli Subject: [PATCH 12/22] ARM: gemini: DT for the Cortina Gemini SoC platforms Date: Sun, 22 Jan 2017 13:22:36 +0100 Message-Id: <20170122122236.10665-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-20170122_042404_267741_184CB60A X-CRM114-Status: GOOD ( 17.65 ) X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.215.43 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.43 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.43 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, Paulius Zaleckas , Arnd Bergmann , Linus Walleij , linux-kernel@vger.kernel.org, Janos Laube 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 --- 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..2983246d9c63 --- /dev/null +++ b/arch/arm/mach-gemini/board-dt.c @@ -0,0 +1,38 @@ +/* + * Gemini Device Tree boot support + */ +#include +#include +#include + +#include +#include + +/* Can we just use CONFIG_DEBUG_UART_PHYS and CONFIG_DEBUG_UART_VIRT? */ +#define GEMINI_UART_BASE 0x42000000 +#define GEMINI_UART_VBASE 0xf4200000 + +/* This is needed for LL-debug/earlyprintk/debug-macro.S */ +static struct map_desc gemini_io_desc[] __initdata = { + { + .virtual = GEMINI_UART_VBASE, + .pfn = __phys_to_pfn(GEMINI_UART_BASE), + .length = SZ_4K, + .type = MT_DEVICE, + }, +}; + +static void __init gemini_map_io(void) +{ + iotable_init(gemini_io_desc, ARRAY_SIZE(gemini_io_desc)); +} + +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