From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: I2C not working upon 2.6.24 to 2.6.28 kernel upgrade Date: Thu, 12 Mar 2009 12:08:07 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org To: Johns Daniel Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org List-Id: devicetree@vger.kernel.org On Thu, Mar 12, 2009 at 11:37 AM, Johns Daniel wro= te: > We have had this device tree (a section shown below) working for a long t= ime: > =A0 =A0 =A0 =A0soc8343@e0000000 { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <1>; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#interrupt-cells =3D <2>; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device_type =3D "soc"; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ranges =3D <00000000 e0000000 00100000>; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bus-frequency =3D <0>; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i2c@3000 { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device_type =3D "i2c"; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "fsl-i2c"; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <3000 100>; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <700>; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dfsrr; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}; > ... > } > > With linux-2.6.24, it worked with this struct defined in the > board-specific file: > =A0 =A0 =A0 =A0 =A0static struct of_device_id __initdata of_bus_ids[] =3D= { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ .compatible =3D "fsl,pq2pro-localbus", }, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{}, > =A0 =A0 =A0 =A0 =A0}; This doesn't make much sense since the snippit above doesn't show a compatible value in the soc node. > With linux-2.6.28, it needs the following struct in the board-specific > file for I2C to work: > =A0 =A0 =A0 =A0 =A0static struct of_device_id __initdata of_bus_ids[] =3D= { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ .type =3D "soc", }, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ .name =3D "localbus", }, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{}, > =A0 =A0 =A0 =A0 =A0}; > > Is this easily explained? Binding on device_type or name is strongly discouraged, so the above snippit isn't a good idea. Is it okay to add a property to your device tree? If so, then add: compatible =3D "fsl,mpc8315-immr", "simple-bus" and make sure that { .compatible =3D "simple-bus"} is in the of_bus_ids list. Adding this property will not break older versions of the kernel. > What is the right way to do this now? Ideally, I would like to keep > the device tree unchanged since I need for it to work with older > versions of the kernel! compatible =3D "simple-bus" is the right way to describe simple memory mapped translations like on the internally memory mapped registers. Cheers, g. -- = Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.