vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Data Structures

struct  SceSysconPacket
 
struct  SceSysconDebugHandlers
 A set of debug handlers for syscon, that you can set in ksceSysconSetDebugHandlers(). More...
 
struct  SceKernelTouchpanelDeviceInfo
 Touch-panel vendor IDs and firmware revisions returned by ksceSysconGetTouchpanelDeviceInfo. More...
 

Macros

#define SCE_SYSCON_PACKET_TX_CMD_LO   0
 
#define SCE_SYSCON_PACKET_TX_CMD_HI   1
 
#define SCE_SYSCON_PACKET_TX_LENGTH   2
 
#define SCE_SYSCON_PACKET_TX_DATA(i)   (3 + (i))
 
#define SCE_SYSCON_PACKET_RX_STATUS_LO   0
 
#define SCE_SYSCON_PACKET_RX_STATUS_HI   1
 
#define SCE_SYSCON_PACKET_RX_LENGTH   2
 
#define SCE_SYSCON_PACKET_RX_RESULT   3
 
#define SCE_SYSCON_PACKET_RX_DATA(i)   (4 + (i))
 
#define SCE_SYSCON_BATTERY_BL_MAX_TRANSFER_SIZE   0x10
 
#define SCE_SYSCON_NVS_SIZE   0xB60
 
#define SCE_SYSCON_UPDATER_DIGEST_SIZE   0x14
 

Typedefs

typedef int(* SceSysconCmdExecAsyncCallback) (SceSysconPacket *packet, void *argp)
 
typedef void(* SceSysconCallback) (int enable, void *argp)
 

Enumerations

enum  SceSysconCmd { SCE_SYSCON_CMD_RESET_DEVICE = 0x0C }
 
enum  SceSysconResetType { SCE_SYSCON_RESET_TYPE_POWEROFF = 0x00 , SCE_SYSCON_RESET_TYPE_SUSPEND = 0x01 , SCE_SYSCON_RESET_TYPE_COLD_RESET = 0x02 , SCE_SYSCON_RESET_TYPE_SOFT_RESET = 0x11 }
 
enum  SceSysconControl {
  SCE_SYSCON_CTRL_UP = 0x1 , SCE_SYSCON_CTRL_RIGHT = 0x2 , SCE_SYSCON_CTRL_DOWN = 0x4 , SCE_SYSCON_CTRL_LEFT = 0x8 ,
  SCE_SYSCON_CTRL_TRIANGLE = 0x10 , SCE_SYSCON_CTRL_CIRCLE = 0x20 , SCE_SYSCON_CTRL_CROSS = 0x40 , SCE_SYSCON_CTRL_SQUARE = 0x80 ,
  SCE_SYSCON_CTRL_SELECT = 0x100 , SCE_SYSCON_CTRL_LTRIGGER = 0x200 , SCE_SYSCON_CTRL_RTRIGGER = 0x400 , SCE_SYSCON_CTRL_START = 0x800 ,
  SCE_SYSCON_CTRL_PSBUTTON = 0x1000 , SCE_SYSCON_CTRL_POWER = 0x4000 , SCE_SYSCON_CTRL_VOLUP = 0x10000 , SCE_SYSCON_CTRL_VOLDOWN = 0x20000 ,
  SCE_SYSCON_CTRL_HEADPHONE = 0x8000000
}
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x80, SceSysconPacket)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceSysconDebugHandlers)
 
int ksceSysconWaitInitialized (void)
 Waits until the syscon is initialized.
 
int ksceSysconCmdExec (SceSysconPacket *packet, unsigned int flags)
 Execute synchronously a syscon packet.
 
int ksceSysconCmdExecAsync (SceSysconPacket *packet, unsigned int flags, SceSysconCmdExecAsyncCallback cb, void *argp)
 Execute asynchronously a syscon packet.
 
int ksceSysconCmdSync (SceSysconPacket *packet, int noWait)
 Wait for the currently queued syscon packets to be executed, or check if any are in the queue.
 
int ksceSysconSetPowerMode (int type, int mode)
 Reset the device.
 
int ksceSysconReadCommand (unsigned short cmd, void *buffer, SceSize size)
 
int ksceSysconSendCommand (unsigned short cmd, const void *buffer, SceSize size)
 
int ksceSysconSetDebugHandlers (const SceSysconDebugHandlers *handlers)
 Set the debug handlers.
 
int ksceSysconCtrlLED (int led, int enable)
 Turn a LED on or off.
 
int ksceSysconCtrlRMRPower (int power)
 Set the memory stick power.
 
int ksceSysconCtrlSdPower (int power)
 Set the SD power.
 
int ksceSysconCtrlHdmiCecPower (int power)
 Set the ADV7533 HDMI CEC power.
 
int ksceSysconCtrlManualChargeMode (int)
 
int ksceSysconEnableHibernateIO (int)
 
int ksceSysconIduModeClear (void)
 
int ksceSysconIduModeSet (void)
 
int ksceSysconIsDownLoaderMode (void)
 
