SceClockgen: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
m (→‎sceClockgenAudioClkEnableForDriver: Indicate which clock is turned on)
(→‎Hardware: Rework section)
Line 10: Line 10:
== Hardware ==
== Hardware ==


<code>P1P40167</code> ''1.8V 4-PLL Low Power Clock Generator'' by ON Semiconductor (onsemi)
Clockgen is a derivative of the <code>P1P40167</code> ''1.8V 4-PLL Low Power Clock Generator'' by ON Semiconductor (onsemi).
The reference frequency of 27 MHz is generated thank to an on-board oscillator (from Analog Devices).


An oscillator provides the reference 27MHz frequency from which 5 clock signals are derived:
According to the <code>P1P40167</code> datasheet, 5 clock signals are generated by Clockgen:
* Fixed 22.5792 MHz
{| class="wikitable"
* Fixed 27 MHz (= buffered reference clock)
|-
* Fixed 37 MHz (w/ spread spectrum feature)
! Clock !! Usage !! Notes
* Fixed 48 MHz (<code>UCLK</code>?)
|-
* Configurable ''Audio Clock'' (22.5792 or 24.576 MHz)
| 22.5792 MHz || <code>CameraClk</code>? ||
|-
| 27 MHz || <code>WlanBtClk</code>? || Buffered oscillator clock
|-
| 37 MHz || ? || Configurable spread-spectrum. Always on?
|-
| 48 MHz || <code>UCLK</code>? || "Main" Kermit clock? Always on.
|-
| ''Audio Clock'' || <code>AudioClk</code>? || Configurable (22.5792 or 24.576 MHz)
|}
However, <code>MotionClk</code> is missing from this list (maybe it's the 37 MHz clock?).


Kermit communicates with Clockgen via I²C.
Communication between Kermit and Clockgen is performed over I²C (bus 0, address 0xD2).


== Libraries ==
== Libraries ==

Revision as of 21:59, 27 October 2024

Module

Version World Privilege
0.940-3.65 Non-secure Kernel

Hardware

Clockgen is a derivative of the P1P40167 1.8V 4-PLL Low Power Clock Generator by ON Semiconductor (onsemi). The reference frequency of 27 MHz is generated thank to an on-board oscillator (from Analog Devices).

According to the P1P40167 datasheet, 5 clock signals are generated by Clockgen:

Clock Usage Notes
22.5792 MHz CameraClk?
27 MHz WlanBtClk? Buffered oscillator clock
37 MHz ? Configurable spread-spectrum. Always on?
48 MHz UCLK? "Main" Kermit clock? Always on.
Audio Clock AudioClk? Configurable (22.5792 or 24.576 MHz)

However, MotionClk is missing from this list (maybe it's the 37 MHz clock?).

Communication between Kermit and Clockgen is performed over I²C (bus 0, address 0xD2).

Libraries

Known NIDs

Version Name World Visibility NID
0.940-3.60 SceClockgenForDriver Non-secure Kernel 0xFF160234

SceClockgenForDriver

sceClockgenInitForDriver

Version NID
3.60 0x0BA41732

This is a guessed name.

int sceClockgenInitForDriver(void);

sceClockgenSetProtocolForDriver

Version NID
3.60 0xEFE8A68C

This is a guessed name.

Changes behaviour of #sceClockgenInit. Default is true.

int sceClockgenSetProtocolForDriver(SceBool protocol);

sceClockgenGetRegValueForDriver

Version NID
3.60 0x09072366

This is a guessed name. Returns the cached value of Clockgen register reg.

// reg: between 0 and 2
int sceClockgenGetRegValueForDriver(SceUInt32 reg);

sceClockgenSetSpectrumSpreadingForDriver

Version NID
3.60 0xA2CA8B65
int sceClockgenSetSpectrumSpreadingForDriver(SceUInt32 mode);

sceClockgenGetRevisionForDriver

Version NID
3.60 0xCF63B11D

This is a guessed name.

int sceClockgenGetRevisionForDriver(void);

sceClockgenWlanBtClkEnableForDriver

Version NID
0.990-3.60 0x7B28A724
int sceClockgenWlanBtClkEnableForDriver(void);

sceClockgenWlanBtClkDisableForDriver

Version NID
0.990-3.60 0xB6F0A532
int sceClockgenWlanBtClkDisableForDriver(void);

sceClockgenCameraClkEnableForDriver

Version NID
0.940-3.60 0x06663ECA

Enables the 22 MHz output of Clockgen.

int sceClockgenCameraClkEnableForDriver(void);

sceClockgenCameraClkDisableForDriver

Version NID
0.940-3.60 0x82F39378
int sceClockgenCameraClkDisableForDriver(void);

sceClockgenAudioClkEnableForDriver

Version NID
3.60 0x5130682D

This is a guessed name. Enables the configurable 22/24M output of Clockgen.

int sceClockgenAudioClkEnableForDriver(void);

sceClockgenAudioClkDisableForDriver

Version NID
3.60 0xF0A0242D

This is a guessed name.

int sceClockgenAudioClkDisableForDriver(void);

sceClockgenAudioClkSetSamplingFreqForDriver

Version NID
3.60 0x820D3516

This is a guessed name.

// 44100 or 48000, default 48000
int sceClockgenAudioClkSetSamplingFreqForDriver(SceUInt32 frequency);

sceClockgenMotionClkEnableForDriver

Version NID
3.60 0x62478916

This is a guessed name.

int sceClockgenMotionClkEnableForDriver(void);

sceClockgenMotionClkDisableForDriver

Version NID
3.60 0x66AC5580

This is a guessed name.

int sceClockgenMotionClkDisableForDriver(void);