From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93BD7C5DF62 for ; Wed, 26 Jan 2022 00:59:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8846F82F87; Wed, 26 Jan 2022 01:59:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gz6+E/2X"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6676982FE7; Wed, 26 Jan 2022 01:59:28 +0100 (CET) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 54E668210F for ; Wed, 26 Jan 2022 01:59:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.bossman075@gmail.com Received: by mail-qk1-x72a.google.com with SMTP id a12so11707634qkk.9 for ; Tue, 25 Jan 2022 16:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=kLGx/OMX+bKXUpSlORU6fOmHruNLauFo5NRMwnSzSjY=; b=gz6+E/2XQspINfLqDBkhPsoejSZKRKeOZFhGY/5KkteKmu+u7cJHY4COAvoLwp1akY HQQ68Rmm/QHmEtoaNmN8CTX5sQ5OrzOjK98BmdxDN6hejoT4HLS2vLRMgbd67XOiffHv wUzlJ2ImLi19IJnD5TBcLoOr/gKAz4kqYLBmyXnmfdaoZdHP8a/dG67kj8yDQzjZQK5H NwlvC0GW14iQPHyZnh/qgwT54TgYfcxQQNHlDC3uSTfZBZHtQHKzDhLu4NQbWZVpvYv2 0So1jLRhdBDENOmRcdke/eyTzB5e/67xA1ONklS3hppQZAMWS7rwHah4F5tttd36wOR8 yhGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=kLGx/OMX+bKXUpSlORU6fOmHruNLauFo5NRMwnSzSjY=; b=Kaq76puQc/7g1uc2bxHIPeaFcQWA9SvmVVmJ1Me2a8nMlhUHSvMOsQm0g60fNVIrds +P0/+eJkwBFP0kxL5ezQ2YAtJ2TLRhXODfy9RxdVibJtTpfKVDHc/ty00TscKFZSs4ey wTOIrCFKcDAXHzT5+sf02hILMQ5JGWUQT17tHpQPUeekux0gpUwCBNEl7lEUAa7k57Zo oC8F3USRk89D4/pfJoz4eaIpxPq606EMC5Jv6wqdtTlj9AubGN5Qy2v2p1/oMIOb8foJ 6jTE7nbzdrEBOdPUdd0GfaBonlBmm4pvgz9Lt/fejsWoclUpas70+WprtmlxrzeFxDNE 0ZNQ== X-Gm-Message-State: AOAM5320v50Nn9crF2evDBh+tM/AvSQNnUjTMeDEz/9yEKOjOJO0d0as oxZ3PPbOBFYGSSg7O/xuoCA= X-Google-Smtp-Source: ABdhPJzcGUhJexZTuuVHF9y7ISZ0OyWzWMWFgkFmpzUPrbzy0YAjfFr5Cybpe1BWdIpoFxxeJA1VNw== X-Received: by 2002:a05:620a:1aa4:: with SMTP id bl36mr16910920qkb.137.1643158763928; Tue, 25 Jan 2022 16:59:23 -0800 (PST) Received: from [10.4.10.38] (146-115-144-188.s4282.c3-0.nwt-cbr1.sbo-nwt.ma.cable.rcncustomer.com. [146.115.144.188]) by smtp.gmail.com with ESMTPSA id de35sm5924680qkb.4.2022.01.25.16.59.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jan 2022 16:59:23 -0800 (PST) Message-ID: <32b02b65-631a-c6ae-4acf-4d222443c13d@gmail.com> Date: Tue, 25 Jan 2022 19:59:20 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH 0/5] sunxi: remove lowlevel_init Content-Language: en-US From: Jesse Taube To: Andre Przywara , Jagan Teki , Tom Rini , Simon Glass Cc: Jernej Skrabec , Samuel Holland , Chen-Yu Tsai , Icenowy Zheng , u-boot@lists.denx.de References: <20220125011517.7773-1-andre.przywara@arm.com> <46c3b16d-3d7a-1733-2eb6-f3e68209130a@gmail.com> In-Reply-To: <46c3b16d-3d7a-1733-2eb6-f3e68209130a@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean On 1/25/22 18:47, Jesse Taube wrote: > > > On 1/24/22 20:15, Andre Przywara wrote: >> For a long time the Allwinner platform was using the lowlevel_init() >> routine in U-Boot's boot process, even though there did not seem to be >> a real need for that. The README file suggests it should only be used >> for "bare minimum" tasks to reach board_init_f(). The routines called >> in arch/arm/mach-sunxi/board.c:s_init() did nothing that really >> warranted the early and special execution. Since we always run with an >> SPL, the board_init_f() routine in there seems to be the right place >> for early peripherals initialisation. >> Having those routines in s_init() actually forced other parts of U-Boot >> to follow suit: for instance we added a lowlevel_init() function to the >> armv8 side, just for sunxi. The same game seems to repeat for the >> ARM9 support we need for the F1C100s chip, and possibly for the RISC-V >> part as well. >> >> To avoid this and to cleanup some code on the way, remove the need for >> lowlevel_init for sunxi completely, by: >> - moving the early peripheral init (clocks, timer, pinmux) to >> board_init_f(). This also avoids executing those bits a second time when >> we boot up U-Boot proper. (patch 1/5) >> - move the "SRAM setup" bits for just a few old SoCs into a separate file, >> and include this only if needed. (patch 3/5) >> - move the ACTLR.SMPEN bit setting from board.c into start.S, because we >> actually need to set this bit early. Other platforms should be able to >> scrap their own copies and piggy back on this change. (patch 2/5) >> This allows us to actually remove the lowlevel_init.S file from armv8 in >> patch 4/5, as sunxi was the only user. >> For good measure, we also clean up some bits in sunxi_common.h. (patch 5/5) >> >> I compile tested this for all sunxi boards, and boot tested (into Linux) on >> Pine64, PineH64, BananaPi M1, OrangePi Zero. But there is a high chance of >> something breaking, so please give it a good shake on whatever Allwinner >> hardware you have access to. >> >> Thanks, >> Andre >> >> Andre Przywara (5): >> sunxi: move non-essential code out of s_init() >> sunxi: move Cortex SMPEN setting into start.S >> sunxi: move early "SRAM setup" into separate file >> armv8: remove no longer needed lowlevel_init.S >> sunxi-common.h: remove pointless #ifdefs >> >> arch/arm/Kconfig | 3 -- >> arch/arm/cpu/armv7/Kconfig | 7 +++ >> arch/arm/cpu/armv7/start.S | 11 +++++ >> arch/arm/cpu/armv7/sunxi/Makefile | 3 ++ >> arch/arm/cpu/armv7/sunxi/sram.c | 45 +++++++++++++++++ >> arch/arm/cpu/armv8/Makefile | 1 - >> arch/arm/cpu/armv8/lowlevel_init.S | 43 ---------------- >> arch/arm/mach-sunxi/Kconfig | 2 - >> arch/arm/mach-sunxi/board.c | 78 ++++++++---------------------- >> include/configs/sunxi-common.h | 7 --- >> 10 files changed, 86 insertions(+), 114 deletions(-) >> create mode 100644 arch/arm/cpu/armv7/sunxi/sram.c >> delete mode 100644 arch/arm/cpu/armv8/lowlevel_init.S >> > > Tested-By: Jesse Taube > > Tested on Lamobo_R1_defconfig. Tested on Lamobo_R1_defconfig and f1c100s. > > Thanks, > Jesse Taube