mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-17 14:11:36 +00:00
fusee: execute more ccplex boot code out of iram
This commit is contained in:
parent
dcfd01cf59
commit
6b3a3ecb44
@ -14,15 +14,15 @@ PHDRS
|
||||
MEMORY
|
||||
{
|
||||
main : ORIGIN = 0xF0000000, LENGTH = 0x10000000
|
||||
high_iram : ORIGIN = 0x40010000, LENGTH = 0x20000
|
||||
high_iram : ORIGIN = 0x40010000, LENGTH = 0x8000
|
||||
low_iram : ORIGIN = 0x40003000, LENGTH = 0x8000
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
PROVIDE(__start__ = 0xF0000000);
|
||||
PROVIDE(__stack_top__ = 0x90020000);
|
||||
PROVIDE(__stack_bottom__ = 0x90010000);
|
||||
PROVIDE(__stack_top__ = 0x40020000);
|
||||
PROVIDE(__stack_bottom__ = 0x40018000);
|
||||
PROVIDE(__heap_start__ = 0x90020000);
|
||||
PROVIDE(__heap_end__ = 0xA0020000);
|
||||
|
||||
|
@ -82,19 +82,26 @@ static void cluster_enable_power(uint32_t regulator) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool cluster_is_partition_powered(volatile tegra_pmc_t *pmc, uint32_t status) {
|
||||
return (pmc->pwrgate_status & status) == status;
|
||||
}
|
||||
|
||||
static void cluster_pmc_enable_partition(uint32_t part, uint32_t toggle) {
|
||||
volatile tegra_pmc_t *pmc = pmc_get_regs();
|
||||
const uint32_t status = (toggle << part);
|
||||
|
||||
/* Check if the partition has already been turned on. */
|
||||
if (pmc->pwrgate_status & (toggle << part)) {
|
||||
if (cluster_is_partition_powered(pmc, status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t i = 5001;
|
||||
while (pmc->pwrgate_toggle & 0x100) {
|
||||
int timeout = 5000;
|
||||
while (true) {
|
||||
if ((pmc->pwrgate_toggle & 0x100) == 0) {
|
||||
break;
|
||||
}
|
||||
udelay(1);
|
||||
i--;
|
||||
if (i < 1) {
|
||||
if ((--timeout) < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -102,14 +109,15 @@ static void cluster_pmc_enable_partition(uint32_t part, uint32_t toggle) {
|
||||
/* Turn the partition on. */
|
||||
pmc->pwrgate_toggle = (part | 0x100);
|
||||
|
||||
i = 5001;
|
||||
while (i > 0) {
|
||||
/* Check if the partition has already been turned on. */
|
||||
if (pmc->pwrgate_status & (toggle << part)) {
|
||||
timeout = 5000;
|
||||
while (true) {
|
||||
if (cluster_is_partition_powered(pmc, status)) {
|
||||
break;
|
||||
}
|
||||
udelay(1);
|
||||
i--;
|
||||
if ((--timeout) < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* 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 <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
@ -35,14 +35,14 @@ static bool is_soc_mariko() {
|
||||
|
||||
void nxboot_finish(uint32_t boot_memaddr) {
|
||||
bool is_mariko = is_soc_mariko();
|
||||
|
||||
|
||||
/* Boot up Exosphère. */
|
||||
MAILBOX_NX_BOOTLOADER_IS_SECMON_AWAKE = 0;
|
||||
MAILBOX_NX_BOOTLOADER_SETUP_STATE = NX_BOOTLOADER_STATE_DRAM_INITIALIZED_4X;
|
||||
|
||||
/* Terminate the display. */
|
||||
display_end();
|
||||
|
||||
|
||||
if (is_mariko) {
|
||||
/* Boot CPU0. */
|
||||
cluster_boot_cpu0(boot_memaddr);
|
||||
|
Loading…
Reference in New Issue
Block a user