Diff for /wikisrc/tutorials/bus_space_tutorial.mdwn between versions 1.9 and 1.10

version 1.9, 2013/06/23 15:10:46 version 1.10, 2013/06/29 12:37:00
Line 217  this knowledge yourself. Line 217  this knowledge yourself.
   
 -   Advanced Addition Acceleration registers  -   Advanced Addition Acceleration registers
   
 <table>  [[!table data="""
 <tr><th>Register Name</th><th>Offset</th><th>Description</th></tr>  Register Name   |Offset         |Description
 <tr><td>COMMAND</td><td>0x4</td><td>Register used to issue commands to the engine</td></tr>  COMMAND         |0x4            |Register used to issue commands to the engine
 <tr><td>DATA</td><td>0x8</td><td>Register used to load data to internal engine registers</td></tr>  DATA            |0x8            |Register used to load data to internal engine registers
 <tr><td>RESULT</td><td>0xC</td><td>Register used to store the result of arithmetic operation</td></tr>  RESULT          |0xC            |Register used to store the result of arithmetic operation
 </table>  """]]
   
 -   COMMAND register  -   COMMAND register
   
 <table>  [[!table data="""
 <tr><th>Bit</th><th>R/W</th><th>Description</th></tr>  Bit     |R/W    |Description
 <tr><td>0</td><td>W</td><td>Execute ADD operation on values loaded into internal register A and B</td></tr>  0       |W      |Execute ADD operation on values loaded into internal register A and B
 <tr><td>1</td><td>R/W</td><td>Select internal register A for access through DATA register</td></tr>  1       |R/W    |Select internal register A for access through DATA register
 <tr><td>2</td><td>R/W</td><td>Select internal register B for access through DATA register</td></tr>  2       |R/W    |Select internal register B for access through DATA register
 </table>  """]]
   
 -   Selecting internal register A and B at the same time will lead to  -   Selecting internal register A and B at the same time will lead to
     undefined behaviour      undefined behaviour
Line 240  this knowledge yourself. Line 240  this knowledge yourself.
   
 -   DATA register  -   DATA register
   
 <table>  [[!table data="""
 <tr><th>Bit</th><th>R/W</th><th>Description</th></tr>  Bit     |R/W    |Description
 <tr><td>0:31</td><td>R/W</td><td>Read/write the value in internal engine register</td></tr>  0:31    |R/W    |Read/write the value in internal engine register
 </table>  """]]
   
 -   RESULT register  -   RESULT register
   
 <table>  [[!table data="""
 <tr><th>Bit</th><th>R/W</th><th>Description</th></tr>  Bit     |R/W    |Description
 <tr><td>0:31</td><td>R</td><td>Holds the result of last ADD operation</td></tr>  0:31    |R      |Holds the result of last ADD operation
 </table>  """]]
   
 ### Our hardware - technical details (operation algorithm)  ### Our hardware - technical details (operation algorithm)
   
Line 401  this knowledge yourself. Line 401  this knowledge yourself.
 <!-- -->  <!-- -->
   
     #include <sys/cdefs.h>      #include <sys/cdefs.h>
     __KERNEL_RCSID(0, "$NetBSD: bus_space_tutorial.mdwn,v 1.8 2013/06/23 15:07:54 mspo Exp $");      __KERNEL_RCSID(0, "$NetBSD: bus_space_tutorial.mdwn,v 1.9 2013/06/23 15:10:46 mspo Exp $");
     #include <sys/param.h>      #include <sys/param.h>
     #include <sys/device.h>      #include <sys/device.h>
     #include <dev/pci/pcivar.h>      #include <dev/pci/pcivar.h>
Line 556  this knowledge yourself. Line 556  this knowledge yourself.
 -   bus\_space\_tag\_t  -   bus\_space\_tag\_t
   
     – type used to describe a particular bus, usually passed to the      – type used to describe a particular bus, usually passed to the
     driver from MI bus structures         driver from MI bus structures
   
 -   bus\_space\_handle\_t  -   bus\_space\_handle\_t
   
     – used to describe a mapped range of bus space, usually created with      – used to describe a mapped range of bus space, usually created with
     the bus\_space\_map() function         the bus\_space\_map() function
   
 -   bus\_addr\_t  -   bus\_addr\_t
   
Line 593  this knowledge yourself. Line 593  this knowledge yourself.
   
 -   bus\_space\_map  -   bus\_space\_map
   
     creates a mapping from the physical address to a kernel virtual      – creates a mapping from the physical address to a kernel virtual
     address      address
   
 -   space  -   space
Line 603  this knowledge yourself. Line 603  this knowledge yourself.
 -   address  -   address
   
     – typically represents the physical address for which a mapping will      – typically represents the physical address for which a mapping will
     be created         be created
   
 -   size  -   size
   
Line 627  this knowledge yourself. Line 627  this knowledge yourself.
   
 -   pci\_mapreg\_map  -   pci\_mapreg\_map
   
     creates mapping from physical address present in specified BAR      – creates mapping from physical address present in specified BAR
     register to kernel virtual address      register to kernel virtual address
   
 -   pa  -   pa
Line 644  this knowledge yourself. Line 644  this knowledge yourself.
   
 -   busflags  -   busflags
   
     – Passed to bus\_space\_map flags argument      – Passed to bbus_space_map flags argument
   
 -   tagp  -   tagp
   
     – pointer to bus\_space\_tag      – pointer to bus\_pace_tag
   
 -   handlep  -   handlep
   
Line 740  this knowledge yourself. Line 740  this knowledge yourself.
   
 ### Variants of bus\_space\_read and bus\_space\_write  ### Variants of bus\_space\_read and bus\_space\_write
   
 <table>  [[!table data="""
 <tr><th>Data</th><th>Read function</th><th>Write function</th></tr>  Data    |Read function          |Write function
 <tr><td>8-bit</td><td>bus\_space\_read\_1</td><td>bus\_space\_write\_1</td></tr>  8-bitb  |bus_space_read_1       |bus_space_write_1
 <tr><td>16-bit</td><td>bus\_space\_read\_2</td><td>bus\_space\_write\_2</td></tr>  16-bit  |bus_space_read_2       |bus_space_write_2
 <tr><td>32-bit</td><td>bus\_space\_read\_4</td><td>bus\_space\_write\_4</td></tr>  32-bit  |bus_space_read_4       |bus_space_write_4
 <tr><td>64-bit</td><td>bus\_space\_read\_8</td><td>bus\_space\_write\_8</td></tr>  64-bit  |bus_space_read_8       |bus_space_write_8
 </table>  """]]
   
 -   There are many more variants of read and write functions and they  -   There are many more variants of read and write functions and they
     are useful in certain situations, see the      are useful in certain situations, see the

Removed from v.1.9  
changed lines
  Added in v.1.10


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb