openMSX
|
#include <AmdFlash.hh>
Classes | |
struct | AddressValue |
struct | AutoSelect |
struct | CFI |
struct | Chip |
struct | Geometry |
struct | Misc |
struct | Program |
struct | Region |
struct | Sector |
struct | ValidatedChip |
Public Types | |
enum class | ManufacturerID : uint8_t { AMD = 0x01 , STM = 0x20 , SST = 0xBF } |
enum class | DeviceInterface : uint16_t { x8 = 0x0000 , x8x16 = 0x0002 } |
enum class | State { IDLE , IDENT , CFI , STATUS , PRGERR } |
Public Member Functions | |
AmdFlash (const Rom &rom, const ValidatedChip &chip, std::span< const bool > writeProtectSectors, const DeviceConfig &config) | |
Create AmdFlash with given configuration. | |
AmdFlash (const std::string &name, const ValidatedChip &chip, std::span< const bool > writeProtectSectors, const DeviceConfig &config, std::string_view id={}) | |
~AmdFlash () | |
void | reset () |
void | setVppWpPinLow (bool value) |
Setting the Vpp/WP# pin LOW enables a certain kind of write protection of some sectors. | |
power_of_two< size_t > | size () const |
uint8_t | read (size_t address) |
uint8_t | peek (size_t address) const |
void | write (size_t address, uint8_t value) |
const uint8_t * | getReadCacheLine (size_t address) const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Static Public Attributes | |
static constexpr unsigned | MAX_CMD_SIZE = 5 + 256 |
Definition at line 26 of file AmdFlash.hh.
|
strong |
Enumerator | |
---|---|
x8 | |
x8x16 |
Definition at line 52 of file AmdFlash.hh.
|
strong |
Enumerator | |
---|---|
AMD | |
STM | |
SST |
Definition at line 30 of file AmdFlash.hh.
|
strong |
Enumerator | |
---|---|
IDLE | |
IDENT | |
CFI | |
STATUS | |
PRGERR |
Definition at line 236 of file AmdFlash.hh.
openmsx::AmdFlash::AmdFlash | ( | const Rom & | rom, |
const ValidatedChip & | chip, | ||
std::span< const bool > | writeProtectSectors, | ||
const DeviceConfig & | config | ||
) |
Create AmdFlash with given configuration.
rom | The initial content for this flash |
chip | Contains chip configuration for this flash. |
sectorInfo | A span containing the size and write protected status of each sector in the flash. This implicitly also communicates the number of sectors (a sector is a region in the flash that can be erased individually). There exist flash roms were the different sectors are not all equally large, that's why it's required to enumerate the size of each sector (instead of simply specifying the size and the number of sectors). |
addressing | Specify addressing mode (11-bit or 12-bit) |
config | The motherboard this flash belongs to |
load | Load initial content (hack for 'Matra INK') |
Definition at line 23 of file AmdFlash.cc.
openmsx::AmdFlash::AmdFlash | ( | const std::string & | name, |
const ValidatedChip & | chip, | ||
std::span< const bool > | writeProtectSectors, | ||
const DeviceConfig & | config, | ||
std::string_view | id = {} |
||
) |
Definition at line 30 of file AmdFlash.cc.
|
default |
const uint8_t * openmsx::AmdFlash::getReadCacheLine | ( | size_t | address | ) | const |
Definition at line 444 of file AmdFlash.cc.
References openmsx::AmdFlash::Sector::address, IDLE, openmsx::AmdFlash::Sector::readAddress, size(), and openmsx::MSXDevice::unmappedRead.
Referenced by openmsx::NowindInterface::getReadCacheLine(), openmsx::KonamiUltimateCollection::getReadCacheLine(), openmsx::ReproCartridgeV1::getReadCacheLine(), openmsx::ReproCartridgeV2::getReadCacheLine(), openmsx::RomAscii16X::getReadCacheLine(), openmsx::RomManbow2::getReadCacheLine(), openmsx::RomMatraInk::getReadCacheLine(), openmsx::Yamanooto::getReadCacheLine(), and openmsx::DalSoRiR2::getReadCacheLine().
uint8_t openmsx::AmdFlash::peek | ( | size_t | address | ) | const |
Definition at line 186 of file AmdFlash.cc.
References openmsx::AmdFlash::Sector::address, openmsx::AmdFlash::Chip::autoSelect, CFI, openmsx::AmdFlash::Geometry::deviceInterface, openmsx::AmdFlash::Chip::geometry, IDENT, IDLE, openmsx::AmdFlash::AutoSelect::oddZero, PRGERR, openmsx::AmdFlash::Sector::readAddress, size(), STATUS, openmsx::AmdFlash::AutoSelect::undefined, UNREACHABLE, and x8x16.
Referenced by openmsx::DalSoRiR2::peekMem(), openmsx::NowindInterface::peekMem(), openmsx::KonamiUltimateCollection::peekMem(), openmsx::MegaFlashRomSCCPlus::peekMem(), openmsx::ReproCartridgeV1::peekMem(), openmsx::ReproCartridgeV2::peekMem(), openmsx::RomAscii16X::peekMem(), openmsx::RomManbow2::peekMem(), openmsx::RomMatraInk::peekMem(), openmsx::Yamanooto::peekMem(), and read().
uint8_t openmsx::AmdFlash::read | ( | size_t | address | ) |
Definition at line 432 of file AmdFlash.cc.
References IDLE, peek(), PRGERR, size(), and STATUS.
Referenced by openmsx::DalSoRiR2::readMem(), openmsx::NowindInterface::readMem(), openmsx::KonamiUltimateCollection::readMem(), openmsx::MegaFlashRomSCCPlus::readMem(), openmsx::ReproCartridgeV1::readMem(), openmsx::ReproCartridgeV2::readMem(), openmsx::RomAscii16X::readMem(), openmsx::RomManbow2::readMem(), openmsx::RomMatraInk::readMem(), and openmsx::Yamanooto::readMem().
void openmsx::AmdFlash::reset | ( | ) |
Definition at line 166 of file AmdFlash.cc.
Referenced by openmsx::MegaFlashRomSCCPlus::reset(), openmsx::MegaFlashRomSCCPlusSD::reset(), openmsx::ReproCartridgeV1::reset(), openmsx::ReproCartridgeV2::reset(), openmsx::RomAscii16X::reset(), openmsx::RomManbow2::reset(), openmsx::RomMatraInk::reset(), openmsx::Yamanooto::reset(), and openmsx::DalSoRiR2::reset().
void openmsx::AmdFlash::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 740 of file AmdFlash.cc.
References from_range, and subspan().
|
inline |
Setting the Vpp/WP# pin LOW enables a certain kind of write protection of some sectors.
Currently it is implemented that it will enable protection of the first two sectors. (As for example in Numonix/Micron M29W640FB/M29W640GB.)
Definition at line 214 of file AmdFlash.hh.
|
inline |
Definition at line 216 of file AmdFlash.hh.
Referenced by getReadCacheLine(), peek(), read(), and write().
void openmsx::AmdFlash::write | ( | size_t | address, |
uint8_t | value | ||
) |
Definition at line 456 of file AmdFlash.cc.
References CFI, IDENT, IDLE, PRGERR, openmsx::AmdFlash::Chip::program, openmsx::AmdFlash::Program::shortAbortReset, size(), STATUS, and UNREACHABLE.
Referenced by openmsx::DalSoRiR2::writeMem(), openmsx::NowindInterface::writeMem(), openmsx::KonamiUltimateCollection::writeMem(), openmsx::MegaFlashRomSCCPlus::writeMem(), openmsx::ReproCartridgeV1::writeMem(), openmsx::ReproCartridgeV2::writeMem(), openmsx::RomAscii16X::writeMem(), openmsx::RomManbow2::writeMem(), openmsx::RomMatraInk::writeMem(), and openmsx::Yamanooto::writeMem().
|
staticconstexpr |
Definition at line 283 of file AmdFlash.hh.
Referenced by openmsx::AmdFlash::Program::validate().