RE: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver

2008-07-09 Thread John Linn
These look like good comments from Peter.

Dmitry, how would you like to do this, would you prefer us to do an
incremental patch from the existing patch (V3)?  Or a new V4 for the
patch?

Peter, with regard to the data sheet, I would prefer not to put a
specific URL in as things always seem to get moved around so anything
beyond xilinx.com would likely be wrong sometime in the future.

Thanks,
John

 -Original Message-
 From: Peter Korsgaard [mailto:[EMAIL PROTECTED] On Behalf Of Peter
Korsgaard
 Sent: Tuesday, July 08, 2008 3:00 AM
 To: John Linn
 Cc: linuxppc-dev@ozlabs.org; [EMAIL PROTECTED];
[EMAIL PROTECTED];
 [EMAIL PROTECTED]; [EMAIL PROTECTED]; Sadanand
Mutyala
 Subject: Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2
driver
 
  John == John Linn [EMAIL PROTECTED] writes:
 
 Hi,
 
   Added a new driver for Xilinx XPS PS2 IP. This driver is
   a flat driver to better match the Linux driver pattern.
 
   Signed-off-by: Sadanand [EMAIL PROTECTED]
   Signed-off-by: John Linn [EMAIL PROTECTED]
   ---
   V2
  Updated the driver based on feedback from Dmitry, Peter, and
Grant.
  We believe Montavista copyright is still valid.
   V3
  Incorporated Dmitry and Grant's 2nd set of comments which were
some
  minor cleanup and removal of the mutex which was not needed.
 
drivers/input/serio/Kconfig  |5 +
drivers/input/serio/Makefile |1 +
drivers/input/serio/xilinx_ps2.c |  384
++
3 files changed, 390 insertions(+), 0 deletions(-)
create mode 100644 drivers/input/serio/xilinx_ps2.c
 
   diff --git a/drivers/input/serio/Kconfig
b/drivers/input/serio/Kconfig
   index ec4b661..0e62b39 100644
   --- a/drivers/input/serio/Kconfig
   +++ b/drivers/input/serio/Kconfig
   @@ -190,4 +190,9 @@ config SERIO_RAW
To compile this driver as a module, choose M here: the
module will be called serio_raw.
 
   +config SERIO_XILINX_XPS_PS2
   +  tristate Xilinx XPS PS/2 Controller Support
   +  help
   +This driver supports XPS PS/2 IP from Xilinx EDK.
   +
endif
   diff --git a/drivers/input/serio/Makefile
b/drivers/input/serio/Makefile
   index 38b8868..9b6c813 100644
   --- a/drivers/input/serio/Makefile
   +++ b/drivers/input/serio/Makefile
   @@ -21,3 +21,4 @@ obj-$(CONFIG_SERIO_PCIPS2)   += pcips2.o
obj-$(CONFIG_SERIO_MACEPS2)   += maceps2.o
obj-$(CONFIG_SERIO_LIBPS2)+= libps2.o
obj-$(CONFIG_SERIO_RAW)   += serio_raw.o
   +obj-$(CONFIG_SERIO_XILINX_XPS_PS2)+= xilinx_ps2.o
   diff --git a/drivers/input/serio/xilinx_ps2.c
b/drivers/input/serio/xilinx_ps2.c
   new file mode 100644
   index 000..e86f11b
   --- /dev/null
   +++ b/drivers/input/serio/xilinx_ps2.c
   @@ -0,0 +1,384 @@
   +/*
   + * Xilinx XPS PS/2 device driver
   + *
   + * (c) 2005 MontaVista Software, Inc.
   + * (c) 2008 Xilinx, Inc.
   + *
   + * This program is free software; you can redistribute it and/or
modify it
   + * under the terms of the GNU General Public License as published
by the
   + * Free Software Foundation; either version 2 of the License, or
(at your
   + * option) any later version.
   + *
   + * You should have received a copy of the GNU General Public
License along
   + * with this program; if not, write to the Free Software
Foundation, Inc.,
   + * 675 Mass Ave, Cambridge, MA 02139, USA.
   + */
   +
   +
   +#include linux/module.h
   +#include linux/serio.h
   +#include linux/interrupt.h
   +#include linux/errno.h
   +#include linux/init.h
   +#include linux/list.h
   +#include linux/io.h
   +
   +#include linux/of_device.h
   +#include linux/of_platform.h
   +
   +#define DRIVER_NAME   xilinx_ps2
   +
 
 Is there an online datasheet available somewhere on xilinx.com? (I
 couldn't find any right away) - If so, please add a link here.
 
   +/* Register offsets for the xps2 device */
   +#define XPS2_SRST_OFFSET  0x /* Software Reset register */
   +#define XPS2_STATUS_OFFSET0x0004 /* Status register */
   +#define XPS2_RX_DATA_OFFSET   0x0008 /* Receive Data
register */
   +#define XPS2_TX_DATA_OFFSET   0x000C /* Transmit Data
register */
   +#define XPS2_GIER_OFFSET  0x002C /* Global Interrupt Enable
reg */
   +#define XPS2_IPISR_OFFSET 0x0030 /* Interrupt Status register
*/
   +#define XPS2_IPIER_OFFSET 0x0038 /* Interrupt Enable register
*/
   +
   +/* Reset Register Bit Definitions */
   +#define XPS2_SRST_RESET   0x000A /* Software Reset  */
   +
   +/* Status Register Bit Positions */
   +#define XPS2_STATUS_RX_FULL   0x0001 /* Receive Full  */
   +#define XPS2_STATUS_TX_FULL   0x0002 /* Transmit Full  */
   +
   +/* Bit definitions for ISR/IER registers. Both the registers have
the same bit
   + * definitions and are only defined once. */
   +#define XPS2_IPIXR_WDT_TOUT   0x0001 /* Watchdog Timeout
Interrupt */
   +#define XPS2_IPIXR_TX_NOACK   0x0002

Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver

2008-07-09 Thread Dmitry Torokhov
On Wed, Jul 9, 2008 at 12:14 PM, John Linn [EMAIL PROTECTED] wrote:
 These look like good comments from Peter.

 Dmitry, how would you like to do this, would you prefer us to do an
 incremental patch from the existing patch (V3)?  Or a new V4 for the
 patch?


Incremental please. I already committed V3 to the 'next' branch and I
don't want to rebuild it unless the patch is completely broken so
incremental cleanup is the way to go.

Thanks.

-- 
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver

2008-07-08 Thread Peter Korsgaard
 John == John Linn [EMAIL PROTECTED] writes:

Hi,

  Added a new driver for Xilinx XPS PS2 IP. This driver is
  a flat driver to better match the Linux driver pattern.

  Signed-off-by: Sadanand [EMAIL PROTECTED]
  Signed-off-by: John Linn [EMAIL PROTECTED]
  ---
  V2
   Updated the driver based on feedback from Dmitry, Peter, and Grant.
   We believe Montavista copyright is still valid.
  V3
   Incorporated Dmitry and Grant's 2nd set of comments which were some
   minor cleanup and removal of the mutex which was not needed.
 
   drivers/input/serio/Kconfig  |5 +
   drivers/input/serio/Makefile |1 +
   drivers/input/serio/xilinx_ps2.c |  384 
  ++
   3 files changed, 390 insertions(+), 0 deletions(-)
   create mode 100644 drivers/input/serio/xilinx_ps2.c

  diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
  index ec4b661..0e62b39 100644
  --- a/drivers/input/serio/Kconfig
  +++ b/drivers/input/serio/Kconfig
  @@ -190,4 +190,9 @@ config SERIO_RAW
 To compile this driver as a module, choose M here: the
 module will be called serio_raw.
 
  +config SERIO_XILINX_XPS_PS2
  +tristate Xilinx XPS PS/2 Controller Support
  +help
  +  This driver supports XPS PS/2 IP from Xilinx EDK.
  +
   endif
  diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile
  index 38b8868..9b6c813 100644
  --- a/drivers/input/serio/Makefile
  +++ b/drivers/input/serio/Makefile
  @@ -21,3 +21,4 @@ obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o
   obj-$(CONFIG_SERIO_MACEPS2) += maceps2.o
   obj-$(CONFIG_SERIO_LIBPS2)  += libps2.o
   obj-$(CONFIG_SERIO_RAW) += serio_raw.o
  +obj-$(CONFIG_SERIO_XILINX_XPS_PS2)  += xilinx_ps2.o
  diff --git a/drivers/input/serio/xilinx_ps2.c 
  b/drivers/input/serio/xilinx_ps2.c
  new file mode 100644
  index 000..e86f11b
  --- /dev/null
  +++ b/drivers/input/serio/xilinx_ps2.c
  @@ -0,0 +1,384 @@
  +/*
  + * Xilinx XPS PS/2 device driver
  + *
  + * (c) 2005 MontaVista Software, Inc.
  + * (c) 2008 Xilinx, Inc.
  + *
  + * This program is free software; you can redistribute it and/or modify it
  + * under the terms of the GNU General Public License as published by the
  + * Free Software Foundation; either version 2 of the License, or (at your
  + * option) any later version.
  + *
  + * You should have received a copy of the GNU General Public License along
  + * with this program; if not, write to the Free Software Foundation, Inc.,
  + * 675 Mass Ave, Cambridge, MA 02139, USA.
  + */
  +
  +
  +#include linux/module.h
  +#include linux/serio.h
  +#include linux/interrupt.h
  +#include linux/errno.h
  +#include linux/init.h
  +#include linux/list.h
  +#include linux/io.h
  +
  +#include linux/of_device.h
  +#include linux/of_platform.h
  +
  +#define DRIVER_NAME xilinx_ps2
  +

Is there an online datasheet available somewhere on xilinx.com? (I
couldn't find any right away) - If so, please add a link here.

  +/* Register offsets for the xps2 device */
  +#define XPS2_SRST_OFFSET0x /* Software Reset register */
  +#define XPS2_STATUS_OFFSET  0x0004 /* Status register */
  +#define XPS2_RX_DATA_OFFSET 0x0008 /* Receive Data register */
  +#define XPS2_TX_DATA_OFFSET 0x000C /* Transmit Data register */
  +#define XPS2_GIER_OFFSET0x002C /* Global Interrupt Enable reg */
  +#define XPS2_IPISR_OFFSET   0x0030 /* Interrupt Status register */
  +#define XPS2_IPIER_OFFSET   0x0038 /* Interrupt Enable register */
  +
  +/* Reset Register Bit Definitions */
  +#define XPS2_SRST_RESET 0x000A /* Software Reset  */
  +
  +/* Status Register Bit Positions */
  +#define XPS2_STATUS_RX_FULL 0x0001 /* Receive Full  */
  +#define XPS2_STATUS_TX_FULL 0x0002 /* Transmit Full  */
  +
  +/* Bit definitions for ISR/IER registers. Both the registers have the same 
  bit
  + * definitions and are only defined once. */
  +#define XPS2_IPIXR_WDT_TOUT 0x0001 /* Watchdog Timeout Interrupt */
  +#define XPS2_IPIXR_TX_NOACK 0x0002 /* Transmit No ACK Interrupt */
  +#define XPS2_IPIXR_TX_ACK   0x0004 /* Transmit ACK (Data) Interrupt */
  +#define XPS2_IPIXR_RX_OVF   0x0008 /* Receive Overflow Interrupt */
  +#define XPS2_IPIXR_RX_ERR   0x0010 /* Receive Error Interrupt */
  +#define XPS2_IPIXR_RX_FULL  0x0020 /* Receive Data Interrupt */
  +
  +/* Mask for all the Transmit Interrupts */
  +#define XPS2_IPIXR_TX_ALL   (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_TX_ACK)
  +
  +/* Mask for all the Receive Interrupts */
  +#define XPS2_IPIXR_RX_ALL   (XPS2_IPIXR_RX_OVF | XPS2_IPIXR_RX_ERR |  \
  +XPS2_IPIXR_RX_FULL)
  +
  +/* Mask for all the Interrupts */
  +#define XPS2_IPIXR_ALL  (XPS2_IPIXR_TX_ALL | XPS2_IPIXR_RX_ALL 
  |  \
  +XPS2_IPIXR_WDT_TOUT)
  +
  +/* Global Interrupt Enable mask */
  +#define XPS2_GIER_GIE_MASK  

RE: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver

2008-07-07 Thread John Linn
Thanks Dmitry, appreciate the help.

Powerpc dependencies in the Kconfig sound right.  Sorry for not thinking
that thru well across all architectures. 

Do you want me to spin the patch again?

-- John

 -Original Message-
 From: [EMAIL PROTECTED]
[mailto:linuxppc-dev-
 [EMAIL PROTECTED] On Behalf Of Dmitry Torokhov
 Sent: Monday, July 07, 2008 12:20 PM
 To: John Linn
 Cc: Sadanand Mutyala; linuxppc-dev@ozlabs.org;
[EMAIL PROTECTED]
 Subject: Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2
driver
 
 On Mon, Jul 07, 2008 at 08:38:45AM -0700, John Linn wrote:
  Added a new driver for Xilinx XPS PS2 IP. This driver is
  a flat driver to better match the Linux driver pattern.
 
  Signed-off-by: Sadanand [EMAIL PROTECTED]
  Signed-off-by: John Linn [EMAIL PROTECTED]
 
 Looks good and I am ready to apply with the exception that compile
 errors out when i try to build on x86 (asm/prom.h is missing). Do we
 need some Kconfig dependencies added?
 
 --
 Dmitry
 ___
 Linuxppc-dev mailing list
 Linuxppc-dev@ozlabs.org
 https://ozlabs.org/mailman/listinfo/linuxppc-dev


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver

2008-07-07 Thread Dmitry Torokhov
On Mon, Jul 07, 2008 at 12:27:09PM -0600, John Linn wrote:
 Thanks Dmitry, appreciate the help.
 
 Powerpc dependencies in the Kconfig sound right.  Sorry for not thinking
 that thru well across all architectures. 
 
 Do you want me to spin the patch again?
 

Please send me incremental patch that implements proper Kconfig
dependencies and I will fold it all together on my side.

Thanks.

-- 
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev