Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
On 05/23/2014 05:53 PM, Tony Lindgren wrote: > * Roger Quadros [140523 01:17]: >> On 05/22/2014 05:46 PM, Ezequiel Garcia wrote: >>> On 22 May 01:51 PM, Javier Martinez Canillas wrote: On Thu, May 22, 2014 at 10:12 AM, Roger Quadros wrote: >> On 21 May 02:20 PM, Roger Quadros wrote: >> While I agree that the GPMC driver is a bit messy, I'm not sure it's >> possible >> to go through such a complete devicetree binding re-design (breaking >> backwards >> compatibility) now that the binding is already in production. > > Why not? especially if the existing bindings are poorly dones. Is anyone > using these > bindings burning the DT into ROM and can't change it when they update the > kernel? > While I do agree that your DT bindings are much better than the current ones, there is a policy that DT bindings are an external API and once are released with a kernel are set in stone and can't be changed. >>> >>> Exactly. The DT binding is considered an ABI. Thus, invariant across kernel >>> versions. Users can't be coherced into a DTB update after a kernel update. >>> >>> That said, I don't really care if you break compatilibity in this case. >>> Rather, I'm suggesting that you make sure this change is going to be >>> accepted >>> upstream, before doing any more work. The DT maintainers are reluctant to do >>> so. >> >> Appreciate your concern. >> >> Would be really nice if you can review patches 1-12. They have nothing to do >> with DT changes. >> Thanks. > > I'm mostly concerned about keeping things working. I think the > only way we can keep things working is to keep support for > the old binding around in addition to the new one. That way > we can update devices one at a time. Good to hear that you are not keen on keeping the old bindings forever. I understand that we need to keep things working during the transition. I'll think of something to maintain backward compatibility while supporting the new binding. cheers, -roger -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
Javier, On 05/23/2014 12:40 PM, Javier Martinez Canillas wrote: > Hello Roger, > > On Fri, May 23, 2014 at 10:16 AM, Roger Quadros wrote: >> Ezequiel & Javier, >> >> On 05/22/2014 05:46 PM, Ezequiel Garcia wrote: >>> On 22 May 01:51 PM, Javier Martinez Canillas wrote: On Thu, May 22, 2014 at 10:12 AM, Roger Quadros wrote: >> On 21 May 02:20 PM, Roger Quadros wrote: >>> >>> For DT boot: >>> - The GPMC controller node should have a chip select (CS) node for each >>> used >>> chip select. The CS node must have a child device node for each device >>> attached to that chip select. Properties for that child are GPMC >>> agnostic. >>> >>> i.e. >>> gpmc { >>> cs0 { >>> nand0 { >>> } >>> }; >>> >>> cs1 { >>> nor0 { >>> } >>> } >>> ... >>> }; >>> >> >> While I agree that the GPMC driver is a bit messy, I'm not sure it's >> possible >> to go through such a complete devicetree binding re-design (breaking >> backwards >> compatibility) now that the binding is already in production. > > Why not? especially if the existing bindings are poorly dones. Is anyone > using these > bindings burning the DT into ROM and can't change it when they update the > kernel? > While I do agree that your DT bindings are much better than the current ones, there is a policy that DT bindings are an external API and once are released with a kernel are set in stone and can't be changed. >>> >>> Exactly. The DT binding is considered an ABI. Thus, invariant across kernel >>> versions. Users can't be coherced into a DTB update after a kernel update. >>> >>> That said, I don't really care if you break compatilibity in this case. >>> Rather, I'm suggesting that you make sure this change is going to be >>> accepted >>> upstream, before doing any more work. The DT maintainers are reluctant to do >>> so. >> >> Appreciate your concern. >> >> Would be really nice if you can review patches 1-12. They have nothing to do >> with DT changes. >> Thanks. >> > > Overall your patches looks good to me. But I think it's better to wait > until Tony removes the legacy board files for OMAP2+ since AFAIU at > least the following patches could be dropped or trimmed down when > board files are gone: > > [RFC PATCH 04/16] ARM: OMAP2+: gpmc: use platform data to configure CS > space and poplulate > [RFC PATCH 06/16] ARM: OMAP2+: gpmc: add NAND specific setup > [RFC PATCH 07/16] ARM: OMAP2+: nand: Update gpmc_nand_init() to use > generic_gpmc_init() > > Patches 1-3 and 5 are independent and can be applied in the meantime > as a preparation for further changes following board files removal. > > I really like patches 9-12 since those moves some NAND add-hoc code to > the NAND driver where it really belongs. I think that similar changes > can be made for OneNAND and push the special case handling code from > GPMC driver to drivers/mtd/onenand/omap2.c. > > Other devices (nor, ethernet, uart, etc) are already using > gpmc_probe_generic_child() so I hope we can isolate the NAND and > OneNAND specific changes and just use a single probe function for all > child devices and possibly get even need the enum gpmc_omap_type you > are adding on your struct gpmc_omap_cs_data. Yes, I was thinking the same. > > So what do you think if as a first step we add the platform data as > you propose with all the commons timings and settings there, move all > the possible code to NAND and OneNAND drivers and try to use a single > configuration function for all child devices? Yes, I agree. > > Then once board files are gone we can do further cleanup in the driver > and then we can discuss about changing the DT bindings. Maybe we can > even change it while keeping backwards compatibility? Although I'm not > sure about the last point I think that at least is worth to discuss > it. OK. cheers, -roger -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
* Roger Quadros [140523 01:17]: > On 05/22/2014 05:46 PM, Ezequiel Garcia wrote: > > On 22 May 01:51 PM, Javier Martinez Canillas wrote: > >> On Thu, May 22, 2014 at 10:12 AM, Roger Quadros wrote: > On 21 May 02:20 PM, Roger Quadros wrote: > While I agree that the GPMC driver is a bit messy, I'm not sure it's > possible > to go through such a complete devicetree binding re-design (breaking > backwards > compatibility) now that the binding is already in production. > >>> > >>> Why not? especially if the existing bindings are poorly dones. Is anyone > >>> using these > >>> bindings burning the DT into ROM and can't change it when they update the > >>> kernel? > >>> > >> > >> While I do agree that your DT bindings are much better than the > >> current ones, there is a policy that DT bindings are an external API > >> and once are released with a kernel are set in stone and can't be > >> changed. > >> > > > > Exactly. The DT binding is considered an ABI. Thus, invariant across kernel > > versions. Users can't be coherced into a DTB update after a kernel update. > > > > That said, I don't really care if you break compatilibity in this case. > > Rather, I'm suggesting that you make sure this change is going to be > > accepted > > upstream, before doing any more work. The DT maintainers are reluctant to do > > so. > > Appreciate your concern. > > Would be really nice if you can review patches 1-12. They have nothing to do > with DT changes. > Thanks. I'm mostly concerned about keeping things working. I think the only way we can keep things working is to keep support for the old binding around in addition to the new one. That way we can update devices one at a time. Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
Hello Roger, On Fri, May 23, 2014 at 10:16 AM, Roger Quadros wrote: > Ezequiel & Javier, > > On 05/22/2014 05:46 PM, Ezequiel Garcia wrote: >> On 22 May 01:51 PM, Javier Martinez Canillas wrote: >>> On Thu, May 22, 2014 at 10:12 AM, Roger Quadros wrote: > On 21 May 02:20 PM, Roger Quadros wrote: >> >> For DT boot: >> - The GPMC controller node should have a chip select (CS) node for each >> used >> chip select. The CS node must have a child device node for each device >> attached to that chip select. Properties for that child are GPMC >> agnostic. >> >> i.e. >> gpmc { >> cs0 { >> nand0 { >> } >> }; >> >> cs1 { >> nor0 { >> } >> } >> ... >> }; >> > > While I agree that the GPMC driver is a bit messy, I'm not sure it's > possible > to go through such a complete devicetree binding re-design (breaking > backwards > compatibility) now that the binding is already in production. Why not? especially if the existing bindings are poorly dones. Is anyone using these bindings burning the DT into ROM and can't change it when they update the kernel? >>> >>> While I do agree that your DT bindings are much better than the >>> current ones, there is a policy that DT bindings are an external API >>> and once are released with a kernel are set in stone and can't be >>> changed. >>> >> >> Exactly. The DT binding is considered an ABI. Thus, invariant across kernel >> versions. Users can't be coherced into a DTB update after a kernel update. >> >> That said, I don't really care if you break compatilibity in this case. >> Rather, I'm suggesting that you make sure this change is going to be accepted >> upstream, before doing any more work. The DT maintainers are reluctant to do >> so. > > Appreciate your concern. > > Would be really nice if you can review patches 1-12. They have nothing to do > with DT changes. > Thanks. > Overall your patches looks good to me. But I think it's better to wait until Tony removes the legacy board files for OMAP2+ since AFAIU at least the following patches could be dropped or trimmed down when board files are gone: [RFC PATCH 04/16] ARM: OMAP2+: gpmc: use platform data to configure CS space and poplulate [RFC PATCH 06/16] ARM: OMAP2+: gpmc: add NAND specific setup [RFC PATCH 07/16] ARM: OMAP2+: nand: Update gpmc_nand_init() to use generic_gpmc_init() Patches 1-3 and 5 are independent and can be applied in the meantime as a preparation for further changes following board files removal. I really like patches 9-12 since those moves some NAND add-hoc code to the NAND driver where it really belongs. I think that similar changes can be made for OneNAND and push the special case handling code from GPMC driver to drivers/mtd/onenand/omap2.c. Other devices (nor, ethernet, uart, etc) are already using gpmc_probe_generic_child() so I hope we can isolate the NAND and OneNAND specific changes and just use a single probe function for all child devices and possibly get even need the enum gpmc_omap_type you are adding on your struct gpmc_omap_cs_data. So what do you think if as a first step we add the platform data as you propose with all the commons timings and settings there, move all the possible code to NAND and OneNAND drivers and try to use a single configuration function for all child devices? Then once board files are gone we can do further cleanup in the driver and then we can discuss about changing the DT bindings. Maybe we can even change it while keeping backwards compatibility? Although I'm not sure about the last point I think that at least is worth to discuss it. > cheers, > -roger > Thanks a lot and best regards, Javier >> >> On the other side, I guess you will also break bisectability while breaking >> backward compatibility. Doesn't sound very nice. >> > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
Ezequiel & Javier, On 05/22/2014 05:46 PM, Ezequiel Garcia wrote: > On 22 May 01:51 PM, Javier Martinez Canillas wrote: >> On Thu, May 22, 2014 at 10:12 AM, Roger Quadros wrote: On 21 May 02:20 PM, Roger Quadros wrote: > > For DT boot: > - The GPMC controller node should have a chip select (CS) node for each > used > chip select. The CS node must have a child device node for each device > attached to that chip select. Properties for that child are GPMC > agnostic. > > i.e. > gpmc { > cs0 { > nand0 { > } > }; > > cs1 { > nor0 { > } > } > ... > }; > While I agree that the GPMC driver is a bit messy, I'm not sure it's possible to go through such a complete devicetree binding re-design (breaking backwards compatibility) now that the binding is already in production. >>> >>> Why not? especially if the existing bindings are poorly dones. Is anyone >>> using these >>> bindings burning the DT into ROM and can't change it when they update the >>> kernel? >>> >> >> While I do agree that your DT bindings are much better than the >> current ones, there is a policy that DT bindings are an external API >> and once are released with a kernel are set in stone and can't be >> changed. >> > > Exactly. The DT binding is considered an ABI. Thus, invariant across kernel > versions. Users can't be coherced into a DTB update after a kernel update. > > That said, I don't really care if you break compatilibity in this case. > Rather, I'm suggesting that you make sure this change is going to be accepted > upstream, before doing any more work. The DT maintainers are reluctant to do > so. Appreciate your concern. Would be really nice if you can review patches 1-12. They have nothing to do with DT changes. Thanks. cheers, -roger > > On the other side, I guess you will also break bisectability while breaking > backward compatibility. Doesn't sound very nice. > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
On 22 May 01:51 PM, Javier Martinez Canillas wrote: > On Thu, May 22, 2014 at 10:12 AM, Roger Quadros wrote: > >> On 21 May 02:20 PM, Roger Quadros wrote: > >>> > >>> For DT boot: > >>> - The GPMC controller node should have a chip select (CS) node for each > >>> used > >>> chip select. The CS node must have a child device node for each device > >>> attached to that chip select. Properties for that child are GPMC > >>> agnostic. > >>> > >>> i.e. > >>> gpmc { > >>> cs0 { > >>> nand0 { > >>> } > >>> }; > >>> > >>> cs1 { > >>> nor0 { > >>> } > >>> } > >>> ... > >>> }; > >>> > >> > >> While I agree that the GPMC driver is a bit messy, I'm not sure it's > >> possible > >> to go through such a complete devicetree binding re-design (breaking > >> backwards > >> compatibility) now that the binding is already in production. > > > > Why not? especially if the existing bindings are poorly dones. Is anyone > > using these > > bindings burning the DT into ROM and can't change it when they update the > > kernel? > > > > While I do agree that your DT bindings are much better than the > current ones, there is a policy that DT bindings are an external API > and once are released with a kernel are set in stone and can't be > changed. > Exactly. The DT binding is considered an ABI. Thus, invariant across kernel versions. Users can't be coherced into a DTB update after a kernel update. That said, I don't really care if you break compatilibity in this case. Rather, I'm suggesting that you make sure this change is going to be accepted upstream, before doing any more work. The DT maintainers are reluctant to do so. On the other side, I guess you will also break bisectability while breaking backward compatibility. Doesn't sound very nice. -- Ezequiel GarcĂa, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
Hello Roger, On Thu, May 22, 2014 at 10:12 AM, Roger Quadros wrote: > Hi Ezequiel, > > On 05/21/2014 07:08 PM, Ezequiel Garcia wrote: >> Hi Roger, >> >> On 21 May 02:20 PM, Roger Quadros wrote: >>> >>> For DT boot: >>> - The GPMC controller node should have a chip select (CS) node for each used >>> chip select. The CS node must have a child device node for each device >>> attached to that chip select. Properties for that child are GPMC agnostic. >>> >>> i.e. >>> gpmc { >>> cs0 { >>> nand0 { >>> } >>> }; >>> >>> cs1 { >>> nor0 { >>> } >>> } >>> ... >>> }; >>> >> >> While I agree that the GPMC driver is a bit messy, I'm not sure it's possible >> to go through such a complete devicetree binding re-design (breaking >> backwards >> compatibility) now that the binding is already in production. > > Why not? especially if the existing bindings are poorly dones. Is anyone > using these > bindings burning the DT into ROM and can't change it when they update the > kernel? > While I do agree that your DT bindings are much better than the current ones, there is a policy that DT bindings are an external API and once are released with a kernel are set in stone and can't be changed. The rationale here is that DT only describes hardware and since hardware does not change, there is no need to change the DT on subsequent kernel releases. While that may be true in theory, in practice our understanding of the hardware keeps evolving. It may be possible that the person adding those binding didn't understand the hardware fully or did not have access to all the documentation. So given that the GPMC bindings are really awful maybe we can make an exception here? I don't even know who should decide this, if Tony as OMAP maintainer or the DT maintainers. > I wouldn't bother much about backward compatibility but just focus on not > breaking > functionality with all GPMC users while cleaning up the existing bindings. > >> >> AFAIK, TI's SDK 7.0 is released, with a v3.8.x kernel which uses this GPMC >> binding. And then you have the ISEE board too, using this binding. > > How does this prevent them from not using the new bindings when they update > the kernel? > In the particular case of ISEE boards, the vendor still ships a very old kernel that uses board files and platform data so probably is not an issue for mainline users to update their DTB but I see that there are many users of the GPMC binding in mainline: $ git grep "gpmc[:@_a-zA-Z0-9]* {" arch/arm/boot/dts/ | wc -l 36 >> >> Also, what's the problem with the current devicetree binding (not that I'm >> fan >> of it)? >> Like Ezequiel said, I'm not a big fan of the current binding neither but I don't know how safe is to break backward compatibility at this point. Best regards, Javier > > The existing binding uses this format > > gpmc { > ranges cs-num 0 IO_partition_start IO_partition_size, > ...> > > node-name0 { > compatible = ""; > reg = ; > > ; > > ; > }; > > node-name1 { > ... > }; > }; > > with requirements that > - chip select number (cs-num) is encoded in range id > - child's node-name is used to identify device type (NAND, Onenand, etc) and > driver expects that. > > All this results in the following issues > - No way to define entire GPMC I/O map (typically 1st 1GB), without assigning > them to a Chip select. i.e. incomplete hardware description. > TI SoCs variants can have different GPMC I/O sizes, some can have 512MB > others can have 1GB. There needs to be a way to specify that. > - No clean way to specify GPMC register map for use by child nodes. NAND > controller which can be one of the children needs to use the GPMC register > map. > - Tricky to define multiple devices within a single chip select region. > - Uses node name to identify device type like nand and onenand. Doesn't use > compatible id for them. > - GPMC CS properties are mixed with device properties, resulting in > unnecessary binding documents like > http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/net/gpmc-eth.txt > http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/mtd/gpmc-nor.txt > > To solve these issues, I'm proposing the following format > > gpmc { > ranges <0 0 IO_start IO_size/* entire GPMC I/O > space e.g. 1GB or 512MB */ > 1 0 Reg_start Reg_size>;/* GPMC register > space */ > > cs0 { > ranges <0 0 IO_partition_start IO_partition_size>; > /* CS0 IO partition e.g. 16MB */ > >
Re: [RFC PATCH 00/16] OMAP: GPMC: Restructure OMAP GPMC driver (NAND) : DT binding change proposal
Hi Ezequiel, On 05/21/2014 07:08 PM, Ezequiel Garcia wrote: > Hi Roger, > > On 21 May 02:20 PM, Roger Quadros wrote: >> >> For DT boot: >> - The GPMC controller node should have a chip select (CS) node for each used >> chip select. The CS node must have a child device node for each device >> attached to that chip select. Properties for that child are GPMC agnostic. >> >> i.e. >> gpmc { >> cs0 { >> nand0 { >> } >> }; >> >> cs1 { >> nor0 { >> } >> } >> ... >> }; >> > > While I agree that the GPMC driver is a bit messy, I'm not sure it's possible > to go through such a complete devicetree binding re-design (breaking backwards > compatibility) now that the binding is already in production. Why not? especially if the existing bindings are poorly dones. Is anyone using these bindings burning the DT into ROM and can't change it when they update the kernel? I wouldn't bother much about backward compatibility but just focus on not breaking functionality with all GPMC users while cleaning up the existing bindings. > > AFAIK, TI's SDK 7.0 is released, with a v3.8.x kernel which uses this GPMC > binding. And then you have the ISEE board too, using this binding. How does this prevent them from not using the new bindings when they update the kernel? > > Also, what's the problem with the current devicetree binding (not that I'm fan > of it)? > The existing binding uses this format gpmc { ranges node-name0 { compatible = ""; reg = ; ; ; }; node-name1 { ... }; }; with requirements that - chip select number (cs-num) is encoded in range id - child's node-name is used to identify device type (NAND, Onenand, etc) and driver expects that. All this results in the following issues - No way to define entire GPMC I/O map (typically 1st 1GB), without assigning them to a Chip select. i.e. incomplete hardware description. TI SoCs variants can have different GPMC I/O sizes, some can have 512MB others can have 1GB. There needs to be a way to specify that. - No clean way to specify GPMC register map for use by child nodes. NAND controller which can be one of the children needs to use the GPMC register map. - Tricky to define multiple devices within a single chip select region. - Uses node name to identify device type like nand and onenand. Doesn't use compatible id for them. - GPMC CS properties are mixed with device properties, resulting in unnecessary binding documents like http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/net/gpmc-eth.txt http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/mtd/gpmc-nor.txt To solve these issues, I'm proposing the following format gpmc { ranges <0 0 IO_start IO_size/* entire GPMC I/O space e.g. 1GB or 512MB */ 1 0 Reg_start Reg_size>;/* GPMC register space */ cs0 { ranges <0 0 IO_partition_start IO_partition_size>; /* CS0 IO partition e.g. 16MB */ gpmc,cs-num = <0>; /* pass chip select number explicitly */ ; dev0 { compatible = ""; reg = <0 IO_offset IO_size /* Device IO region e.g. 1KB */ 1 Reg_offset Reg_size>; ; }; dev1 { ... }; }; cs1 { ... }; }; All I'm doing is splitting up the CS node and the device node and removing the cs-num encoding from the ranges property. This results in a much cleaner DT binding and code. The format is similar to the one used by the ti-aemif driver. http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/memory-controllers/ti-aemif.txt Having a unified format for all TI memory controllers will make life much easier for us. cheers, -roger -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/