int ksceSysconLogStart (void)
 
int ksceSysconLogStartWaiting (void)
 
int ksceSysconLogReadData (unsigned short, void *buff, SceSize size)
 
int ksceSysconShowModeClear (void)
 
int ksceSysconShowModeSet (void)
 
int ksceSysconGetBaryonVersion (void)
 Get the baryon version.
 
unsigned long long ksceSysconGetBaryonTimestamp ()
 Get the baryon timestamp.
 
int ksceSysconGetBatteryCalibData (int *, int *, int *, int *)
 
int ksceSysconGetHardwareInfo (void)
 
int ksceSysconGetHardwareInfo2 (int *, int *, int *)
 
int ksceSysconGetLogInfo (int *)
 
int ksceSysconGetManualChargeMode (int *)
 
int ksceSysconGetManufacturesStatus (int *)
 
int ksceSysconGetTemperatureLog (int *)
 
int ksceSysconGetUsbDetStatus (int *)
 
int ksceSysconClearTemperatureLog (int)
 
int ksceSysconBeginConfigstorageTransaction (void)
 
int ksceSysconCommitConfigstorageTransaction (void)
 
int ksceSysconEndConfigstorageTransaction (void)
 
int ksceSysconLoadConfigstorageScript (unsigned short, const void *buff, SceSize size)
 
int ksceSysconVerifyConfigstorageScript (unsigned short, const void *buff, SceSize size)
 
int ksceSysconSetAlarmCallback (SceSysconCallback callback, void *argp)
 Set the alarm callback, that will be ran when the alarm timer is passed.
 
int ksceSysconSetLowBatteryCallback (SceSysconCallback callback, void *argp)
 Set the low battery callback, that will be ran when the battery is low.
 
int ksceSysconSetThermalAlertCallback (SceSysconCallback callback, void *argp)
 Set the thermal alert callback, that will be ran when the temperature reaches a critical point.
 
int ksceSysconGetControlsInfo (SceUInt32 *ctrl)
 Get physics button control info.
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceKernelTouchpanelDeviceInfo)
 
int ksceSysconBatteryExecBLCommand (SceUInt16 command_context)
 Execute the current battery-bootloader command context.
 
int ksceSysconBatteryReadBLCommand (SceUInt16 command_context, SceUInt8 request0, SceUInt8 request1, void *dst, SceUInt8 size)
 Read data from a battery-bootloader command response.
 
int ksceSysconBatterySWReset (void)
 Request a battery-controller software reset.
 
int ksceSysconBatterySetBLCommand (SceUInt16 command_context, SceUInt8 offset, const void *src, SceUInt8 size)
 Write one chunk of battery-bootloader command data.
 
int ksceSysconBatteryStartBLMode (void)
 Enter battery-bootloader mode.
 
int ksceSysconBatteryStopBLMode (void)
 Leave battery-bootloader mode.
 
int ksceSysconCtrlAccPower (SceBool enable)
 Control accessory-port power with Syscon command 0x0889.
 
int ksceSysconCtrlDevKitUsbPower (SceBool enable)
 Control DevKit USB power with Syscon command 0x089C.
 
int ksceSysconCtrlDolceUsbPower (SceBool enable)
 Control PSTV/Dolce USB power with Syscon command 0x08C5.
 
int ksceSysconCtrlHostOutputViaDongle (SceBool enable)
 Control host diagnostic output through the Jig dongle.
 
int ksceSysconGetBatteryVersion (SceUInt32 *hardware_version, SceUInt32 *firmware_version, SceUInt32 *data_flash_version)
 Get the battery hardware, firmware, and data-flash versions.
 
int ksceSysconGetMicroUsbInfo (SceUInt32 *info)
 Get the cached raw Micro-USB connector information.
 
int ksceSysconGetMultiCnInfo (SceUInt32 *info)
 Get the cached multi-connector information, with the mappings below.
 
int ksceSysconGetTouchpanelDeviceInfo (SceKernelTouchpanelDeviceInfo *info)
 Get the front and rear touch-panel vendor IDs and firmware revisions.
 
int ksceSysconJigClosePort (void)
 Close the Jig port.
 
int ksceSysconJigOpenPort (void)
 Open the Jig port.
 
int ksceSysconJigSetConfig (SceUInt8 config0, SceUInt8 config1)
 Set the two raw Jig configuration bytes.
 
int ksceSysconNvsReadData (SceUInt32 offset, void *buffer, SceSize size)
 Read one aligned block from Syscon NVS.
 
int ksceSysconNvsSetRunMode (int mode)
 Set the Syscon NVS run mode.
 
int ksceSysconNvsWriteData (SceUInt32 offset, const void *buffer, SceSize size)
 Write one aligned block to Syscon NVS.
 
int ksceSysconSetMultiCnPort (int port)
 Select the multi-connector port routing with Syscon command 0x0190.
 
int ksceSysconUpdaterCalcChecksum (const void *segment, SceSize segment_size, SceUInt32 *checksum)
 Calculate the checksum of a Syscon updater firmware segment.
 
