Re: [PATCH] Simple tidy up of puc(4) bus driver

2011-06-15 Thread Alexey Shuvaev
On Tue, Jun 14, 2011 at 11:34:34AM -0400, John Baldwin wrote:
 On Tuesday, June 14, 2011 10:44:18 am Alexey Shuvaev wrote:
  On Fri, Jun 10, 2011 at 03:11:02PM -0400, John Baldwin wrote:
   On Monday, May 23, 2011 10:39:02 am John Baldwin wrote:
This small patch makes the puc(4) bus drivers a little more friendly.  
It 
should now list the port for each child device in the boot messages, 
and 
devinfo -v should list the type and port of each child device in its 
output as 
well:
   
   Can I get a volunteer to test these changes?
   
  Would it be OK to use r202285 as a base for your patch?
  If so, I will test it today/tomorrow. If not, it will take a little bit
  longer...
 
 Yes, it should apply fine to that.  It doesn't touch pucdata.c which is the
 only thing in the puc driver that has changed since that revision.  Thanks!
 
Seems to work fine. Attached are relevant diff-s of dmesg.boot and
devinfo -v output.

Alexey.
--- dmesg.boot_old  2011-06-15 16:18:52.0 +0200
+++ dmesg.boot_new  2011-06-15 16:23:56.0 +0200
@@ -49,11 +49,11 @@
 pcm0: Analog Devices AD1881A AC97 Codec
 puc0: NetMos NM9835 Dual UART and 1284 Printer port port 
0x7c00-0x7c07,0x8000-0x8007,0x8400-0x8407,0x8800-0x8807,0x8c00-0x8c07,0x9000-0x900f
 irq 7 at device 10.0 on pci0
 puc0: [FILTER]
-uart2: Non-standard ns8250 class UART with FIFOs on puc0
+uart2: Non-standard ns8250 class UART with FIFOs at port 1 on puc0
 uart2: [FILTER]
-uart3: Non-standard ns8250 class UART with FIFOs on puc0
+uart3: Non-standard ns8250 class UART with FIFOs at port 2 on puc0
 uart3: [FILTER]
-ppc0: Parallel port on puc0
+ppc0: Parallel port at port 3 on puc0
 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
 ppc0: FIFO with 16/16/12 bytes threshold
 ppbus0: Parallel port bus on ppc0
--- devinfo_old 2011-06-15 16:19:03.0 +0200
+++ devinfo_new 2011-06-15 16:24:02.0 +0200
@@ -38,9 +38,9 @@
 hostb1 pnpinfo vendor=0x1106 device=0x3057 subvendor=0x 
subdevice=0x class=0x06 at slot=7 function=4 handle=\_SB_.PCI0.VTAC
 pcm0 pnpinfo vendor=0x1106 device=0x3058 subvendor=0x11d6 
subdevice=0x7358 class=0x040100 at slot=7 function=5
 puc0 pnpinfo vendor=0x9710 device=0x9835 subvendor=0x1000 
subdevice=0x0012 class=0x078000 at slot=10 function=0
-  uart2
-  uart3
-  ppc0
+  uart2 pnpinfo type=1 at port=1
+  uart3 pnpinfo type=1 at port=2
+  ppc0 pnpinfo type=2 at port=3
 ppbus0
   plip0
   lpt0
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: [PATCH] Simple tidy up of puc(4) bus driver

2011-06-14 Thread Alexey Shuvaev
On Fri, Jun 10, 2011 at 03:11:02PM -0400, John Baldwin wrote:
 On Monday, May 23, 2011 10:39:02 am John Baldwin wrote:
  This small patch makes the puc(4) bus drivers a little more friendly.  It 
  should now list the port for each child device in the boot messages, and 
  devinfo -v should list the type and port of each child device in its output 
  as 
  well:
 
 Can I get a volunteer to test these changes?
 
Would it be OK to use r202285 as a base for your patch?
If so, I will test it today/tomorrow. If not, it will take a little bit
longer...

