From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] WIP: tegra: i2c: Enable new CONFIG_SYS_I2C framework
Date: Wed, 31 Oct 2012 09:41:57 -0600 [thread overview]
Message-ID: <509146C5.8020301@wwwdotorg.org> (raw)
In-Reply-To: <5090BE73.6050501@denx.de>
On 10/31/2012 12:00 AM, Heiko Schocher wrote:
> Hello Stephen,
>
> On 30.10.2012 23:32, Stephen Warren wrote:
>> On 10/30/2012 11:28 AM, Simon Glass wrote:
>>> (just for illustration, please don't merge)
>>>
>>> This enables CONFIG_SYS_I2C on Tegra, updating existing boards and
>>> the Tegra
>>> i2c driver to support this.
>>
>>> diff --git a/drivers/i2c/i2c_core.c b/drivers/i2c/i2c_core.c
>>
>>> +#ifdef CONFIG_TEGRA_I2C
>>> +extern struct i2c_adapter tegra_i2c_adap[];
>>> +#endif
>>
>> I'm not sure why that's needed if the config files have to put the
>> adpater list into a #define:
>>
>>> diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
>>
>>> +#define CONFIG_SYS_I2C
>>> +#define CONFIG_SYS_I2C_ADAPTERS {&tegra_i2c_adap[0]}
>>> +#define CONFIG_SYS_NUM_I2C_ADAPTERS TEGRA_I2C_NUM_CONTROLLERS
>>
>> But, why is CONFIG_SYS_I2C_ADAPTERS needed; can't the adapter init
>> functions (which presumably would be called from board code or as a
>> result of DT parsing) dynamically register themselves?
>
> This would not work, if we are running for example from flash on
> powerpc before relocation. There some boards need to read RAM
> infos from an SPD Eeprom through i2c ... so we must have very early
> i2c bus ready and usable ...
>
> It maybe a good plus to add i2c busses/adapters dynamically after
> relocation is done and we have enough RAM ... I tried such an
> approach here:
>
> http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=commit;h=ccb680c8cf9002232bc459e4003e3b47db5e1bf4
>
> but this is an old state (only rebased a long time),
> but it is maybe a good base for doing such an feature
> if it is needed ...
I mainly ask because Simon is pushing to have Tegra's U-Boot completely
driven by device tree. If we need to hard-code the list of enabled I2C
adapters in the U-Boot config file, and don't also support dynamically
added I2C drivers, then that will be incompatible with device tree.
next prev parent reply other threads:[~2012-10-31 15:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-30 17:28 [U-Boot] [PATCH 1/2] tegra: i2c: Add function to know about current bus Simon Glass
2012-10-30 17:28 ` [U-Boot] [PATCH 2/2] WIP: tegra: i2c: Enable new CONFIG_SYS_I2C framework Simon Glass
2012-10-30 22:32 ` Stephen Warren
2012-10-31 6:00 ` Heiko Schocher
2012-10-31 15:41 ` Stephen Warren [this message]
2012-10-31 15:56 ` Simon Glass
2012-10-31 16:25 ` Stephen Warren
2012-11-01 7:42 ` Heiko Schocher
2012-11-01 17:03 ` Stephen Warren
2012-11-05 20:39 ` Simon Glass
2012-11-08 7:02 ` Heiko Schocher
2012-11-08 18:03 ` Simon Glass
2012-11-08 6:47 ` Heiko Schocher
2012-11-08 17:05 ` Stephen Warren
2012-11-13 6:24 ` Heiko Schocher
2012-11-13 7:48 ` Wolfgang Denk
2012-11-13 17:30 ` Stephen Warren
2012-10-31 5:53 ` Heiko Schocher
2012-10-31 5:26 ` [U-Boot] [PATCH 1/2] tegra: i2c: Add function to know about current bus Heiko Schocher
2012-11-05 20:43 ` Simon Glass
2012-11-08 7:05 ` 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=509146C5.8020301@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--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