boot/spl: update for spl-in-libstrat

This commit is contained in:
Michael Scire
2019-06-22 12:23:46 -07:00
parent 804e5d49bb
commit d0d4888184
39 changed files with 105 additions and 720 deletions

View File

@@ -14,10 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere/spl.hpp>
#include "boot_boot_reason.hpp"
#include "boot_pmic_driver.hpp"
#include "boot_rtc_driver.hpp"
#include "boot_spl_utils.hpp"
namespace sts::boot {

View File

@@ -15,11 +15,11 @@
*/
#include <stratosphere/reg.hpp>
#include <stratosphere/spl.hpp>
#include "boot_display.hpp"
#include "boot_i2c_utils.hpp"
#include "boot_pmc_wrapper.hpp"
#include "boot_spl_utils.hpp"
#include "boot_registers_clkrst.hpp"
#include "boot_registers_di.hpp"

View File

@@ -14,8 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere/spl.hpp>
#include "boot_fan_enable.hpp"
#include "boot_spl_utils.hpp"
#include "gpio/gpio_utils.hpp"

View File

@@ -22,6 +22,7 @@
#include <switch.h>
#include <atmosphere.h>
#include <stratosphere.hpp>
#include <stratosphere/spl.hpp>
#include "boot_boot_reason.hpp"
#include "boot_change_voltage.hpp"
@@ -37,7 +38,6 @@
#include "pinmux/pinmux_initial_configuration.hpp"
#include "boot_power_utils.hpp"
#include "boot_spl_utils.hpp"
using namespace sts;

View File

@@ -14,9 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere/spl.hpp>
#include "boot_power_utils.hpp"
#include "boot_repair_boot_images.hpp"
#include "boot_spl_utils.hpp"
#include "updater/updater_api.hpp"

View File

@@ -1,47 +0,0 @@
/*
* Copyright (c) 2018-2019 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/>.
*/
#include "boot_spl_utils.hpp"
namespace sts::spl {
spl::HardwareType GetHardwareType() {
u64 out_val = 0;
R_ASSERT(splGetConfig(SplConfigItem_HardwareType, &out_val));
return static_cast<spl::HardwareType>(out_val);
}
bool IsRecoveryBoot() {
u64 val = 0;
R_ASSERT(splGetConfig(SplConfigItem_IsRecoveryBoot, &val));
return val != 0;
}
bool IsMariko() {
const auto hw_type = GetHardwareType();
switch (hw_type) {
case spl::HardwareType::Icosa:
case spl::HardwareType::Copper:
return false;
case spl::HardwareType::Hoag:
case spl::HardwareType::Iowa:
return true;
default:
std::abort();
}
}
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright (c) 2018-2019 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 <switch.h>
#include <stratosphere.hpp>
namespace sts::spl {
enum class HardwareType {
Icosa = 0,
Copper = 1,
Hoag = 2,
Iowa = 3,
};
/* SPL Utilities. */
HardwareType GetHardwareType();
bool IsRecoveryBoot();
bool IsMariko();
}

View File

@@ -14,8 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere/spl.hpp>
#include "boot_pmc_wrapper.hpp"
#include "boot_spl_utils.hpp"
#include "boot_wake_pins.hpp"
#include "boot_registers_pmc.hpp"

View File

@@ -14,12 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere/spl.hpp>
#include "gpio_initial_configuration.hpp"
#include "gpio_utils.hpp"
/* TODO: Better way? */
#include "../boot_spl_utils.hpp"
namespace sts::gpio {
namespace {

View File

@@ -14,13 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere/spl.hpp>
#include "pinmux_initial_configuration.hpp"
#include "pinmux_utils.hpp"
/* TODO: Better way? */
#include "../boot_spl_utils.hpp"
namespace sts::pinmux {
namespace {

View File

@@ -17,6 +17,7 @@
#pragma once
#include <switch.h>
#include <stratosphere.hpp>
#include <stratosphere/spl/spl_types.hpp>
#include "updater_types.hpp"

View File

@@ -18,9 +18,6 @@
#include <switch.h>
#include <stratosphere.hpp>
/* TODO: Better way to do this? */
#include "../boot_spl_utils.hpp"
namespace sts::updater {
/* Types. */