summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/x76f041.h
diff options
context:
space:
mode:
author 987123879113 <63495610+987123879113@users.noreply.github.com>2022-02-08 09:13:24 +0900
committer GitHub <noreply@github.com>2022-02-07 19:13:24 -0500
commit99404ddd2d32a9c9058d8359cf9132e4b274e346 (patch)
tree7d3cea5aaa2ac44fcc41b96a3a6484ce055097dd /src/devices/machine/x76f041.h
parente450cc79539942693b9fffcc61cdfc7d0e9cff17 (diff)
x76f041/x76f100/zs01: Implement new operations and security features (#9137)
* x76f100: Implement security features * x76f041: Implement security features * zs01: Implement security features * ksys573: Update security flash data * k573mcal: Add master calendar for initializing security cassettes * zs01: Update comment about unknown serial
Diffstat (limited to 'src/devices/machine/x76f041.h')
-rw-r--r--src/devices/machine/x76f041.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/devices/machine/x76f041.h b/src/devices/machine/x76f041.h
index af487f75a1d..44f6baf52db 100644
--- a/src/devices/machine/x76f041.h
+++ b/src/devices/machine/x76f041.h
@@ -29,6 +29,7 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
+ virtual void device_reset() override;
// device_nvram_interface overrides
virtual void nvram_default() override;
@@ -44,11 +45,24 @@ private:
enum configuration_register_t
{
- CONFIG_BCR1 = 0,
- CONFIG_BCR2 = 1,
- CONFIG_CR = 2,
- CONFIG_RR = 3,
- CONFIG_RC = 4
+ // If set to 1, retry counter is incremented when an invalid password is provided
+ CR_RETRY_COUNTER_ENABLE_BIT = 0x04,
+
+ // If set to 1, retry counter will be reset when a correct password is provided
+ CR_RETRY_COUNTER_RESET_BIT = 0x08,
+
+ // 10 = If retry counter is enabled, deny all commands when retry register equals retry counter
+ // 00, 01, 11 = If retry counter is enabled, allow only configuration commands when retry register equals retry counter
+ CR_UNAUTHORIZED_ACCESS_BITS = 0xc0,
+ };
+
+ enum configuration_registers_t
+ {
+ CONFIG_BCR1 = 0, // Array Control Register
+ CONFIG_BCR2 = 1, // Array Control Register 2
+ CONFIG_CR = 2, // Configuration Register
+ CONFIG_RR = 3, // Retry Register
+ CONFIG_RC = 4 // Reset Counter
};
enum bcr_t
@@ -91,8 +105,18 @@ private:
STATE_VERIFY_PASSWORD,
STATE_READ_DATA,
STATE_WRITE_DATA,
+ STATE_CONFIGURATION_WRITE_DATA,
STATE_READ_CONFIGURATION_REGISTERS,
- STATE_WRITE_CONFIGURATION_REGISTERS
+ STATE_WRITE_CONFIGURATION_REGISTERS,
+
+ STATE_PROGRAM_WRITE_PASSWORD,
+ STATE_PROGRAM_READ_PASSWORD,
+ STATE_PROGRAM_CONFIGURATION_PASSWORD,
+
+ STATE_RESET_WRITE_PASSWORD,
+ STATE_RESET_READ_PASSWORD,
+ STATE_MASS_PROGRAM,
+ STATE_MASS_ERASE
};
optional_memory_region m_region;
@@ -109,6 +133,7 @@ private:
int m_byte;
int m_command;
int m_address;
+ bool m_is_password_accepted;
uint8_t m_write_buffer[ 8 ];
uint8_t m_response_to_reset[ 4 ];
uint8_t m_write_password[ 8 ];
@@ -116,6 +141,7 @@ private:
uint8_t m_configuration_password[ 8 ];
uint8_t m_configuration_registers[ 8 ];
uint8_t m_data[ 512 ];
+ uint8_t m_password_temp[ 16 ];
};