SDIO 0.1 Release Notes
----------------------

  This release note refers to the initial release of the SDIO driver.
  The note covers:

   - Structure of the SDIO release.
   - How to use the SDIO API.
   - How to install/uninstall the SDIO driver modules.
   - How to use the SDIO test program.

  This is an initial release.  If you have any questions about its
  use, or you find bugs, please email jlivesey@broadon.com

Structure of the SDIO release.
------------------------------

  This initial release of SDIO consists of several parts:

   - Loadable driver modules, located in /opt/iop-sdk/usr/bin/utils

       /opt/iop-sdk/usr/bin/utils/sdioserial.ko
       /opt/iop-sdk/usr/bin/utils/sdpci.ko

   - Scripts to load/unload the SDIO driver modules.

       /opt/iop-sdk/usr/bin/utils/sdk-pci_load
       /opt/iop-sdk/usr/bin/utils/sdk-sdio_load

   - SDIO API header file:

       /opt/iop-sdk/usr/include/iose/sdio_api.h


How to use the SDIO API.
------------------------

  The SDIO API consists of:

    - Header files.
    - libraries.

  The header file for the SDIO API is:

    iose/include/sdio_api.h

  This header file contains the prototypes for the SDIO API routines
  as well as extensive comments which should help with using it.

  The libraries for the SDIO API are:

    iose/os/lib/iossyscalls/libiossyscall_sdio.a
    iose/os/lib/ioslibc/libioslibc.a

  Emulator components which need to use the SDIO API should link with
  both these libraries.

How to install/uninstall the SDIO driver modules.
-------------------------------------------------

  Installing or uninstalling the SDIO driver modules into the kernel
  is order-dependent.  When installing, the PCI mdule must be
  installed first, followed by the SDIO module.  When uninstalling,
  the reverse is true.

  To install:

    /opt/iop-sdk/usr/bin/utils/sdk-pci_load
    /opt/iop-sdk/usr/bin/utils/sdk-sdio_load

  To uninstall:

    /opt/iop-sdk/usr/bin/utils/sdk-pci_load -u
    /opt/iop-sdk/usr/bin/utils/sdk-sdio_load -u

