Skip to content

Commit

Permalink
drivers: ccu: Use the system counter for IOSC calibration
Browse files Browse the repository at this point in the history
Now that a system counter driver is available on all supported
platforms, use that instead of the trusted watchdog.

Closes: #199
Signed-off-by: Samuel Holland <[email protected]>
  • Loading branch information
smaeul committed Jun 11, 2022
1 parent 1aeef5d commit 27de456
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/clock/r_ccu_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <mmio.h>
#include <stdint.h>
#include <system.h>
#include <watchdog/sunxi-twd.h>
#include <platform/devices.h>
#include <platform/prcm.h>
#include <platform/time.h>
Expand Down Expand Up @@ -97,7 +96,7 @@ r_ccu_common_init(void)
do {
before = cycle_counter_read();
barrier();
now = r_twd_counter_read();
now = system_counter_read();
end = now + (REFCLK_HZ >> 9);
} while (end < now);

Expand All @@ -106,7 +105,7 @@ r_ccu_common_init(void)
after = cycle_counter_read();
/* Ensure the counters are read in a consistent order. */
barrier();
now = r_twd_counter_read();
now = system_counter_read();
} while (now < end);

/*
Expand Down

0 comments on commit 27de456

Please sign in to comment.