int ksceSysconUpdaterExecFinalize (const void *digest, SceSize size)
 Finalize Syscon firmware programming.
 
int ksceSysconUpdaterExecProgramming (SceUInt32 checksum)
 Program the selected Syscon firmware segment.
 
int ksceSysconUpdaterSetRunMode (int mode)
 Set the Syscon updater run mode.
 
int ksceSysconUpdaterSetSegment (SceUInt32 segment_no)
 Select a Syscon updater firmware segment.
 

Variables

struct SceSysconPacket * SceSysconPacket::next
 
unsigned int SceSysconPacket::status
 
SceUID SceSysconPacket::semaId
 
unsigned int SceSysconPacket::unk
 
unsigned char SceSysconPacket::tx [32]
 
unsigned char SceSysconPacket::rx [32]
 
unsigned int SceSysconPacket::unk1 [4]
 
int(* SceSysconPacket::callback )(struct SceSysconPacket *packet, void *argp)
 
void * SceSysconPacket::argp
 
unsigned int SceSysconPacket::time
 
unsigned int SceSysconPacket::unk2 [5]
 
int SceSysconDebugHandlers::size
 Structure size (probably, unused).
 
void(* SceSysconDebugHandlers::start )(SceSysconPacket *packet)
 Callback ran right before running a packet, with a pointer to it passed as the first argument.
 
void(* SceSysconDebugHandlers::end )(SceSysconPacket *packet)
 Callback ran right after finishing running a packet, with a pointer to it passed as the first argument.
 
SceUInt16 SceKernelTouchpanelDeviceInfo::front_vendor_id
 Front touch-panel vendor ID.
 
SceUInt16 SceKernelTouchpanelDeviceInfo::front_firmware_rev
 Front touch-panel firmware revision.
 
SceUInt16 SceKernelTouchpanelDeviceInfo::rear_vendor_id
 Rear touch-panel vendor ID.
 
SceUInt16 SceKernelTouchpanelDeviceInfo::rear_firmware_rev
 Rear touch-panel firmware revision.
 

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceSysconForDriver_stub




Data Structure Documentation

◆ SceSysconPacket

struct SceSysconPacket

Data Fields

struct SceSysconPacket * next
 
unsigned int status
 
SceUID semaId
 
unsigned int unk
 
unsigned char tx [32]
 
unsigned char rx [32]
 
unsigned int unk1 [4]
 
int(* callback )(struct SceSysconPacket *packet, void *argp)
 
void * argp
 
unsigned int time
 
unsigned int unk2 [5]
 

◆ SceSysconDebugHandlers

struct SceSysconDebugHandlers

A set of debug handlers for syscon, that you can set in ksceSysconSetDebugHandlers().

Data Fields

int size
 Structure size (probably, unused).
 
void(* start )(SceSysconPacket *packet)
 Callback ran right before running a packet, with a pointer to it passed as the first argument.
 
void(* end )(SceSysconPacket *packet)
 Callback ran right after finishing running a packet, with a pointer to it passed as the first argument.
 

◆ SceKernelTouchpanelDeviceInfo

struct SceKernelTouchpanelDeviceInfo

Touch-panel vendor IDs and firmware revisions returned by ksceSysconGetTouchpanelDeviceInfo.

Data Fields
SceUInt16 front_vendor_id Front touch-panel vendor ID.
SceUInt16 front_firmware_rev Front touch-panel firmware revision.
SceUInt16 rear_vendor_id Rear touch-panel vendor ID.
SceUInt16 rear_firmware_rev Rear touch-panel firmware revision.

Macro Definition Documentation

◆ SCE_SYSCON_PACKET_TX_CMD_LO

#define SCE_SYSCON_PACKET_TX_CMD_LO   0

◆ SCE_SYSCON_PACKET_TX_CMD_HI

#define SCE_SYSCON_PACKET_TX_CMD_HI   1

◆ SCE_SYSCON_PACKET_TX_LENGTH

#define SCE_SYSCON_PACKET_TX_LENGTH   2

◆ SCE_SYSCON_PACKET_TX_DATA

#define SCE_SYSCON_PACKET_TX_DATA (   i)    (3 + (i))

◆ SCE_SYSCON_PACKET_RX_STATUS_LO

#define SCE_SYSCON_PACKET_RX_STATUS_LO   0

◆ SCE_SYSCON_PACKET_RX_STATUS_HI

#define SCE_SYSCON_PACKET_RX_STATUS_HI   1

◆ SCE_SYSCON_PACKET_RX_LENGTH

#define SCE_SYSCON_PACKET_RX_LENGTH   2

◆ SCE_SYSCON_PACKET_RX_RESULT

#define SCE_SYSCON_PACKET_RX_RESULT   3

◆ SCE_SYSCON_PACKET_RX_DATA

#define SCE_SYSCON_PACKET_RX_DATA (   i)    (4 + (i))

◆ SCE_SYSCON_BATTERY_BL_MAX_TRANSFER_SIZE

