From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 8/9] tegra: i2c: Enable new CONFIG_SYS_I2C framework
Date: Wed, 31 Jul 2013 15:03:16 +0200 [thread overview]
Message-ID: <51F90B14.1060104@denx.de> (raw)
In-Reply-To: <CAPnjgZ2VnEFtjXiA_j4hAg8hsVQ_LrinFR1Kfhn3KGgM82_v7g@mail.gmail.com>
Hello Simon,
Am 31.07.2013 14:30, schrieb Simon Glass:
> Hi,
>
> On Wed, Jul 31, 2013 at 3:38 AM, Albert ARIBAUD
> <albert.u.boot@aribaud.net>wrote:
>
>> Hi Heiko,
>>
>> On Wed, 31 Jul 2013 10:31:12 +0200, Heiko Schocher<hs@denx.de> wrote:
>>
>>> Hello Albert,
>>>
>>> Am 31.07.2013 10:16, schrieb Albert ARIBAUD:
>>>> Hi Heiko,
>>>>
>>>> On Wed, 31 Jul 2013 09:36:19 +0200, Heiko Schocher<hs@denx.de> wrote:
>>>>
>>>>>> On the other hand, it may be hard to immediately know what functions
>>>>>> throughout U-boot are safe to call from within board_init_f(); maybe
>> we
>>>>>> should start thinking about checking and marking these, the simplest
>>>>>> way being to suffix them with "_f" once we have made sure they are
>> safe
>>>>>> to call from within board_init_f().
>>>>>
>>>>> Hmmm... Maybe instead we should think (also in thinking common bring
>>>>> up for all boards) about:
>>>>>
>>>>> getting rid of board_init_f in u-boot code, instead use for all
>>>>> boards spl code to init needed things and copy and relocate u-boot
>>>>> to ram in spl code ... so we have in u-boot no longer such
>>>>> restictions ... but thats just an idea which whirs in my head ...
>>>>> without thinking to deep in it.
>>>>>
>>>>> But this approach would have some advantages ...
>>>>
>>>> Well, the original SPL was basically board_init_f() plus some code to
>>>> copy U-Boot from wherever it was to DDR, so it was tightly linked to
>>>> board_init_f(). But... first, SPL has evolved into a "U-Boot lite"
>>>> where much can happen beyond board_init_f() -- think Falcon mode, for
>>>> instance -- and second, there are boards which do not have SPL at all,
>>>> and their board_init_f() can thus not be "moved to SPL".
>>>
>>> Hmm... all boards use board_init_f ... and spl do pieces from
>> board_init_f
>>> So why should it not be possible to do all init things in spl code?
>>> Code beyond board_init_f is optional ...
>>
>> It is, in the original "SPL is just board_init_f plus some copying"
>> view. In the current "SPL is U-boot only not full-featured", it becomes
>> false.
>>
>>> And yes, there are a lot of boards, which have no spl, but they
>>> can execute spl code (thinking of the lof of powerpc boards which
>>> booting from nor flash ... spl code can also run from nor ... and
>>> copy the u-boot piece of the image to ram, relocate it ...)
>>>
>>> And yes, a side effect could be, that all boards can use Falcon boot
>> mode.
>>>
>>> ;-)
>>>
>>>> So no, I don't think we can move U-Boot's design from "_f/_r" to
>>>> "SPL/U-Boot".
>>>
>>> I am not sure ...
>>
>> I see this approach of likening SPL to _f and U-boot to _r as forcing a
>> dual-binary model onto all boards whereas not all boards require it. I
>> prefer a model where _f can exist, _r can exist, and for each target,
>> the maintainer decides which binaries are built and for each one,
>> whether _f and/or _r is present and what _r does.
>>
>
> I am not really any clearer as to what should be done here.
>
> Previously on ARM i2c init generally happened in board_init_r(). This has
really? The init_func_i2c() call is not introduced through the
i2c multibus approach ...
> changed now, and so boards which need to do some init (e.g. reading and
> storing DT information) to make i2c work are going to have problems if they
> cannot access any memory (yes we could put it in global_data I suppose).
>
> It sounds like the need for early i2c is rare, so we could perhaps create
> an option like CONFIG_SYS_EARLY_I2C to enable this?
>
> While I agree that minimising code in board_init_f() is a great idea, if we
> have one case that needs it, then we need to deal with the problem.
From my side, yes. But this different to powerpc!
> Although did I mention that it does seem silly to me to solve what is an
> entirely hypothetical problem on Tegra and (I think) any other modern ARM
> SOC that uses SPL? After all, SDRAM is fully available on these SOCs and in
> fact setting that up and getting U-Boot loaded into RAM is the purpose of
> the SPL stage! To my mind, SPL has taken over this responsibility of
> board_init_f(). Thoughts? Maybe a minor rethink of
> SPL/board_init_f()/board_init_r() is in order?
Yes, but board_init_f is used in spl code, or? And it is not only
ram settings, maybe read baudrate setting in an i2c epprom ...
We can make init_func_i2c() weak, and in the first step a
dummy function and see, which boards really need it.
Nevertheless, why the tegra i2c driver do not call process_node()
from the i2c_init function? This must be fixed I think, as it
is not good to do some setup needed for i2c in board_init()
and other in i2c_init to have a working i2c adapter ...
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2013-07-31 13:03 UTC|newest]
Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-04 12:01 [U-Boot] [PATCH v3 0/9] Bring in new I2C framework Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 1/9] i2c: add i2c_core and prepare for new multibus support Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support Heiko Schocher
2013-05-06 16:39 ` Daniel Schwierzeck
2013-05-07 13:05 ` Heiko Schocher
2013-05-11 21:17 ` Simon Glass
2013-05-13 4:47 ` Heiko Schocher
2013-05-11 21:33 ` Simon Glass
2013-05-13 5:41 ` Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 3/9] i2c, soft-i2c: switch to new " Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 4/9] i2c, fsl_i2c: " Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 5/9] i2c, multibus: get rid of CONFIG_I2C_MUX Heiko Schocher
2013-05-06 12:23 ` Holger Brunck
2013-05-06 13:57 ` Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 6/9] i2c, multibus, keymile: get rid of EEprom_ivm envvariable Heiko Schocher
2013-05-06 12:24 ` Holger Brunck
2013-05-06 13:58 ` Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 7/9] tegra: i2c: Add function to know about current bus Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 8/9] tegra: i2c: Enable new CONFIG_SYS_I2C framework Heiko Schocher
2013-05-06 19:08 ` Stephen Warren
2013-05-07 8:01 ` [U-Boot] [PATCH v3 8/9] tegra: i2c: Enable new CONFIG_SYS_I2Cframework Marc Dietrich
2013-05-07 14:55 ` Stephen Warren
2013-05-07 16:17 ` Simon Glass
2013-05-08 4:11 ` Heiko Schocher
2013-05-07 13:07 ` [U-Boot] [PATCH v3 8/9] tegra: i2c: Enable new CONFIG_SYS_I2C framework Heiko Schocher
[not found] ` <5FBF8E85CA34454794F0F7ECBA79798F37ACAFEF3F@HQMAIL04.nvidia.com>
2013-05-07 13:12 ` Heiko Schocher
2013-07-29 16:12 ` Stephen Warren
2013-07-30 4:28 ` Heiko Schocher
2013-07-30 4:34 ` Simon Glass
2013-07-30 18:56 ` Stephen Warren
2013-07-31 4:29 ` Heiko Schocher
2013-07-30 19:22 ` Stephen Warren
2013-07-30 20:00 ` Stephen Warren
2013-07-30 21:21 ` Simon Glass
2013-07-30 21:32 ` Stephen Warren
2013-07-30 21:46 ` Simon Glass
2013-07-30 21:51 ` Stephen Warren
2013-07-30 22:05 ` Simon Glass
2013-07-31 5:46 ` Heiko Schocher
2013-07-31 19:31 ` Stephen Warren
2013-08-01 4:32 ` Heiko Schocher
2013-08-01 5:39 ` Stephen Warren
2013-08-01 6:02 ` Heiko Schocher
2013-08-01 6:53 ` Albert ARIBAUD
2013-08-01 8:38 ` Heiko Schocher
2013-08-01 14:22 ` Simon Glass
2013-08-01 15:06 ` Heiko Schocher
2013-08-01 20:16 ` Albert ARIBAUD
2013-08-02 19:32 ` Simon Glass
2013-08-01 20:14 ` Albert ARIBAUD
2013-08-01 20:34 ` Stephen Warren
2013-08-01 20:32 ` Stephen Warren
2013-08-02 4:40 ` Heiko Schocher
2013-08-02 19:35 ` Simon Glass
2013-08-02 21:43 ` Stephen Warren
2013-08-03 3:55 ` Heiko Schocher
2013-08-05 15:40 ` Simon Glass
2013-08-05 17:28 ` Stephen Warren
2013-08-05 20:12 ` Simon Glass
2013-08-05 20:15 ` Stephen Warren
2013-08-05 17:59 ` Stephen Warren
2013-07-30 22:09 ` Albert ARIBAUD
2013-07-30 22:11 ` Simon Glass
2013-07-31 5:18 ` Wolfgang Denk
2013-07-31 5:55 ` Heiko Schocher
2013-07-31 7:06 ` Albert ARIBAUD
2013-07-31 7:36 ` Heiko Schocher
2013-07-31 8:16 ` Albert ARIBAUD
2013-07-31 8:31 ` Heiko Schocher
2013-07-31 9:38 ` Albert ARIBAUD
2013-07-31 12:30 ` Simon Glass
2013-07-31 13:03 ` Heiko Schocher [this message]
2013-07-31 19:41 ` Stephen Warren
2013-08-01 4:32 ` Heiko Schocher
2013-07-31 19:39 ` Wolfgang Denk
2013-07-31 5:52 ` Heiko Schocher
2013-07-31 5:03 ` Heiko Schocher
2013-08-05 19:21 ` Stephen Warren
2013-08-05 20:08 ` Tom Rini
2013-08-05 21:06 ` Stephen Warren
2013-08-05 23:18 ` Stephen Warren
2013-07-30 21:19 ` Simon Glass
2013-07-30 21:21 ` Stephen Warren
2013-07-30 21:45 ` Simon Glass
2013-07-31 5:01 ` Heiko Schocher
2013-05-04 12:01 ` [U-Boot] [PATCH v3 9/9] i2c, ppc4xx_i2c: switch to new multibus/multiadapter support Heiko Schocher
2013-05-06 6:52 ` Stefan Roese
2013-05-06 8:57 ` [U-Boot] [PATCH v3 0/9] Bring in new I2C framework Dirk Eibach
2013-05-06 14:11 ` Heiko Schocher
2013-05-17 13:17 ` Piotr Wilczek
2013-05-18 17:41 ` Simon Glass
2013-05-20 6:13 ` Piotr Wilczek
2013-06-19 22:07 ` Simon Glass
2013-06-20 3:38 ` Heiko Schocher
2013-06-20 5:50 ` Minkyu Kang
2013-06-20 6:41 ` Piotr Wilczek
2013-06-20 7:14 ` Heiko Schocher
2013-06-20 8:34 ` Piotr Wilczek
2013-06-20 9:19 ` Heiko Schocher
2013-06-20 5:52 ` Piotr Wilczek
2013-06-20 6:52 ` Dirk Eibach
2013-06-20 7:59 ` Heiko Schocher
2013-06-20 8:20 ` Dirk Eibach
2013-06-20 9:11 ` Heiko Schocher
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=51F90B14.1060104@denx.de \
--to=hs@denx.de \
--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