NetBurner 3.5.8
PDF Version
clock_diag.h
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
5/* clock_diag.h - read-only HyperRAM (FlexSPI) clock and RX-tap diagnostics.
6 *
7 * The SOMRT1061 boot monitor owns the HyperRAM clock and the DLL RX sampling
8 * tap (it calibrates the tap at first boot and applies it on every boot).
9 * This module makes no changes to either - it only decodes the live CCM and
10 * FlexSPI registers so the values can be reported:
11 *
12 * - on the config server's Diagnostics tab (:20034/DIAG, entry
13 * "HyperRamClock"), and
14 * - as a one-line boot report via ClockDiagPrint().
15 */
16#ifndef CLOCK_DIAG_H
17#define CLOCK_DIAG_H
18#include <stdint.h>
19
20/* Live HyperRAM interface state, decoded from the clock tree and DLLCR. */
21struct HyperRamClockInfo
22{
23 uint32_t sckHz; // HyperRAM DDR serial clock
24 uint32_t pfd2Frac; // PFD_528.PFD2_FRAC field value
25 uint32_t tap; // RX sampling tap (override tap, or live auto tap)
26 bool ovrd; // true = fixed override tap
27 bool dllen; // DLL machinery enabled
28 uint32_t dllcr; // raw DLLCR[0]
29};
30
31void GetHyperRamClockInfo(HyperRamClockInfo *out);
32
33/* One-line console report: SCK and RX tap. */
34void ClockDiagPrint(void);
35
36#endif /* CLOCK_DIAG_H */