Alexey.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] Simple tidy up of puc(4) bus driver

2011-06-14 Thread John Baldwin
On Tuesday, June 14, 2011 10:44:18 am Alexey Shuvaev wrote:
 On Fri, Jun 10, 2011 at 03:11:02PM -0400, John Baldwin wrote:
  On Monday, May 23, 2011 10:39:02 am John Baldwin wrote:
   This small patch makes the puc(4) bus drivers a little more friendly.  It 
   should now list the port for each child device in the boot messages, and 
   devinfo -v should list the type and port of each child device in its 
   output as 
   well:
  
  Can I get a volunteer to test these changes?
  
 Would it be OK to use r202285 as a base for your patch?
 If so, I will test it today/tomorrow. If not, it will take a little bit
 longer...

Yes, it should apply fine to that.  It doesn't touch pucdata.c which is the
only thing in the puc driver that has changed since that revision.  Thanks!

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] Simple tidy up of puc(4) bus driver

2011-06-14 Thread Boris Samorodov
On Fri, 10 Jun 2011 15:11:02 -0400 John Baldwin wrote:

 On Monday, May 23, 2011 10:39:02 am John Baldwin wrote:
  This small patch makes the puc(4) bus drivers a little more friendly.  It 
  should now list the port for each child device in the boot messages, and 
  devinfo -v should list the type and port of each child device in its output 
  as 
  well:

 Can I get a volunteer to test these changes?

Seems to be OK:
-
% uname -a
FreeBSD bb.ipt.ru 9.0-CURRENT FreeBSD 9.0-CURRENT #3 r223003M: Tue Jun 14 
20:37:38 MSD 2011 r...@bb.ipt.ru:/usr/obj/usr/src/sys/BB  i386
-

Messages and devinfo from the patched kernel:
-
puc0: Oxford Semiconductor OX16PCI958 UARTs port 
0xec00-0xec7f,0xe880-0xe8bf,0xe800-0xe80f mem 
0xfebffc00-0xfebffc7f,0xfebff800-0xfebff83f,0xfebff400-0xfebff40f irq 16 at 
device 0.0 on pci5
uart2: 16550 or compatible at port 1 on puc0
uart3: 16550 or compatible at port 2 on puc0
uart4: 16550 or compatible at port 3 on puc0
uart5: 16550 or compatible at port 4 on puc0
uart6: 16550 or compatible at port 5 on puc0
uart7: 16550 or compatible at port 6 on puc0
uart8: 16550 or compatible at port 7 on puc0
uart9: 16550 or compatible at port 8 on puc0
---
  pci5
puc0 pnpinfo vendor=0x1415 device=0x9538 subvendor=0x1415 
subdevice=0x0671 class=0x070200 at slot=0 function=0
  uart2 pnpinfo type=1 at port=1
  uart3 pnpinfo type=1 at port=2
  uart4 pnpinfo type=1 at port=3
  uart5 pnpinfo type=1 at port=4
  uart6 pnpinfo type=1 at port=5
  uart7 pnpinfo type=1 at port=6
  uart8 pnpinfo type=1 at port=7
  uart9 pnpinfo type=1 at port=8
-

-- 
WBR, Boris Samorodov (bsam)
Research Engineer, http://www.ipt.ru Telephone  Internet SP
FreeBSD Committer, http://www.FreeBSD.org The Power To Serve
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] Simple tidy up of puc(4) bus driver

2011-06-14 Thread John Baldwin
On Tuesday, June 14, 2011 12:56:31 pm Boris Samorodov wrote:
 On Fri, 10 Jun 2011 15:11:02 -0400 John Baldwin wrote:
 
  On Monday, May 23, 2011 10:39:02 am John Baldwin wrote:
   This small patch makes the puc(4) bus drivers a little more friendly.  It 
   should now list the port for each child device in the boot messages, and 
   devinfo -v should list the type and port of each child device in its 
   output as 
   well:
 
  Can I get a volunteer to test these changes?
 
 Seems to be OK:

