flash.c
来自「TP-LINK公司TL-WR941N无线路由器的Bootloader U_BOO」· C语言 代码 · 共 29 行
C
29 行
#include <common.h>#include <config.h>#include <asm/types.h>#include <flash.h>/* * sets up flash_info and returns size of FLASH (bytes) */unsigned long flash_get_geom (flash_info_t *flash_info){ int i; /* XXX this is hardcoded until we figure out how to read flash id */ flash_info->flash_id = FLASH_M25P64; flash_info->size = CFG_FLASH_SIZE; /* bytes */ flash_info->sector_count = flash_info->size/CFG_FLASH_SECTOR_SIZE; for (i = 0; i < flash_info->sector_count; i++) { flash_info->start[i] = CFG_FLASH_BASE + (i * CFG_FLASH_SECTOR_SIZE); flash_info->protect[i] = 0; } printf ("flash size 8MB, sector count = %d\n", flash_info->sector_count); return (flash_info->size);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?