From patchwork Wed Mar 25 14:46:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1261431 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48nWFD40fDz9sRR for ; Thu, 26 Mar 2020 01:47:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6739081822; Wed, 25 Mar 2020 15:47:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id DC6A081827; Wed, 25 Mar 2020 15:47:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id A9C8A811EE for ; Wed, 25 Mar 2020 15:47:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8730A1FB; Wed, 25 Mar 2020 07:47:33 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 343DA3F71E; Wed, 25 Mar 2020 07:47:32 -0700 (PDT) From: Andre Przywara To: David Feng , Liviu Dudau , Linus Walleij Cc: u-boot@lists.denx.de, Simon Glass , Tom Rini Subject: [PATCH 0/7] Arm Juno board OF_CONTROL upgrade Date: Wed, 25 Mar 2020 14:46:55 +0000 Message-Id: <20200325144702.16288-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Hi, The Juno port in U-Boot didn't see much love lately, so it has fallen a bit behind. We already get a build warning for using an old network driver, but there is more: - The port is using hardcoded information, even though we have quite decent DTs available to find things at runtime. - There is no support for USB or PCI, which pretty much limits the board to load a kernel from flash (yuck!) or TFTP (at least!). - Probably because of this, newer features like UEFI support don't work properly. - There are minor things like less-than-ideal default load addresses and missing reset support. This series is the first part of fixing this. The main part is to switch the board port to use OF_CONTROL, so U-Boot will use a DT to configure itself at runtime. This requires some update to the PL011 driver first (patch 2/7), and allows us to simply enable USB in the defconfig (patch 6/7). USB requires two "usb reset" calls after the initial "usb start" to recognise any devices, not sure why this is. But eventually I am able to load grub from a USB hard drive and do a full featured Ubuntu UEFI boot from there (with a distro kernel). Patches 1, 3, and 7 are mere fixes, patch 4/7 does the actual OF_CONTROL conversion. I also have some proper DM_PCI compliant driver in an advanced state, which allows to load from a SATA hard disk. Unfortunately there is no sky2 network driver in U-Boot, so the Gigabit Ethernet chip connected to PCI will not work easily. I will post this once this is cleaned up and tested. Converting the smc network driver to DM_ETH is on my list as well, but the code is shared with some U-Boot *application* code, also used by some PowerPC boards, so that's not really a low hanging fruit. But it would remove the deprecation warning. Cheers, Andre P.S. In case you want to test this without flashing it, you can chainload U-Boot from an existing U-Boot installation: $ mkimage -A arm64 -O u-boot -T standalone -C none -a 0xe0000000 -e 0xe0000000 -d u-boot.bin -n U-Boot /srv/tftp/u-boot-juno.img VExpress64# tftpboot 0xe0000000 u-boot-juno.img VExpress64# bootm 0xe0000000 Andre Przywara (7): arm: juno: Fix Juno address variables uart: pl011: Add proper DM clock support arm: juno: Fix UART clock rate arm: juno: Enable OF_CONTROL arm: juno: Use PSCI based reset arm: juno: enable USB arm: vexpress64: Remove unneeded CONFIG_ check arch/arm/Kconfig | 11 ++++++ board/armltd/vexpress64/Kconfig | 7 ++++ board/armltd/vexpress64/vexpress64.c | 61 ++++++++++++++++++++++++++++++++-- configs/vexpress_aemv8a_juno_defconfig | 9 +++-- drivers/serial/serial_pl01x.c | 10 +++++- include/configs/vexpress_aemv8a.h | 35 ++++++++++--------- 6 files changed, 108 insertions(+), 25 deletions(-)