#define SCE_SYSCON_BATTERY_BL_MAX_TRANSFER_SIZE   0x10

◆ SCE_SYSCON_NVS_SIZE

#define SCE_SYSCON_NVS_SIZE   0xB60

◆ SCE_SYSCON_UPDATER_DIGEST_SIZE

#define SCE_SYSCON_UPDATER_DIGEST_SIZE   0x14

Typedef Documentation

◆ SceSysconCmdExecAsyncCallback

typedef int(* SceSysconCmdExecAsyncCallback) (SceSysconPacket *packet, void *argp)

◆ SceSysconCallback

typedef void(* SceSysconCallback) (int enable, void *argp)

Enumeration Type Documentation

◆ SceSysconCmd

Enumerator
SCE_SYSCON_CMD_RESET_DEVICE 

◆ SceSysconResetType

Enumerator
SCE_SYSCON_RESET_TYPE_POWEROFF 
SCE_SYSCON_RESET_TYPE_SUSPEND 
SCE_SYSCON_RESET_TYPE_COLD_RESET 
SCE_SYSCON_RESET_TYPE_SOFT_RESET 

◆ SceSysconControl

Enumerator
SCE_SYSCON_CTRL_UP 
SCE_SYSCON_CTRL_RIGHT 
SCE_SYSCON_CTRL_DOWN 
SCE_SYSCON_CTRL_LEFT 
SCE_SYSCON_CTRL_TRIANGLE 
SCE_SYSCON_CTRL_CIRCLE 
SCE_SYSCON_CTRL_CROSS 
SCE_SYSCON_CTRL_SQUARE 
SCE_SYSCON_CTRL_SELECT 
SCE_SYSCON_CTRL_LTRIGGER 
SCE_SYSCON_CTRL_RTRIGGER 
SCE_SYSCON_CTRL_START 
SCE_SYSCON_CTRL_PSBUTTON 
SCE_SYSCON_CTRL_POWER 
SCE_SYSCON_CTRL_VOLUP 
SCE_SYSCON_CTRL_VOLDOWN 
SCE_SYSCON_CTRL_HEADPHONE 

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/3]

VITASDK_BUILD_ASSERT_EQ ( 0x80  ,
SceSysconPacket   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/3]

VITASDK_BUILD_ASSERT_EQ ( 0xC  ,
SceSysconDebugHandlers   
)

◆ ksceSysconWaitInitialized()

int ksceSysconWaitInitialized ( void  )

Waits until the syscon is initialized.

Returns
0 on success.

◆ ksceSysconCmdExec()

int ksceSysconCmdExec ( SceSysconPacket *  packet,
unsigned int  flags 
)

Execute synchronously a syscon packet.

Parameters
packetThe packet to execute. Its tx member needs to be initialized.
flagsThe packet flags. Check SceSysconPacketFlags.
Returns
0 on success.

◆ ksceSysconCmdExecAsync()

int ksceSysconCmdExecAsync ( SceSysconPacket *  packet,
unsigned int  flags,
SceSysconCmdExecAsyncCallback  cb,
void *  argp 
)

Execute asynchronously a syscon packet.

Parameters
packetThe packet to execute. Its tx member needs to be initialized.
flagsThe packet flags. Check SceSysconPacketFlags.
cbThe packet callback. Check the callback member of SceSysconPacket.
argpThe second argument that will be passed to the callback when executed.
Returns
0 on success.

◆ ksceSysconCmdSync()

int ksceSysconCmdSync ( SceSysconPacket *  packet,
int  noWait 
)

Wait for the currently queued syscon packets to be executed, or check if any are in the queue.

Parameters
packetThe packet you want to check or wait for, or NULL if you want to check or wait for all the currently running packets.
noWaitSet to 1 if you just want to check the packet status, or 0 if you want the function to return only when the packet queue is empty.
Returns
1 if packets are still running (and noWait was set to 1), 0 on success, < 0 otherwise.

◆ ksceSysconSetPowerMode()

int ksceSysconSetPowerMode ( int  type,
int  mode 
)

Reset the device.

Parameters
typeThe reset type value, one of SceSysconResetType.
modeThe resetting mode (?).
Returns
0 on success.

◆ ksceSysconReadCommand()

int ksceSysconReadCommand ( unsigned short  cmd,
void *  buffer,
SceSize  size 
)

◆ ksceSysconSendCommand()

int ksceSysconSendCommand ( unsigned short  cmd,
const void *  buffer,
SceSize  size 
)

◆ ksceSysconSetDebugHandlers()

int ksceSysconSetDebugHandlers ( const SceSysconDebugHandlers *  handlers)

Set the debug handlers.

Returns
0.

◆ ksceSysconCtrlLED()

int ksceSysconCtrlLED ( int  led,
int  enable 
)

Turn a LED on or off.

Parameters
ledThe LED id.
enableSet this value to 1 if you want the LED to turn on, or 0 if you want it to turn off.
Returns
0 on success.

◆ ksceSysconCtrlRMRPower()

int ksceSysconCtrlRMRPower ( int  power)

