wip: adding pubkey programming

This commit is contained in:
Martin Beynon 2021-11-25 14:50:33 +00:00
parent 7e7e030661
commit 7fe0a5ab66
1 changed files with 23 additions and 0 deletions

View File

@ -2040,6 +2040,29 @@ bool Lattice::program_pubkey_MachXO3D()
}
}
/* Programming and Verify the AUTH_EN2 and AUTH_EN1 Fuses..."
* -- This is undocumented (extracted from USB capture) */
uint8_t tx_byte = 0x01;
wr_rd(0xc4, &tx, 1, NULL, 0);
_jtag->set_state(Jtag::RUN_TEST_IDLE);
_jtag->toggleClk(2);
wr_rd(ISC_NOOP, NULL, 0, NULL, 0);
/* lattice diamond sends this twice... ? */
wr_rd(0xc4, &tx, 1, NULL, 0);
_jtag->set_state(Jtag::RUN_TEST_IDLE);
_jtag->toggleClk(2);
wr_rd(ISC_NOOP, NULL, 0, NULL, 0);
wr_rd(READ_STATUS_REGISTER_1, NULL, 0, rxkey, 4);
_jtag->set_state(Jtag::RUN_TEST_IDLE);
_jtag->toggleClk(2);
printf("Auth Mode: [0x%x]\n", rxkey >> 0x08 & 0x03);
/* ISC program done 0x5E */
printInfo("Write program Done: ", false);
if (writeProgramDone() == false) {