From 2619ccad0c71663a15bf60f400cefae5982e5a86 Mon Sep 17 00:00:00 2001 From: hexkyz Date: Wed, 1 Jan 2020 17:21:46 +0000 Subject: [PATCH] fusee/sept/exo: minor code style fixes --- fusee/fusee-mtc/src/fuse.c | 8 ++++---- fusee/fusee-secondary/src/fuse.c | 8 ++++---- fusee/fusee-secondary/src/tsec.c | 6 +++++- sept/sept-primary/src/main.c | 6 +++++- sept/sept-secondary/src/fuse.c | 8 ++++---- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/fusee/fusee-mtc/src/fuse.c b/fusee/fusee-mtc/src/fuse.c index b17ea65fb..9bf733967 100644 --- a/fusee/fusee-mtc/src/fuse.c +++ b/fusee/fusee-mtc/src/fuse.c @@ -52,18 +52,18 @@ void fuse_disable_programming(void) { /* Enable power to the fuse hardware array. */ void fuse_enable_power(void) { volatile tegra_pmc_t *pmc = pmc_get_regs(); - pmc->fuse_control &= ~(0x200); // Clear PMC_FUSE_CTRL_PS18_LATCH_CLEAR. + pmc->fuse_control &= ~(0x200); /* Clear PMC_FUSE_CTRL_PS18_LATCH_CLEAR. */ mdelay(1); - pmc->fuse_control |= 0x100; // Set PMC_FUSE_CTRL_PS18_LATCH_SET. + pmc->fuse_control |= 0x100; /* Set PMC_FUSE_CTRL_PS18_LATCH_SET. */ mdelay(1); } /* Disable power to the fuse hardware array. */ void fuse_disable_power(void) { volatile tegra_pmc_t *pmc = pmc_get_regs(); - pmc->fuse_control &= ~(0x100); // Clear PMC_FUSE_CTRL_PS18_LATCH_SET. + pmc->fuse_control &= ~(0x100); /* Clear PMC_FUSE_CTRL_PS18_LATCH_SET. */ mdelay(1); - pmc->fuse_control |= 0x200; // Set PMC_FUSE_CTRL_PS18_LATCH_CLEAR. + pmc->fuse_control |= 0x200; /* Set PMC_FUSE_CTRL_PS18_LATCH_CLEAR. */ mdelay(1); } diff --git a/fusee/fusee-secondary/src/fuse.c b/fusee/fusee-secondary/src/fuse.c index b17ea65fb..9bf733967 100644 --- a/fusee/fusee-secondary/src/fuse.c +++ b/fusee/fusee-secondary/src/fuse.c @@ -52,18 +52,18 @@ void fuse_disable_programming(void) { /* Enable power to the fuse hardware array. */ void fuse_enable_power(void) { volatile tegra_pmc_t *pmc = pmc_get_regs(); - pmc->fuse_control &= ~(0x200); // Clear PMC_FUSE_CTRL_PS18_LATCH_CLEAR. + pmc->fuse_control &= ~(0x200); /* Clear PMC_FUSE_CTRL_PS18_LATCH_CLEAR. */ mdelay(1); - pmc->fuse_control |= 0x100; // Set PMC_FUSE_CTRL_PS18_LATCH_SET. + pmc->fuse_control |= 0x100; /* Set PMC_FUSE_CTRL_PS18_LATCH_SET. */ mdelay(1); } /* Disable power to the fuse hardware array. */ void fuse_disable_power(void) { volatile tegra_pmc_t *pmc = pmc_get_regs(); - pmc->fuse_control &= ~(0x100); // Clear PMC_FUSE_CTRL_PS18_LATCH_SET. + pmc->fuse_control &= ~(0x100); /* Clear PMC_FUSE_CTRL_PS18_LATCH_SET. */ mdelay(1); - pmc->fuse_control |= 0x200; // Set PMC_FUSE_CTRL_PS18_LATCH_CLEAR. + pmc->fuse_control |= 0x200; /* Set PMC_FUSE_CTRL_PS18_LATCH_CLEAR. */ mdelay(1); } diff --git a/fusee/fusee-secondary/src/tsec.c b/fusee/fusee-secondary/src/tsec.c index 73a831e77..bbb2a4a2b 100644 --- a/fusee/fusee-secondary/src/tsec.c +++ b/fusee/fusee-secondary/src/tsec.c @@ -26,9 +26,11 @@ static int tsec_dma_wait_idle() uint32_t timeout = (get_time_ms() + 10000); while (!(tsec->TSEC_FALCON_DMATRFCMD & 2)) + { if (get_time_ms() > timeout) return 0; - + } + return 1; } @@ -55,8 +57,10 @@ static int tsec_kfuse_wait_ready() /* Wait for STATE_DONE. */ while (!(KFUSE_STATE & 0x10000)) + { if (get_time_ms() > timeout) return 0; + } /* Check for STATE_CRCPASS. */ if (!(KFUSE_STATE & 0x20000)) diff --git a/sept/sept-primary/src/main.c b/sept/sept-primary/src/main.c index 5b939c996..e381ea62f 100644 --- a/sept/sept-primary/src/main.c +++ b/sept/sept-primary/src/main.c @@ -97,9 +97,11 @@ static int tsec_dma_wait_idle() uint32_t timeout = (get_time_ms() + 10000); while (!(tsec->TSEC_FALCON_DMATRFCMD & 2)) + { if (get_time_ms() > timeout) return 0; - + } + return 1; } @@ -126,8 +128,10 @@ static int tsec_kfuse_wait_ready() /* Wait for STATE_DONE. */ while (!(KFUSE_STATE & 0x10000)) + { if (get_time_ms() > timeout) return 0; + } /* Check for STATE_CRCPASS. */ if (!(KFUSE_STATE & 0x20000)) diff --git a/sept/sept-secondary/src/fuse.c b/sept/sept-secondary/src/fuse.c index 4a3baebf8..c56d7f173 100644 --- a/sept/sept-secondary/src/fuse.c +++ b/sept/sept-secondary/src/fuse.c @@ -52,18 +52,18 @@ void fuse_disable_programming(void) { /* Enable power to the fuse hardware array. */ void fuse_enable_power(void) { volatile tegra_pmc_t *pmc = pmc_get_regs(); - pmc->fuse_control &= ~(0x200); // Clear PMC_FUSE_CTRL_PS18_LATCH_CLEAR. + pmc->fuse_control &= ~(0x200); /* Clear PMC_FUSE_CTRL_PS18_LATCH_CLEAR. */ mdelay(1); - pmc->fuse_control |= 0x100; // Set PMC_FUSE_CTRL_PS18_LATCH_SET. + pmc->fuse_control |= 0x100; /* Set PMC_FUSE_CTRL_PS18_LATCH_SET. */ mdelay(1); } /* Disable power to the fuse hardware array. */ void fuse_disable_power(void) { volatile tegra_pmc_t *pmc = pmc_get_regs(); - pmc->fuse_control &= ~(0x100); // Clear PMC_FUSE_CTRL_PS18_LATCH_SET. + pmc->fuse_control &= ~(0x100); /* Clear PMC_FUSE_CTRL_PS18_LATCH_SET. */ mdelay(1); - pmc->fuse_control |= 0x200; // Set PMC_FUSE_CTRL_PS18_LATCH_CLEAR. + pmc->fuse_control |= 0x200; /* Set PMC_FUSE_CTRL_PS18_LATCH_CLEAR. */ mdelay(1); }