mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
CPLD: Add XC2C64A method to init from EEPROM contents.
This commit is contained in:
parent
c0b9761fe5
commit
4b7fa9f411
@ -116,6 +116,23 @@ bool XC2C64A::verify_eeprom(const verify_blocks_t& blocks) {
|
|||||||
return !error;
|
return !error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XC2C64A::init_from_eeprom() {
|
||||||
|
tap.set_repeat(0);
|
||||||
|
tap.set_end_ir(state_t::run_test_idle);
|
||||||
|
tap.set_end_dr(state_t::run_test_idle);
|
||||||
|
|
||||||
|
reset();
|
||||||
|
enable();
|
||||||
|
|
||||||
|
discharge();
|
||||||
|
init();
|
||||||
|
|
||||||
|
disable();
|
||||||
|
bypass();
|
||||||
|
|
||||||
|
tap.state(state_t::test_logic_reset);
|
||||||
|
}
|
||||||
|
|
||||||
bool XC2C64A::shift_ir(const instruction_t instruction) {
|
bool XC2C64A::shift_ir(const instruction_t instruction) {
|
||||||
const ir_t ir_buffer = toUType(instruction);
|
const ir_t ir_buffer = toUType(instruction);
|
||||||
const jtag::tap::bits_t bits { &ir_buffer, ir_length };
|
const jtag::tap::bits_t bits { &ir_buffer, ir_length };
|
||||||
@ -132,6 +149,23 @@ void XC2C64A::enable() {
|
|||||||
tap.wait(state_t::run_test_idle, state_t::run_test_idle, 800);
|
tap.wait(state_t::run_test_idle, state_t::run_test_idle, 800);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XC2C64A::enable_otf() {
|
||||||
|
shift_ir(instruction_t::ISC_ENABLE_OTF);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XC2C64A::discharge() {
|
||||||
|
shift_ir(instruction_t::ISC_INIT);
|
||||||
|
tap.wait(state_t::run_test_idle, state_t::run_test_idle, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XC2C64A::init() {
|
||||||
|
tap.set_end_ir(state_t::update_ir);
|
||||||
|
shift_ir(instruction_t::ISC_INIT);
|
||||||
|
tap.set_end_ir(state_t::run_test_idle);
|
||||||
|
tap.state(state_t::capture_dr);
|
||||||
|
tap.wait(state_t::run_test_idle, state_t::run_test_idle, 800);
|
||||||
|
}
|
||||||
|
|
||||||
void XC2C64A::disable() {
|
void XC2C64A::disable() {
|
||||||
shift_ir(instruction_t::ISC_DISABLE);
|
shift_ir(instruction_t::ISC_DISABLE);
|
||||||
tap.wait(state_t::run_test_idle, state_t::run_test_idle, 100);
|
tap.wait(state_t::run_test_idle, state_t::run_test_idle, 100);
|
||||||
|
@ -67,6 +67,7 @@ public:
|
|||||||
bool verify_sram(const verify_blocks_t& blocks);
|
bool verify_sram(const verify_blocks_t& blocks);
|
||||||
|
|
||||||
bool verify_eeprom(const verify_blocks_t& blocks);
|
bool verify_eeprom(const verify_blocks_t& blocks);
|
||||||
|
void init_from_eeprom();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr size_t idcode_length = 32;
|
static constexpr size_t idcode_length = 32;
|
||||||
@ -112,6 +113,9 @@ private:
|
|||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
void enable();
|
void enable();
|
||||||
|
void enable_otf();
|
||||||
|
void discharge();
|
||||||
|
void init();
|
||||||
void disable();
|
void disable();
|
||||||
bool bypass();
|
bool bypass();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user