mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-18 17:14:28 -04:00
exo2: rename exosphere2 -> exosphere
This commit is contained in:
parent
282f8f6612
commit
42f1a3bf60
136 changed files with 15 additions and 15 deletions
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
.section .vectors, "ax", %progbits
|
||||
.align 3
|
||||
.global reset
|
||||
reset:
|
||||
b _ZN3ams10rebootstub4MainEv
|
||||
|
||||
.global _ZN3ams10rebootstub10RebootTypeE
|
||||
_ZN3ams10rebootstub10RebootTypeE:
|
||||
.word 0x00000001
|
50
exosphere/program/rebootstub/source/rebootstub_main.s
Normal file
50
exosphere/program/rebootstub/source/rebootstub_main.s
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
.section .text._ZN3ams10rebootstub4MainEv, "ax", %progbits
|
||||
.align 3
|
||||
.global _ZN3ams10rebootstub4MainEv
|
||||
_ZN3ams10rebootstub4MainEv:
|
||||
/* Get the reboot type. */
|
||||
ldr r0, =_ZN3ams10rebootstub10RebootTypeE
|
||||
ldr r0, [r0]
|
||||
|
||||
/* If the reboot type is power off, perform a power off. */
|
||||
cmp r0, #0
|
||||
beq _ZN3ams10rebootstub8PowerOffEv
|
||||
|
||||
/* Otherwise, clear all registers jump to the reboot payload in iram. */
|
||||
ldr r0, =0x52425430 /* RBT0 */
|
||||
mov r1, #0
|
||||
mov r2, #0
|
||||
mov r3, #0
|
||||
mov r4, #0
|
||||
mov r5, #0
|
||||
mov r5, #0
|
||||
mov r6, #0
|
||||
mov r7, #0
|
||||
mov r8, #0
|
||||
mov r9, #0
|
||||
mov r10, #0
|
||||
mov r11, #0
|
||||
mov r12, #0
|
||||
mov r9, #0
|
||||
mov lr, #0
|
||||
ldr sp, =0x40010000
|
||||
ldr pc, =0x40010000
|
||||
|
||||
/* Infinite loop. */
|
||||
1: b 1b
|
61
exosphere/program/rebootstub/source/rebootstub_power_off.cpp
Normal file
61
exosphere/program/rebootstub/source/rebootstub_power_off.cpp
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
#include <exosphere.hpp>
|
||||
|
||||
namespace ams::rebootstub {
|
||||
|
||||
NORETURN void Halt() {
|
||||
while (true) {
|
||||
reg::Write(secmon::MemoryRegionPhysicalDeviceFlowController.GetAddress() + FLOW_CTLR_HALT_COP_EVENTS, FLOW_REG_BITS_ENUM(HALT_COP_EVENTS_MODE, FLOW_MODE_STOP),
|
||||
FLOW_REG_BITS_ENUM(HALT_COP_EVENTS_JTAG, ENABLED));
|
||||
}
|
||||
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
NORETURN void PowerOff() {
|
||||
/* Ensure that i2c5 is usable. */
|
||||
clkrst::EnableI2c5Clock();
|
||||
|
||||
/* Initialize i2c5. */
|
||||
i2c::Initialize(i2c::Port_5);
|
||||
|
||||
/* Stop rtc alarms. */
|
||||
rtc::StopAlarm();
|
||||
|
||||
/* Perform a pmic power off. */
|
||||
pmic::PowerOff();
|
||||
|
||||
/* Halt the bpmp. */
|
||||
Halt();
|
||||
|
||||
/* This can never be reached. */
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace ams::diag {
|
||||
|
||||
void AbortImpl() {
|
||||
/* Halt the bpmp. */
|
||||
rebootstub::Halt();
|
||||
|
||||
/* This can never be reached. */
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue