fusee: execute more ccplex boot code out of iram

This commit is contained in:
Michael Scire 2021-01-01 16:44:43 -08:00
parent 539dbf0800
commit 200da4c2da
4 changed files with 24 additions and 16 deletions

View file

@ -14,15 +14,15 @@ PHDRS
MEMORY MEMORY
{ {
main : ORIGIN = 0xF0000000, LENGTH = 0x10000000 main : ORIGIN = 0xF0000000, LENGTH = 0x10000000
high_iram : ORIGIN = 0x40010000, LENGTH = 0x20000 high_iram : ORIGIN = 0x40010000, LENGTH = 0x8000
low_iram : ORIGIN = 0x40003000, LENGTH = 0x8000 low_iram : ORIGIN = 0x40003000, LENGTH = 0x8000
} }
SECTIONS SECTIONS
{ {
PROVIDE(__start__ = 0xF0000000); PROVIDE(__start__ = 0xF0000000);
PROVIDE(__stack_top__ = 0x90020000); PROVIDE(__stack_top__ = 0x40020000);
PROVIDE(__stack_bottom__ = 0x90010000); PROVIDE(__stack_bottom__ = 0x40018000);
PROVIDE(__heap_start__ = 0x90020000); PROVIDE(__heap_start__ = 0x90020000);
PROVIDE(__heap_end__ = 0xA0020000); PROVIDE(__heap_end__ = 0xA0020000);

View file

@ -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) { static void cluster_pmc_enable_partition(uint32_t part, uint32_t toggle) {
volatile tegra_pmc_t *pmc = pmc_get_regs(); volatile tegra_pmc_t *pmc = pmc_get_regs();
const uint32_t status = (toggle << part);
/* Check if the partition has already been turned on. */ /* Check if the partition has already been turned on. */
if (pmc->pwrgate_status & (toggle << part)) { if (cluster_is_partition_powered(pmc, status)) {
return; return;
} }
uint32_t i = 5001; int timeout = 5000;
while (pmc->pwrgate_toggle & 0x100) { while (true) {
if ((pmc->pwrgate_toggle & 0x100) == 0) {
break;
}
udelay(1); udelay(1);
i--; if ((--timeout) < 0) {
if (i < 1) {
return; return;
} }
} }
@ -102,14 +109,15 @@ static void cluster_pmc_enable_partition(uint32_t part, uint32_t toggle) {
/* Turn the partition on. */ /* Turn the partition on. */
pmc->pwrgate_toggle = (part | 0x100); pmc->pwrgate_toggle = (part | 0x100);
i = 5001; timeout = 5000;
while (i > 0) { while (true) {
/* Check if the partition has already been turned on. */ if (cluster_is_partition_powered(pmc, status)) {
if (pmc->pwrgate_status & (toggle << part)) {
break; break;
} }
udelay(1); udelay(1);
i--; if ((--timeout) < 0) {
return;
}
} }
} }