1
2
3
4
5
6
7
8 #ifndef _AIC94XX_SDS_H_
9 #define _AIC94XX_SDS_H_
10
11 enum {
12 FLASH_METHOD_UNKNOWN,
13 FLASH_METHOD_A,
14 FLASH_METHOD_B
15 };
16
17 #define FLASH_MANUF_ID_AMD 0x01
18 #define FLASH_MANUF_ID_ST 0x20
19 #define FLASH_MANUF_ID_FUJITSU 0x04
20 #define FLASH_MANUF_ID_MACRONIX 0xC2
21 #define FLASH_MANUF_ID_INTEL 0x89
22 #define FLASH_MANUF_ID_UNKNOWN 0xFF
23
24 #define FLASH_DEV_ID_AM29LV008BT 0x3E
25 #define FLASH_DEV_ID_AM29LV800DT 0xDA
26 #define FLASH_DEV_ID_STM29W800DT 0xD7
27 #define FLASH_DEV_ID_STM29LV640 0xDE
28 #define FLASH_DEV_ID_STM29008 0xEA
29 #define FLASH_DEV_ID_MBM29LV800TE 0xDA
30 #define FLASH_DEV_ID_MBM29DL800TA 0x4A
31 #define FLASH_DEV_ID_MBM29LV008TA 0x3E
32 #define FLASH_DEV_ID_AM29LV640MT 0x7E
33 #define FLASH_DEV_ID_AM29F800B 0xD6
34 #define FLASH_DEV_ID_MX29LV800BT 0xDA
35 #define FLASH_DEV_ID_MX29LV008CT 0xDA
36 #define FLASH_DEV_ID_I28LV00TAT 0x3E
37 #define FLASH_DEV_ID_UNKNOWN 0xFF
38
39
40 #define FLASH_STATUS_BIT_MASK_DQ6 0x40
41 #define FLASH_STATUS_BIT_MASK_DQ5 0x20
42 #define FLASH_STATUS_BIT_MASK_DQ2 0x04
43
44
45 #define FLASH_STATUS_ERASE_DELAY_COUNT 50
46 #define FLASH_STATUS_WRITE_DELAY_COUNT 25
47
48 #define FLASH_SECTOR_SIZE 0x010000
49 #define FLASH_SECTOR_SIZE_MASK 0xffff0000
50
51 #define FLASH_OK 0x000000
52 #define FAIL_OPEN_BIOS_FILE 0x000100
53 #define FAIL_CHECK_PCI_ID 0x000200
54 #define FAIL_CHECK_SUM 0x000300
55 #define FAIL_UNKNOWN 0x000400
56 #define FAIL_VERIFY 0x000500
57 #define FAIL_RESET_FLASH 0x000600
58 #define FAIL_FIND_FLASH_ID 0x000700
59 #define FAIL_ERASE_FLASH 0x000800
60 #define FAIL_WRITE_FLASH 0x000900
61 #define FAIL_FILE_SIZE 0x000a00
62 #define FAIL_PARAMETERS 0x000b00
63 #define FAIL_OUT_MEMORY 0x000c00
64 #define FLASH_IN_PROGRESS 0x001000
65
66 struct controller_id {
67 u32 vendor;
68 u32 device;
69 u32 sub_vendor;
70 u32 sub_device;
71 };
72
73 struct image_info {
74 u32 ImageId;
75 u32 ImageOffset;
76 u32 ImageLength;
77 u32 ImageChecksum;
78 u32 ImageVersion;
79 };
80
81 struct bios_file_header {
82 u8 signature[32];
83 u32 checksum;
84 u32 antidote;
85 struct controller_id contrl_id;
86 u32 filelen;
87 u32 chunk_num;
88 u32 total_chunks;
89 u32 num_images;
90 u32 build_num;
91 struct image_info image_header;
92 };
93
94 int asd_verify_flash_seg(struct asd_ha_struct *asd_ha,
95 const void *src, u32 dest_offset, u32 bytes_to_verify);
96 int asd_write_flash_seg(struct asd_ha_struct *asd_ha,
97 const void *src, u32 dest_offset, u32 bytes_to_write);
98 int asd_chk_write_status(struct asd_ha_struct *asd_ha,
99 u32 sector_addr, u8 erase_flag);
100 int asd_check_flash_type(struct asd_ha_struct *asd_ha);
101 int asd_erase_nv_sector(struct asd_ha_struct *asd_ha,
102 u32 flash_addr, u32 size);
103 #endif