Great, thanks for testing!

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] Simple tidy up of puc(4) bus driver

2011-06-10 Thread John Baldwin
On Monday, May 23, 2011 10:39:02 am John Baldwin wrote:
 This small patch makes the puc(4) bus drivers a little more friendly.  It 
 should now list the port for each child device in the boot messages, and 
 devinfo -v should list the type and port of each child device in its output 
 as 
 well:

Can I get a volunteer to test these changes?

 
 Index: puc_pci.c
 ===
 --- puc_pci.c (revision 222126)
 +++ puc_pci.c (working copy)
 @@ -132,7 +132,9 @@
  DEVMETHOD(bus_read_ivar, puc_bus_read_ivar),
  DEVMETHOD(bus_setup_intr,puc_bus_setup_intr),
  DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr),
 -DEVMETHOD(bus_print_child,   bus_generic_print_child),
 +DEVMETHOD(bus_print_child,   puc_bus_print_child),
 +DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str),
 +DEVMETHOD(bus_child_location_str,puc_bus_child_location_str),
  DEVMETHOD(bus_driver_added,  bus_generic_driver_added),
  { 0, 0 }
  };
 Index: puc_pccard.c
 ===
 --- puc_pccard.c  (revision 222126)
 +++ puc_pccard.c  (working copy)
 @@ -82,7 +82,9 @@
  DEVMETHOD(bus_read_ivar, puc_bus_read_ivar),
  DEVMETHOD(bus_setup_intr,puc_bus_setup_intr),
  DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr),
 -DEVMETHOD(bus_print_child,   bus_generic_print_child),
 +DEVMETHOD(bus_print_child,   puc_bus_print_child),
 +DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str),
 +DEVMETHOD(bus_child_location_str,puc_bus_child_location_str),
  DEVMETHOD(bus_driver_added,  bus_generic_driver_added),
  { 0, 0 }
  };
 Index: puc.c
 ===
 --- puc.c (revision 222126)
 +++ puc.c (working copy)
 @@ -726,3 +726,41 @@
   }
   return (0);
  }
 +
 +int
 +puc_bus_print_child(device_t dev, device_t child)
 +{
 + struct puc_port *port;
 + int retval;
 +
 + port = device_get_ivars(child);
 + retval = 0;
 +
 + retval += bus_print_child_header(dev, child);
 + retval += printf( at port %d, port-p_nr);
 + retval += bus_print_child_footer(dev, child);
 +
 + return (retval);
 +}
 +
 +int
 +puc_bus_child_location_str(device_t dev, device_t child, char *buf,
 +size_t buflen)
 +{
 + struct puc_port *port;
 +
 + port = device_get_ivars(child);
 + snprintf(buf, buflen, port=%d, port-p_nr);
 + return (0);
 +}
 +
 +int
 +puc_bus_child_pnpinfo_str(device_t dev, device_t child, char *buf,
 +size_t buflen)
 +{
 + struct puc_port *port;
 +
 + port = device_get_ivars(child);
 + snprintf(buf, buflen, type=%d, port-p_type);
 + return (0);
 +}
 Index: puc_bfe.h
 ===
 --- puc_bfe.h (revision 222126)
 +++ puc_bfe.h (working copy)
 @@ -82,9 +82,12 @@
  int puc_bfe_detach(device_t);
  int puc_bfe_probe(device_t, const struct puc_cfg *);
  
 +int puc_bus_child_location_str(device_t, device_t, char *, size_t);
 +int puc_bus_child_pnpinfo_str(device_t, device_t, char *, size_t);
  struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *, 
 u_long,
  u_long, u_long, u_int);
  int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
 +int puc_bus_print_child(device_t, device_t);
  int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
  int puc_bus_release_resource(device_t, device_t, int, int, struct resource 
 *);
  int puc_bus_setup_intr(device_t, device_t, struct resource *, int,
 

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


[PATCH] Simple tidy up of puc(4) bus driver

2011-05-23 Thread John Baldwin
This small patch makes the puc(4) bus drivers a little more friendly.  It 
should now list the port for each child device in the boot messages, and 
devinfo -v should list the type and port of each child device in its output as 
well:

Index: puc_pci.c
===
--- puc_pci.c   (revision 222126)
+++ puc_pci.c   (working copy)
@@ -132,7 +132,9 @@
 DEVMETHOD(bus_read_ivar,   puc_bus_read_ivar),
 DEVMETHOD(bus_setup_intr,  puc_bus_setup_intr),
 DEVMETHOD(bus_teardown_intr,   puc_bus_teardown_intr),
-DEVMETHOD(bus_print_child, bus_generic_print_child),
+DEVMETHOD(bus_print_child, puc_bus_print_child),
+DEVMETHOD(bus_child_pnpinfo_str,   puc_bus_child_pnpinfo_str),
+DEVMETHOD(bus_child_location_str,  puc_bus_child_location_str),
 DEVMETHOD(bus_driver_added,bus_generic_driver_added),
 { 0, 0 }
 };