Set the memory stick power.

Parameters
powerThe new power value.
Returns
0 on success.

◆ ksceSysconCtrlSdPower()

int ksceSysconCtrlSdPower ( int  power)

Set the SD power.

Parameters
powerThe new power value.
Returns
0 on success.

◆ ksceSysconCtrlHdmiCecPower()

int ksceSysconCtrlHdmiCecPower ( int  power)

Set the ADV7533 HDMI CEC power.

Parameters
powerThe new power value.
Returns
0 on success.

◆ ksceSysconCtrlManualChargeMode()

int ksceSysconCtrlManualChargeMode ( int  )

◆ ksceSysconEnableHibernateIO()

int ksceSysconEnableHibernateIO ( int  )

◆ ksceSysconIduModeClear()

int ksceSysconIduModeClear ( void  )

◆ ksceSysconIduModeSet()

int ksceSysconIduModeSet ( void  )

◆ ksceSysconIsDownLoaderMode()

int ksceSysconIsDownLoaderMode ( void  )

◆ ksceSysconLogStart()

int ksceSysconLogStart ( void  )

◆ ksceSysconLogStartWaiting()

int ksceSysconLogStartWaiting ( void  )

◆ ksceSysconLogReadData()

int ksceSysconLogReadData ( unsigned short  ,
void *  buff,
SceSize  size 
)

◆ ksceSysconShowModeClear()

int ksceSysconShowModeClear ( void  )

◆ ksceSysconShowModeSet()

int ksceSysconShowModeSet ( void  )

◆ ksceSysconGetBaryonVersion()

int ksceSysconGetBaryonVersion ( void  )

Get the baryon version.

Returns
The baryon version.

◆ ksceSysconGetBaryonTimestamp()

unsigned long long ksceSysconGetBaryonTimestamp ( )

Get the baryon timestamp.

Returns
The baryon timestamp.

◆ ksceSysconGetBatteryCalibData()

int ksceSysconGetBatteryCalibData ( int *  ,
int *  ,
int *  ,
int *   
)

◆ ksceSysconGetHardwareInfo()

int ksceSysconGetHardwareInfo ( void  )

◆ ksceSysconGetHardwareInfo2()

int ksceSysconGetHardwareInfo2 ( int *  ,
int *  ,
int *   
)

◆ ksceSysconGetLogInfo()

int ksceSysconGetLogInfo ( int *  )

◆ ksceSysconGetManualChargeMode()

int ksceSysconGetManualChargeMode ( int *  )

◆ ksceSysconGetManufacturesStatus()

int ksceSysconGetManufacturesStatus ( int *  )

◆ ksceSysconGetTemperatureLog()

int ksceSysconGetTemperatureLog ( int *  )

◆ ksceSysconGetUsbDetStatus()

int ksceSysconGetUsbDetStatus ( int *  )

◆ ksceSysconClearTemperatureLog()

int ksceSysconClearTemperatureLog ( int  )

◆ ksceSysconBeginConfigstorageTransaction()

int ksceSysconBeginConfigstorageTransaction ( void  )

◆ ksceSysconCommitConfigstorageTransaction()

int ksceSysconCommitConfigstorageTransaction ( void  )

◆ ksceSysconEndConfigstorageTransaction()

int ksceSysconEndConfigstorageTransaction ( void  )

◆ ksceSysconLoadConfigstorageScript()

int ksceSysconLoadConfigstorageScript ( unsigned short  ,
const void *  buff,
SceSize  size 
)

◆ ksceSysconVerifyConfigstorageScript()

int ksceSysconVerifyConfigstorageScript ( unsigned short  ,
const void *  buff,
SceSize  size 
)

◆ ksceSysconSetAlarmCallback()

int ksceSysconSetAlarmCallback ( SceSysconCallback  callback,
void *  argp 
)

Set the alarm callback, that will be ran when the alarm timer is passed.

Parameters
callbackThe callback function.
argpThe second argument that will be passed to the callback.
Returns
0.

◆ ksceSysconSetLowBatteryCallback()

int ksceSysconSetLowBatteryCallback ( SceSysconCallback  callback,
void *  argp 
)

Set the low battery callback, that will be ran when the battery is low.

Parameters
callbackThe callback function.
argpThe second argument that will be passed to the callback.
Returns
0.

◆ ksceSysconSetThermalAlertCallback()

int ksceSysconSetThermalAlertCallback ( SceSysconCallback  callback,
void *  argp 
)

Set the thermal alert callback, that will be ran when the temperature reaches a critical point.

Parameters
callbackThe callback function.
argpThe second argument that will be passed to the callback.
Returns
0.

◆ ksceSysconGetControlsInfo()

int ksceSysconGetControlsInfo ( SceUInt32 *  ctrl)

Get physics button control info.

Parameters
[out]ctrl- The pointer of physics button control info output
Returns
0 on success.

◆ VITASDK_BUILD_ASSERT_EQ() [3/3]

