New interface makes more explicit the split between the device driver API and the public API. CDL --- cdl_option CYGBLD_LEGACY_FLASH_DEVICE. Include a device named 'flash' which interfaces with V1 flash devices. cdl_interface CYGHWR_IO_FLASH_DEVICE_V2. A device driver should implement this if it implements the V2 flash device driver interface. cdl_??? CYGSEM_IO_FLASH_LEGACY_COMPAT. Provide legacy public flash API. Public Flash Interface ---------------------- L: Has legacy support #define. cyg_flash_init (was: flash_init) L Init the flash subsystem. Used to call flash_query and do full device setup. This bit is now in cyg_flash_open. This function just egisters the workspace etc. cyg_flash_open (NEW) Opens a particular flash device. Calls the ->query function. cyg_flash_read (NEW) What it says on the tin. Calls ->read. cyg_flash_erase (was: flash_erase) L calls ->erase_block cyg_flash_program (was: flash_program) L calls ->program_block cyg_flash_dev_query (was: flash_dev_query) L Arranges to call ->query_hwr. Use to call flash_query and was used by flash_hwr_init. Now it is used by ->query. Should be private/part of driver API? cyg_flash_lock (was: flash_lock) L Locks a region of flash. calls ->lock cyg_flash_unlock (was: flash_unlock) L Unlocks a region of flash. calls ->unlock cyg_flash_verify_addr (was: flash_verify_addr) L Checks if an address lies inside the flash. Possible to deprecate? cyg_flash_get_limit (was: flash_get_limits) : Returns the size of the flash device. used to return start and end points. Could possibly be renames to get_size? cyg_flash_get_block_info (was: flash_get_block_info) : Returns information about block structure of flash. (doesn't need to call down to driver, yet) cyg_flash_code_overlaps (was: flash_code_overlaps) L Determines if a range of code overlaps flash. Calls f_i->code_overlaps. cyg_flash_errmsg (was: flash_errmsg) L Returns string version of a flash error cyg_flash_hwr_map_error (was: flash_hwr_map_error) L Calls ->map_error. Should be made private/part of driver API? Internal Flash Driver Interface ------------------------------- 1-2: Has a different prototype for a V1 device to a V2 device. M: Is copied to RAM for execution (and therefore has a _length counterpart which should be filled in) Function Pointers ->query (in devtab) (was: flash_hwr_init) Calls cyg_flash_dev_query which calls through to ->query_hwr. (possibly rename to ->open?) ->read (was: memcpy etc...) 1-2 ->query_hwr (was: flash_query) 1-2 M Perform QRY command. (possibly rename to ->query if above renamed) ->code_overlaps (was: flash_code_overlaps) 1-2 ->lock (was: flash_lock_block) 1-2 M ->unlock (was: flash_unlock_block) 1-2 M ->erase_block (was: flash_erase_block) 1-2 M ->program_buf (was: flash_program_buf) 1-2 M ->map_error (was: flash_hwr_map_error)