Talk:SC Communication: Difference between revisions
No edit summary |
No edit summary |
||
Line 139: | Line 139: | ||
=== Power Service (0x13) === | === Power Service (0x13) === | ||
==== Shutdown ==== | |||
Purpose: Shutdown console. | |||
<pre> | |||
struct __attribute__ ((packed)) shutdown_request_t { | |||
uint8_t cmd; // 0x00 | |||
}; | |||
</pre> | |||
==== Reboot ==== | |||
Purpose: Reboot console. | |||
<pre> | |||
struct __attribute__ ((packed)) reboot_request_t { | |||
uint8_t cmd; // 0x01 | |||
}; | |||
</pre> | |||
=== NVS Service (0x14) === | |||
==== EEPROM write ==== | |||
Purpose: Write block of data to EEPROM. | |||
<pre> | |||
struct __attribute__ ((packed)) nvs_access_request_t { | |||
uint8_t cmd; // 0x20 | |||
uint8_t index; | |||
uint8_t offset; | |||
uint8_t size; // 0x00 for full block | |||
}; | |||
struct __attribute__ ((packed)) nvs_access_response_t { | |||
uint8_t status; // 0x00:OK, 0x02:Invalid block index, 0x03:Invalid offset/size | |||
uint8_t index; | |||
uint8_t offset; | |||
uint8_t size; | |||
uint8_t data[0]; | |||
}; | |||
</pre> | |||
==== EEPROM read ==== | |||
Purpose: Read block of data from EEPROM. | |||
<pre> | |||
struct __attribute__ ((packed)) nvs_access_request_t { | |||
uint8_t cmd; // 0x10 | |||
uint8_t index; | |||
uint8_t offset; | |||
uint8_t size; // 0x00 for full block | |||
}; | |||
struct __attribute__ ((packed)) nvs_access_response_t { | |||
uint8_t status; // 0x00:OK, 0x02:Invalid block index, 0x03:Invalid offset/size | |||
uint8_t index; | |||
uint8_t offset; | |||
uint8_t size; | |||
uint8_t data[0]; | |||
}; | |||
</pre> | |||
==== Query system power up cause ==== | ==== Query system power up cause ==== |
Revision as of 12:07, 7 November 2014
0x30 AV Service return packet when HDMI inserted (personal info removed):
000c000: 3001 0000 0000 8031 8000 0000 0104 0104 0......1........ 000c010: 2000 0282 00ff ffff ffff ff00 0469 fa22 ............i." 000c020: 0101 0101 2c15 0103 8030 1b78 eec4 f5a3 ....,....0.x.... 000c030: 574a 9c23 1150 54bf ef00 714f 8180 8140 WJ.#.PT...qO...@ 000c040: 9500 a940 b300 d1c0 0101 023a 8018 7138 ...@.......:..q8 000c050: 2d40 582c 4500 132b 2100 001e 0000 00fd -@X,E..+!....... 000c060: 0032 4c1e 5311 000a 2020 2020 2020 0000 .2L.S... .. 000c070: 00fc 0056 4532 3238 0a20 2020 2020 2020 ...VE228. 000c080: 0000 00ff 00XX XXXX XXXX XXXX XXXX XXXX .....EDIDSERIALN 000c090: XX0a 0188 0203 1ef1 4b90 0504 0302 0111 M.......K....... 000c0a0: 1213 141f 2309 0707 8301 0000 6503 0c00 ....#.......e... 000c0b0: 1000 1a36 80a0 7038 1e40 3020 3500 132b ...6..p8.@0 5..+ 000c0c0: 2100 001a 6621 56aa 5100 1e30 468f 3300 !...f!V.Q..0F.3. 000c0d0: 132b 2100 001e 011d 0072 51d0 1e20 6e28 .+!......rQ.. n( 000c0e0: 5500 132b 2100 001e 8c0a d08a 20e0 2d10 U..+!....... .-. 000c0f0: 103e 9600 132b 2100 0018 011d 8018 711c .>...+!.......q. 000c100: 1620 582c 2500 132b 2100 009f 0000 0000 . X,%..+!.......
Syscon packets
Timezone/Thermal Service (0x11)
Get temperature
Purpose: Used to get current temperature.
struct __attribute__ ((packed)) get_temperature_request_t { uint8_t cmd; // 0x20 uint8_t param; // 0xFF }; struct __attribute__ ((packed)) get_temperature_response_t { uint8_t unk1; // status? uint8_t unk2; // status? uint8_t data[32]; };
- To calculate temperature in celsius use: (data[0] * 0x64) >> 8.
Configuration Service (0x12)
Get IDlog information
Purpose: Can be used to get CID/eCID information.
struct __attribute__ ((packed)) get_idlog_info_request_t { uint8_t cmd; // 0x03 uint8_t param; // 0x01 }; struct __attribute__ ((packed)) get_idlog_info_response_t { uint8_t cmd; uint8_t padding[3]; uint8_t ecid[16]; uint8_t cid[6]; };
Get reference clock
Purpose: Used to calculate an initial value of timebase register.
struct __attribute__ ((packed)) get_reference_clock_request_t { uint8_t cmd; // 0x03 uint8_t param; // 0x10 }; struct __attribute__ ((packed)) get_reference_clock_response_t { uint8_t cmd; uint8_t padding[3]; uint32_t ref_clock_value; uint32_t unk; };
Get core clock multiplier
Purpose: Used together with reference clock to calculate clock frequency.
struct __attribute__ ((packed)) get_core_clock_multiplier_request_t { uint8_t cmd; // 0x03 uint8_t param; // 0x00 }; struct __attribute__ ((packed)) get_core_clock_multiplier_response_t { uint8_t cmd; uint8_t padding[3]; uint8_t id; // 00:2, 01:4, 03: 8, 04:10, 05:12, 06:16, 07:20 };
- Clock frequency = core clock multiplier table[id] * reference clock.
- For example, if you have id=3 and reference clock=400000000, then your clock frequency will be: 400000000*8=3200000000 (3.2 Ghz)
Get platform ID
Purpose: Used to get platform ID (Cytology, Cookie, etc).
struct __attribute__ ((packed)) get_platform_id_request_t { uint8_t cmd; // 0x20 uint8_t param; // 0x10 }; struct __attribute__ ((packed)) get_platform_id_response_t { uint8_t cmd; uint8_t padding[3]; uint8_t platform_id[8]; // ASCII-string };
Get hardware configuration
Purpose: Used to get hardware configuration (PS2 emulation compatibility, card support, WLAN interface, etc).
struct __attribute__ ((packed)) get_hw_config_request_t { uint8_t cmd; // 0x22 }; struct __attribute__ ((packed)) get_hw_config_response_t { uint8_t cmd; uint8_t padding[3]; uint8_t data[12]; };
Get BE counters
Purpose: Used to get several BE counters.
struct __attribute__ ((packed)) get_be_counters_request_t { uint8_t cmd; // 0x41 }; struct __attribute__ ((packed)) get_be_counters_response_t { uint8_t cmd; uint32_t total_operation_time; uint32_t power_on_counter; uint32_t power_off_counter; };
Power Service (0x13)
Shutdown
Purpose: Shutdown console.
struct __attribute__ ((packed)) shutdown_request_t { uint8_t cmd; // 0x00 };
Reboot
Purpose: Reboot console.
struct __attribute__ ((packed)) reboot_request_t { uint8_t cmd; // 0x01 };
NVS Service (0x14)
EEPROM write
Purpose: Write block of data to EEPROM.
struct __attribute__ ((packed)) nvs_access_request_t { uint8_t cmd; // 0x20 uint8_t index; uint8_t offset; uint8_t size; // 0x00 for full block }; struct __attribute__ ((packed)) nvs_access_response_t { uint8_t status; // 0x00:OK, 0x02:Invalid block index, 0x03:Invalid offset/size uint8_t index; uint8_t offset; uint8_t size; uint8_t data[0]; };
EEPROM read
Purpose: Read block of data from EEPROM.
struct __attribute__ ((packed)) nvs_access_request_t { uint8_t cmd; // 0x10 uint8_t index; uint8_t offset; uint8_t size; // 0x00 for full block }; struct __attribute__ ((packed)) nvs_access_response_t { uint8_t status; // 0x00:OK, 0x02:Invalid block index, 0x03:Invalid offset/size uint8_t index; uint8_t offset; uint8_t size; uint8_t data[0]; };
Query system power up cause
Purpose: Get information about system power up cause.
struct __attribute__ ((packed)) query_system_power_up_cause_request_t { uint8_t cmd; // 0x10 }; struct __attribute__ ((packed)) query_system_power_up_cause_response_t { uint8_t cmd; uint8_t padding1[3]; uint32_t wake_source; uint8_t requested_os_context; uint8_t current_os_context; uint8_t requested_gr_context; uint8_t current_gr_context; uint8_t last_shutdown_cause; uint8_t padding2[3]; };
Get realtime clock
Purpose: Get current value of realtime clock.
struct __attribute__ ((packed)) get_rtc_request_t { uint8_t cmd; // 0x33 }; struct __attribute__ ((packed)) get_rtc_response_t { uint8_t cmd; uint8_t padding[3]; uint32_t rtc; };
Livelock Service (0x18)
Get syscon version
Purpose: Get information about syscon version.
struct __attribute__ ((packed)) get_sc_version_request_t { uint8_t cmd; // 0x12/0x14 }; struct __attribute__ ((packed)) get_sc_version_response_t { uint8_t cmd; uint8_t padding[3]; uint16_t version; };
A/V Service (0x30)
Get HDMI KSV
Purpose: Get HDMI key selection vector.
struct __attribute__ ((packed)) get_hdmi_ksv_request_t { uint8_t cmd; // 0x11 }; struct __attribute__ ((packed)) get_hdmi_ksv_response_t { uint8_t result; uint8_t padding[3]; uint8_t ksv[5]; };