Skip to contentSkip to conversation

OMAP DT i2c aliases

RFC Ivaylo Dimitrov 2 participants 5 messages Jun 1, 2014 – Jun 2, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

patch https://lkml.org/lkml/2013/10/16/744 fixes DT i2c bus ids in case of deferred probe and assigns id 0,1 and 2 for i2c buses 1,2 and 3. Unfortunately, this breaks Maemo userspace on N900, where board code (in case of legacy boot) assigns ids 1, 2 and 3, but with DT boot ids are 0,1 and 2. I've already send a patch https://lkml.org/lkml/2014/6/1/49 that will allow me to fix that from board .dts, but I was wondering if it is the correct way, or ids should be changed in omap3.dtsi for all omap devices.

Regards,
Ivo

#1 lore raw
Quoted 6 lines · Ivaylo Dimitrov

Hi,

patch https://lkml.org/lkml/2013/10/16/744 fixes DT i2c bus ids in case of deferred probe and assigns id 0,1 and 2 for i2c buses 1,2 and 3. Unfortunately, this breaks Maemo userspace on N900, where board code (in case of legacy boot) assigns ids 1, 2 and 3, but with DT boot ids are

ughh.. missed that :(

Quoted 4 lines

0,1 and 2. I've already send a patch https://lkml.org/lkml/2014/6/1/49
that will allow me to fix that from board .dts, but I was wondering if it is the correct way, or ids should be changed in omap3.dtsi for all omap devices.

Should'nt we retain 0,1,2 as indexing to make this consistent for all SoCs?

Signature · 2 lines
Regards,
Nishanth Menon
#2 lore raw
Quoted 10 lines · Nishanth Menon
Quoted 6 lines · Ivaylo Dimitrov

Hi,

patch https://lkml.org/lkml/2013/10/16/744 fixes DT i2c bus ids in case of deferred probe and assigns id 0,1 and 2 for i2c buses 1,2 and 3. Unfortunately, this breaks Maemo userspace on N900, where board code (in case of legacy boot) assigns ids 1, 2 and 3, but with DT boot ids are

ughh.. missed that :(

Quoted 9 lines
Quoted 4 lines

0,1 and 2. I've already send a patch https://lkml.org/lkml/2014/6/1/49
that will allow me to fix that from board .dts, but I was wondering if it is the correct way, or ids should be changed in omap3.dtsi for all omap devices.

Should'nt we retain 0,1,2 as indexing to make this consistent for all SoCs?

I think this is the most sane thing, esp if the "alias replace" patch gets accepted(thus allowing us to workaround the problems on N900 and N9/50), however I wanted to hear from you on the matter. Esp that indexing is different with legacy boot compared to DT boot.

#3 lore raw

On Mon 02 Jun 2014 11:03:24 AM CDT, Ivaylo Dimitrov wrote:
[...]

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines

0,1 and 2. I've already send a patch https://lkml.org/lkml/2014/6/1/49
that will allow me to fix that from board .dts, but I was wondering if it is the correct way, or ids should be changed in omap3.dtsi for all omap devices.

Should'nt we retain 0,1,2 as indexing to make this consistent for all SoCs?

Quoted 4 lines

I think this is the most sane thing, esp if the "alias replace" patch gets accepted(thus allowing us to workaround the problems on N900 and N9/50), however I wanted to hear from you on the matter. Esp that indexing is different with legacy boot compared to DT boot.

I think that slipped my check list unfortunately. :( But then, if we think that it is just n900 that is impacted, then I wonder if we can override the alias? just wondering..

--
Regards,
Nishanth Menon

#4 lore raw
Quoted 5 lines · Nishanth Menon

I think that slipped my check list unfortunately. :( But then, if we think that it is just n900 that is impacted, then I wonder if we can override the alias? just wondering..

That https://lkml.org/lkml/2014/6/1/49 patch will allow such override, I tested it on N900 with Fremantle and it works fine. Ofc I had to add

aliases {
	i2c1 = &i2c1;
	i2c2 = &i2c2;
	i2c3 = &i2c3;
};

to omap3-n900.dts (while keeping omap3.dtsi intact) for it to work.

I checked in some Nemo N9/N950 adaptation kernel and it seems those will be broken too(and I bet it is the same in stock Nokia N9/50 kernels):

static void __init rm680_i2c_init(void)

{
	omap3_pmic_get_config(&rm680_twl_data, TWL_COMMON_PDATA_USB,
			      TWL_COMMON_REGULATOR_VDAC |
			      TWL_COMMON_REGULATOR_VPLL2);
	omap_pmic_init(1, 2900, "twl5031", INT_34XX_SYS_NIRQ, &rm680_twl_data);
	omap_register_i2c_bus(2, 400, rm696_peripherals_i2c_board_info_2,
			      ARRAY_SIZE(rm696_peripherals_i2c_board_info_2));
	omap_register_i2c_bus(3, 400, rm696_peripherals_i2c_board_info_3,
			      ARRAY_SIZE(rm696_peripherals_i2c_board_info_3));
}

Again 1,2 and 3 for bus indexes just like on N900.

Anyway, I am fine with the alias override. If the patch makes it to the upstream :)

Regards,
Ivo