blob: 2fe2ddb9cd94a9211386f292334336251d6be990 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*******************************************************************************
2 * Copyright (C) 2016, ZXIC Corporation.
3 *
4 * File Name:
5 * File Mark:
6 * Description:
7 * Others:
8 * Version: v1.0
9 * Author: zhouqi
10 * Date: 2013-8-21
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19#ifndef _FLASH_H_
20#define _FLASH_H_
21
22#include <linux/types.h>
23
24#define NOR_BOOT 0x0
25#define NAND_BOOT 0x1
26#define SPI_NAND_BOOT 0x2
27#define OTHER_BOOT 0xff
28
29struct flash_type{
30 uint8_t flash_type;
31 uint8_t manuf_id;
32 uint8_t device_id;
33 uint16_t page_size;
34 uint16_t page_size_shift;
35 uint16_t oob_size;
36 uint16_t block_size_shift;
37 uint16_t block_num;
38 uint32_t block_size;
39 int32_t (*read_page_raw)(uint32_t buf, uint32_t offset);
40 int32_t (*read)(uint32_t from, uint32_t len, uint32_t to);
41 void (*read_oob)(uint8_t *buf, uint32_t offset, uint32_t len);
42};
43
44
45extern struct flash_type flash;
46
47char get_boot_mode(void);
48int board_flash_init(void);
49
50
51#endif/*_FLASH_H_*/
52
53