/******************************************************************************* | |
* Copyright (C) 2016, ZXIC Corporation. | |
* | |
* File Name: | |
* File Mark: | |
* Description: | |
* Others: | |
* Version: v1.0 | |
* Author: zhouqi | |
* Date: 2013-8-21 | |
* History 1: | |
* Date: | |
* Version: | |
* Author: | |
* Modification: | |
* History 2: | |
********************************************************************************/ | |
#ifndef _FLASH_H_ | |
#define _FLASH_H_ | |
#include <linux/types.h> | |
#define NOR_BOOT 0x0 | |
#define NAND_BOOT 0x1 | |
#define SPI_NAND_BOOT 0x2 | |
#define OTHER_BOOT 0xff | |
struct flash_type{ | |
uint8_t flash_type; | |
uint8_t manuf_id; | |
uint8_t device_id; | |
uint16_t page_size; | |
uint16_t page_size_shift; | |
uint16_t oob_size; | |
uint16_t block_size_shift; | |
uint16_t block_num; | |
uint32_t block_size; | |
int32_t (*read_page_raw)(uint32_t buf, uint32_t offset); | |
int32_t (*read)(uint32_t from, uint32_t len, uint32_t to); | |
void (*read_oob)(uint8_t *buf, uint32_t offset, uint32_t len); | |
}; | |
extern struct flash_type flash; | |
char get_boot_mode(void); | |
int board_flash_init(void); | |
#endif/*_FLASH_H_*/ | |