U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers
@ 2016-08-06  3:35 Simon Glass
  2016-08-06  3:35 ` [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available Simon Glass
  2016-08-07  6:52 ` [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers Bin Meng
  0 siblings, 2 replies; 7+ messages in thread
From: Simon Glass @ 2016-08-06  3:35 UTC (permalink / raw)
  To: u-boot

The i2c uclass has a default setting for per_child_platdata_auto_alloc_size
so drivers do not need to set it. Remove this from drivers to avoid
confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/i2c/cros_ec_ldo.c          | 1 -
 drivers/i2c/cros_ec_tunnel.c       | 1 -
 drivers/i2c/intel_i2c.c            | 1 -
 drivers/i2c/muxes/i2c-mux-uclass.c | 1 -
 drivers/i2c/s3c24x0_i2c.c          | 2 --
 5 files changed, 6 deletions(-)

diff --git a/drivers/i2c/cros_ec_ldo.c b/drivers/i2c/cros_ec_ldo.c
index b817c61..a4cd660 100644
--- a/drivers/i2c/cros_ec_ldo.c
+++ b/drivers/i2c/cros_ec_ldo.c
@@ -72,6 +72,5 @@ U_BOOT_DRIVER(cros_ec_ldo) = {
 	.name	= "cros_ec_ldo_tunnel",
 	.id	= UCLASS_I2C,
 	.of_match = cros_ec_i2c_ids,
-	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
 	.ops	= &cros_ec_i2c_ops,
 };
diff --git a/drivers/i2c/cros_ec_tunnel.c b/drivers/i2c/cros_ec_tunnel.c
index 7ab1fd8..e2c6e44 100644
--- a/drivers/i2c/cros_ec_tunnel.c
+++ b/drivers/i2c/cros_ec_tunnel.c
@@ -36,6 +36,5 @@ U_BOOT_DRIVER(cros_ec_tunnel) = {
 	.name	= "cros_ec_tunnel",
 	.id	= UCLASS_I2C,
 	.of_match = cros_ec_i2c_ids,
-	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
 	.ops	= &cros_ec_i2c_ops,
 };
diff --git a/drivers/i2c/intel_i2c.c b/drivers/i2c/intel_i2c.c
index 8b63916..5b7953a 100644
--- a/drivers/i2c/intel_i2c.c
+++ b/drivers/i2c/intel_i2c.c
@@ -325,7 +325,6 @@ U_BOOT_DRIVER(intel_i2c) = {
 	.name	= "i2c_intel",
 	.id	= UCLASS_I2C,
 	.of_match = intel_i2c_ids,
-	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
 	.ops	= &intel_i2c_ops,
 	.priv_auto_alloc_size = sizeof(struct intel_i2c),
 	.bind	= intel_i2c_bind,
diff --git a/drivers/i2c/muxes/i2c-mux-uclass.c b/drivers/i2c/muxes/i2c-mux-uclass.c
index 3f52bff..7a698b6 100644
--- a/drivers/i2c/muxes/i2c-mux-uclass.c
+++ b/drivers/i2c/muxes/i2c-mux-uclass.c
@@ -183,7 +183,6 @@ static const struct dm_i2c_ops i2c_mux_bus_ops = {
 U_BOOT_DRIVER(i2c_mux_bus) = {
 	.name		= "i2c_mux_bus_drv",
 	.id		= UCLASS_I2C,
-	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
 	.ops	= &i2c_mux_bus_ops,
 };
 
diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index dc9b661..eab49d0 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -1433,7 +1433,6 @@ U_BOOT_DRIVER(i2c_s3c) = {
 	.id	= UCLASS_I2C,
 	.of_match = s3c_i2c_ids,
 	.ofdata_to_platdata = s3c_i2c_ofdata_to_platdata,
-	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
 	.priv_auto_alloc_size = sizeof(struct s3c24x0_i2c_bus),
 	.ops	= &s3c_i2c_ops,
 };
@@ -1458,7 +1457,6 @@ U_BOOT_DRIVER(hs_i2c) = {
 	.id	= UCLASS_I2C,
 	.of_match = exynos_hs_i2c_ids,
 	.ofdata_to_platdata = s3c_i2c_ofdata_to_platdata,
-	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
 	.priv_auto_alloc_size = sizeof(struct s3c24x0_i2c_bus),
 	.ops	= &exynos_hs_i2c_ops,
 };
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available
  2016-08-06  3:35 [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers Simon Glass
@ 2016-08-06  3:35 ` Simon Glass
  2016-08-07  6:54   ` Bin Meng
  2016-08-07  6:52 ` [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers Bin Meng
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Glass @ 2016-08-06  3:35 UTC (permalink / raw)
  To: u-boot

If intel_i2c_bind() is called before relocation there is no BSS section
available. Use the data section instead, which is always available.

A better fix might be to use global_data, perhaps a new member in
x86's struct arch_global_data. Comments welcome.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/i2c/intel_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/intel_i2c.c b/drivers/i2c/intel_i2c.c
index 5b7953a..01badf2 100644
--- a/drivers/i2c/intel_i2c.c
+++ b/drivers/i2c/intel_i2c.c
@@ -289,7 +289,7 @@ static int intel_i2c_probe(struct udevice *dev)
 
 static int intel_i2c_bind(struct udevice *dev)
 {
-	static int num_cards;
+	static int num_cards __attribute__ ((section(".data")));
 	char name[20];
 
 	/* Create a unique device name for PCI type devices */
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers
  2016-08-06  3:35 [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers Simon Glass
  2016-08-06  3:35 ` [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available Simon Glass
@ 2016-08-07  6:52 ` Bin Meng
  1 sibling, 0 replies; 7+ messages in thread
From: Bin Meng @ 2016-08-07  6:52 UTC (permalink / raw)
  To: u-boot

On Sat, Aug 6, 2016 at 11:35 AM, Simon Glass <sjg@chromium.org> wrote:
> The i2c uclass has a default setting for per_child_platdata_auto_alloc_size
> so drivers do not need to set it. Remove this from drivers to avoid
> confusion.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  drivers/i2c/cros_ec_ldo.c          | 1 -
>  drivers/i2c/cros_ec_tunnel.c       | 1 -
>  drivers/i2c/intel_i2c.c            | 1 -
>  drivers/i2c/muxes/i2c-mux-uclass.c | 1 -
>  drivers/i2c/s3c24x0_i2c.c          | 2 --
>  5 files changed, 6 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available
  2016-08-06  3:35 ` [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available Simon Glass
@ 2016-08-07  6:54   ` Bin Meng
  2016-08-08 14:45     ` Heiko Schocher
  0 siblings, 1 reply; 7+ messages in thread
From: Bin Meng @ 2016-08-07  6:54 UTC (permalink / raw)
  To: u-boot

On Sat, Aug 6, 2016 at 11:35 AM, Simon Glass <sjg@chromium.org> wrote:
> If intel_i2c_bind() is called before relocation there is no BSS section
> available. Use the data section instead, which is always available.
>
> A better fix might be to use global_data, perhaps a new member in
> x86's struct arch_global_data. Comments welcome.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  drivers/i2c/intel_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available
  2016-08-07  6:54   ` Bin Meng
@ 2016-08-08 14:45     ` Heiko Schocher
  2016-08-08 21:44       ` Simon Glass
  0 siblings, 1 reply; 7+ messages in thread
From: Heiko Schocher @ 2016-08-08 14:45 UTC (permalink / raw)
  To: u-boot

Hello Simon,

Am 07.08.2016 um 08:54 schrieb Bin Meng:
> On Sat, Aug 6, 2016 at 11:35 AM, Simon Glass <sjg@chromium.org> wrote:
>> If intel_i2c_bind() is called before relocation there is no BSS section
>> available. Use the data section instead, which is always available.
>>
>> A better fix might be to use global_data, perhaps a new member in
>> x86's struct arch_global_data. Comments welcome.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>   drivers/i2c/intel_i2c.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Hmm... I see no i2c_bind() in mainline U-Boot drivers/i2c/intel_i2c.c
driver ?

Is this patch and also patch:
http://patchwork.ozlabs.org/patch/656335/

dependend on another patch(or patchserie) ?

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available
  2016-08-08 14:45     ` Heiko Schocher
@ 2016-08-08 21:44       ` Simon Glass
  2016-08-09  5:37         ` Stefan Roese
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2016-08-08 21:44 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

On 8 August 2016 at 08:45, Heiko Schocher <hs@denx.de> wrote:
> Hello Simon,
>
>
> Am 07.08.2016 um 08:54 schrieb Bin Meng:
>>
>> On Sat, Aug 6, 2016 at 11:35 AM, Simon Glass <sjg@chromium.org> wrote:
>>>
>>> If intel_i2c_bind() is called before relocation there is no BSS section
>>> available. Use the data section instead, which is always available.
>>>
>>> A better fix might be to use global_data, perhaps a new member in
>>> x86's struct arch_global_data. Comments welcome.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>   drivers/i2c/intel_i2c.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
>
> Hmm... I see no i2c_bind() in mainline U-Boot drivers/i2c/intel_i2c.c
> driver ?
>
> Is this patch and also patch:
> http://patchwork.ozlabs.org/patch/656335/
>
> dependend on another patch(or patchserie) ?

Yes it depends on Stefan's x86 i2c driver. He asked me to take a look.
It can be squashed in - will leave this to Stefan.

Regards,
Simon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available
  2016-08-08 21:44       ` Simon Glass
@ 2016-08-09  5:37         ` Stefan Roese
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2016-08-09  5:37 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 08.08.2016 23:44, Simon Glass wrote:
> On 8 August 2016 at 08:45, Heiko Schocher <hs@denx.de> wrote:
>> Hello Simon,
>>
>>
>> Am 07.08.2016 um 08:54 schrieb Bin Meng:
>>>
>>> On Sat, Aug 6, 2016 at 11:35 AM, Simon Glass <sjg@chromium.org> wrote:
>>>>
>>>> If intel_i2c_bind() is called before relocation there is no BSS section
>>>> available. Use the data section instead, which is always available.
>>>>
>>>> A better fix might be to use global_data, perhaps a new member in
>>>> x86's struct arch_global_data. Comments welcome.
>>>>
>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>> ---
>>>>
>>>>   drivers/i2c/intel_i2c.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>
>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>
>>
>> Hmm... I see no i2c_bind() in mainline U-Boot drivers/i2c/intel_i2c.c
>> driver ?
>>
>> Is this patch and also patch:
>> http://patchwork.ozlabs.org/patch/656335/
>>
>> dependend on another patch(or patchserie) ?
>
> Yes it depends on Stefan's x86 i2c driver. He asked me to take a look.
> It can be squashed in - will leave this to Stefan.

I have squashed it in v2 of the SMBus I2C driver patch which will
hit the list very soon.

Thanks,
Stefan
Avoid

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-09  5:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-06  3:35 [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers Simon Glass
2016-08-06  3:35 ` [U-Boot] [PATCH 2/2] x86: i2c: Avoid using BSS before it is available Simon Glass
2016-08-07  6:54   ` Bin Meng
2016-08-08 14:45     ` Heiko Schocher
2016-08-08 21:44       ` Simon Glass
2016-08-09  5:37         ` Stefan Roese
2016-08-07  6:52 ` [U-Boot] [PATCH 1/2] i2c: Drop redundant platform data setting in drivers Bin Meng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox