From: Anton Vorontsov <hidden> Date: 2008-12-03 19:26:46
Hi Kumar,
Here are few patches queued for the next branch. The patches are
mostly USB related. Plus a trivial patch that fixes some sparse
warnings.
[PATCH 1/5] powerpc/qe: Implement QE Pin Multiplexing API
[PATCH 2/5] powerpc: Implement GPIO driver for simple memory-mapped banks
[PATCH 3/5] powerpc/83xx: Add USB Host/Gadget support for MPC8360E-MDS boards
[PATCH 4/5] powerpc/83xx: Add USB Host support for MPC8360E-RDK boards
[PATCH 5/5] powerpc/83xx: Fix sparse warnings in mpc836x_mds.c
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
From: Anton Vorontsov <hidden> Date: 2008-12-03 19:27:40
With this API we're able to set a QE pin to the GPIO mode or a dedicated
peripheral function.
The API relies on the fact that QE gpio controllers are registered. If
they aren't, the API won't work (gracefully though).
There is one caveat though: if anybody occupied the node->data before us,
or overwrote it, then bad things will happen. Luckily this is all in the
platform code that we fully control, so this should never happen.
I could implement more checks (for example we could create a list of
successfully registered QE controllers, and compare the node->data in the
qe_pin_request()), but this is unneeded if nobody is going to do silly
things behind our back.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/include/asm/qe.h | 21 ++++
arch/powerpc/sysdev/qe_lib/gpio.c | 195 +++++++++++++++++++++++++++++++++++++
2 files changed, 216 insertions(+), 0 deletions(-)
@@ -112,6 +114,25 @@ extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,intassignment,inthas_irq);externintpar_io_data_set(u8port,u8pin,u8val);+/*+*Pinmultiplexingfunctions.+*/+structqe_pin;+#ifdef CONFIG_QE_GPIO+externstructqe_pin*qe_pin_request(structdevice_node*np,intindex);+externvoidqe_pin_free(structqe_pin*qe_pin);+externvoidqe_pin_set_gpio(structqe_pin*qe_pin);+externvoidqe_pin_set_dedicated(structqe_pin*pin);+#else+staticinlinestructqe_pin*qe_pin_request(structdevice_node*np,intindex)+{+returnERR_PTR(-ENOSYS);+}+staticinlinevoidqe_pin_free(structqe_pin*qe_pin){}+staticinlinevoidqe_pin_set_gpio(structqe_pin*qe_pin){}+staticinlinevoidqe_pin_set_dedicated(structqe_pin*pin){}+#endif /* CONFIG_QE_GPIO */+/* QE internal API */intqe_issue_cmd(u32cmd,u32device,u8mcn_protocol,u32cmd_input);enumqe_clockqe_clock_source(constchar*source);
@@ -103,6 +116,188 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)return0;}+structqe_pin{+/*+*Theqe_gpio_chipnameisunfortunate,weshouldchangethatto+*somethinglikeqe_pio_controller.Someday.+*/+structqe_gpio_chip*controller;+intnum;+};++/**+*qe_pin_request-RequestaQEpin+*@np:devicenodetogetapinfrom+*@index:indexofapininthedevicetree+*Context:non-atomic+*+*Thisfunctionreturnqe_pinsothatyoucoulduseitwiththerestof+*theQEPinMultiplexingAPI.+*/+structqe_pin*qe_pin_request(structdevice_node*np,intindex)+{+structqe_pin*qe_pin;+structdevice_node*gc;+structof_gpio_chip*of_gc=NULL;+structof_mm_gpio_chip*mm_gc;+structqe_gpio_chip*qe_gc;+interr;+intsize;+constvoid*gpio_spec;+constu32*gpio_cells;+unsignedlongflags;++qe_pin=kzalloc(sizeof(*qe_pin),GFP_KERNEL);+if(!qe_pin){+pr_debug("%s: can't allocate memory\n",__func__);+returnERR_PTR(-ENOMEM);+}++err=of_parse_phandles_with_args(np,"gpios","#gpio-cells",index,+&gc,&gpio_spec);+if(err){+pr_debug("%s: can't parse gpios property\n",__func__);+gotoerr0;+}++if(!of_device_is_compatible(gc,"fsl,mpc8323-qe-pario-bank")){+pr_debug("%s: tried to get a non-qe pin\n",__func__);+err=-EINVAL;+gotoerr1;+}++of_gc=gc->data;+if(!of_gc){+pr_debug("%s: gpio controller %s isn't registered\n",+np->full_name,gc->full_name);+err=-ENODEV;+gotoerr1;+}++gpio_cells=of_get_property(gc,"#gpio-cells",&size);+if(!gpio_cells||size!=sizeof(*gpio_cells)||+*gpio_cells!=of_gc->gpio_cells){+pr_debug("%s: wrong #gpio-cells for %s\n",+np->full_name,gc->full_name);+err=-EINVAL;+gotoerr1;+}++err=of_gc->xlate(of_gc,np,gpio_spec,NULL);+if(err<0)+gotoerr1;++mm_gc=to_of_mm_gpio_chip(&of_gc->gc);+qe_gc=to_qe_gpio_chip(mm_gc);++spin_lock_irqsave(&qe_gc->lock,flags);++if(test_and_set_bit(QE_PIN_REQUESTED,&qe_gc->pin_flags[err])==0){+qe_pin->controller=qe_gc;+qe_pin->num=err;+err=0;+}else{+err=-EBUSY;+}++spin_unlock_irqrestore(&qe_gc->lock,flags);++if(!err)+returnqe_pin;+err1:+of_node_put(gc);+err0:+kfree(qe_pin);+pr_debug("%s failed with status %d\n",__func__,err);+returnERR_PTR(err);+}+EXPORT_SYMBOL(qe_pin_request);++/**+*qe_pin_free-Freeapin+*@qe_pin:pointertotheqe_pinstructure+*Context:any+*+*Thisfunctionfreestheqe_pinstructureandmakesapinavailable+*forfurtherqe_pin_request()calls.+*/+voidqe_pin_free(structqe_pin*qe_pin)+{+structqe_gpio_chip*qe_gc=qe_pin->controller;+unsignedlongflags;+constintpin=qe_pin->num;++spin_lock_irqsave(&qe_gc->lock,flags);+test_and_clear_bit(QE_PIN_REQUESTED,&qe_gc->pin_flags[pin]);+spin_unlock_irqrestore(&qe_gc->lock,flags);++kfree(qe_pin);+}+EXPORT_SYMBOL(qe_pin_free);++/**+*qe_pin_set_dedicated-Revertapintoadedicatedperipheralfunctionmode+*@qe_pin:pointertotheqe_pinstructure+*Context:any+*+*Thisfunctionresetsapintoadedicatedperipheralfunctionthat+*hasbeensetupbythefirmware.+*/+voidqe_pin_set_dedicated(structqe_pin*qe_pin)+{+structqe_gpio_chip*qe_gc=qe_pin->controller;+structqe_pio_regs__iomem*regs=qe_gc->mm_gc.regs;+structqe_pio_regs*sregs=&qe_gc->saved_regs;+intpin=qe_pin->num;+u32mask1=1<<(QE_PIO_PINS-(pin+1));+u32mask2=0x3<<(QE_PIO_PINS-(pin%(QE_PIO_PINS/2)+1)*2);+boolsecond_reg=pin>(QE_PIO_PINS/2)-1;+unsignedlongflags;++spin_lock_irqsave(&qe_gc->lock,flags);++if(second_reg){+clrsetbits_be32(®s->cpdir2,mask2,sregs->cpdir2&mask2);+clrsetbits_be32(®s->cppar2,mask2,sregs->cppar2&mask2);+}else{+clrsetbits_be32(®s->cpdir1,mask2,sregs->cpdir1&mask2);+clrsetbits_be32(®s->cppar1,mask2,sregs->cppar1&mask2);+}++if(sregs->cpdata&mask1)+qe_gc->cpdata|=mask1;+else+qe_gc->cpdata&=~mask1;++out_be32(®s->cpdata,qe_gc->cpdata);+clrsetbits_be32(®s->cpodr,mask1,sregs->cpodr&mask1);++spin_unlock_irqrestore(&qe_gc->lock,flags);+}+EXPORT_SYMBOL(qe_pin_set_dedicated);++/**+*qe_pin_set_gpio-SetapintotheGPIOmode+*@qe_pin:pointertotheqe_pinstructure+*Context:any+*+*ThisfunctionsetsapintotheGPIOmode.+*/+voidqe_pin_set_gpio(structqe_pin*qe_pin)+{+structqe_gpio_chip*qe_gc=qe_pin->controller;+structqe_pio_regs__iomem*regs=qe_gc->mm_gc.regs;+unsignedlongflags;++spin_lock_irqsave(&qe_gc->lock,flags);++/* Let's make it input by default, GPIO API is able to change that. */+__par_io_config_pin(regs,qe_pin->num,QE_PIO_DIR_IN,0,0,0);++spin_unlock_irqrestore(&qe_gc->lock,flags);+}+EXPORT_SYMBOL(qe_pin_set_gpio);+staticint__initqe_add_gpiochips(void){structdevice_node*np;
From: Anton Vorontsov <hidden> Date: 2008-12-17 15:41:13
On Wed, Dec 03, 2008 at 10:27:38PM +0300, Anton Vorontsov wrote:
With this API we're able to set a QE pin to the GPIO mode or a dedicated
peripheral function.
The API relies on the fact that QE gpio controllers are registered. If
they aren't, the API won't work (gracefully though).
There is one caveat though: if anybody occupied the node->data before us,
or overwrote it, then bad things will happen. Luckily this is all in the
platform code that we fully control, so this should never happen.
I could implement more checks (for example we could create a list of
successfully registered QE controllers, and compare the node->data in the
qe_pin_request()), but this is unneeded if nobody is going to do silly
things behind our back.
Signed-off-by: Anton Vorontsov <redacted>
---
Kumar, can you please merge this patch? It is the last patch that
holds the FHCI USB driver.
Thanks,
@@ -112,6 +114,25 @@ extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,intassignment,inthas_irq);externintpar_io_data_set(u8port,u8pin,u8val);+/*+*Pinmultiplexingfunctions.+*/+structqe_pin;+#ifdef CONFIG_QE_GPIO+externstructqe_pin*qe_pin_request(structdevice_node*np,intindex);+externvoidqe_pin_free(structqe_pin*qe_pin);+externvoidqe_pin_set_gpio(structqe_pin*qe_pin);+externvoidqe_pin_set_dedicated(structqe_pin*pin);+#else+staticinlinestructqe_pin*qe_pin_request(structdevice_node*np,intindex)+{+returnERR_PTR(-ENOSYS);+}+staticinlinevoidqe_pin_free(structqe_pin*qe_pin){}+staticinlinevoidqe_pin_set_gpio(structqe_pin*qe_pin){}+staticinlinevoidqe_pin_set_dedicated(structqe_pin*pin){}+#endif /* CONFIG_QE_GPIO */+/* QE internal API */intqe_issue_cmd(u32cmd,u32device,u8mcn_protocol,u32cmd_input);enumqe_clockqe_clock_source(constchar*source);
@@ -103,6 +116,188 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)return0;}+structqe_pin{+/*+*Theqe_gpio_chipnameisunfortunate,weshouldchangethatto+*somethinglikeqe_pio_controller.Someday.+*/+structqe_gpio_chip*controller;+intnum;+};++/**+*qe_pin_request-RequestaQEpin+*@np:devicenodetogetapinfrom+*@index:indexofapininthedevicetree+*Context:non-atomic+*+*Thisfunctionreturnqe_pinsothatyoucoulduseitwiththerestof+*theQEPinMultiplexingAPI.+*/+structqe_pin*qe_pin_request(structdevice_node*np,intindex)+{+structqe_pin*qe_pin;+structdevice_node*gc;+structof_gpio_chip*of_gc=NULL;+structof_mm_gpio_chip*mm_gc;+structqe_gpio_chip*qe_gc;+interr;+intsize;+constvoid*gpio_spec;+constu32*gpio_cells;+unsignedlongflags;++qe_pin=kzalloc(sizeof(*qe_pin),GFP_KERNEL);+if(!qe_pin){+pr_debug("%s: can't allocate memory\n",__func__);+returnERR_PTR(-ENOMEM);+}++err=of_parse_phandles_with_args(np,"gpios","#gpio-cells",index,+&gc,&gpio_spec);+if(err){+pr_debug("%s: can't parse gpios property\n",__func__);+gotoerr0;+}++if(!of_device_is_compatible(gc,"fsl,mpc8323-qe-pario-bank")){+pr_debug("%s: tried to get a non-qe pin\n",__func__);+err=-EINVAL;+gotoerr1;+}++of_gc=gc->data;+if(!of_gc){+pr_debug("%s: gpio controller %s isn't registered\n",+np->full_name,gc->full_name);+err=-ENODEV;+gotoerr1;+}++gpio_cells=of_get_property(gc,"#gpio-cells",&size);+if(!gpio_cells||size!=sizeof(*gpio_cells)||+*gpio_cells!=of_gc->gpio_cells){+pr_debug("%s: wrong #gpio-cells for %s\n",+np->full_name,gc->full_name);+err=-EINVAL;+gotoerr1;+}++err=of_gc->xlate(of_gc,np,gpio_spec,NULL);+if(err<0)+gotoerr1;++mm_gc=to_of_mm_gpio_chip(&of_gc->gc);+qe_gc=to_qe_gpio_chip(mm_gc);++spin_lock_irqsave(&qe_gc->lock,flags);++if(test_and_set_bit(QE_PIN_REQUESTED,&qe_gc->pin_flags[err])==0){+qe_pin->controller=qe_gc;+qe_pin->num=err;+err=0;+}else{+err=-EBUSY;+}++spin_unlock_irqrestore(&qe_gc->lock,flags);++if(!err)+returnqe_pin;+err1:+of_node_put(gc);+err0:+kfree(qe_pin);+pr_debug("%s failed with status %d\n",__func__,err);+returnERR_PTR(err);+}+EXPORT_SYMBOL(qe_pin_request);++/**+*qe_pin_free-Freeapin+*@qe_pin:pointertotheqe_pinstructure+*Context:any+*+*Thisfunctionfreestheqe_pinstructureandmakesapinavailable+*forfurtherqe_pin_request()calls.+*/+voidqe_pin_free(structqe_pin*qe_pin)+{+structqe_gpio_chip*qe_gc=qe_pin->controller;+unsignedlongflags;+constintpin=qe_pin->num;++spin_lock_irqsave(&qe_gc->lock,flags);+test_and_clear_bit(QE_PIN_REQUESTED,&qe_gc->pin_flags[pin]);+spin_unlock_irqrestore(&qe_gc->lock,flags);++kfree(qe_pin);+}+EXPORT_SYMBOL(qe_pin_free);++/**+*qe_pin_set_dedicated-Revertapintoadedicatedperipheralfunctionmode+*@qe_pin:pointertotheqe_pinstructure+*Context:any+*+*Thisfunctionresetsapintoadedicatedperipheralfunctionthat+*hasbeensetupbythefirmware.+*/+voidqe_pin_set_dedicated(structqe_pin*qe_pin)+{+structqe_gpio_chip*qe_gc=qe_pin->controller;+structqe_pio_regs__iomem*regs=qe_gc->mm_gc.regs;+structqe_pio_regs*sregs=&qe_gc->saved_regs;+intpin=qe_pin->num;+u32mask1=1<<(QE_PIO_PINS-(pin+1));+u32mask2=0x3<<(QE_PIO_PINS-(pin%(QE_PIO_PINS/2)+1)*2);+boolsecond_reg=pin>(QE_PIO_PINS/2)-1;+unsignedlongflags;++spin_lock_irqsave(&qe_gc->lock,flags);++if(second_reg){+clrsetbits_be32(®s->cpdir2,mask2,sregs->cpdir2&mask2);+clrsetbits_be32(®s->cppar2,mask2,sregs->cppar2&mask2);+}else{+clrsetbits_be32(®s->cpdir1,mask2,sregs->cpdir1&mask2);+clrsetbits_be32(®s->cppar1,mask2,sregs->cppar1&mask2);+}++if(sregs->cpdata&mask1)+qe_gc->cpdata|=mask1;+else+qe_gc->cpdata&=~mask1;++out_be32(®s->cpdata,qe_gc->cpdata);+clrsetbits_be32(®s->cpodr,mask1,sregs->cpodr&mask1);++spin_unlock_irqrestore(&qe_gc->lock,flags);+}+EXPORT_SYMBOL(qe_pin_set_dedicated);++/**+*qe_pin_set_gpio-SetapintotheGPIOmode+*@qe_pin:pointertotheqe_pinstructure+*Context:any+*+*ThisfunctionsetsapintotheGPIOmode.+*/+voidqe_pin_set_gpio(structqe_pin*qe_pin)+{+structqe_gpio_chip*qe_gc=qe_pin->controller;+structqe_pio_regs__iomem*regs=qe_gc->mm_gc.regs;+unsignedlongflags;++spin_lock_irqsave(&qe_gc->lock,flags);++/* Let's make it input by default, GPIO API is able to change that. */+__par_io_config_pin(regs,qe_pin->num,QE_PIO_DIR_IN,0,0,0);++spin_unlock_irqrestore(&qe_gc->lock,flags);+}+EXPORT_SYMBOL(qe_pin_set_gpio);+staticint__initqe_add_gpiochips(void){structdevice_node*np;
--
1.5.6.5
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
From: Kumar Gala <hidden> Date: 2008-12-17 16:48:24
On Dec 17, 2008, at 9:41 AM, Anton Vorontsov wrote:
On Wed, Dec 03, 2008 at 10:27:38PM +0300, Anton Vorontsov wrote:
quoted
With this API we're able to set a QE pin to the GPIO mode or a
dedicated
peripheral function.
The API relies on the fact that QE gpio controllers are registered.
If
they aren't, the API won't work (gracefully though).
There is one caveat though: if anybody occupied the node->data
before us,
or overwrote it, then bad things will happen. Luckily this is all
in the
platform code that we fully control, so this should never happen.
I could implement more checks (for example we could create a list of
successfully registered QE controllers, and compare the node->data
in the
qe_pin_request()), but this is unneeded if nobody is going to do
silly
things behind our back.
Signed-off-by: Anton Vorontsov <redacted>
---
Kumar, can you please merge this patch? It is the last patch that
holds the FHCI USB driver.
Thanks,
Will do. Can I get you to add kdoc comments for the API functions:
+extern struct qe_pin *qe_pin_request(struct device_node *np, int
index);
+extern void qe_pin_free(struct qe_pin *qe_pin);
+extern void qe_pin_set_gpio(struct qe_pin *qe_pin);
+extern void qe_pin_set_dedicated(struct qe_pin *pin);
- k
From: Anton Vorontsov <hidden> Date: 2008-12-17 16:55:55
On Wed, Dec 17, 2008 at 10:46:17AM -0600, Kumar Gala wrote:
On Dec 17, 2008, at 9:41 AM, Anton Vorontsov wrote:
quoted
On Wed, Dec 03, 2008 at 10:27:38PM +0300, Anton Vorontsov wrote:
quoted
With this API we're able to set a QE pin to the GPIO mode or a
dedicated
peripheral function.
The API relies on the fact that QE gpio controllers are registered.
If
they aren't, the API won't work (gracefully though).
There is one caveat though: if anybody occupied the node->data
before us,
or overwrote it, then bad things will happen. Luckily this is all in
the
platform code that we fully control, so this should never happen.
I could implement more checks (for example we could create a list of
successfully registered QE controllers, and compare the node->data
in the
qe_pin_request()), but this is unneeded if nobody is going to do
silly
things behind our back.
Signed-off-by: Anton Vorontsov <redacted>
---
Kumar, can you please merge this patch? It is the last patch that
holds the FHCI USB driver.
Thanks,
Will do. Can I get you to add kdoc comments for the API functions:
The functions already have kdoc comments (see qe_lib/gpio.c changes).
From: Kumar Gala <hidden> Date: 2008-12-17 16:49:42
On Dec 3, 2008, at 1:27 PM, Anton Vorontsov wrote:
With this API we're able to set a QE pin to the GPIO mode or a
dedicated
peripheral function.
The API relies on the fact that QE gpio controllers are registered. If
they aren't, the API won't work (gracefully though).
There is one caveat though: if anybody occupied the node->data
before us,
or overwrote it, then bad things will happen. Luckily this is all in
the
platform code that we fully control, so this should never happen.
I could implement more checks (for example we could create a list of
successfully registered QE controllers, and compare the node->data
in the
qe_pin_request()), but this is unneeded if nobody is going to do silly
things behind our back.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/include/asm/qe.h | 21 ++++
arch/powerpc/sysdev/qe_lib/gpio.c | 195 ++++++++++++++++++++++++++++
+++++++++
2 files changed, 216 insertions(+), 0 deletions(-)
From: Anton Vorontsov <hidden> Date: 2008-12-03 19:27:43
The driver supports very simple GPIO controllers, that is, when a
controller provides just a 'data' register. Such controllers may be
found in various BCSRs (Board's FPGAs used to control board's
switches, LEDs, chip-selects, Ethernet/USB PHY power, etc).
So far we support only 1-byte GPIO banks. Support for other widths may
be implemented when/if needed.
p.s.
To avoid "made up" compatible entries (like compatible = "simple-gpio"),
boards must call the simple_gpiochip_init() to pass the compatible
string.
Signed-off-by: Anton Vorontsov <redacted>
---
Documentation/powerpc/dts-bindings/fsl/board.txt | 30 ++++
arch/powerpc/platforms/Kconfig | 10 ++
arch/powerpc/sysdev/Makefile | 1 +
arch/powerpc/sysdev/simple_gpio.c | 156 ++++++++++++++++++++++
arch/powerpc/sysdev/simple_gpio.h | 15 ++
5 files changed, 212 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/sysdev/simple_gpio.c
create mode 100644 arch/powerpc/sysdev/simple_gpio.h
@@ -27,3 +27,33 @@ Example (MPC8610HPCD): compatible = "fsl,fpga-pixis"; reg = <0xe8000000 32>; };++* Freescale BCSR GPIO banks++Some BCSR registers act as simple GPIO controllers, each such+register can be represented by the gpio-controller node.++Required properities:+- compatible : Should be "fsl,<board>-bcsr-gpio";+- reg : Should contain the address and the lenght of the GPIO bank+ register;+- #gpio-cells : Should be two. The first cell is the pin number and the+ second cell is used to specify optional paramters (currently unused);+- gpio-controller : Marks the port as GPIO controller.++Example:++ bcsr@1,0 {+ #address-cells = <1>;+ #size-cells = <1>;+ compatible = "fsl,mpc8360mds-bcsr";+ reg = <1 0 0x8000>;+ ranges = <0 1 0 0x8000>;++ bcsr13: gpio-controller@d {+ #gpio-cells = <2>;+ compatible = "fsl,mpc8360mds-bcsr-gpio";+ reg = <0xd 1>;+ gpio-controller;+ };+ };
From: Kumar Gala <hidden> Date: 2008-12-17 16:58:15
On Dec 3, 2008, at 1:27 PM, Anton Vorontsov wrote:
The driver supports very simple GPIO controllers, that is, when a
controller provides just a 'data' register. Such controllers may be
found in various BCSRs (Board's FPGAs used to control board's
switches, LEDs, chip-selects, Ethernet/USB PHY power, etc).
So far we support only 1-byte GPIO banks. Support for other widths may
be implemented when/if needed.
p.s.
To avoid "made up" compatible entries (like compatible = "simple-
gpio"),
boards must call the simple_gpiochip_init() to pass the compatible
string.
Signed-off-by: Anton Vorontsov <redacted>
---
Documentation/powerpc/dts-bindings/fsl/board.txt | 30 ++++
can we pull this out of this patch. Since the fsl board specific
binding its 100% relevant to the generic support for simple_gpio. We
can also update the .dts for just gpio and Kconfig in that patch.
compatible = "fsl,fpga-pixis";
reg = <0xe8000000 32>;
};
+
+* Freescale BCSR GPIO banks
+
+Some BCSR registers act as simple GPIO controllers, each such
+register can be represented by the gpio-controller node.
+
+Required properities:
+- compatible : Should be "fsl,<board>-bcsr-gpio";
+- reg : Should contain the address and the lenght of the GPIO bank
+ register;
spelling - length
semicolon at add of register can be dropped.
+- #gpio-cells : Should be two. The first cell is the pin number and
the
+ second cell is used to specify optional paramters (currently
unused);
+- gpio-controller : Marks the port as GPIO controller.
+
+Example:
+
+ bcsr@1,0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,mpc8360mds-bcsr";
+ reg = <1 0 0x8000>;
+ ranges = <0 1 0 0x8000>;
+
+ bcsr13: gpio-controller@d {
+ #gpio-cells = <2>;
+ compatible = "fsl,mpc8360mds-bcsr-gpio";
+ reg = <0xd 1>;
+ gpio-controller;
+ };
+ };
From: Anton Vorontsov <hidden> Date: 2008-12-17 17:10:14
On Wed, Dec 17, 2008 at 10:56:08AM -0600, Kumar Gala wrote:
On Dec 3, 2008, at 1:27 PM, Anton Vorontsov wrote:
quoted
The driver supports very simple GPIO controllers, that is, when a
controller provides just a 'data' register. Such controllers may be
found in various BCSRs (Board's FPGAs used to control board's
switches, LEDs, chip-selects, Ethernet/USB PHY power, etc).
So far we support only 1-byte GPIO banks. Support for other widths may
be implemented when/if needed.
p.s.
To avoid "made up" compatible entries (like compatible = "simple-
gpio"),
boards must call the simple_gpiochip_init() to pass the compatible
string.
Signed-off-by: Anton Vorontsov <redacted>
---
Documentation/powerpc/dts-bindings/fsl/board.txt | 30 ++++
From: Anton Vorontsov <hidden> Date: 2008-12-03 19:27:45
- Update the device tree per QE USB bindings;
- Add timer (FSL GTM) node;
- Add gpio-controller node for BCSR13 bank (GPIOs on that bank
are used to control the USB transceiver);
- Set up other BCSR registers;
- Configure the QE Par IO.
The work is loosely based on Li Yang's patch[1], which was used
to support peripheral mode only.
[1] http://ozlabs.org/pipermail/linuxppc-dev/2008-August/061357.html
The s-o-b line of the original patch preserved here.
Signed-off-by: Li Yang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/boot/dts/mpc836x_mds.dts | 43 ++++++++++++++++-
arch/powerpc/platforms/83xx/mpc836x_mds.c | 75 +++++++++++++++++++++++++++++
2 files changed, 116 insertions(+), 2 deletions(-)
From: Kumar Gala <hidden> Date: 2008-12-17 17:01:18
On Dec 3, 2008, at 1:27 PM, Anton Vorontsov wrote:
- Update the device tree per QE USB bindings;
- Add timer (FSL GTM) node;
- Add gpio-controller node for BCSR13 bank (GPIOs on that bank
are used to control the USB transceiver);
- Set up other BCSR registers;
- Configure the QE Par IO.
Of these are they all in the kernel tree already? What I mean is QE
usb bindings in linus's tree? I know GTM timers is and this patch
series had the bcsr gpio. Similar question for qe par io. I think we
are good but clearly I leave much of QE to you & timur.
- k
From: Timur Tabi <hidden> Date: 2008-12-17 17:03:35
Kumar Gala wrote:
Of these are they all in the kernel tree already? What I mean is QE
usb bindings in linus's tree? I know GTM timers is and this patch
series had the bcsr gpio. Similar question for qe par io. I think we
are good but clearly I leave much of QE to you & timur.
These QE GPIO and USB patches have been floating around so long, that I think
it's important to get them in so that the functionality is available. I
reviewed them a while go and gave them my thumbs up, and I trust Anton, so I'm
sure these latest patches are OK.
--
Timur Tabi
Linux kernel developer at Freescale
From: Anton Vorontsov <hidden> Date: 2008-12-17 17:15:47
On Wed, Dec 17, 2008 at 10:59:09AM -0600, Kumar Gala wrote:
On Dec 3, 2008, at 1:27 PM, Anton Vorontsov wrote:
quoted
- Update the device tree per QE USB bindings;
- Add timer (FSL GTM) node;
- Add gpio-controller node for BCSR13 bank (GPIOs on that bank
are used to control the USB transceiver);
- Set up other BCSR registers;
- Configure the QE Par IO.
Of these are they all in the kernel tree already? What I mean is QE usb
bindings in linus's tree?
Yes, they're all in the Linus' tree already (except for simple/bcsr
gpio bindings, which are in this patch series).
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
From: Kumar Gala <hidden> Date: 2008-12-17 20:24:07
On Dec 17, 2008, at 11:15 AM, Anton Vorontsov wrote:
On Wed, Dec 17, 2008 at 10:59:09AM -0600, Kumar Gala wrote:
quoted
On Dec 3, 2008, at 1:27 PM, Anton Vorontsov wrote:
quoted
- Update the device tree per QE USB bindings;
- Add timer (FSL GTM) node;
- Add gpio-controller node for BCSR13 bank (GPIOs on that bank
are used to control the USB transceiver);
- Set up other BCSR registers;
- Configure the QE Par IO.
Of these are they all in the kernel tree already? What I mean is
QE usb
bindings in linus's tree?
Yes, they're all in the Linus' tree already (except for simple/bcsr
gpio bindings, which are in this patch series).
Ok. If you fixup my comment about splitting up patch 2/5 & 3/5 w/
regards to BCSR GPIO and repost the patch series (excluding 1/5 since
that is in my tree) I'll apply all these since they look good.
- k
From: Anton Vorontsov <hidden> Date: 2008-12-03 19:27:47
Simply add the usb node to support USB host on the MPC8360E-RDK
boards.
Currently U-Boot doesn't fill the clock-frequency property for
timer nodes, so for now we have to fill it manually.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/boot/dts/mpc836x_rdk.dts | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
From: Kumar Gala <hidden> Date: 2008-12-03 19:55:33
On Dec 3, 2008, at 1:26 PM, Anton Vorontsov wrote:
Hi Kumar,
Here are few patches queued for the next branch. The patches are
mostly USB related. Plus a trivial patch that fixes some sparse
warnings.
[PATCH 1/5] powerpc/qe: Implement QE Pin Multiplexing API
[PATCH 2/5] powerpc: Implement GPIO driver for simple memory-mapped
banks
[PATCH 3/5] powerpc/83xx: Add USB Host/Gadget support for MPC8360E-
MDS boards
[PATCH 4/5] powerpc/83xx: Add USB Host support for MPC8360E-RDK boards
[PATCH 5/5] powerpc/83xx: Fix sparse warnings in mpc836x_mds.c
Thanks,
Thanks.. Do you mind doing me a favor and updating the status of any
patches that are superceded on http://patchwork.ozlabs.org/
- k
From: Anton Vorontsov <hidden> Date: 2008-12-03 22:28:18
On Wed, Dec 03, 2008 at 01:53:26PM -0600, Kumar Gala wrote:
On Dec 3, 2008, at 1:26 PM, Anton Vorontsov wrote:
quoted
Hi Kumar,
Here are few patches queued for the next branch. The patches are
mostly USB related. Plus a trivial patch that fixes some sparse
warnings.
[PATCH 1/5] powerpc/qe: Implement QE Pin Multiplexing API
[PATCH 2/5] powerpc: Implement GPIO driver for simple memory-mapped
banks
[PATCH 3/5] powerpc/83xx: Add USB Host/Gadget support for MPC8360E-MDS
boards
[PATCH 4/5] powerpc/83xx: Add USB Host support for MPC8360E-RDK boards
[PATCH 5/5] powerpc/83xx: Fix sparse warnings in mpc836x_mds.c
Thanks,
Thanks.. Do you mind doing me a favor and updating the status of any
patches that are superceded on http://patchwork.ozlabs.org/
Wow, I can change status of my own patches.. super.
Done, plus I also set 'accepted' state for some patches that
were already merged in powerpc or other trees. Hope this is ok.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2