drivers: clock_control: ra: fix issue with setting memwait cycles

Setting the number of memory wait cycles must take place while the clock
is set to 32MHz or less. This patch ensure the MEMWAIT register is
changed before the clock is changed from its default value (of 8MHz).
Note that in order to set MEMWAIT to 1 the power control mode must be
set to high speed (which is why the lines of code interacting with the
OPCCR register have also been moved).

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
1 file changed