Index: puc_pccard.c
===
--- puc_pccard.c(revision 222126)
+++ puc_pccard.c(working copy)
@@ -82,7 +82,9 @@
 DEVMETHOD(bus_read_ivar,   puc_bus_read_ivar),
 DEVMETHOD(bus_setup_intr,  puc_bus_setup_intr),
 DEVMETHOD(bus_teardown_intr,   puc_bus_teardown_intr),
-DEVMETHOD(bus_print_child, bus_generic_print_child),
+DEVMETHOD(bus_print_child, puc_bus_print_child),
+DEVMETHOD(bus_child_pnpinfo_str,   puc_bus_child_pnpinfo_str),
+DEVMETHOD(bus_child_location_str,  puc_bus_child_location_str),
 DEVMETHOD(bus_driver_added,bus_generic_driver_added),
 { 0, 0 }
 };
Index: puc.c
===
--- puc.c   (revision 222126)
+++ puc.c   (working copy)
@@ -726,3 +726,41 @@
}
return (0);
 }
+
+int
+puc_bus_print_child(device_t dev, device_t child)
+{
+   struct puc_port *port;
+   int retval;
+
+   port = device_get_ivars(child);
+   retval = 0;
+
+   retval += bus_print_child_header(dev, child);
+   retval += printf( at port %d, port-p_nr);
+   retval += bus_print_child_footer(dev, child);
+
+   return (retval);
+}
+
+int
+puc_bus_child_location_str(device_t dev, device_t child, char *buf,
+size_t buflen)
+{
+   struct puc_port *port;
+
+   port = device_get_ivars(child);
+   snprintf(buf, buflen, port=%d, port-p_nr);
+   return (0);
+}
+
+int
+puc_bus_child_pnpinfo_str(device_t dev, device_t child, char *buf,
+size_t buflen)
+{
+   struct puc_port *port;
+
+   port = device_get_ivars(child);
+   snprintf(buf, buflen, type=%d, port-p_type);
+   return (0);
+}
Index: puc_bfe.h
===
--- puc_bfe.h   (revision 222126)
+++ puc_bfe.h   (working copy)
@@ -82,9 +82,12 @@
 int puc_bfe_detach(device_t);
 int puc_bfe_probe(device_t, const struct puc_cfg *);
 
+int puc_bus_child_location_str(device_t, device_t, char *, size_t);
+int puc_bus_child_pnpinfo_str(device_t, device_t, char *, size_t);
 struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *, 
u_long,
 u_long, u_long, u_int);
 int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
+int puc_bus_print_child(device_t, device_t);
 int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
 int puc_bus_release_resource(device_t, device_t, int, int, struct resource 
*);
 int puc_bus_setup_intr(device_t, device_t, struct resource *, int,

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org