SD 0.1 Release Notes
----------------------

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

   - How to use the SD API.
   - How to use the SD test program.

  This is an initial release.  If you have any questions about its
  use, or you find bugs, please email gbarnard@broadon.com Also refer to 
  the SDIO release notes.

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

	Driver section same as SDIO,

   - SD API header file:

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


How to use the SD API.
------------------------

  The SD API consists of:

    - Header files.
    - libraries.

  The header file for the SD API is:

    iose/include/sd_api.h

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

  The libraries for the SD API are:

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

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

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

  This release includes an sd driver test program: sd_api_test. 
  The program exercise the basic SD API interface. 
  The basic sequence is as follows, see sd_test() in sd_api_test.c:
  1) select slot where device is located
  config.SDDevSlot = 0 for slot 0
                     1 for slot 1
                     
  2) Attach to driver: ISD_AttachDevice
  3) Mount Card: ISD_MountCard. This prepares the card for access, by
  		resetting, 
  		setting voltages,
  		acquiring SD card address (RCA),
  		and putting card in data transfer mode.
  4) Retrieving card information example:
  		cmd_deselect(); take out of data transfer mode for general commands
		cmd_cardsize(); retieve card size
  5) Data transfer example:
  	if (cmd_select()==IOS_ERROR_OK)	put back in data transfer mode
	{	
		#if 1
			cmd_writeblocks(0,1024); example to write multiple blocks, 
				SD card address is 0, size is 1024 (multiple of 512bytes)
		#else
			cmd_writeblock(0);	example to write single block
			cmd_writeblock(512);
		#endif
	
		#if 1
			cmd_readblocks(0,1024);
		#else
	    	cmd_readblock(0);
	    	cmd_readblock(512);
	    #endif
	}
  6) Erase Example: 
  		This code erase one sector (address = blocksize * sectorsize = 512 x ...)
  		Then read back erased blocks (I.e. data is now FFFFF...)
	    #if 1
	    	cmd_erase_sector(0);
	    	cmd_readblocks(0,1024);
	    #endif  		
  7) Unmount and detach. Detach from driver in linux environment not completely functional. 
  So user should exit iose, and run it again to run sd_api_test again.

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

    Same as SDIO:
    1) load drivers,
    2) run iose:
    
$ iose
iose will handle signals in range [34, 64]
USB Core initialized...
SDIO Core initialized...
iossh version: 0.3 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 sd_api_test
iossh: will run with default priority: 50
$Id$

======= SD API Test Program =======
sd_api_test: devId 2

------- Tests Start -------
ISD_AttachDevice, attach to Host Driver Dev:4 OK
ISD_MountCard RCA:0xb975 OK
 - cmd_deselect OK -
 - GetSdStatus:700  READY_FOR_DATA stby
ISD_GetCardSize OK
     Sector Size   = 128
     Total Sectors = 7810
     Card Capacity = 511836160
ISD_ReadCardRegister(CID) OK
     0x0002544D53443531321085E9C22D0055
 - GetSdStatus:700  READY_FOR_DATA stby
RCA response:0000B975
 - select SD card for R/W -
ISD_WriteMultiBlockAsync(data=0x119620 to offset=0x0 blocks=2)
     80000000 80000001 80000002 80000003
     80000080 80000081 80000082 80000083
ISD_ReadMultiBlockAsync(offset=0x0 to data=0x119620 blocks=2)
     80000000 80000001 80000002 80000003
     80000080 80000081 80000082 80000083
ISD_EraseSectorAsync(sector=0)
ISD_ReadMultiBlockAsync(offset=0x0 to data=0x119620 blocks=2)
     ffffffff ffffffff ffffffff ffffffff
     ffffffff ffffffff ffffffff ffffffff
>

# eof