VITASDK_BUILD_ASSERT_EQ ( 0x8  ,
SceKernelTouchpanelDeviceInfo   
)

◆ ksceSysconBatteryExecBLCommand()

int ksceSysconBatteryExecBLCommand ( SceUInt16  command_context)

Execute the current battery-bootloader command context.

FW 3.60 uses Syscon command 0x09B3. On Baryon versions through 0x00070503 it uses the legacy command 0x08B3. SceSblUpdateMgr numbers script records starting at 1 and uses each record's number as the command context.

Parameters
[in]command_contextBattery-bootloader command context.
Returns
0 on success, or a negative Syscon error.

◆ ksceSysconBatteryReadBLCommand()

int ksceSysconBatteryReadBLCommand ( SceUInt16  command_context,
SceUInt8  request0,
SceUInt8  request1,
void *  dst,
SceUInt8  size 
)

Read data from a battery-bootloader command response.

FW 3.60 uses Syscon command 0x09B4, or legacy command 0x08B4 on Baryon versions through 0x00070503. The two request bytes are transmitted independently and unmodified; their individual purposes are unknown.

Parameters
[in]command_contextBattery-bootloader command context.
[in]request0First raw request byte.
[in]request1Second raw request byte.
[out]dstRequired buffer that receives size bytes.
[in]sizeNumber of bytes to read, from 1 through SCE_SYSCON_BATTERY_BL_MAX_TRANSFER_SIZE.
Returns
0 on success, 0x80250001 for an invalid size, or a negative Syscon error.

◆ ksceSysconBatterySWReset()

int ksceSysconBatterySWReset ( void  )

Request a battery-controller software reset.

FW 3.60 uses Syscon command 0x0989. Baryon versions through 0x00070503 do not support this operation and return 0x8025023F without sending a command.

Returns
0 on success, or a negative Syscon error.

◆ ksceSysconBatterySetBLCommand()

int ksceSysconBatterySetBLCommand ( SceUInt16  command_context,
SceUInt8  offset,
const void *  src,
SceUInt8  size 
)

Write one chunk of battery-bootloader command data.

FW 3.60 uses Syscon command 0x09B2, or legacy command 0x08B2 on Baryon versions through 0x00070503. SceSblUpdateMgr uses offset as the byte offset of this chunk within the current script record.

Parameters
[in]command_contextBattery-bootloader command context.
[in]offsetByte offset of the chunk within the command data.
[in]srcRequired source buffer.
[in]sizeNumber of bytes to write, from 1 through SCE_SYSCON_BATTERY_BL_MAX_TRANSFER_SIZE.
Returns
0 on success, 0x80250001 for an invalid size, or a negative Syscon error.

◆ ksceSysconBatteryStartBLMode()

int ksceSysconBatteryStartBLMode ( void  )

Enter battery-bootloader mode.

Uses Syscon command 0x09B0, or legacy command 0x08B0 on Baryon versions through 0x00070503.

Returns
0 on success, or a negative Syscon error.

◆ ksceSysconBatteryStopBLMode()

int ksceSysconBatteryStopBLMode ( void  )

Leave battery-bootloader mode.

Uses Syscon command 0x09B1, or legacy command 0x08B1 on Baryon versions through 0x00070503.

Returns
0 on success, or a negative Syscon error.

◆ ksceSysconCtrlAccPower()

int ksceSysconCtrlAccPower ( SceBool  enable)

Control accessory-port power with Syscon command 0x0889.

The low 16 bits are sent without validation. Observed FW 3.60 callers use SCE_FALSE and SCE_TRUE.

Parameters
[in]enableRequested accessory-power state.
Returns
0 on success, or a negative Syscon/context error.

◆ ksceSysconCtrlDevKitUsbPower()

int ksceSysconCtrlDevKitUsbPower ( SceBool  enable)

Control DevKit USB power with Syscon command 0x089C.

The low 16 bits are sent without validation. Observed FW 3.60 callers use SCE_FALSE and SCE_TRUE.

Parameters
[in]enableRequested DevKit USB-power state.
Returns
0 on success, or a negative Syscon/context error.

◆ ksceSysconCtrlDolceUsbPower()

int ksceSysconCtrlDolceUsbPower ( SceBool  enable)

Control PSTV/Dolce USB power with Syscon command 0x08C5.

The low 16 bits are sent without validation. Observed FW 3.60 callers use SCE_FALSE and SCE_TRUE.

Parameters
[in]enableRequested PSTV USB-power state.
Returns
0 on success, or a negative Syscon/context error.

◆ ksceSysconCtrlHostOutputViaDongle()

int ksceSysconCtrlHostOutputViaDongle ( SceBool  enable)

Control host diagnostic output through the Jig dongle.

Syscon command 0x00B2 receives the low 16 bits without validation. The PostSs manager disables this output while it owns the Jig port and restores it afterward on newer hardware.

Parameters
[in]enableRequested host-output state.
Returns
0 on success, or a negative Syscon/context error.

◆ ksceSysconGetBatteryVersion()

