-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflash.txt
98 lines (77 loc) · 3 KB
/
flash.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/******************************************************************************
******************************************************************************
*** From <emulator>/SrcShared/Bank_ROM.cpp
******************************************************************************
******************************************************************************/
// ===========================================================================
// ¥ Flash Bank Accessors
// ===========================================================================
// These functions provide fetch and store access to the emulator's read only
// memory.
/*
There are five types of flash that our flash manager routines identify:
Mitsubishi, Hitachi, Intel, AMD, and Fujitsu. Of these, only the last
two are really supported right now. Unfortunately, they are the hardest
to emulate. :-(
To identify the kind of flash being used, our ROM routines:
- Read a word from FLASHBASE
- Write 0x00FF to FLASHBASE
- Read a word from FLASHBASE
- Write 0x0090 to FLASHBASE
- Read a manufacturer ID (word) from FLASHBASE
- Read a device ID (word) from FLASHBASE + 2
- Write 0x00FF to FLASHBASE
Mitsubishi: manufacturer == 0x001C, device == 0x005E
Hitachi: manufacturer == 0x0007, device == 0x0086
Intel: manufacturer == 0x0089, device == 0x0091
If the flash is not one of those, our ROM routines:
- Read a word from FLASHBASE
- Write 0x00F0 to FLASHBASE
- Write 0x00AA to FLASHBASE + 0xAAAA
- Write 0x0055 to FLASHBASE + 0x5554
- Write 0x0090 to FLASHBASE + 0xAAAA
- Read a manufacturer ID (word) from FLASHBASE
- Read a device ID (word) from FLASHBASE + 2
- Write 0x00F0 to FLASHBASE
AMD: manufacturer == 0x0001, device == 0x0049
Fujitsu: manufacturer == 0x0004, device == 0x0049
To erase a word of flash, our ROM routines:
AMD, Fujitsu:
- Read a word from FLASHBASE
- Write 0x00F0 to FLASHBASE
- Write 0x00AA to FLASHBASE + 0xAAAA
- Write 0x0055 to FLASHBASE + 0x5554
- Write 0x0080 to FLASHBASE + 0xAAAA
- Write 0x00AA to FLASHBASE + 0xAAAA
- Write 0x0055 to FLASHBASE + 0x5554
- Write 0x0030 to location to be erased
- Check erase location for 0x0080
- Read from FLASHBASE
- Write 0x00F0 to FLASHBASE
Mitsubishi, Hitachi:
- Read a word from FLASHBASE
- Write 0x00FF to FLASHBASE
- Write 0x0020 to FLASHBASE
- Write 0x00D0 to location to be erased
- Check erase location for 0x0080
-- If 0x0020 is also set, an error occured
- Read from FLASHBASE
- Write 0x00FF to FLASHBASE
Intel
- Not supported
To program a block of flash:
AMD, Fujitsu:
- Read a word from FLASHBASE
- Write 0x00F0 to FLASHBASE
- For each word to write
- If the word is already there, continue
- Write 0x00AA to FLASHBASE + 0xAAAA
- Write 0x0055 to FLASHBASE + 0x5554
- Write 0x00A0 to FLASHBASE + 0xAAAA
- Write the word to the dest location
- Check write location for 0x0080
- Read from FLASHBASE
- Write 0x00F0 to FLASHBASE
Mitsubishi, Hitachi, Intel:
- Not supported
*/