From patchwork Thu Nov 30 01:24:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 842828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ynKVM6BF3z9sCZ for ; Thu, 30 Nov 2017 12:26:03 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5F2EAC21DE6; Thu, 30 Nov 2017 01:25:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 138DAC21D99; Thu, 30 Nov 2017 01:25:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 62156C21D8C; Thu, 30 Nov 2017 01:25:47 +0000 (UTC) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id 8F623C21C4F for ; Thu, 30 Nov 2017 01:25:46 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D8981435; Wed, 29 Nov 2017 17:25:45 -0800 (PST) Received: from slackpad.lan (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9DE4F3F236; Wed, 29 Nov 2017 17:25:43 -0800 (PST) From: Andre Przywara To: Simon Glass , Tom Rini , Minkyu Kang Date: Thu, 30 Nov 2017 01:24:58 +0000 Message-Id: <20171130012511.16333-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 Cc: u-boot@lists.denx.de, rafaello7 , Metro Subject: [U-Boot] [RFC PATCH 00/13] Nexell S5P6818 SoC support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hi, this is a first draft of the things Amit and I have been working on in the last months. It introduces support for an SoC called "Nexell S5P6818". This is an Octa-core ARMv8 SoC with Cortex-A53 cores, which apparently is closely related to (older) Samsung SoCs. Many peripherals are compatible to Samsung IP (UART, MMC, Ethernet, timers, ...), but some core peripherals like the clocks and the pin controller seem to be completely different. We used the NanoPi M3 board [1] for testing, which uses this SoC along with the usual suspects of on-board components and connectors. This port is done completely from scratch, by just looking at the manual. This allows a much cleaner and modern U-Boot support than the BSP code. The ARM Generic Timer (aka. arch timer) does not seem to work on this SoC. Ideally there would be some (hidden?) register enabling the right clock source, though we haven't found one (yet). But as also other code for this SoC out there on the net does not seem to be able to use the arch timer, I am not too hopeful here. While this does not impose a real problem to U-Boot (patch 3/13 takes care of that), it is a showstopper for mainline arm64 Linux, which heavily relies on the arch timer (since it's a mandatory part of the ARMv8 architecture). There is only a very small chance that the arch timer ever becomes optional in the mainline arm64 kernel. However our arm(32) kernel ports works quite nicely so far, also a (hacked) arm64 kernel boots to the prompt. We will submit Linux patches at a later time. We would be grateful to get some comments on the patches. The first five patches adapt existing code to simplify support for this SoC. The following six patches then successively enable and add SoC support, culmulating in the addition of a nanopi_m3_defconfig file in patch 11/13. The SoC support code is actually architecture agnostic, though up until the last patch it generates an AArch64 binary. To overcome the problems with the arch timer mentioned above, the final patch switches the port over to AArch32, which can more naturally launch arm kernels. This code so far does not include an SPL, instead it relies on some vendor provided code to initialise the DRAM and load U-Boot proper. The original BSP code provided a binary blob for that (called "secondboot"), although there is some GPLed version of that available on github([2]). We can load a 32-bit U-Boot with both the vendor blob and Rafaello's GPL version, the 64-bit version is only usable with the GPL code. Instruction on how to create a bootable SD card are contained in the arch/arm/mach-nexell/README file. We would be very grateful to get some first feedback on those patches and the approach in general taken here. Cheers, Andre. [1] http://nanopi.io/nanopi-m3.html [2] https://github.com/rafaello7/bl1-nanopi-m3 Amit Singh Tomar (4): reset: add driver for generic reset controllers mmc: add MMC (glue) driver for Nexell SoCs arm: nexell: add ARM64 MMU regions arm: nexell: add timer support Andre Przywara (9): serial: s5p: rework Samsung UART driver to get rid of uart.h serial: S5P/Samsung: refactor and Kconfig-ize UART selection arm: move SYS_ARCH_TIMER to KConfig arm: add basic framework for Nexell S5P6818 support arm: nexell: embed NSIH header arm: nexell: add UART support arm: nexell: add preliminary S5P6818 SoC device tree arm: add NanoPi M3 board support arm: nexell: switch to 32-bit arch/arm/Kconfig | 29 +++++ arch/arm/Makefile | 1 + arch/arm/cpu/armv8/Makefile | 2 +- arch/arm/dts/s5p6818-nanopi-m3.dts | 30 +++++ arch/arm/dts/s5p6818.dtsi | 196 ++++++++++++++++++++++++++++++ arch/arm/dts/s5pc1xx-goni.dts | 2 +- arch/arm/dts/s5pc1xx-smdkc100.dts | 2 +- arch/arm/include/asm/arch-nexell/boot0.h | 35 ++++++ arch/arm/include/asm/arch-nexell/clk.h | 15 +++ arch/arm/include/asm/arch-nexell/pwm.h | 62 ++++++++++ arch/arm/mach-exynos/include/mach/uart.h | 44 ------- arch/arm/mach-imx/mx7ulp/Kconfig | 1 + arch/arm/mach-nexell/Kconfig | 9 ++ arch/arm/mach-nexell/Makefile | 10 ++ arch/arm/mach-nexell/README | 49 ++++++++ arch/arm/mach-nexell/board.c | 128 +++++++++++++++++++ arch/arm/mach-nexell/mmu-arm64.c | 39 ++++++ arch/arm/mach-s5pc1xx/Kconfig | 2 + arch/arm/mach-s5pc1xx/include/mach/uart.h | 44 ------- configs/nanopi_m3_defconfig | 12 ++ drivers/mmc/Kconfig | 8 ++ drivers/mmc/Makefile | 1 + drivers/mmc/nexell_dw_mmc.c | 159 ++++++++++++++++++++++++ drivers/reset/Kconfig | 6 + drivers/reset/Makefile | 1 + drivers/reset/reset-generic.c | 111 +++++++++++++++++ drivers/serial/Kconfig | 6 + drivers/serial/Makefile | 2 +- drivers/serial/serial_s5p.c | 45 ++++++- include/configs/mx7ulp_evk.h | 1 - include/configs/s5p6818.h | 35 ++++++ include/configs/ti_armv7_keystone2.h | 1 - scripts/config_whitelist.txt | 1 - 33 files changed, 989 insertions(+), 100 deletions(-) create mode 100644 arch/arm/dts/s5p6818-nanopi-m3.dts create mode 100644 arch/arm/dts/s5p6818.dtsi create mode 100644 arch/arm/include/asm/arch-nexell/boot0.h create mode 100644 arch/arm/include/asm/arch-nexell/clk.h create mode 100644 arch/arm/include/asm/arch-nexell/pwm.h delete mode 100644 arch/arm/mach-exynos/include/mach/uart.h create mode 100644 arch/arm/mach-nexell/Kconfig create mode 100644 arch/arm/mach-nexell/Makefile create mode 100644 arch/arm/mach-nexell/README create mode 100644 arch/arm/mach-nexell/board.c create mode 100644 arch/arm/mach-nexell/mmu-arm64.c delete mode 100644 arch/arm/mach-s5pc1xx/include/mach/uart.h create mode 100644 configs/nanopi_m3_defconfig create mode 100644 drivers/mmc/nexell_dw_mmc.c create mode 100644 drivers/reset/reset-generic.c create mode 100644 include/configs/s5p6818.h