From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 05/12] sunxi: Move setting of CPU system control register SMP bit to save_boot_params
Date: Wed, 21 Jan 2015 07:59:30 +0100 [thread overview]
Message-ID: <20150121075930.00ba1e43@lilith> (raw)
In-Reply-To: <54BE6702.1040307@redhat.com>
Hello Hans,
On Tue, 20 Jan 2015 15:32:34 +0100, Hans de Goede <hdegoede@redhat.com>
wrote:
> Hi,
>
> On 20-01-15 11:22, Albert ARIBAUD wrote:
> > Hello Hans,
> >
> > I'm leaning toward grouping all CP15 inits (including cache(s)
> > and TLB disabling and maybe VBAR setting) in a single CP15 call to
> > a single soc_init_cp15 function.
> >
> > Now, SoCs with the same CPU will have a common CP15 init part, and
> > that part could go into a <cpu>_init_cp15 function which soc_init_cp15
> > would call. Of course, since we're doing this way before we have any
> > stack, we will have to handle nested calls by saving and restoring LR
> > in intermediate function contexts.
> >
> >> Note that solving this still leaves the A80 magic sram controller poke which
> >> also needs to happen really really early or otherwise the entire SoC just
> >> resets as if the watchdog has triggered, I'm fine with using save_boot_params
> >> for that, it is not its intended purpose, but it works fine for it, so
> >> I see no reason to complicate things with yet another callback.
> >
> > Maybe we could turn soc_init_cp15 into a more general soc_init function
> > which would do whatever is needed, on cp15 or otherwise.
> >
> > (I see there is one soc_init defined, for spear600, but it is actually
> > empty and could/should be removed. Patch anyone?)
>
> Hmm, so if I'm reading the above correctly, then I think you want to do
> the following:
>
> 1) Rename cpu_init_cp15 to cpu_init_cp15_common
> 2) Add a new soc_init function, with a weak default which just calls
> cpu_init_cp15_common
> 3) Add a a7_init_cp15 which sets the smp bit
> 4) Have Cortex A7 SoCs override soc_init with one which first calls
> a7_init_cp15 and then calls cpu_init_cp15_common
> 5) And on SoC's which need to do something special before or after
> cp15 init, they can do so by overriding soc_init and do what
> ever they need to do there before *or* after calling
> cpu_init_cp15_common
>
> Have I got that right ?
Almost entirely. My only comments are on 1) :
- cpu_init_cp15_common does not need the "common" suffix IMO; actually,
it might be more general than just touching cp15, so we could just
call it "cpu_init" (1).
- if two CPUs need different versions, then we will want to make
cpu_init a weak function, with a default based on the 'common
denominator'.
(1) Note that there is already a cpu_init() function in U-Boot, used by
SH and AVR32; if we want 'cpu_init' to be consistent across architectures,
we might have to change "{soc,cpu}_init" to somehting else (for instance
"{soc,cpu}_setup" or "{soc,cpu}_boot_init") but I don't like that much, or
investigate what the existing cpu_init() does and see if /that/ could be
renamed or merged into a common mechanism (I doubt that the second is
practically feasible).
> If so I can try to write a patch-set for this, my arm asm is a bit
> weak, but I should be able to cobble this together using existing code
> as an example.
Thanks!
> Regards,
>
> Hans
Amicalement,
--
Albert.
next prev parent reply other threads:[~2015-01-21 6:59 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 14:52 [U-Boot] sunxi: Initial A80 support Hans de Goede
2015-01-15 14:52 ` [U-Boot] [PATCH 01/12] sunxi: Drop pll6 setting from clock_init_uart Hans de Goede
2015-01-17 22:33 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 02/12] sunxi: Rename cpu.h to cpu_sun4i.h Hans de Goede
2015-01-17 22:34 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 03/12] sunxi: Move clock_get_pllX / clock_set_pllX protos to mach specific headers Hans de Goede
2015-01-17 22:34 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 04/12] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i Hans de Goede
2015-01-17 22:44 ` Ian Campbell
2015-01-19 18:57 ` Hans de Goede
2015-05-19 20:15 ` Hans de Goede
2015-01-15 14:52 ` [U-Boot] [PATCH 05/12] sunxi: Move setting of CPU system control register SMP bit to save_boot_params Hans de Goede
2015-01-17 22:51 ` Ian Campbell
2015-01-19 19:04 ` Hans de Goede
2015-01-20 7:10 ` Albert ARIBAUD
2015-01-20 8:44 ` Ian Campbell
2015-01-20 10:22 ` Albert ARIBAUD
2015-01-20 14:32 ` Hans de Goede
2015-01-21 6:59 ` Albert ARIBAUD [this message]
2015-01-15 14:52 ` [U-Boot] [PATCH 06/12] sun9i: Add cpu_sun9i.h with iomem defines Hans de Goede
2015-01-17 22:51 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 07/12] sun9i: Add clock_sun9i.h with ccu register layout for sun9i Hans de Goede
2015-01-17 22:52 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 08/12] sun9i: Add sun9i (A80) clock setup support Hans de Goede
2015-01-17 22:52 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 09/12] sunxi: mmc: Use a realistic timeout when sending a mmc command Hans de Goede
2015-01-17 22:54 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 10/12] sunxi: mmc: Add support for sun9i (A80) Hans de Goede
2015-01-17 22:56 ` Ian Campbell
2015-01-19 19:43 ` Hans de Goede
2015-01-15 14:52 ` [U-Boot] [PATCH 11/12] sun9i: Basic sun9i (A80) support Hans de Goede
2015-01-17 22:59 ` Ian Campbell
2015-01-19 19:44 ` Hans de Goede
2015-01-20 8:43 ` Ian Campbell
2015-01-15 14:52 ` [U-Boot] [PATCH 12/12] sun9i: Add Merrii_A80_Optimus board / defconfig file Hans de Goede
2015-01-17 22:59 ` Ian Campbell
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=20150121075930.00ba1e43@lilith \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.