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
{
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);

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) {
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;
}
}
}