
Hi,
To support the flash one of our boards (no integrated in U-Boot) I need to implement something similar to Linux MTD complex mappings option in the CFI driver. In my case I have a NOR flash chip with an address line connected to a GPIO pin. The GPIO pin needs to be set correctly at each access to the flash.
What I wanted to know: Is someone else already working on a solution? Would such a feature have a chance of being integrated in U-boot?
My plan was: 1. Add a new CFG_FLASH_COMPLEX_MAPPING option to U-boot. 2. Create map structure to contain functions pointers to flash read/write functions. 3. Modify flash_info_t structure and add a pointer to map structure (if CFG_FLASH_COMPLEX_MAPPING is defined). 4. Add generic map_read(), map_write() functions to CFI driver. 5. Modify CFI driver to access flash using map_read()/map_write() functions. 6. If CFG_FLASH_COMPLEX_MAPPING is not defined the map_read()/map_write() are simple inline functions that access memory directly. 7. If CFG_FLASH_COMPLEX_MAPPING is defined it's up to the board specific code to initialize the map structure pointer in flash_info_t and the generic map_read()/map_write() functions will call board_map_read()/board_map_write() (through a function pointer).
Unfortunately this only takes care of writting operations. Support for read would mean further extensive modifications (introduce some flash_read() function and use it from cp, md, jffs2, ... commands).
Thanks, Rui