ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_cgc_usb.c
Go to the documentation of this file.
1
29
30#include <stdint.h>
31
32#include "ra8_attributes.h"
33#include "ra8_cgc.h"
34#include "ra8_cgc_internal.h"
35#include "ra8_cgc_regs.h"
36#include "ra8_check.h"
37#include "ra8_err.h"
38#include "ra8_hw_err.h"
39#include "ra8_log.h"
40#include "ra8_mstp.h"
41#include "ra8_mstp_regs.h"
43#include "ra8_system_regs.h"
44#include "ra8_time_constants.h"
45
46static const char* s_tag = "CGC";
47
65static volatile uint8_t s_usb60ckcr_probe = 0U;
66
83static volatile uint8_t s_pll2_status_probe = 0U;
84
94typedef enum : uint32_t {
95 /* The USBCKSREQ -> USBCKSRDY synchronizer chain crosses from ICLK
96 * into the UCK clock domain (currently HOCO @ ~20 MHz before this
97 * routine runs). Worst case is a few HOCO cycles plus the M85 spin
98 * latency at 1 GHz. FSP polls this unbounded; we cap at ~600 us to
99 * stay NASA-Rule-2-compliant while leaving four orders of magnitude
100 * of slack over the worst-case real handshake. */
105
124typedef enum : uint32_t {
125 k_ra8_mstpb11_usbfs_mask = (uint32_t)(1UL << 11),
127
149
165{
166 volatile const uint8_t* const usbckcr = ra8_sys_usbckcr();
167 const uint8_t mask = (uint8_t)(1U << k_ra8_usbckcr_bit_srdy);
168 /* Bounded wait through ra8_hw_err.h: on host tests the ra8_fake_mmio
169 * seam decides the poll (first-poll success unless a test arms a
170 * fault), so the real timeout leg is reachable everywhere. */
171 if (expected != 0U) {
172 return ra8_hw_wait_flag_set8(usbckcr, mask, (uint32_t)k_ra8_usbfs_srdy_poll_limit);
173 }
174 return ra8_hw_wait_flag_clear8(usbckcr, mask, (uint32_t)k_ra8_usbfs_srdy_poll_limit);
175}
176
192RA8_INTERNAL static ra8_err_t internal_pll2_program_protected(uint32_t pll2ccr, uint16_t pll2ccr2)
193{
194 ra8_err_t err = k_ra8_ok;
196 {
197 /* HUM Ch 9.2.11 "PLL2CR : PLL2 Control Register" p 336 -- stop
198 * PLL2 before writing PLL2CCR / PLL2CCR2. */
199 *ra8_sys_pll2cr() = (uint8_t)k_ra8_pll2cr_stop;
201 if (err != k_ra8_ok) {
202 ra8_log_error(s_tag, "pll2: stop wait timeout");
203 break;
204 }
205 /* HUM Ch 9.2.10 "PLL2CCR : PLL2 Clock Control Register" p 335 */
206 *ra8_sys_pll2ccr() = pll2ccr;
207 /* HUM Ch 9.2.12 "PLL2CCR2 : PLL2 Clock Control Register 2" p 335 */
208 *ra8_sys_pll2ccr2() = pll2ccr2;
209 *ra8_sys_pll2cr() = (uint8_t)k_ra8_pll2cr_run;
211 if (err != k_ra8_ok) {
212 ra8_log_error(s_tag, "pll2: lock wait timeout");
213 break;
214 }
215 }
216 return err;
217}
218
258ra8_err_t ra8_cgc_pll2_enable(uint8_t mul_int, uint8_t mul_quarters, ra8_plodiv_t p_div_code)
259{
260 if (mul_int == 0U) {
262 }
263 if ((uint16_t)mul_quarters > (uint16_t)k_ra8_pll2_max_quarters) {
265 }
266
267 ra8_log_info_val(s_tag, "pll2 enable mul_int", (uint32_t)mul_int);
268
269 /* Idempotency (HUM Ch 9): never re-program a running PLL2 -- if FS
270 * path already locked it, the HS path's "same VCO" request is a no-op. */
271 if ((*ra8_sys_oscsf() & (uint8_t)(1U << k_ra8_oscsf_bit_pll2sf)) != 0U) {
272 ra8_log_info(s_tag, "pll2 already locked -- skip re-program");
273 return k_ra8_ok;
274 }
275
276 /* PLL2CCR (32-bit, HUM Ch 9.2.9): PLL2MULNF[7:6] | PLL2MUL[16:8]. */
277 const uint32_t mul_quarters_field =
278 ((uint32_t)mul_int * (uint32_t)k_ra8_cgc_quarters_per_unit) + (uint32_t)mul_quarters;
279 const uint32_t pll2ccr =
280 ((mul_quarters_field & (uint32_t)k_ra8_pll2ccr_mask_quarters) << k_ra8_pllccr_shift_quarters) |
282 ((uint32_t)k_ra8_plidiv_div2 & (uint32_t)k_ra8_pll2ccr_mask_plidiv);
283
284 /* PLL2CCR2: P from caller; Q/R fixed at /6. Code 0 is prohibited
285 * per HUM Ch 9.2.10/9.2.12 (drops the whole 16-bit write). */
286 const uint16_t pll2ccr2 =
287 (uint16_t)(((uint16_t)k_ra8_plodiv_div6 << k_ra8_pllccr2_shift_plodivr) |
289 ((uint16_t)p_div_code << k_ra8_pllccr2_shift_plodivp));
290
291 const ra8_err_t err = internal_pll2_program_protected(pll2ccr, pll2ccr2);
292 if (err != k_ra8_ok) {
293 return err;
294 }
295 ra8_log_info(s_tag, "pll2 locked");
296 return k_ra8_ok;
297}
298
315{
316 ra8_err_t err = k_ra8_ok;
318 {
319 const uint8_t sreq_mask = (uint8_t)(1U << k_ra8_usbckcr_bit_sreq);
320 *ra8_sys_usbckcr() = sreq_mask;
321 err = internal_wait_usbcksrdy(1U);
322 if (err != k_ra8_ok) {
323 ra8_log_error(s_tag, "usbfs: SRDY=1 timeout");
324 break;
325 }
327 const uint8_t src = (uint8_t)((uint8_t)k_ra8_usbcksel_pll2p & k_ra8_usbckcr_mask_sel);
328 *ra8_sys_usbckcr() = (uint8_t)(src | sreq_mask);
329 *ra8_sys_usbckcr() = src;
330 err = internal_wait_usbcksrdy(0U);
331 if (err != k_ra8_ok) {
332 ra8_log_error(s_tag, "usbfs: SRDY=0 timeout");
333 break;
334 }
335 }
336 return err;
337}
338
365{
366 ra8_log_info(s_tag, "usbfs clock enable");
367
368 /* Step 1: bring up PLL2 to land 240 MHz on PLL2P. */
369 const ra8_err_t pll2_err = ra8_cgc_pll2_enable((uint8_t)k_ra8_pll2_usbfs_mul,
372 if (pll2_err != k_ra8_ok) {
373 ra8_log_error_val(s_tag, "usbfs: pll2 enable failed", (uint32_t)pll2_err);
374 return pll2_err;
375 }
376
377 /* Step 2a: Force USBFS into module-stop (MSTPB11 = 1) BEFORE the SREQ
378 * handshake. HUM Ch 9 "Clock selection switching procedure" step 1
379 * (p367 / p370 / p373 / p378 / p381) is mandatory whenever USBCKDIVCR
380 * is moved off 1/1; we are programming /5 below. MSTPCR is NOT
381 * PRCR-protected. ra8_usb_device_init() releases MSTPB11 again later
382 * via the ref-counted ra8_mstp_enable() path. */
384 (void)ra8_mstp()->MSTPCRB; /* HUM 11.2.7 Note 2: read-back. */
385
386 /* Step 2a': Ensure HOCO is running. USBCKCR's reset-default source is
387 * HOCO; the SREQ -> SRDY synchronizer crosses from ICLK into the
388 * CURRENT UCK source's clock domain (HOCO). If HOCO is stopped
389 * (HCSTP=1, the chip reset state) the handshake never completes -- we
390 * observed USBCKCR=0x40 (SREQ=1, SRDY=0) with HOCOCR=0x01 and
391 * OSCSF.HOCOSF=0 on real silicon. ra8_cgc_init() leaves HOCO stopped
392 * because it switches SCKSCR to PLL1; we have to start HOCO here so
393 * the source clock for USBCKCR is alive when SREQ is asserted.
394 * HOCOCR IS PRCR-protected (HUM Ch 9; FSP wraps writes inside its
395 * BSP_PRV_PRCR_UNLOCK / BSP_PRV_PRCR_LOCK window -- writes outside
396 * the window are silently dropped, which is what we observed when
397 * an earlier attempt left HOCOCR at 0x01 after the store). */
398 ra8_err_t hoco_err = k_ra8_ok;
400 {
401 volatile uint8_t* const hococr = ra8_sys_hococr();
402 if ((*hococr & (uint8_t)(1U << k_ra8_hococr_hcstp)) != 0U) {
403 *hococr = (uint8_t)((uint8_t)*hococr & (uint8_t)~(1U << k_ra8_hococr_hcstp));
404 }
405 }
406 /* OSCSF.HOCOSF poll outside PRCR window (read-only register). */
408 if (hoco_err != k_ra8_ok) {
409 ra8_log_error(s_tag, "usbfs: HOCO stabilization timeout");
410 return hoco_err;
411 }
412 ra8_log_info(s_tag, "usbfs: HOCO running for USBCKCR source");
413
414 /* Step 2b: USBCKCR / USBCKDIVCR handshake. */
416 if (err != k_ra8_ok) {
417 return err;
418 }
419 ra8_log_info(s_tag, "usbfs clock ready (PLL2P/5 = 48 MHz)");
420 return k_ra8_ok;
421}
422
455
468typedef enum : uint32_t {
469 k_ra8_mstpb12_usbhs_mask = (uint32_t)(1UL << 12),
471
487{
488 volatile const uint8_t* const usb60ckcr = ra8_sys_usb60ckcr();
489 const uint8_t mask = (uint8_t)(1U << k_ra8_usbckcr_bit_srdy);
490 /* Bounded wait through ra8_hw_err.h: on host tests the ra8_fake_mmio
491 * seam decides the poll (first-poll success unless a test arms a
492 * fault), so the real timeout leg is reachable everywhere. */
493 if (expected != 0U) {
494 return ra8_hw_wait_flag_set8(usb60ckcr, mask, (uint32_t)k_ra8_usbhs_srdy_poll_limit);
495 }
496 return ra8_hw_wait_flag_clear8(usb60ckcr, mask, (uint32_t)k_ra8_usbhs_srdy_poll_limit);
497}
498
518{
519 ra8_err_t err = k_ra8_ok;
521 {
522 const uint8_t sreq_mask = (uint8_t)(1U << k_ra8_usbckcr_bit_sreq);
523 const uint8_t srdy_mask = (uint8_t)(1U << k_ra8_usbckcr_bit_srdy);
524 /* FSP `bsp_clocks.c` ::bsp_peripheral_clock_set sequence (HUM Ch 9
525 * "Clock selection switching procedure"):
526 *
527 * 1. Set SREQ=1 with read-modify-write so the current SEL field
528 * is preserved (the reset-default source is HOCO; clobbering
529 * SEL to 0 also writes "HOCO" but loses the invariant that
530 * SREQ is asserted on top of the EXISTING source -- this
531 * matters when the previous source is no longer running).
532 * 2. Spin-wait SRDY=1 (handshake acknowledge).
533 * 3. Programme USB60CKDIVCR (peripheral clock now stopped).
534 * 4. Write `source | SREQ | SRDY` -- the SRDY bit being set in
535 * the same write is mandatory per FSP (line 2896 of
536 * `bsp_clocks.c`); on RA8 Gen2 silicon, omitting SRDY here
537 * makes the subsequent SREQ-clear hang at step 6.
538 * 5. Clear SREQ via read-modify-write (peripheral clock starts).
539 * 6. Spin-wait SRDY=0 (start acknowledged). */
540 volatile uint8_t* const ckcr = ra8_sys_usb60ckcr();
541 *ckcr = (uint8_t)(*ckcr | sreq_mask);
543 if (err != k_ra8_ok) {
544 ra8_log_error(s_tag, "usbhs: SRDY=1 timeout");
545 break;
546 }
548 const uint8_t src = (uint8_t)((uint8_t)k_ra8_usbcksel_pll2p & k_ra8_usbckcr_mask_sel);
549 *ckcr = (uint8_t)(src | sreq_mask | srdy_mask);
550 *ckcr = (uint8_t)(*ckcr & (uint8_t)~sreq_mask);
552 if (err != k_ra8_ok) {
553 ra8_log_error(s_tag, "usbhs: SRDY=0 timeout");
554 break;
555 }
556 }
557 /* Diagnostic witnesses -- read OUTSIDE the PRCR window since
558 * USB60CKCR / OSCSF reads are not protected. */
561 return err;
562}
563
565{
567 {
568 volatile uint8_t* const hococr = ra8_sys_hococr();
569 if ((*hococr & (uint8_t)(1U << k_ra8_hococr_hcstp)) != 0U) {
570 *hococr = (uint8_t)((uint8_t)*hococr & (uint8_t)~(1U << k_ra8_hococr_hcstp));
571 }
572 }
573 /* On host tests the OSCSF wait consults the ra8_fake_mmio seam and
574 * succeeds on its first poll unless a test arms a fault -- no HOCOSF
575 * RAM seeding is needed for callers (USB60CKCR / ESWCKCR SREQ->SRDY
576 * handshakes) to make progress. */
578}
579
625{
626 ra8_log_info(s_tag, "usbhs phy clock enable");
627
628 /* Step 1: HUM Ch 9.2.21 "OSCSF : Oscillation Stabilization Flag
629 * Register", p 344. The USBHS PHY's 12 MHz reference is derived
630 * from the main XTAL; without MOSCSF=1 the PHY cannot lock. */
632 if (osc_err != k_ra8_ok) {
633 ra8_log_error_val(s_tag, "usbhs: main xtal not stable", (uint32_t)osc_err);
634 return osc_err;
635 }
636
637 /* Step 2: bring up PLL2 to land 240 MHz on PLL2P. Reuse the FS path's
638 * configuration -- 24 MHz XTAL / PL2IDIV(/2) * MUL(80) = 960 MHz VCO,
639 * PL2ODIVP=/4 -> PLL2P = 240 MHz. PLL2P / 4 = 60.000 MHz on USB60CLK
640 * exactly (0 ppm vs the USBHS 60 MHz spec target). ra8_cgc_pll2_enable
641 * is idempotent w.r.t. the PRCR window and tolerates being called
642 * once per USB controller bring-up (FS path also calls it). */
643 const ra8_err_t pll2_err = ra8_cgc_pll2_enable((uint8_t)k_ra8_pll2_usbfs_mul,
646 if (pll2_err != k_ra8_ok) {
647 ra8_log_error_val(s_tag, "usbhs: pll2 enable failed", (uint32_t)pll2_err);
648 return pll2_err;
649 }
650
651 /* Step 3: Force USBHS into module-stop (MSTPB12 = 1) BEFORE the SREQ
652 * handshake. HUM Ch 9 "Clock selection switching procedure" step 1 is
653 * mandatory whenever USB60CKDIVCR is moved off 1/1 (we are programming
654 * /4 below). MSTPCR is NOT PRCR-protected. ra8_usb_device_init() will
655 * release MSTPB12 again later via the ref-counted ra8_mstp_enable
656 * path for k_ra8_mstp_usbhs. */
658 (void)ra8_mstp()->MSTPCRB; /* HUM 11.2.7 Note 2: read-back. */
659
660 /* Step 4: Ensure HOCO is running so the SREQ->SRDY synchronizer can
661 * drain (USB60CKCR's reset-default source is HOCO). */
663 if (hoco_err != k_ra8_ok) {
664 ra8_log_error(s_tag, "usbhs: HOCO stabilization timeout");
665 return hoco_err;
666 }
667
668 /* Step 5: USB60CKCR / USB60CKDIVCR SREQ/SRDY handshake. */
670 if (err != k_ra8_ok) {
671 return err;
672 }
673
674 ra8_log_info(s_tag, "usbhs phy clock ready (PLL2P/4 = 60 MHz)");
675 return k_ra8_ok;
676}
static const char * s_tag
Logging / check tag.
Definition ra8_app.c:17
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
ra8_err_t priv_ra8_cgc_wait_oscsf_clear(uint8_t bit)
Bounded poll on a single OSCSF flag becoming clear.
Definition ra8_cgc.c:243
ra8_err_t priv_ra8_cgc_wait_oscsf_set(uint8_t bit)
Bounded poll on a single OSCSF flag becoming set.
Definition ra8_cgc.c:233
High-level Clock Generation Circuit driver.
Cross-TU sharing for the split Clock Generation Circuit driver.
@ k_ra8_cgc_quarters_per_unit
PLL multiplier 0.25 step.
Clock Generation Circuit (CGC) field layouts for the Renesas RA8D2.
@ k_ra8_pll2cr_run
Clear PLL2STP -> PLL2 runs.
@ k_ra8_pll2cr_stop
Set PLL2STP -> PLL2 stops.
@ k_ra8_pll2ccr_mask_quarters
11-bit (mul*4) field.
@ k_ra8_pll2ccr_mask_plidiv
PL2IDIV 2-bit field.
@ k_ra8_plidiv_div2
PLL input divide by 2.
ra8_plodiv_t
PLL output divider codes for PLODIVP/Q/R fields in PLLCCR2.
@ k_ra8_plodiv_div6
PLL output divide by 6.
@ k_ra8_plodiv_div4
PLL output divide by 4.
@ k_ra8_pllccr2_shift_plodivp
PLODIVP field starts at bit 0.
@ k_ra8_pllccr2_shift_plodivr
PLODIVR field starts at bit 8.
@ k_ra8_pllccr2_shift_plodivq
PLODIVQ field starts at bit 4.
@ k_ra8_pllccr_shift_quarters
(mul * 4) goes here.
@ k_ra8_pllccr_shift_plsrcsel
PLSRCSEL field is bit 4.
@ k_ra8_plsrcsel_main
Main-oscillator input (default on EK board).
@ k_ra8_hococr_hcstp
HCSTP: 0 operating, 1 stopped.
ra8_usbhs_clock_local_t
Local sentinels for the USB60CKCR SREQ/SRDY handshake.
@ k_ra8_usbhs_div4_code
USB60CKDIVCR codepoint /4.
@ k_ra8_usbhs_srdy_poll_limit
Iterations before timeout.
ra8_usbfs_mstp_local_t
Local sentinels for the USBFS module-stop pre-step.
@ k_ra8_mstpb11_usbfs_mask
MSTPCRB.MSTPB11 (USBFS0).
ra8_err_t ra8_cgc_pll2_enable(uint8_t mul_int, uint8_t mul_quarters, ra8_plodiv_t p_div_code)
Implementation of ra8_cgc_pll2_enable().
ra8_usbfs_clock_local_t
Local sentinels for the USBCKSRDY handshake and divider codes.
Definition ra8_cgc_usb.c:94
@ k_ra8_usbfs_srdy_poll_limit
Iterations before timeout.
@ k_ra8_usbfs_div8_code
USBCKDIVCR codepoint for /8.
@ k_ra8_usbfs_div5_code
USBCKDIVCR codepoint for /5.
ra8_usbhs_mstp_local_t
Local sentinels for the USBHS module-stop pre-step.
@ k_ra8_mstpb12_usbhs_mask
MSTPCRB.MSTPB12 (USBHS).
ra8_err_t priv_ra8_cgc_ensure_hoco_running_for_usb_ck(void)
Ensure HOCO is running so a USBCKCR/USB60CKCR/ESWCKCR SREQ->SRDY handshake can drain.
ra8_pll2_local_t
Local constants for the PLL2 bring-up path.
@ k_ra8_pll2_usbfs_quarters
Fractional quarter-steps (none).
@ k_ra8_pll2_usbfs_mul
Integer multiplier for PLL2 USBFS path.
@ k_ra8_pll2_max_quarters
Max value of PLL2MULNF[7:6].
static ra8_err_t internal_wait_usb60cksrdy(uint8_t expected)
Spin until USB60CKCR.USB60CKSRDY matches the expected value.
static ra8_err_t internal_pll2_program_protected(uint32_t pll2ccr, uint16_t pll2ccr2)
PRCR-protected stop+program+restart body of ra8_cgc_pll2_enable.
static ra8_err_t internal_wait_usbcksrdy(uint8_t expected)
Spin until USBCKCR.USBCKSRDY matches the expected value.
static ra8_err_t internal_usb60ckcr_switch_to_pll2p_div4(void)
PRCR-protected USB60CKCR / USB60CKDIVCR handshake body.
static volatile uint8_t s_pll2_status_probe
Last value read back from R_SYSTEM->OSCSF at the end of internal_usb60ckcr_switch_to_pll2p_div4.
Definition ra8_cgc_usb.c:83
static ra8_err_t internal_usbckcr_switch_to_pll2p_div5(void)
PRCR-protected USBCKCR / USBCKDIVCR handshake body.
static volatile uint8_t s_usb60ckcr_probe
Last value read back from R_SYSTEM->USB60CKCR at the end of internal_usb60ckcr_switch_to_pll2p_div4.
Definition ra8_cgc_usb.c:65
ra8_err_t ra8_cgc_usbfs_clock_enable(void)
Bring up the 48 MHz USB-FS clock from PLL2P / 5.
ra8_err_t ra8_cgc_usbhs_pll_enable(void)
Bring up the USBHS PHY 60 MHz reference clock + module clock path.
Validation and Error-Checking Macros for ra8-firmware.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
Definition ra8_err.h:152
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Definition ra8_err.h:119
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Bounded wait-flag primitives for RA8D2 HAL drivers.
static ra8_err_t ra8_hw_wait_flag_clear8(volatile const uint8_t *reg, uint8_t mask, uint32_t budget)
Spin until (*reg & mask) == 0 or budget runs out.
Definition ra8_hw_err.h:262
static ra8_err_t ra8_hw_wait_flag_set8(volatile const uint8_t *reg, uint8_t mask, uint32_t budget)
Spin until (*reg & mask) != 0 or budget runs out.
Definition ra8_hw_err.h:219
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_info_val(tag, message, value)
RA8 log info val.
Definition ra8_log.h:366
#define ra8_log_error_val(tag, message, value)
RA8 log error val.
Definition ra8_log.h:337
#define ra8_log_info(tag, message)
RA8 log info.
Definition ra8_log.h:364
#define ra8_log_error(tag, message)
RA8 log error.
Definition ra8_log.h:335
Ref-counted Module Stop Control wrapper for the RA8D2.
Module Stop Control (MSTP) register layout for the Renesas RA8D2.
static volatile r_mstp_regs_t * ra8_mstp(void)
Get pointer to the MSTP register block.
Scoped PRCR unlock helper.
#define RA8_PROTECTED_WRITE(unlock_val)
Scoped PRCR unlock block.
System Control (SYSC) register layout for the Renesas RA8D2.
static volatile uint8_t * ra8_sys_usbckcr(void)
Get pointer to the 8-bit USBCKCR (USB-FS source select).
@ k_ra8_prcr_unlock_cgc
RA8 prcr unlock cgc.
static volatile uint32_t * ra8_sys_pll2ccr(void)
Get pointer to the 32-bit PLL2CCR register (PLL2 input/mul/source).
static volatile uint16_t * ra8_sys_pll2ccr2(void)
Get pointer to the 16-bit PLL2CCR2 register (PLL2 output dividers).
@ k_ra8_oscsf_bit_pll2sf
PLL2 stabilisation flag.
@ k_ra8_oscsf_bit_moscsf
Main oscillator stab flag.
@ k_ra8_oscsf_bit_hocosf
HOCO stabilisation flag.
static volatile uint8_t * ra8_sys_hococr(void)
Get pointer to the 8-bit HOCOCR register.
static volatile uint8_t * ra8_sys_pll2cr(void)
Get pointer to the 8-bit PLL2CR register (PLL2 stop control).
static volatile uint8_t * ra8_sys_usbckdivcr(void)
Get pointer to the 8-bit USBCKDIVCR (USB clock divider).
static volatile uint8_t * ra8_sys_usb60ckdivcr(void)
Get pointer to the 8-bit USB60CKDIVCR (USBHS 60MHz divider).
static volatile uint8_t * ra8_sys_oscsf(void)
Get pointer to the 8-bit OSCSF (oscillation stabilisation) register.
static volatile uint8_t * ra8_sys_usb60ckcr(void)
Get pointer to the 8-bit USB60CKCR (USBHS 60MHz source select).
@ k_ra8_usbcksel_pll2p
PLL2P.
@ k_ra8_usbckcr_mask_sel
USBCKSEL field is 4 bits wide.
@ k_ra8_usbckcr_bit_srdy
USBCKSRDY – handshake ready.
@ k_ra8_usbckcr_bit_sreq
USBCKSREQ – request switch.
Named Time Unit Constants for Delay / Timeout / Tick Math.
volatile uint32_t MSTPCRB
Module Stop Control Register B (+0x04).