openMSX
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
openmsx::AmdFlash Class Reference

#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 }
 
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)
 
 ~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
 

Detailed Description

Definition at line 25 of file AmdFlash.hh.

Member Enumeration Documentation

◆ DeviceInterface

enum class openmsx::AmdFlash::DeviceInterface : uint16_t
strong
Enumerator
x8 
x8x16 

Definition at line 50 of file AmdFlash.hh.

◆ ManufacturerID

enum class openmsx::AmdFlash::ManufacturerID : uint8_t
strong
Enumerator
AMD 
STM 

Definition at line 29 of file AmdFlash.hh.

◆ State

enum class openmsx::AmdFlash::State
strong
Enumerator
IDLE 
IDENT 
CFI 
STATUS 
PRGERR 

Definition at line 234 of file AmdFlash.hh.

Constructor & Destructor Documentation

◆ AmdFlash() [1/2]

openmsx::AmdFlash::AmdFlash ( const Rom rom,
const ValidatedChip chip,
std::span< const bool >  writeProtectSectors,
const DeviceConfig config 
)

Create AmdFlash with given configuration.

Parameters
romThe initial content for this flash
chipContains chip configuration for this flash.
sectorInfoA 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).
addressingSpecify addressing mode (11-bit or 12-bit)
configThe motherboard this flash belongs to
loadLoad initial content (hack for 'Matra INK')

Definition at line 23 of file AmdFlash.cc.

◆ AmdFlash() [2/2]

openmsx::AmdFlash::AmdFlash ( const std::string &  name,
const ValidatedChip chip,
std::span< const bool >  writeProtectSectors,
const DeviceConfig config 
)

Definition at line 30 of file AmdFlash.cc.

◆ ~AmdFlash()

openmsx::AmdFlash::~AmdFlash ( )
default

Member Function Documentation

◆ getReadCacheLine()

const uint8_t * openmsx::AmdFlash::getReadCacheLine ( size_t  address) const

◆ peek()

uint8_t openmsx::AmdFlash::peek ( size_t  address) const

◆ read()

uint8_t openmsx::AmdFlash::read ( size_t  address)

◆ reset()

void openmsx::AmdFlash::reset ( )

◆ serialize()

template<typename Archive >
void openmsx::AmdFlash::serialize ( Archive &  ar,
unsigned  version 
)

Definition at line 740 of file AmdFlash.cc.

References from_range, and subspan().

◆ setVppWpPinLow()

void openmsx::AmdFlash::setVppWpPinLow ( bool  value)
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 212 of file AmdFlash.hh.

◆ size()

power_of_two< size_t > openmsx::AmdFlash::size ( ) const
inline

◆ write()

void openmsx::AmdFlash::write ( size_t  address,
uint8_t  value 
)

Member Data Documentation

◆ MAX_CMD_SIZE

constexpr unsigned openmsx::AmdFlash::MAX_CMD_SIZE = 5 + 256
staticconstexpr

Definition at line 281 of file AmdFlash.hh.

Referenced by openmsx::AmdFlash::Program::validate().


The documentation for this class was generated from the following files: