First of all, fixed dummy cycles for various frequencies is difficult, and potentially undesirable. You will have to use the number of dummy cycles that would work with the highest frequency you want to use. Which would be a waste of time/bandwidth every time you talk to the slave at lower speeds.
Instead, depending on how frequently you access QSPI (or Octo-) data, you may opt for reconfiguring dummy cycles before every frequency change. Dummy cycle configuration of master and slave has to match, obviously, so you will have to take care of that.
If you want to change master frequency on the fly:
- Determine how many dummy cycles you need for the new frequency.
- Write a command to the slave to alter its dummy cycle configuration, so the slave would expect new number of dummy cycles. It means you have to write to some slave's configuration register (Most likely 1 or 2 commands, which have no dummy cycles themselves).
- Change the number of cycles in MCU QSPI configuration register to the same new number of cycles.
- Now both master and slave agree on the new number of dummy cycles.