diff --git a/src/lattice.cpp b/src/lattice.cpp index 43712a4..0e83813 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -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) {