Atmosphere/libraries/libexosphere/include/exosphere/fuse.hpp

119 lines
3.4 KiB
C++
Raw Normal View History

/*
* Copyright (c) 2018-2020 Atmosphère-NX
*
* 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/>.
*/
#pragma once
#include <vapours.hpp>
#include <exosphere/br.hpp>
#include <exosphere/pmic.hpp>
namespace ams::fuse {
enum HardwareType {
HardwareType_Icosa = 0,
HardwareType_Copper = 1,
HardwareType_Hoag = 2,
HardwareType_Iowa = 3,
HardwareType_Calcio = 4,
HardwareType_Aula = 5,
HardwareType_Undefined = 0xF,
};
2020-05-15 09:32:17 +00:00
enum SocType {
SocType_Erista = 0,
SocType_Mariko = 1,
SocType_Undefined = 0xF,
};
enum HardwareState {
HardwareState_Development = 0,
HardwareState_Production = 1,
HardwareState_Undefined = 2,
};
enum PatchVersion {
PatchVersion_Odnx02A2 = (SocType_Erista << 12) | 0x07F,
};
2020-05-15 09:32:17 +00:00
enum DramId {
DramId_IcosaSamsung4GB = 0,
DramId_IcosaHynix4GB = 1,
DramId_IcosaMicron4GB = 2,
2021-04-06 20:37:46 +00:00
DramId_IowaHynix1y4GB = 3,
2020-05-15 09:32:17 +00:00
DramId_IcosaSamsung6GB = 4,
2021-04-06 20:37:46 +00:00
DramId_HoagHynix1y4GB = 5,
2020-05-15 09:32:17 +00:00
DramId_CopperMicron4GB = 6,
DramId_IowaX1X2Samsung4GB = 7,
DramId_IowaSansung4GB = 8,
DramId_IowaSamsung8GB = 9,
DramId_IowaHynix4GB = 10,
DramId_IowaMicron4GB = 11,
DramId_HoagSamsung4GB = 12,
DramId_HoagSamsung8GB = 13,
DramId_HoagHynix4GB = 14,
DramId_HoagMicron4GB = 15,
DramId_IowaSamsung4GBY = 16,
DramId_IowaSamsung1y4GBX = 17,
DramId_IowaSamsung1y8GBX = 18,
DramId_HoagSamsung1y4GBX = 19,
DramId_IowaSamsung1y4GBY = 20,
DramId_IowaSamsung1y8GBY = 21,
DramId_AulaSamsung1y4GB = 22,
2020-12-02 17:59:53 +00:00
DramId_HoagSamsung1y8GBX = 23,
DramId_AulaSamsung1y4GBX = 24,
2020-12-02 17:59:53 +00:00
DramId_IowaMicron1y4GB = 25,
DramId_HoagMicron1y4GB = 26,
DramId_AulaMicron1y4GB = 27,
DramId_AulaSamsung1y8GBX = 28,
2020-05-15 09:32:17 +00:00
DramId_Count,
};
enum QuestState {
QuestState_Disabled = 0,
QuestState_Enabled = 1,
};
void SetRegisterAddress(uintptr_t address);
void SetWriteSecureOnly();
void Lockout();
2020-05-15 09:32:17 +00:00
void Activate();
void Deactivate();
void Reload();
u32 ReadWord(int address);
u32 GetOdmWord(int index);
2020-05-15 09:32:17 +00:00
DramId GetDramId();
void GetEcid(br::BootEcid *out);
HardwareType GetHardwareType();
HardwareState GetHardwareState();
2020-05-15 09:32:17 +00:00
u64 GetDeviceId();
PatchVersion GetPatchVersion();
2020-05-15 09:32:17 +00:00
QuestState GetQuestState();
pmic::Regulator GetRegulator();
2020-05-15 09:32:17 +00:00
int GetDeviceUniqueKeyGeneration();
SocType GetSocType();
int GetExpectedFuseVersion(TargetFirmware target_fw);
bool HasRcmVulnerabilityPatch();
2020-06-11 08:30:30 +00:00
bool IsOdmProductionMode();
void ConfigureFuseBypass();
}