Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi LiangYi,
> But, the files below play what function. Do they have relation with u-boot flash driver? > ..\u-boot\common\cmd_flash.c This implements all of the flash commands (e.g.: erase, protect, etc.) > ..\u-boot\common\env_dataflash.c Used for storing non-volatile environment. > ..\u-boot\common\env_flash.c Used for storing non-volatile environment. > ..\u-boot\common\flash.c Implements some higher-level flash routines. > ..\u-boot\drivers\cfi_flash.c Low-level CFI flash driver implementation. This can be used rather than implementing your own flash driver in your board-specific source tree. Many boards have their own "flash.c" file that is customized for the specific flash device on the board. But don't take my word ... the best way to understand how things work is to read through the code yourself ;-) Start with the following: common/cmd_flash.c -- start with do_flerase(). common/cmd_mem.c -- start with do_mem_cp(). It should all become clear. Regards, --Scott