* Re: [PATCH 2/4] can: flexcan: add hardware controller version support [not found] ` <4FEAC3EF.3060606@pengutronix.de> @ 2012-06-27 8:56 ` Wolfgang Grandegger 2012-06-27 9:43 ` Wolfgang Grandegger 0 siblings, 1 reply; 6+ messages in thread From: Wolfgang Grandegger @ 2012-06-27 8:56 UTC (permalink / raw) To: Marc Kleine-Budde Cc: Hui Wang, davem, shawn.guo, linux-can, Devicetree Discussions On 06/27/2012 10:27 AM, Marc Kleine-Budde wrote: > On 06/27/2012 10:19 AM, Hui Wang wrote: >> At least in the i.MX series, the flexcan contrller divides into ver_3 >> and ver_10, current driver is for ver_3 controller. >> >> i.MX6 has ver_10 controller, it has more reigsters than ver_3 has. >> The rxfgmask (Rx FIFO Global Mask) register is one of the new added. >> Its reset value is 0xffffffff, this means ID Filter Table must be >> checked when receive a packet, but the driver is designed to accept >> everything during the chip start, we need to clear this register to >> follow this design. >> >> Add a hw_ver entry in the device tree, this can let us distinguish >> which version the controller is, if we don't set value to this entry, >> the hw_ver is 3 by default, this is backward compatible for existing >> platforms like powerpc and imx35. > > Is it possible to read this value from the hardware? > Another possibility would be to introduce a new compatible device in the > device tree. I vote for the latter. IIRC, in the past we already had some discussion on how to handle version dependent Flexcan hardware, e.g. by using flexcan-vX.X or being expicit using fsl,p1010-flexcan. Search for "Add support for powerpc" in the netdev mailing list. I added the devicetree-discuss ml for that reason. Wolfgang. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] can: flexcan: add hardware controller version support 2012-06-27 8:56 ` [PATCH 2/4] can: flexcan: add hardware controller version support Wolfgang Grandegger @ 2012-06-27 9:43 ` Wolfgang Grandegger 2012-06-27 9:51 ` Marc Kleine-Budde 0 siblings, 1 reply; 6+ messages in thread From: Wolfgang Grandegger @ 2012-06-27 9:43 UTC (permalink / raw) To: Marc Kleine-Budde Cc: Hui Wang, davem, shawn.guo, linux-can, Devicetree Discussions Hi Marc, On 06/27/2012 10:56 AM, Wolfgang Grandegger wrote: > On 06/27/2012 10:27 AM, Marc Kleine-Budde wrote: >> On 06/27/2012 10:19 AM, Hui Wang wrote: >>> At least in the i.MX series, the flexcan contrller divides into ver_3 >>> and ver_10, current driver is for ver_3 controller. >>> >>> i.MX6 has ver_10 controller, it has more reigsters than ver_3 has. >>> The rxfgmask (Rx FIFO Global Mask) register is one of the new added. >>> Its reset value is 0xffffffff, this means ID Filter Table must be >>> checked when receive a packet, but the driver is designed to accept >>> everything during the chip start, we need to clear this register to >>> follow this design. >>> >>> Add a hw_ver entry in the device tree, this can let us distinguish >>> which version the controller is, if we don't set value to this entry, >>> the hw_ver is 3 by default, this is backward compatible for existing >>> platforms like powerpc and imx35. >> >> Is it possible to read this value from the hardware? >> Another possibility would be to introduce a new compatible device in the >> device tree. > > I vote for the latter. IIRC, in the past we already had some discussion > on how to handle version dependent Flexcan hardware, e.g. by using > flexcan-vX.X or being expicit using fsl,p1010-flexcan. Search for "Add > support for powerpc" in the netdev mailing list. I added the > devicetree-discuss ml for that reason. I looked up the threads and found: http://marc.info/?w=4&r=1&s=Fix+up+fsl-flexcan+device+tree+bi&q=t In the Flexcan driver we currently only have: static struct of_device_id flexcan_of_match[] = { { .compatible = "fsl,p1010-flexcan", }, {}, }; What compatible string do they actually use for the i.MX6Q board? Shawn or Hui? We need to fix that. From the discussion mentioned above I think "fsl,flexcan-v10" would be acceptable. Unfortunately, we do not known the internal version of the Flexcan controllers used in the various PowerPC and ARM SOCs. We already realized some differences with interrupts and bus error handling between i.MX28 and i.MX35. Would be nice if someone (from Freescale?) could finally clarify that. Wolfgang. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] can: flexcan: add hardware controller version support 2012-06-27 9:43 ` Wolfgang Grandegger @ 2012-06-27 9:51 ` Marc Kleine-Budde 2012-06-27 10:13 ` Hui Wang 0 siblings, 1 reply; 6+ messages in thread From: Marc Kleine-Budde @ 2012-06-27 9:51 UTC (permalink / raw) To: Wolfgang Grandegger Cc: Hui Wang, davem, shawn.guo, linux-can, Devicetree Discussions [-- Attachment #1: Type: text/plain, Size: 2815 bytes --] On 06/27/2012 11:43 AM, Wolfgang Grandegger wrote: > Hi Marc, > > On 06/27/2012 10:56 AM, Wolfgang Grandegger wrote: >> On 06/27/2012 10:27 AM, Marc Kleine-Budde wrote: >>> On 06/27/2012 10:19 AM, Hui Wang wrote: >>>> At least in the i.MX series, the flexcan contrller divides into ver_3 >>>> and ver_10, current driver is for ver_3 controller. >>>> >>>> i.MX6 has ver_10 controller, it has more reigsters than ver_3 has. >>>> The rxfgmask (Rx FIFO Global Mask) register is one of the new added. >>>> Its reset value is 0xffffffff, this means ID Filter Table must be >>>> checked when receive a packet, but the driver is designed to accept >>>> everything during the chip start, we need to clear this register to >>>> follow this design. >>>> >>>> Add a hw_ver entry in the device tree, this can let us distinguish >>>> which version the controller is, if we don't set value to this entry, >>>> the hw_ver is 3 by default, this is backward compatible for existing >>>> platforms like powerpc and imx35. >>> >>> Is it possible to read this value from the hardware? >>> Another possibility would be to introduce a new compatible device in the >>> device tree. >> >> I vote for the latter. IIRC, in the past we already had some discussion >> on how to handle version dependent Flexcan hardware, e.g. by using >> flexcan-vX.X or being expicit using fsl,p1010-flexcan. Search for "Add >> support for powerpc" in the netdev mailing list. I added the >> devicetree-discuss ml for that reason. > > I looked up the threads and found: > > http://marc.info/?w=4&r=1&s=Fix+up+fsl-flexcan+device+tree+bi&q=t > > In the Flexcan driver we currently only have: > > static struct of_device_id flexcan_of_match[] = { > { > .compatible = "fsl,p1010-flexcan", > }, > {}, > }; > > What compatible string do they actually use for the i.MX6Q board? Shawn > or Hui? We need to fix that. From the discussion mentioned above I think > "fsl,flexcan-v10" would be acceptable. Unfortunately, we do not known As far as I understand the DT, the name should be something like "fsl,${OLDEST_SOCK_THAT_HAS_THIS_VERSION_OF_FLEXCAN}-flexcan". > the internal version of the Flexcan controllers used in the various > PowerPC and ARM SOCs. We already realized some differences with > interrupts and bus error handling between i.MX28 and i.MX35. Would be > nice if someone (from Freescale?) could finally clarify that. That information would be interesting. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 262 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] can: flexcan: add hardware controller version support 2012-06-27 9:51 ` Marc Kleine-Budde @ 2012-06-27 10:13 ` Hui Wang 2012-06-27 10:24 ` Marc Kleine-Budde 2012-06-27 10:57 ` Wolfgang Grandegger 0 siblings, 2 replies; 6+ messages in thread From: Hui Wang @ 2012-06-27 10:13 UTC (permalink / raw) To: Marc Kleine-Budde Cc: Wolfgang Grandegger, Hui Wang, davem, shawn.guo, linux-can, Devicetree Discussions Marc Kleine-Budde wrote: > On 06/27/2012 11:43 AM, Wolfgang Grandegger wrote: > >> Hi Marc, >> >> On 06/27/2012 10:56 AM, Wolfgang Grandegger wrote: >> >>> On 06/27/2012 10:27 AM, Marc Kleine-Budde wrote: >>> >>>> On 06/27/2012 10:19 AM, Hui Wang wrote: >>>> >>>>> At least in the i.MX series, the flexcan contrller divides into ver_3 >>>>> and ver_10, current driver is for ver_3 controller. >>>>> >>>>> i.MX6 has ver_10 controller, it has more reigsters than ver_3 has. >>>>> The rxfgmask (Rx FIFO Global Mask) register is one of the new added. >>>>> Its reset value is 0xffffffff, this means ID Filter Table must be >>>>> checked when receive a packet, but the driver is designed to accept >>>>> everything during the chip start, we need to clear this register to >>>>> follow this design. >>>>> >>>>> Add a hw_ver entry in the device tree, this can let us distinguish >>>>> which version the controller is, if we don't set value to this entry, >>>>> the hw_ver is 3 by default, this is backward compatible for existing >>>>> platforms like powerpc and imx35. >>>>> >>>> Is it possible to read this value from the hardware? >>>> Another possibility would be to introduce a new compatible device in the >>>> device tree. >>>> >>> I vote for the latter. IIRC, in the past we already had some discussion >>> on how to handle version dependent Flexcan hardware, e.g. by using >>> flexcan-vX.X or being expicit using fsl,p1010-flexcan. Search for "Add >>> support for powerpc" in the netdev mailing list. I added the >>> devicetree-discuss ml for that reason. >>> >> I looked up the threads and found: >> >> http://marc.info/?w=4&r=1&s=Fix+up+fsl-flexcan+device+tree+bi&q=t >> >> In the Flexcan driver we currently only have: >> >> static struct of_device_id flexcan_of_match[] = { >> { >> .compatible = "fsl,p1010-flexcan", >> }, >> {}, >> }; >> >> What compatible string do they actually use for the i.MX6Q board? Shawn >> or Hui? We need to fix that. From the discussion mentioned above I think >> Currently i modified the can1 DT entry in the imx6q.dtsi like this: flexcan@02090000 { /* CAN1 */ reg = <0x02090000 0x4000>; interrupts = <0 110 0x04>; hw-version = <10>; }; and the DT entry in the imx6q-sabrelite.dts like this: flexcan@02090000 { /* CAN1 */ compatible = "fsl,imx6q-flexcan", "fsl,p1010-flexcan"; phy-en-gpio = <&gpio1 4 0>; phy-stby-gpio = <&gpio1 2 0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flexcan1_1>; }; if we don't use hw-version entry and use flexcan-v10, do you mean we use strcmp or strxxx to decide controller version? Regards, Hui. >> "fsl,flexcan-v10" would be acceptable. Unfortunately, we do not known >> > > As far as I understand the DT, the name should be something like > > "fsl,${OLDEST_SOCK_THAT_HAS_THIS_VERSION_OF_FLEXCAN}-flexcan". > > >> the internal version of the Flexcan controllers used in the various >> PowerPC and ARM SOCs. We already realized some differences with >> interrupts and bus error handling between i.MX28 and i.MX35. Would be >> nice if someone (from Freescale?) could finally clarify that. >> > > That information would be interesting. > > Marc > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] can: flexcan: add hardware controller version support 2012-06-27 10:13 ` Hui Wang @ 2012-06-27 10:24 ` Marc Kleine-Budde 2012-06-27 10:57 ` Wolfgang Grandegger 1 sibling, 0 replies; 6+ messages in thread From: Marc Kleine-Budde @ 2012-06-27 10:24 UTC (permalink / raw) To: Hui Wang Cc: Wolfgang Grandegger, davem, shawn.guo, linux-can, Devicetree Discussions [-- Attachment #1: Type: text/plain, Size: 1884 bytes --] On 06/27/2012 12:13 PM, Hui Wang wrote: [...] >>> What compatible string do they actually use for the i.MX6Q board? Shawn >>> or Hui? We need to fix that. From the discussion mentioned above I think >>> > Currently i modified the can1 DT entry in the imx6q.dtsi like this: > flexcan@02090000 { /* CAN1 */ > reg = <0x02090000 0x4000>; > interrupts = <0 110 0x04>; > hw-version = <10>; ^^^^^^^^^^^^^^^^^^ remove > }; > > and the DT entry in the imx6q-sabrelite.dts like this: > flexcan@02090000 { /* CAN1 */ > compatible = "fsl,imx6q-flexcan", "fsl,p1010-flexcan"; ^^^^^^^^^^^^^^^^^^^ If imx6q is the first sock with this core "fsl,imx6q-flexcan" is the official name. "fsl,p1010-flexcan" will be removed. The compatible should go into the imx6q.dtsi > phy-en-gpio = <&gpio1 4 0>; > phy-stby-gpio = <&gpio1 2 0>; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_flexcan1_1>; > }; > if we don't use hw-version entry and use flexcan-v10, do you mean we use > strcmp or strxxx to decide controller version? No, have a look at the flexcan_of_match. The struct of_device_id has a data pointer that can point to some arbitrary data. Define a struct flexcan_devtype_data which has, for now, a hardware revision member. Have a look at the imx-spi[1] driver. Marc [1] http://lxr.free-electrons.com/source/drivers/spi/spi-imx.c -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 262 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] can: flexcan: add hardware controller version support 2012-06-27 10:13 ` Hui Wang 2012-06-27 10:24 ` Marc Kleine-Budde @ 2012-06-27 10:57 ` Wolfgang Grandegger 1 sibling, 0 replies; 6+ messages in thread From: Wolfgang Grandegger @ 2012-06-27 10:57 UTC (permalink / raw) To: Hui Wang Cc: Marc Kleine-Budde, davem, shawn.guo, linux-can, Devicetree Discussions On 06/27/2012 12:13 PM, Hui Wang wrote: > Marc Kleine-Budde wrote: >> On 06/27/2012 11:43 AM, Wolfgang Grandegger wrote: >> >>> Hi Marc, >>> >>> On 06/27/2012 10:56 AM, Wolfgang Grandegger wrote: >>> >>>> On 06/27/2012 10:27 AM, Marc Kleine-Budde wrote: >>>> >>>>> On 06/27/2012 10:19 AM, Hui Wang wrote: >>>>> >>>>>> At least in the i.MX series, the flexcan contrller divides into ver_3 >>>>>> and ver_10, current driver is for ver_3 controller. >>>>>> >>>>>> i.MX6 has ver_10 controller, it has more reigsters than ver_3 has. >>>>>> The rxfgmask (Rx FIFO Global Mask) register is one of the new added. >>>>>> Its reset value is 0xffffffff, this means ID Filter Table must be >>>>>> checked when receive a packet, but the driver is designed to accept >>>>>> everything during the chip start, we need to clear this register to >>>>>> follow this design. >>>>>> >>>>>> Add a hw_ver entry in the device tree, this can let us distinguish >>>>>> which version the controller is, if we don't set value to this entry, >>>>>> the hw_ver is 3 by default, this is backward compatible for existing >>>>>> platforms like powerpc and imx35. >>>>>> >>>>> Is it possible to read this value from the hardware? >>>>> Another possibility would be to introduce a new compatible device >>>>> in the >>>>> device tree. >>>>> >>>> I vote for the latter. IIRC, in the past we already had some discussion >>>> on how to handle version dependent Flexcan hardware, e.g. by using >>>> flexcan-vX.X or being expicit using fsl,p1010-flexcan. Search for "Add >>>> support for powerpc" in the netdev mailing list. I added the >>>> devicetree-discuss ml for that reason. >>>> >>> I looked up the threads and found: >>> >>> http://marc.info/?w=4&r=1&s=Fix+up+fsl-flexcan+device+tree+bi&q=t >>> >>> In the Flexcan driver we currently only have: >>> >>> static struct of_device_id flexcan_of_match[] = { >>> { >>> .compatible = "fsl,p1010-flexcan", >>> }, >>> {}, >>> }; >>> >>> What compatible string do they actually use for the i.MX6Q board? Shawn >>> or Hui? We need to fix that. From the discussion mentioned above I think >>> > Currently i modified the can1 DT entry in the imx6q.dtsi like this: > flexcan@02090000 { /* CAN1 */ > reg = <0x02090000 0x4000>; > interrupts = <0 110 0x04>; > hw-version = <10>; > }; > > and the DT entry in the imx6q-sabrelite.dts like this: > flexcan@02090000 { /* CAN1 */ > compatible = "fsl,imx6q-flexcan", "fsl,p1010-flexcan"; > phy-en-gpio = <&gpio1 4 0>; > phy-stby-gpio = <&gpio1 2 0>; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_flexcan1_1>; > }; > if we don't use hw-version entry and use flexcan-v10, do you mean we use > strcmp or strxxx to decide controller version? Yes, that could be done wuth that syntax, but ... > Regards, > Hui. >>> "fsl,flexcan-v10" would be acceptable. Unfortunately, we do not known >>> >> >> As far as I understand the DT, the name should be something like >> >> "fsl,${OLDEST_SOCK_THAT_HAS_THIS_VERSION_OF_FLEXCAN}-flexcan". ... the above string is indeed the prefered one, even if I think it's much less transparent. You should then define the .data field of "struct of_device_id" to set the hw version. Wolfgang. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-06-27 10:57 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1340785161-3598-1-git-send-email-jason77.wang@gmail.com> [not found] ` <1340785161-3598-2-git-send-email-jason77.wang@gmail.com> [not found] ` <1340785161-3598-3-git-send-email-jason77.wang@gmail.com> [not found] ` <4FEAC3EF.3060606@pengutronix.de> 2012-06-27 8:56 ` [PATCH 2/4] can: flexcan: add hardware controller version support Wolfgang Grandegger 2012-06-27 9:43 ` Wolfgang Grandegger 2012-06-27 9:51 ` Marc Kleine-Budde 2012-06-27 10:13 ` Hui Wang 2012-06-27 10:24 ` Marc Kleine-Budde 2012-06-27 10:57 ` Wolfgang Grandegger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).