int ksceSysconGetBatteryVersion ( SceUInt32 *  hardware_version,
SceUInt32 *  firmware_version,
SceUInt32 *  data_flash_version 
)

Get the battery hardware, firmware, and data-flash versions.

Each output may be NULL. For each non-NULL output, FW 3.60 stores the 16-bit response value in a 32-bit word with the upper 16 bits set to zero. It uses command 0x0980, or legacy command 0x0882 on Baryon versions through 0x00070503.

Parameters
[out]hardware_versionBattery hardware version, or NULL.
[out]firmware_versionBattery firmware version, or NULL.
[out]data_flash_versionBattery data-flash version, or NULL.
Returns
0 on success, or a negative Syscon error.

◆ ksceSysconGetMicroUsbInfo()

int ksceSysconGetMicroUsbInfo ( SceUInt32 *  info)

Get the cached raw Micro-USB connector information.

Bits 8 through 15 contain the connector code. SceUsbServ treats code 0x02 as permitting USB device mode on FW 3.60.

Parameters
[out]infoOptional output for the 32-bit information value.
Returns
Always 0 on FW 3.60.

◆ ksceSysconGetMultiCnInfo()

int ksceSysconGetMultiCnInfo ( SceUInt32 *  info)

Get the cached multi-connector information, with the mappings below.

Bits 8 through 15 contain the connector code. On hardware versions below 0x00400000, FW 3.60 maps the raw codes 0x60, 0x51, 0x65, and 0x55 to 0x00, 0x02, 0x04, and 0x05 respectively, and maps every other raw code to 0xFF. A genuine PSTV receives code 0x00 regardless of the cached value.

SceUsbServ treats codes 0x00 and 0x04 as permitting USB device mode on the older multi-connector hardware. SceHpremote identifies code 0x03 as an audio-output dock.

Parameters
[out]infoOptional output for the 32-bit information value after mapping.
Returns
Always 0 on FW 3.60.

◆ ksceSysconGetTouchpanelDeviceInfo()

int ksceSysconGetTouchpanelDeviceInfo ( SceKernelTouchpanelDeviceInfo *  info)

Get the front and rear touch-panel vendor IDs and firmware revisions.

Uses Syscon command 0x0380.

Parameters
[out]infoRequired 8-byte output structure.
Returns
0 on success, 0x80250002 when info is NULL, or a negative Syscon error.

◆ ksceSysconJigClosePort()

int ksceSysconJigClosePort ( void  )

Close the Jig port.

FW 3.60 holds an internal mutex during the operation and uses Syscon command 0x2081. Closing an already-closed port returns 0x80250001.

Returns
0 on success, or a negative state, mutex, or Syscon error.

◆ ksceSysconJigOpenPort()

int ksceSysconJigOpenPort ( void  )

Open the Jig port.

FW 3.60 holds an internal mutex during the operation and uses Syscon command 0x2080. Opening an already-open port returns 0x80250001.

Returns
0 on success, or a negative state, mutex, or Syscon error.

◆ ksceSysconJigSetConfig()

int ksceSysconJigSetConfig ( SceUInt8  config0,
SceUInt8  config1 
)

Set the two raw Jig configuration bytes.

The port must be open. Syscon command 0x2082 receives the two bytes followed by two zero bytes. Their individual purposes are unknown; the only observed FW 3.60 caller passes zero for both.

Parameters
[in]config0First raw configuration byte.
[in]config1Second raw configuration byte.
Returns
0 on success, 0x80250001 when the port is closed, or a negative mutex or Syscon error.

◆ ksceSysconNvsReadData()

int ksceSysconNvsReadData ( SceUInt32  offset,
void *  buffer,
SceSize  size 
)

Read one aligned block from Syscon NVS.

Uses Syscon command 0x1082. Valid transfer sizes are 1, 2, 4, 8, and 16 bytes. offset must be aligned to size, and the transfer must remain within SCE_SYSCON_NVS_SIZE bytes.

Parameters
[in]offsetByte offset in NVS.
[out]bufferRequired destination buffer.
[in]sizeTransfer size in bytes.
Returns
0 on success, 0x80250001 for an invalid size, alignment, or range, or a negative Syscon error.

◆ ksceSysconNvsSetRunMode()

int ksceSysconNvsSetRunMode ( int  mode)

Set the Syscon NVS run mode.

Syscon command 0x1080 receives the low 16 bits without validation. Observed FW 3.60 callers pass zero before NVS reads and writes.

Parameters
[in]modeRaw NVS run-mode value.
Returns
0 on success, or a negative Syscon/context error.

◆ ksceSysconNvsWriteData()

int ksceSysconNvsWriteData ( SceUInt32  offset,
const void *  buffer,
SceSize  size 
)

Write one aligned block to Syscon NVS.

Uses Syscon command 0x1083. Valid transfer sizes are 1, 2, 4, 8, and 16 bytes. offset must be aligned to size, and the transfer must remain within SCE_SYSCON_NVS_SIZE bytes.

