* driver using another driver @ 2014-07-30 14:45 Priebe, Sebastian [not found] ` <E70AF999396FDF4EAE40E195B84709611F84671F-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Priebe, Sebastian @ 2014-07-30 14:45 UTC (permalink / raw) To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Hello, I am working on a project with an ARMv6 cpu and I am currently trying to port our board file to a device tree. Our custom hardware has a CPLD with is used by multiple driver. In the past we shared the CPLD driver resource (struct resource...) among the drivers platform data to be able to access the CPLD registers from all the drivers. The CPLD driver allocated the resource, returned it to our platform code and our platform code passed it to the other drivers. In other words the CPLD driver is used by the other driver. How can I achieve the same with a device tree? Greetings Sebastian Priebe ========================================== CADCON Ingenieurgesellschaft mbH & Co. KG Geschaeftsfuehrer: Robert Bauer, Andreas Gundel Sitz der Gesellschaft: D-86368 Gersthofen Registergericht: Amtsgericht Augsburg HRA 14521 ========================================== -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <E70AF999396FDF4EAE40E195B84709611F84671F-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org>]
* Re: driver using another driver [not found] ` <E70AF999396FDF4EAE40E195B84709611F84671F-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org> @ 2014-08-01 6:31 ` Sascha Hauer [not found] ` <20140801063105.GV23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Sascha Hauer @ 2014-08-01 6:31 UTC (permalink / raw) To: Priebe, Sebastian; +Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Hi Sebastian, On Wed, Jul 30, 2014 at 02:45:51PM +0000, Priebe, Sebastian wrote: > Hello, > > I am working on a project with an ARMv6 cpu and I am currently trying > to port our board file to a device tree. Our custom hardware has a > CPLD with is used by multiple driver. In the past we shared the CPLD > driver resource (struct resource...) among the drivers platform data > to be able to access the CPLD registers from all the drivers. The > CPLD driver allocated the resource, returned it to our platform code > and our platform code passed it to the other drivers. > In other words the CPLD driver is used by the other driver. > How can I achieve the same with a device tree? You can use a toplevel device node for your CPLD on which your toplevel driver matches. Call of_platform_populate() with this toplevel node to create the child devices. drivers/bus/ contains some examples, like drivers/bus/imx-weim.c. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20140801063105.GV23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>]
* AW: driver using another driver [not found] ` <20140801063105.GV23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> @ 2014-08-01 7:15 ` Priebe, Sebastian [not found] ` <E70AF999396FDF4EAE40E195B84709611F847086-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Priebe, Sebastian @ 2014-08-01 7:15 UTC (permalink / raw) To: Sascha Hauer; +Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Hello Sascha, thanks for your answer. We are using an imx35 cpu and our CPLD is in fact connected via weim (CS1). Though I created the following device node in our dts: &weim { pinctrl-names = "default"; status = "okay"; pld@1,0 { compatible = "roche,hbm-pld"; reg = <1 0x00000000 0x0001000>; fsl,weim-cs-timing = <0x0 0x0 0x0>; /* don't know what to put here */ }; }; And I turned the CPLD driver into a platform driver. But I don't get the resource in probe: res = platform_get_resource(pdev, IORESOURCE_MEM, 0) returns NULL. In our platform code we had: static struct resource hbm_pld_resource_data = { .start = 0xA8000000, .end = 0xA8000000 + 0x1000 - 1, .flags = IORESOURCE_MEM, }; And for the setting of CS1: __raw_writel((0x22 << 8), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + 0x10); __raw_writel(((0x0a << 28) | (0x06 << 12) | (0x03 << 8) | (0x04 << 4) | (0x01 << 0)), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + 0x14); Where do I put this in the device tree? Gruß Sebastian Priebe Telefon: +49 (0)621 685996-26 ========================================== CADCON Ingenieurgesellschaft mbH & Co. KG Geschaeftsfuehrer: Robert Bauer, Andreas Gundel Sitz der Gesellschaft: D-86368 Gersthofen Registergericht: Amtsgericht Augsburg HRA 14521 ========================================== -----Ursprüngliche Nachricht----- Von: Sascha Hauer [mailto:s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org] Gesendet: Freitag, 1. August 2014 08:31 An: Priebe, Sebastian Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Betreff: Re: driver using another driver Hi Sebastian, On Wed, Jul 30, 2014 at 02:45:51PM +0000, Priebe, Sebastian wrote: > Hello, > > I am working on a project with an ARMv6 cpu and I am currently trying > to port our board file to a device tree. Our custom hardware has a > CPLD with is used by multiple driver. In the past we shared the CPLD > driver resource (struct resource...) among the drivers platform data > to be able to access the CPLD registers from all the drivers. The > CPLD driver allocated the resource, returned it to our platform code > and our platform code passed it to the other drivers. > In other words the CPLD driver is used by the other driver. > How can I achieve the same with a device tree? You can use a toplevel device node for your CPLD on which your toplevel driver matches. Call of_platform_populate() with this toplevel node to create the child devices. drivers/bus/ contains some examples, like drivers/bus/imx-weim.c. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <E70AF999396FDF4EAE40E195B84709611F847086-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org>]
* Re: driver using another driver [not found] ` <E70AF999396FDF4EAE40E195B84709611F847086-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org> @ 2014-08-01 8:51 ` Sascha Hauer [not found] ` <20140801085148.GW23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Sascha Hauer @ 2014-08-01 8:51 UTC (permalink / raw) To: Priebe, Sebastian; +Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Fri, Aug 01, 2014 at 07:15:41AM +0000, Priebe, Sebastian wrote: > Hello Sascha, > > thanks for your answer. > We are using an imx35 cpu and our CPLD is in fact connected via weim (CS1). > Though I created the following device node in our dts: > &weim { > pinctrl-names = "default"; > status = "okay"; > > pld@1,0 { > compatible = "roche,hbm-pld"; > reg = <1 0x00000000 0x0001000>; > fsl,weim-cs-timing = <0x0 0x0 0x0>; /* don't know what to put here */ > }; > }; > > And I turned the CPLD driver into a platform driver. But I don't get the resource in probe: > res = platform_get_resource(pdev, IORESOURCE_MEM, 0) returns NULL. > > In our platform code we had: > static struct resource hbm_pld_resource_data = { > .start = 0xA8000000, > .end = 0xA8000000 + 0x1000 - 1, > .flags = IORESOURCE_MEM, > }; Why do you manually register a platform_device? You should add the CPLD device to the device tree instead. > > And for the setting of CS1: > __raw_writel((0x22 << 8), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + 0x10); > __raw_writel(((0x0a << 28) | (0x06 << 12) | (0x03 << 8) | (0x04 << 4) | (0x01 << 0)), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + 0x14); > > Where do I put this in the device tree? In the fsl,weim-cs-timing property. See Documentation/devicetree/bindings/bus/imx-weim.txt Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20140801085148.GW23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>]
* AW: driver using another driver [not found] ` <20140801085148.GW23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> @ 2014-08-01 9:08 ` Priebe, Sebastian [not found] ` <CA+8Hj81tTdCMm-we8F6ZbNq8wPVWsEZZ8tYixLN3--tjiQpyfw@mail.gmail.com> 0 siblings, 1 reply; 6+ messages in thread From: Priebe, Sebastian @ 2014-08-01 9:08 UTC (permalink / raw) To: Sascha Hauer; +Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Hello Sascha, I don't register a platform driver manually anymore. As I wrote before, I turned the CPLD driver in a platform driver and created an entry in the device tree. But I get an error in the probe: res = platform_get_resource(pdev, IORESOURCE_MEM, 0) returns NULL. Greetings Sebastian Priebe Telefon: +49 (0)621 685996-26 ========================================== CADCON Ingenieurgesellschaft mbH & Co. KG Geschaeftsfuehrer: Robert Bauer, Andreas Gundel Sitz der Gesellschaft: D-86368 Gersthofen Registergericht: Amtsgericht Augsburg HRA 14521 ========================================== -----Ursprüngliche Nachricht----- Von: Sascha Hauer [mailto:s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org] Gesendet: Freitag, 1. August 2014 10:52 An: Priebe, Sebastian Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Betreff: Re: driver using another driver On Fri, Aug 01, 2014 at 07:15:41AM +0000, Priebe, Sebastian wrote: > Hello Sascha, > > thanks for your answer. > We are using an imx35 cpu and our CPLD is in fact connected via weim (CS1). > Though I created the following device node in our dts: > &weim { > pinctrl-names = "default"; > status = "okay"; > > pld@1,0 { > compatible = "roche,hbm-pld"; > reg = <1 0x00000000 0x0001000>; > fsl,weim-cs-timing = <0x0 0x0 0x0>; /* don't know what to put here */ > }; > }; > > And I turned the CPLD driver into a platform driver. But I don't get the resource in probe: > res = platform_get_resource(pdev, IORESOURCE_MEM, 0) returns NULL. > > In our platform code we had: > static struct resource hbm_pld_resource_data = { > .start = 0xA8000000, > .end = 0xA8000000 + 0x1000 - 1, > .flags = IORESOURCE_MEM, > }; Why do you manually register a platform_device? You should add the CPLD device to the device tree instead. > > And for the setting of CS1: > __raw_writel((0x22 << 8), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + > 0x10); __raw_writel(((0x0a << 28) | (0x06 << 12) | (0x03 << 8) | (0x04 > << 4) | (0x01 << 0)), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + 0x14); > > Where do I put this in the device tree? In the fsl,weim-cs-timing property. See Documentation/devicetree/bindings/bus/imx-weim.txt Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <CA+8Hj81tTdCMm-we8F6ZbNq8wPVWsEZZ8tYixLN3--tjiQpyfw@mail.gmail.com>]
[parent not found: <CA+8Hj81tTdCMm-we8F6ZbNq8wPVWsEZZ8tYixLN3--tjiQpyfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* AW: driver using another driver [not found] ` <CA+8Hj81tTdCMm-we8F6ZbNq8wPVWsEZZ8tYixLN3--tjiQpyfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-08-07 7:49 ` Priebe, Sebastian 0 siblings, 0 replies; 6+ messages in thread From: Priebe, Sebastian @ 2014-08-07 7:49 UTC (permalink / raw) To: Liu Ying; +Cc: Sascha Hauer, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset="utf-8", Size: 4571 bytes --] Hi, no, I don't have this patch. I will give it a try. Thanks. Greetings Sebastian Priebe ========================================== CADCON Ingenieurgesellschaft mbH & Co. KG Geschaeftsfuehrer: Robert Bauer, Andreas Gundel Sitz der Gesellschaft: D-86368 Gersthofen Registergericht: Amtsgericht Augsburg HRA 14521 ========================================== -----Ursprüngliche Nachricht----- Von: Liu Ying [mailto:liu.y.victor@gmail.com] Gesendet: Mittwoch, 6. August 2014 16:02 An: Priebe, Sebastian Cc: Sascha Hauer; devicetree@vger.kernel.org Betreff: Re: driver using another driver Hi Sebastian, 2014-08-01 17:08 GMT+08:00 Priebe, Sebastian <Sebastian.Priebe@cadcon.de>: Hello Sascha, I don't register a platform driver manually anymore. As I wrote before, I turned the CPLD driver in a platform driver and created an entry in the device tree. But I get an error in the probe: res = platform_get_resource(pdev, IORESOURCE_MEM, 0) returns NULL. Does your kernel contain this patch[1]? This patch is needed to populate the devices on the simple bus of i.MX WEIM. And, it has been queued in linux-next. [1] https://lkml.org/lkml/2014/7/4/129 Regards, Liu Ying Greetings Sebastian Priebe Telefon: +49 (0)621 685996-26 <tel:%2B49%20%280%29621%20685996-26> ========================================== CADCON Ingenieurgesellschaft mbH & Co. KG Geschaeftsfuehrer: Robert Bauer, Andreas Gundel Sitz der Gesellschaft: D-86368 Gersthofen Registergericht: Amtsgericht Augsburg HRA 14521 ========================================== -----Ursprüngliche Nachricht----- Von: Sascha Hauer [mailto:s.hauer@pengutronix.de] Gesendet: Freitag, 1. August 2014 10:52 An: Priebe, Sebastian Cc: devicetree@vger.kernel.org Betreff: Re: driver using another driver On Fri, Aug 01, 2014 at 07:15:41AM +0000, Priebe, Sebastian wrote: > Hello Sascha, > > thanks for your answer. > We are using an imx35 cpu and our CPLD is in fact connected via weim (CS1). > Though I created the following device node in our dts: > &weim { > pinctrl-names = "default"; > status = "okay"; > > pld@1,0 { > compatible = "roche,hbm-pld"; > reg = <1 0x00000000 0x0001000>; > fsl,weim-cs-timing = <0x0 0x0 0x0>; /* don't know what to put here */ > }; > }; > > And I turned the CPLD driver into a platform driver. But I don't get the resource in probe: > res = platform_get_resource(pdev, IORESOURCE_MEM, 0) returns NULL. > > In our platform code we had: > static struct resource hbm_pld_resource_data = { > .start = 0xA8000000, > .end = 0xA8000000 + 0x1000 - 1, > .flags = IORESOURCE_MEM, > }; Why do you manually register a platform_device? You should add the CPLD device to the device tree instead. > > And for the setting of CS1: > __raw_writel((0x22 << 8), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + > 0x10); __raw_writel(((0x0a << 28) | (0x06 << 12) | (0x03 << 8) | (0x04 > << 4) | (0x01 << 0)), MX35_IO_ADDRESS(MX3x_WEIM_BASE_ADDR) + 0x14); > > Where do I put this in the device tree? In the fsl,weim-cs-timing property. See Documentation/devicetree/bindings/bus/imx-weim.txt Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 <tel:%2B49-5121-206917-0> | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 <tel:%2B49-5121-206917-5555> | -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards, Liu Ying N§²æìr¸yúèØb²X¬¶Ç§vØ^)Þº{.nÇ+·zøzÚÞz)í æèw*\x1fjg¬±¨\x1e¶Ý¢j.ïÛ°\½½MúgjÌæa×\x02' ©Þ¢¸\f¢·¦j:+v¨wèjØm¶ÿ¾\a«êçzZ+ùÝ¢j"ú!¶i ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-08-07 7:49 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-07-30 14:45 driver using another driver Priebe, Sebastian [not found] ` <E70AF999396FDF4EAE40E195B84709611F84671F-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org> 2014-08-01 6:31 ` Sascha Hauer [not found] ` <20140801063105.GV23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 2014-08-01 7:15 ` AW: " Priebe, Sebastian [not found] ` <E70AF999396FDF4EAE40E195B84709611F847086-VHQhki0MIenpQFNhCJRnZ0Yy6alPw7Wn0MAMd6zgKLc@public.gmane.org> 2014-08-01 8:51 ` Sascha Hauer [not found] ` <20140801085148.GW23235-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 2014-08-01 9:08 ` AW: " Priebe, Sebastian [not found] ` <CA+8Hj81tTdCMm-we8F6ZbNq8wPVWsEZZ8tYixLN3--tjiQpyfw@mail.gmail.com> [not found] ` <CA+8Hj81tTdCMm-we8F6ZbNq8wPVWsEZZ8tYixLN3--tjiQpyfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2014-08-07 7:49 ` Priebe, Sebastian
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).