Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1404468

[PATCH 10/20] staging: comedi: drivers: re-do PLX PCI 9080 DMCFGA register values

From Ian Abbott <abbotti@mev.co.uk>
Newsgroups linux.kernel
Subject [PATCH 10/20] staging: comedi: drivers: re-do PLX PCI 9080 DMCFGA register values
Date 2016-05-20 16:00 +0200
Message-ID <rAT87-6ck-37@gated-at.bofh.it> (permalink)
References <rASYp-68P-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Replace the existing macros in "plx9080.h" that define values for the
DMCFGA register.  Use the prefix `PLX_DMCFGA_` for the macros.  Make use
of the `BIT(x)` and `GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/plx9080.h | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/plx9080.h b/drivers/staging/comedi/drivers/plx9080.h
index ab90837..e544327 100644
--- a/drivers/staging/comedi/drivers/plx9080.h
+++ b/drivers/staging/comedi/drivers/plx9080.h
@@ -266,13 +266,28 @@ struct plx_dma_desc {
 /* PCI Configuration Address Register for Direct Master to PCI IO/CFG */
 #define PLX_REG_DMCFGA		0x002c
 
-#define  CAR_CT0           0x00000000	/* Config Type 0 */
-#define  CAR_CT1           0x00000001	/* Config Type 1 */
-#define  CAR_REG           0x000000FC	/* Register Number Bits */
-#define  CAR_FUN           0x00000700	/* Function Number Bits */
-#define  CAR_DEV           0x0000F800	/* Device Number Bits */
-#define  CAR_BUS           0x00FF0000	/* Bus Number Bits */
-#define  CAR_CFG           0x80000000	/* Config Spc Access Enable */
+/* Congiguration Type */
+#define PLX_DMCFGA_TYPE0	(BIT(0) * 0)
+#define PLX_DMCFGA_TYPE1	(BIT(0) * 1)
+#define PLX_DMCFGA_TYPE_MASK	GENMASK(1, 0)
+/* Register Number */
+#define PLX_DMCFGA_REGNUM(x)	(BIT(2) * ((x) & 0x3f))
+#define PLX_DMCFGA_REGNUM_MASK	GENMASK(7, 2)
+#define PLX_DMCFGA_REGNUM_SHIFT	2
+/* Function Number */
+#define PLX_DMCFGA_FUNCNUM(x)	(BIT(8) * ((x) & 0x7))
+#define PLX_DMCFGA_FUNCNUM_MASK	GENMASK(10, 8)
+#define PLX_DMCFGA_FUNCNUM_SHIFT 8
+/* Device Number */
+#define PLX_DMCFGA_DEVNUM(x)	(BIT(11) * ((x) & 0x1f))
+#define PLX_DMCFGA_DEVNUM_MASK	GENMASK(15, 11)
+#define PLX_DMCFGA_DEVNUM_SHIFT	11
+/* Bus Number */
+#define PLX_DMCFGA_BUSNUM(x)	(BIT(16) * ((x) & 0xff))
+#define PLX_DMCFGA_BUSNUM_MASK	GENMASK(23, 16)
+#define PLX_DMCFGA_BUSNUM_SHIFT	16
+/* Configuration Enable */
+#define PLX_DMCFGA_CONFIGEN	BIT(31)
 
 /*
  * Mailbox Register N (N <= 7)
-- 
2.8.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/20] staging: comedi: re-do drivers/plx9080.h Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 15:50 +0200
  [PATCH 20/20] staging: comedi: plx9080.h: include headers for declarations Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 16/20] staging: comedi: drivers: re-do PLX PCI 9080 DMACSRx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 14/20] staging: comedi: drivers: re-do PLX PCI 9080 DMAMODEx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 18/20] staging: comedi: plx9080.h: tidy up some comments Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 15/20] staging: comedi: drivers: re-do PLX PCI 9080 DMADPRx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 13/20] staging: comedi: plx9080.h: add hard-coded PCIHIDR register value Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 01/20] staging: comedi: plx9080.h: correct LRNG_IO_MASK and LMAP_IO_MASK Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 09/20] staging: comedi: drivers: re-do PLX PCI 9080 DMPBAM register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 07/20] staging: comedi: drivers: re-do PLX PCI 9080 BIGEND register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 06/20] staging: comedi: drivers: re-do PLX PCI 9080 MARBR register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 05/20] staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 19/20] staging: comedi: plx9080.h: Add kerneldoc comments Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 12/20] staging: comedi: drivers: re-do PLX PCI 9080 CNTRL register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 10/20] staging: comedi: drivers: re-do PLX PCI 9080 DMCFGA register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 11/20] staging: comedi: drivers: re-do PLX PCI 9080 INTCSR register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 17/20] staging: comedi: drivers: add PLX PCI 9080 DMATHR register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 08/20] staging: comedi: drivers: re-do PLX PCI 9080 LBRDx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080 register offsets Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
    RE: [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080  register offsets Hartley Sweeten <HartleyS@visionengravers.com> - 2016-05-20 18:30 +0200
      Re: [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080  register offsets Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 18:40 +0200
        RE: [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080  register offsets Hartley Sweeten <HartleyS@visionengravers.com> - 2016-05-20 19:00 +0200

csiph-web