Parameters
[in]offsetByte offset in NVS.
[in]bufferRequired source buffer.
[in]sizeTransfer size in bytes.
Returns
0 on success, 0x80250001 for an invalid size, alignment, or range, or a negative Syscon error.

◆ ksceSysconSetMultiCnPort()

int ksceSysconSetMultiCnPort ( int  port)

Select the multi-connector port routing with Syscon command 0x0190.

Only the low 24 bits are transmitted and the value is not validated. The PostSs manager uses 0 for Jig routing and 0x10000 for normal routing.

Parameters
[in]portRaw routing value.
Returns
0 on success, or a negative Syscon/context error.

◆ ksceSysconUpdaterCalcChecksum()

int ksceSysconUpdaterCalcChecksum ( const void *  segment,
SceSize  segment_size,
SceUInt32 *  checksum 
)

Calculate the checksum of a Syscon updater firmware segment.

This function does not contact Syscon. It adds the unsigned bytes modulo 2^32 and writes the bitwise complement of the sum to checksum.

Parameters
[in]segmentSegment data. Must not be NULL.
[in]segment_sizeNumber of bytes. Must not be zero.
[out]checksumReceives the complemented 32-bit byte sum. Must not be NULL.
Returns
0 on success, or 0x80250001 for an invalid pointer or size.

◆ ksceSysconUpdaterExecFinalize()

int ksceSysconUpdaterExecFinalize ( const void *  digest,
SceSize  size 
)

Finalize Syscon firmware programming.

Syscon command 0x1184 receives the 20-byte digest. SceSblUpdateMgr supplies the digest from the type-0x20 updater record.

Parameters
[in]digestDigest data. Must not be NULL.
[in]sizeDigest size in bytes. Must be exactly SCE_SYSCON_UPDATER_DIGEST_SIZE.
Returns
0 on success, 0x80250001 for an invalid pointer or size, or a negative Syscon error.

◆ ksceSysconUpdaterExecProgramming()

int ksceSysconUpdaterExecProgramming ( SceUInt32  checksum)

Program the selected Syscon firmware segment.

Syscon command 0x1182 receives the checksum produced by ksceSysconUpdaterCalcChecksum.

Parameters
[in]checksumComplemented 32-bit segment checksum.
Returns
0 on success, or a negative Syscon error.

◆ ksceSysconUpdaterSetRunMode()

int ksceSysconUpdaterSetRunMode ( int  mode)

Set the Syscon updater run mode.

FW 3.60 accepts only 0x152E, 0x3665, 0x72BA, 0x9A54, and 0xC5E7. Command 0x1183 receives the 16-bit value. SceSblUpdateMgr begins updates in modes 0, 2, and 3 with 0x9A54, 0x3665, and 0xC5E7 respectively. It ends updates in modes 2 and 3 with 0x72BA. It does not use 0x152E.

Parameters
[in]modeUpdater run-mode value.
Returns
0 on success, 0x80250001 for any other value, or a negative Syscon error.

◆ ksceSysconUpdaterSetSegment()

int ksceSysconUpdaterSetSegment ( SceUInt32  segment_no)

Select a Syscon updater firmware segment.

Syscon command 0x1180 receives only the low eight bits of segment_no; the value is not range-checked.

Parameters
[in]segment_noSegment number.
Returns
0 on success, or a negative Syscon error.

Variable Documentation

◆ next

struct SceSysconPacket* SceSysconPacket::next

◆ status

unsigned int SceSysconPacket::status

◆ semaId

SceUID SceSysconPacket::semaId

◆ unk

unsigned int SceSysconPacket::unk

◆ tx

unsigned char SceSysconPacket::tx[32]

◆ rx

unsigned char SceSysconPacket::rx[32]

◆ unk1

unsigned int SceSysconPacket::unk1[4]

◆ callback

int(* SceSysconPacket::callback) (struct SceSysconPacket *packet, void *argp)

◆ argp

void* SceSysconPacket::argp

◆ time

unsigned int SceSysconPacket::time

◆ unk2

unsigned int SceSysconPacket::unk2[5]

◆ size

int SceSysconDebugHandlers::size

Structure size (probably, unused).

◆ start

void(* SceSysconDebugHandlers::start) (SceSysconPacket *packet)

Callback ran right before running a packet, with a pointer to it passed as the first argument.

◆ end

void(* SceSysconDebugHandlers::end) (SceSysconPacket *packet)

Callback ran right after finishing running a packet, with a pointer to it passed as the first argument.

◆ front_vendor_id

SceUInt16 SceKernelTouchpanelDeviceInfo::front_vendor_id

Front touch-panel vendor ID.

◆ front_firmware_rev

SceUInt16 SceKernelTouchpanelDeviceInfo::front_firmware_rev

Front touch-panel firmware revision.

◆ rear_vendor_id

SceUInt16 SceKernelTouchpanelDeviceInfo::rear_vendor_id

Rear touch-panel vendor ID.

◆ rear_firmware_rev

SceUInt16 SceKernelTouchpanelDeviceInfo::rear_firmware_rev

Rear touch-panel firmware revision.