How to use the SDIO test program.
---------------------------------

  This release includes an sdio driver test program.  This program is
  interactive and allows the user to exercise the driver functions
  directly.  Below is a transcript of a session, annotated with notes
  where these are thought to be helpful.

  Bringing up the session:
  ------------------------

    [jlivesey@foo test]$ /opt/iop-sdk/usr/bin/iose/iose
    Initialized buffers: size 64 numbufs 32 index 0
    Initialized buffers: size 128 numbufs 32 index 1
    Initialized buffers: size 256 numbufs 32 index 2
    Initialized buffers: size 512 numbufs 32 index 3
    Initialized buffers: size 1024 numbufs 32 index 4
    Initialized buffers: size 1536 numbufs 32 index 5
    Initialized buffers: size 2048 numbufs 32 index 6
    Initialized buffers: size 4096 numbufs 32 index 7
    iose will handle signals in range [34, 64]
    Dynamically loaded usb_core (/opt/iop-sdk//usr/bin/iose/usb_core.so).
    Dynamically loaded sdio_core (/opt/iop-sdk//usr/bin/iose/sdio_core.so).
    Dynamically loaded iossh (/home/jlivesey/root/usr/bin/iose/iossh.so).
    USB Core initialized...
    SDIO Core initialized...
    iossh version: 0.2 starting...
    Commands: help
              run<r>{program} [priority] - Run a program from $ROOT/bin
                               Default location: /opt/iop-sdk//usr/bin/iose/
              ls             - List available programs.
              exit<e>        - Exit current shell.
              shutdown<s, x> - Shutdown emulator
    You can use the letters in <> as abbreviations for the commands
    >r sdio_test
    iossh: will run with default priority: 50
    Dynamically loaded sdio_test (/home/jlivesey/root/usr/bin/iose/sdio_test.so).
    *** SDIO API test program ***
    sdio_test: devId 2
    SDIO registered successfully...
    >> 

  View the usage message:
  -----------------------

    >> usage   
    quit - end session
    open [ "all" | 0-4 ]
    close [ "all" | 0-4 ]
    reset [0,1]
    debug 0xN
    Ddebug 0xN
    rcreg 0-4 function 0xreg width [expected_data]
    wcreg 0-4 function 0xreg width 0xdata
    readcis [0,1] function
    mread [0,1] function reg blk_size blk_count ["pio"|"dma"] [expected_value]
    mwrite [0,1] function reg blk_size blk_count data ["pio"|"dma"]
    funcon [0,1] [1,2,....]
    funcoff [0,1] [1,2,....]
    readcccr [0,1] name
    writecccr [0,1] name data
    readfbr [0,1] name
    inst [0,1] [ "intr" | "rem" | "err" ]
    deinst [0,1] [ "intr" | "rem" | "err" ]
    status [0,1]
    >>

  Open/reset slot 0 function 0:
  -----------------------------
  
    >> open 0 0
    >> reset 0 0
    >> 

  Read the CIS registers for function 1:
  --------------------------------------

    >> readcis 0 1
    slot_crack_cis: code 0x20 (manufacturer id) length 0x4
    slot_crack_cis: tuple data: 0xd0 0x2 0x4b 0x4 
    slot_crack_cis: code 0x21 (function id) length 0x2
    slot_crack_cis: tuple data: 0xc 0x0 
    slot_crack_cis: code 0x22 (functions extensions) length 0x4
    slot_crack_cis: tuple data: 0x0 0x1 0x0 0x32 
    slot_crack_cis: code 0x80 (unknown) length 0x2
    slot_crack_cis: tuple data: 0x0 0x2 
    slot_crack_cis: code 0x80 (unknown) length 0x5
    slot_crack_cis: tuple data: 0x1 0xe4 0x14 0x18 0x43 
    slot_crack_cis: code 0x80 (unknown) length 0x2
    slot_crack_cis: tuple data: 0x2 0x22 
    slot_crack_cis: code 0x80 (unknown) length 0x5
    slot_crack_cis: tuple data: 0x8 0x8 0x88 0x0 0x0 
    slot_crack_cis: code 0xff (terminal) length 0x0
    >> 

  Enable and open slot 0 function 1:
  ----------------------------------

    >> funcon 0 1
    >> open 0 1
    >> 

  Read slot 0 function 1 register 0 (cmd52):
  ------------------------------------------

    >> rcreg 0 1 0 1
    No data comparison
    execute_line: read reg card 0x0 data 0x18
    >> rcreg 0 1 0 1 0x18
    Good data: reg 0x0 0x18
    execute_line: read reg card 0x0 data 0x18
    >>

    [We executed this command twice, once without and once with the
    optional expected data value for comparison.]

  Multi-write/read slot 0 function 1 register0x80c0 (cmd53):
  ----------------------------------------------------------

    >> mwrite 0 1 0x80c0 1 4 0x40003 dma
    >> mread 0 1 0x80c0 1 4 dma 0x40003
     0x3 0x0 0x4 0x0
    Good data: reg 0x80c0 0x40003
    >> mread 0 1 0x80c0 1 4 pio 0x40003
     0x3 0x0 0x4 0x0
    Good data: reg 0x80c0 0x40003
    >> 

  [We first wrote the value 0x40003 width four bytes, to the register
  using dma.  We then read back the value from the register twice,
  first using dma, and the second time using pio operations.  Each
  time we compared the data read from the card with the expected
  value.  All three operations used cmd53.]

  Close down the card:
  --------------------

    >> close 0 1
    >> close 0 0
    >>

  [These close operations are not strictly necessary, since we will
  close all open files automatically when exiting the test program.]


  Bug Fixes
  ---------

  Bugs fixed in this release:

  1. In some cases the wrong status was tested on return from
     a driver ioctl.   This has been corrected.

  2. On reset, the new RCA value was not captured.   This has
     been corrected and the RCA value is stored in the device
     handle.

  3. The API to access the OCR value directly was incompletely
     implemented.   This has been corrected and the OCR value
     can be accessed if required.

# eof
