public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jesse Taube <mr.bossman075@gmail.com>
To: Andre Przywara <andre.przywara@arm.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Chen-Yu Tsai <wens@csie.org>, Icenowy Zheng <icenowy@aosc.io>,
	u-boot@lists.denx.de
Subject: Re: [PATCH 0/5] sunxi: remove lowlevel_init
Date: Tue, 25 Jan 2022 19:59:20 -0500	[thread overview]
Message-ID: <32b02b65-631a-c6ae-4acf-4d222443c13d@gmail.com> (raw)
In-Reply-To: <46c3b16d-3d7a-1733-2eb6-f3e68209130a@gmail.com>



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 <Mr.Bossman075@gmail.com>
> 
> Tested on Lamobo_R1_defconfig.

Tested on Lamobo_R1_defconfig and f1c100s.

> 
> Thanks,
> 	Jesse Taube

      reply	other threads:[~2022-01-26  0:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  1:15 [PATCH 0/5] sunxi: remove lowlevel_init Andre Przywara
2022-01-25  1:15 ` [PATCH 1/5] sunxi: move non-essential code out of s_init() Andre Przywara
2022-01-25  2:42   ` Samuel Holland
2022-01-27 15:41   ` Simon Glass
2022-01-25  1:15 ` [PATCH 2/5] sunxi: move Cortex SMPEN setting into start.S Andre Przywara
2022-01-25  2:47   ` Samuel Holland
2022-01-25 15:48     ` Andre Przywara
2022-01-25  1:15 ` [PATCH 3/5] sunxi: move early "SRAM setup" into separate file Andre Przywara
2022-01-25  2:56   ` Samuel Holland
2022-01-28  0:59     ` Andre Przywara
2022-01-28  5:27       ` Samuel Holland
2022-01-27 15:41   ` Simon Glass
2022-01-25  1:15 ` [PATCH 4/5] armv8: remove no longer needed lowlevel_init.S Andre Przywara
2022-01-25  3:02   ` Samuel Holland
2022-01-27 15:41   ` Simon Glass
2022-01-25  1:15 ` [PATCH 5/5] sunxi-common.h: remove pointless #ifdefs Andre Przywara
2022-01-25  3:07   ` Samuel Holland
2022-01-27 15:41   ` Simon Glass
2022-01-25 23:47 ` [PATCH 0/5] sunxi: remove lowlevel_init Jesse Taube
2022-01-26  0:59   ` Jesse Taube [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32b02b65-631a-c6ae-4acf-4d222443c13d@gmail.com \
    --to=mr.bossman075@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=icenowy@aosc.io \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox