Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsysccr/cdc: Add language and ext update functions #368

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 95 additions & 6 deletions include/nsysccr/cdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef enum CCRCDCWakeStateEnum
typedef enum CCRCDCUicConfigIdEnum
{
//! EEPROM offset 0x200, Size 0x3
CCR_CDC_UIC_CONFIG_ID_UNK0 = 0,
CCR_CDC_UIC_CONFIG_ID_LANGUAGE_BANK = 0,
//! EEPROM offset 0x20D, Size 0x6
CCR_CDC_UIC_CONFIG_ID_MIC_CONFIG = 2,
//! EEPROM offset 0x213, Size 0xE
Expand All @@ -77,23 +77,23 @@ typedef enum CCRCDCUicConfigIdEnum
//! EEPROM offset 0x206, Size 0x3
CCR_CDC_UIC_CONFIG_ID_UNK8 = 8,
//! EEPROM offset 0x256, Size 0x6
CCR_CDC_UIC_CONFIG_ID_UNK9 = 9,
CCR_CDC_UIC_CONFIG_ID_LANGUAGE_EXT_ID = 9,
//! EEPROM offset 0x289, Size 0xC
CCR_CDC_UIC_CONFIG_ID_TV_CONTROL_ID = 10,
//! EEPROM offset 0x262, Size 0x6
CCR_CDC_UIC_CONFIG_ID_UNK11 = 11,
CCR_CDC_UIC_CONFIG_ID_EXT_ID_2 = 11,
//! EEPROM offset 0x268, Size 0x6
CCR_CDC_UIC_CONFIG_ID_UNK12 = 12,
CCR_CDC_UIC_CONFIG_ID_EXT_ID_3 = 12,
//! EEPROM offset 0x26E, Size 0x6
CCR_CDC_UIC_CONFIG_ID_UNK13 = 13,
CCR_CDC_UIC_CONFIG_ID_EXT_ID_4 = 13,
//! EEPROM offset 0x274, Size 0x3
CCR_CDC_UIC_CONFIG_ID_INIT_BOOT_FLAG = 14,
//! EEPROM offset 0x277, Size 0xF
CCR_CDC_UIC_CONFIG_ID_UNK15 = 15,
//! EEPROM offset 0x286, Size 0x3
CCR_CDC_UIC_CONFIG_ID_LCD_MODE = 16,
//! EEPROM offset 0x25C, Size 0x6
CCR_CDC_UIC_CONFIG_ID_UNK17 = 17,
CCR_CDC_UIC_CONFIG_ID_RC_DATABASE_EXT_ID = 17,
//! EEPROM offset 0x295, Size 0x3
CCR_CDC_UIC_CONFIG_ID_UNK18 = 18,
//! EEPROM offset 0x298, Size 0x3
Expand Down Expand Up @@ -616,6 +616,57 @@ CCRCDCSoftwareAbort(CCRCDCDestination dest);
int32_t
CCRCDCSoftwareActivate(CCRCDCDestination dest);

/**
* Perform a language update.
*
* \param dest
* The destination to start a language update.
*
* \param path
* Absolute path to read the language file from.
* Note that this path needs to be accessible from IOS-PAD (e.g. on the MLC).
*
* \param outVersion
* Pointer to store the language version to.
*
* \param callback
* Callback to call once the update completes or \c NULL for synchronous updating.
*
* \param userContext
* User provided value which is passed to the callback.
*
* \return
* 0 on success.
*/
int32_t
CCRCDCSoftwareLangUpdate(CCRCDCDestination dest,
const char *path,
uint32_t *outVersion,
IOSAsyncCallbackFn callback,
void *userContext);

/**
* Activate a performed language update.
*
* \param dest
* The destination to send the command to.
*
* \param version
* The version which should be updated.
* This should be the version returned by \link CCRCDCSoftwareLangUpdate \endlink.
*
* \param outActivationResult
* Pointer to store the activation result to.
* 0 on success, 2 if writing to the EEPROM failed.
*
* \return
* 0 on success.
*/
int32_t
CCRCDCSoftwareLangActivate(CCRCDCDestination dest,
uint32_t version,
uint32_t *outActivationResult);

/**
* Get an ext id from the specified destination.
*
Expand All @@ -636,6 +687,44 @@ CCRCDCSoftwareGetExtId(CCRCDCDestination dest,
CCRCDCExt ext,
uint32_t *outId);

/**
* Perform an ext update.
*
* \param dest
* The destination to start a software update.
*
* \param path
* Absolute path to read the update file from.
* Note that this path needs to be accessible from IOS-PAD (e.g. on the MLC).
*
* \param imageSize
* The size of the image which should be flashed.
* IOSU will correct this value with a warning, if it isn't correct.
*
* \param extId
* The extId which should be written to the EEPROM once the update is complete.
*
* \param ext
* The ext data which should be updated.
*
* \param callback
* Callback to call once the update completes or \c NULL for synchronous updating.
*
* \param userContext
* User provided value which is passed to the callback.
*
* \return
* 0 on success.
*/
int32_t
CCRCDCSoftwareExtUpdate(CCRCDCDestination dest,
const char *path,
uint32_t imageSize,
uint32_t extId,
CCRCDCExt ext,
IOSAsyncCallbackFn callback,
void *userContext);

#ifdef __cplusplus
}
#endif
Expand Down
Loading