public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()
Date: Sat, 22 Oct 2011 09:56:40 +0200	[thread overview]
Message-ID: <4EA27738.4060102@aribaud.net> (raw)
In-Reply-To: <CAPnjgZ2pgLpjNC16jrby_gKOr3uuUn+ubVDYJe0WfAwa8o8jJA@mail.gmail.com>

Le 22/10/2011 07:05, Simon Glass a ?crit :

>>> Well I actually haven't moved it! It is just that previously it was
>>> impossible to call cp15_init from anywhere later.
>>
>> It is moved, in that it belongs to low level init... of A9.
>
> OK, I see - you mean moved in order if not in source code file.

Yes. In the code, though, it belongs to low-level init.

>>> What you say can be done, it would involve some assembler though and
>>> would need to be another CONFIG option. Was trying to avoid adding new
>>> assembler.
>>
>> Low level init is about assembler and, well, low level. :)
>
> Yes but it's yuck. Part of the clean-up is to remove most of the
> assembler - really very little is needed.

I don't think "yuck" is a valid reasoned argument against assembly 
language :) but I assume what you mainly mean is 'hard to understand and 
replaceable by easy to understand C code'. I agree to the first part, 
and to the second one for the general case, but not for the startup path 
where, precisely, we don't have a working C run-time and most of the 
understanding requires knowledge of hardware, not only general 
programming knowledge. Past that, C is ok -- but then beware: some C++ 
guy could chime in and contend that C is "yuck" by your own standards. :)

>> But I don't see why there should be another CONFIG option. IIUC, you should
>> be able to do with only CONFIG_SKIP_LOWLEVEL_INIT: within the low level init
>> code under it, you would do the equivalent of a switch, with one branch for
>> AVM (and DDR init etc) and one branch for A9 (with cp15 init etc).
>
> Yes I can, but I need to be able to call cp15_init. And I can't do
> that because if CONFIG_SKIP_LOWLEVEL_INIT is defined, that code is
> compiled out! So I need to move that cp15_init code outside the
> CONFIG_SKIP_LOWLEVEL_INIT #ifdef. That is all I am trying to do,
> honest!

I understand, and I think the approach here is wrong, because you *do* 
want low-level init in the A9 case, and thus you should not have 
CONFIG_SKIP_LOWLEVEL_INIT set. But you also need the AVP low-level init 
to be empty, and the AVP and A9 must follow the same startup path. And 
all this it not necessarily required for all armv7 platforms, but some 
of them will want lowlevel init, and some not. Considering all this...

For now, I would opt for a CONFIG_ARCH_GENERIC_LOWLEVEL_INIT option 
which start.S would use to compile out the low level init code 
definition (like CONFIG_SKIP_LOWLEVEL_INIT does) but not the the calls 
to it (UNline CONFIG_SKIP_LOWLEVEL_INIT does). Then you could provide a 
SoC-specific version of lowlevel_init.

In the longer term, I would be more in favor of a weak definition system 
with hierarchical ARCH, ISA, SoC, board priority order (yes, I am kind 
of fond of it) for lowlevel init -- but that will require looking into 
asm weak symbol handling and may require splitting of the assembly code 
function by function.

> Regards,
> Simon

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-10-22  7:56 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 21:05 [U-Boot] [PATCH 0/9] tegra2: Tidy up boot path Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 1/9] tegra2: Add arch_cpu_init() to fire up Cortex-A9 Simon Glass
2011-10-13 22:52   ` Mike Frysinger
2011-10-13 23:18     ` Simon Glass
2011-10-13 23:34       ` Mike Frysinger
2011-10-14  0:47         ` Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 2/9] tegra2: Simplify tegra_start() boot path Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit() Simon Glass
2011-10-21 20:58   ` Albert ARIBAUD
2011-10-21 21:18     ` Simon Glass
2011-10-21 21:43       ` Albert ARIBAUD
2011-10-21 21:54         ` Simon Glass
2011-10-21 22:24           ` Albert ARIBAUD
2011-10-22  5:05             ` Simon Glass
2011-10-22  7:56               ` Albert ARIBAUD [this message]
2011-10-22 16:13                 ` Simon Glass
2011-10-24 19:34                   ` Simon Glass
2011-10-24 20:04                   ` Albert ARIBAUD
2011-10-24 20:14                     ` Simon Glass
2011-10-24 21:21                       ` Albert ARIBAUD
2011-10-25  5:02                         ` Simon Glass
2011-10-25  6:41                           ` Albert ARIBAUD
2011-10-25 13:44                             ` Simon Glass
2011-10-25 21:16                               ` Simon Glass
2011-10-27 20:05                                 ` Albert ARIBAUD
2011-10-27 20:17                                   ` Simon Glass
2011-10-27 22:39                                     ` Albert ARIBAUD
2011-10-27 22:46                                       ` Simon Glass
2011-10-28  1:43                                         ` Simon Glass
2011-10-28  5:09                                           ` Albert ARIBAUD
2011-10-29  0:36                                             ` Simon Glass
2011-10-30 10:16                                               ` Albert ARIBAUD
2011-10-31 21:44                                                 ` Simon Glass
2011-10-31 22:54                                                   ` Tom Warren
2011-11-05  5:17                                                     ` Simon Glass
2011-11-05  8:09                                                       ` Albert ARIBAUD
2011-11-05 13:36                                                         ` Simon Glass
2011-10-28  5:07                                         ` Albert ARIBAUD
2011-11-05  8:17   ` Albert ARIBAUD
2011-11-05 14:00     ` Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 4/9] tegra2: Enable instruction cache Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 5/9] tegra2: Remove unneeded boot code Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 6/9] tegra2: Remove unneeded config option Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 7/9] tegra2: Remove unused low-level Tegra2 UART code Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 8/9] tegra2: Remove unneeded 'dynamic ram size' message Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 9/9] tegra2: Don't use board pointer before it is set up Simon Glass

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=4EA27738.4060102@aribaud.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox