2018-09-07 16:00:13 +01:00
|
|
|
/*
|
2020-01-24 10:10:40 +00:00
|
|
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
2018-09-07 16:00:13 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2019-12-07 23:35:34 +00:00
|
|
|
|
2018-04-10 22:56:45 +01:00
|
|
|
#ifndef FUSEE_EXOSPHERE_CONFIG_H
|
|
|
|
#define FUSEE_EXOSPHERE_CONFIG_H
|
|
|
|
|
2019-05-27 20:07:51 +01:00
|
|
|
#include <stdint.h>
|
2019-12-09 11:58:48 +00:00
|
|
|
#include <vapours/ams_version.h>
|
2019-06-14 14:37:25 +01:00
|
|
|
#include "emummc_cfg.h"
|
2018-12-17 20:39:35 +00:00
|
|
|
|
2018-04-10 22:56:45 +01:00
|
|
|
/* This serves to set configuration for *exosphere itself*, separate from the SecMon Exosphere mimics. */
|
|
|
|
|
2019-01-30 21:53:16 +00:00
|
|
|
/* "EXO0" */
|
|
|
|
#define MAGIC_EXOSPHERE_CONFIG (0x304F5845)
|
2018-11-26 00:22:47 +00:00
|
|
|
|
2019-05-10 11:50:25 +01:00
|
|
|
#define EXOSPHERE_FLAG_PERFORM_620_KEYGEN (1 << 0u)
|
|
|
|
#define EXOSPHERE_FLAG_IS_DEBUGMODE_PRIV (1 << 1u)
|
|
|
|
#define EXOSPHERE_FLAG_IS_DEBUGMODE_USER (1 << 2u)
|
|
|
|
#define EXOSPHERE_FLAG_DISABLE_USERMODE_EXCEPTION_HANDLERS (1 << 3u)
|
2019-12-07 23:35:34 +00:00
|
|
|
#define EXOSPHERE_FLAG_ENABLE_USERMODE_PMU_ACCESS (1 << 4u)
|
2020-04-23 00:22:14 +01:00
|
|
|
#define EXOSPHERE_FLAG_BLANK_PRODINFO (1 << 5u)
|
|
|
|
#define EXOSPHERE_FLAG_ALLOW_WRITING_TO_CAL_SYSMMC (1 << 6u)
|
2018-04-10 23:37:58 +01:00
|
|
|
|
2020-12-11 11:18:21 +00:00
|
|
|
#define EXOSPHERE_LOG_FLAG_INVERTED (1 << 0u)
|
|
|
|
|
2018-04-10 23:37:58 +01:00
|
|
|
typedef struct {
|
2019-05-27 20:07:51 +01:00
|
|
|
uint32_t magic;
|
|
|
|
uint32_t target_firmware;
|
2020-12-08 03:25:06 +00:00
|
|
|
uint32_t flags[2];
|
|
|
|
uint16_t lcd_vendor;
|
|
|
|
uint8_t log_port;
|
2020-12-11 11:18:21 +00:00
|
|
|
uint8_t log_flags;
|
2020-12-08 03:25:06 +00:00
|
|
|
uint32_t log_baud_rate;
|
|
|
|
uint32_t reserved1[2];
|
2019-06-14 14:37:25 +01:00
|
|
|
exo_emummc_config_t emummc_cfg;
|
2018-04-10 23:37:58 +01:00
|
|
|
} exosphere_config_t;
|
|
|
|
|
2019-06-14 14:37:25 +01:00
|
|
|
_Static_assert(sizeof(exosphere_config_t) == 0x20 + sizeof(exo_emummc_config_t), "exosphere config definition");
|
2019-05-27 20:07:51 +01:00
|
|
|
|
2019-01-30 21:53:16 +00:00
|
|
|
#define MAILBOX_EXOSPHERE_CONFIGURATION ((volatile exosphere_config_t *)(0x8000F000ull))
|
2018-04-10 23:37:58 +01:00
|
|
|
|
|
|
|
#define EXOSPHERE_TARGETFW_KEY "target_firmware"
|
2018-12-01 21:58:09 +00:00
|
|
|
#define EXOSPHERE_DEBUGMODE_PRIV_KEY "debugmode"
|
|
|
|
#define EXOSPHERE_DEBUGMODE_USER_KEY "debugmode_user"
|
2019-05-10 11:50:25 +01:00
|
|
|
#define EXOSPHERE_DISABLE_USERMODE_EXCEPTION_HANDLERS_KEY "disable_user_exception_handlers"
|
2019-12-07 23:35:34 +00:00
|
|
|
#define EXOSPHERE_ENABLE_USERMODE_PMU_ACCESS_KEY "enable_user_pmu_access"
|
2020-04-23 00:22:14 +01:00
|
|
|
#define EXOSPHERE_BLANK_PRODINFO_SYSMMC_KEY "blank_prodinfo_sysmmc"
|
|
|
|
#define EXOSPHERE_BLANK_PRODINFO_EMUMMC_KEY "blank_prodinfo_emummc"
|
|
|
|
#define EXOSPHERE_ALLOW_WRITING_TO_CAL_SYSMMC_KEY "allow_writing_to_cal_sysmmc"
|
2020-12-08 03:25:06 +00:00
|
|
|
#define EXOSPHERE_LOG_PORT_KEY "log_port"
|
|
|
|
#define EXOSPHERE_LOG_BAUD_RATE_KEY "log_baud_rate"
|
2020-12-11 11:18:21 +00:00
|
|
|
#define EXOSPHERE_LOG_INVERTED_KEY "log_inverted"
|
2018-04-10 22:56:45 +01:00
|
|
|
|
2020-04-23 00:22:14 +01:00
|
|
|
typedef struct {
|
|
|
|
int debugmode;
|
|
|
|
int debugmode_user;
|
|
|
|
int disable_user_exception_handlers;
|
|
|
|
int enable_user_pmu_access;
|
|
|
|
int blank_prodinfo_sysmmc;
|
|
|
|
int blank_prodinfo_emummc;
|
|
|
|
int allow_writing_to_cal_sysmmc;
|
2020-12-08 03:25:06 +00:00
|
|
|
int log_port;
|
|
|
|
int log_baud_rate;
|
2020-12-11 11:18:21 +00:00
|
|
|
int log_inverted;
|
2020-04-23 00:22:14 +01:00
|
|
|
} exosphere_parse_cfg_t;
|
|
|
|
|
|
|
|
#endif
|