mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[ion/device] External flash: SetReadParameters (dummy cycles) according to clock frequency
This commit is contained in:
@@ -199,6 +199,18 @@ void initChip() {
|
||||
wait(QUADSPI::CCR::OperatingMode::Single);
|
||||
send_command(Command::EnableQPI, QUADSPI::CCR::OperatingMode::Single);
|
||||
wait();
|
||||
if (ClockFrequencyDivisor == 1) {
|
||||
class ReadParameters : Register8 {
|
||||
public:
|
||||
/* Parameters sent along with SetReadParameters instruction in order
|
||||
* to configure the number of dummy cycles for the QPI Read instructions. */
|
||||
using Register8::Register8;
|
||||
REGS_BOOL_FIELD_W(P5, 1);
|
||||
};
|
||||
ReadParameters readParameters(0);
|
||||
readParameters.setP5(true);
|
||||
send_write_command(Command::SetReadParameters, reinterpret_cast<uint8_t *>(FlashAddressSpaceSize), reinterpret_cast<uint8_t *>(&readParameters), sizeof(readParameters));
|
||||
}
|
||||
}
|
||||
set_as_memory_mapped();
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ enum class Command : uint8_t {
|
||||
// Erase the whole chip or a 64-Kbyte block as being "1"
|
||||
ChipErase = 0xC7,
|
||||
Erase64KbyteBlock = 0xD8,
|
||||
SetReadParameters = 0xC0
|
||||
};
|
||||
|
||||
constexpr static uint32_t QSPIBaseAddress = 0x90000000;
|
||||
|
||||
Reference in New Issue
Block a user