|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
NSC veneers for the Clock Generation Circuit driver. More...
#include "ra8_nsc_cgc.h"#include <stdint.h>#include "ra8_cgc.h"#include "ra8_check.h"#include "ra8_err.h"#include "ra8_nsc_veneer.h"Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_nsc_cgc_pll2_enable (uint8_t mul_int, uint8_t mul_quarters, ra8_plodiv_t p_div_code) |
| NSC veneer: bring up PLL2 with the given multiplier and divider. | |
| ra8_err_t | ra8_nsc_cgc_usbfs_clock_enable (void) |
| NSC veneer: bring up the USB-FS module clock. | |
| ra8_err_t | ra8_nsc_cgc_get_clock_hz (ra8_clock_id_t id, uint32_t *hz_out) |
| NSC veneer: query a clock-tree frequency. | |
Variables | |
| static const char * | s_tag = "NSCCGC" |
| Logging tag for the CGC veneers. | |
NSC veneers for the Clock Generation Circuit driver.
Implements the Non-Secure Callable veneers declared in ra8_nsc_cgc.h. Each entry validates pointer arguments (when present) and forwards to the secure ra8_cgc_* API. The CGC register block (System Control) is permanently Secure on the RA8D2; this file is the only TZ-safe path for Non-Secure code to request clock-tree changes.
Definition in file ra8_nsc_cgc.c.
|
nodiscard |
NSC veneer: query a clock-tree frequency.
Range-checks hz_out against the NS data region and forwards to ra8_cgc_get_clock_hz.
| [in] | id | Clock identifier. |
| [out] | hz_out | NS destination for the frequency in Hz. |
| k_ra8_ok | Frequency stored. |
| k_ra8_err_null_ptr | hz_out was NULL. |
| k_ra8_err_invalid_arg | hz_out outside NS region or bad id. |
Definition at line 121 of file ra8_nsc_cgc.c.
References ra8_cgc_get_clock_hz(), RA8_CHECK_NULL_PTR, RA8_NSC_CHECK_NS_RANGE_RW, RA8_NSC_VENEER, and s_tag.
Referenced by ns_exercise_veneers().
|
nodiscard |
NSC veneer: bring up PLL2 with the given multiplier and divider.
Forwards to ra8_cgc_pll2_enable. No pointer arguments crossing the TZ boundary, so no NS range-check is needed.
| [in] | mul_int | PLL2 multiplier integer part. |
| [in] | mul_quarters | PLL2 multiplier quarter part. |
| [in] | p_div_code | PLL2 P-divider code. |
| k_ra8_ok | PLL2 locked. |
| k_ra8_err_invalid_arg | Bad multiplier. |
| k_ra8_err_hw_timeout | PLL2SF handshake timed out. |
Definition at line 63 of file ra8_nsc_cgc.c.
References ra8_cgc_pll2_enable(), and RA8_NSC_VENEER.
Referenced by ns_exercise_veneers().
|
nodiscard |
NSC veneer: bring up the USB-FS module clock.
NSC veneer: bring up the USB-FS module clock (USBCKCR / USBCKDIVCR).
Forwards to ra8_cgc_usbfs_clock_enable.
| k_ra8_ok | USB-FS clock running. |
| k_ra8_err_hw_timeout | USBCKSRDY never came up. |
Definition at line 90 of file ra8_nsc_cgc.c.
References ra8_cgc_usbfs_clock_enable(), and RA8_NSC_VENEER.
Referenced by ns_exercise_veneers().
|
static |
Logging tag for the CGC veneers.
Definition at line 35 of file ra8_nsc_cgc.c.