Skip to content

Commit

Permalink
Fix nxstyle. Tested OK
Browse files Browse the repository at this point in the history
Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
  • Loading branch information
lupyuen committed Mar 1, 2025
1 parent 158290d commit 0dc73c7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
12 changes: 7 additions & 5 deletions arch/risc-v/src/eic7700x/eic7700x_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@

void up_irqinitialize(void)
{
uintptr_t claim, addr;
int hart, offset;
uintptr_t addr;
uintptr_t claim;
int hart;
int offset;

/* Disable S-Mode interrupts */

Expand All @@ -66,7 +68,7 @@ void up_irqinitialize(void)
addr = EIC7700X_PLIC_ENABLE0 + (hart * EIC7700X_PLIC_ENABLE_HART);
for (offset = 0; offset < (NR_IRQS - RISCV_IRQ_EXT) >> 3; offset += 4)
{
putreg32(0x0, addr + offset);
putreg32(0x0, addr + offset);
}
}

Expand Down Expand Up @@ -153,7 +155,7 @@ void up_disable_irq(int irq)

if (0 <= extirq && extirq <= NR_IRQS - RISCV_IRQ_EXT)
{
addr = EIC7700X_PLIC_ENABLE0 +
addr = EIC7700X_PLIC_ENABLE0 +
(g_boot_hart * EIC7700X_PLIC_ENABLE_HART);
modifyreg32(addr + (4 * (extirq / 32)),
1 << (extirq % 32), 0);
Expand Down Expand Up @@ -198,7 +200,7 @@ void up_enable_irq(int irq)

if (0 <= extirq && extirq <= NR_IRQS - RISCV_IRQ_EXT)
{
addr = EIC7700X_PLIC_ENABLE0 +
addr = EIC7700X_PLIC_ENABLE0 +
(g_boot_hart * EIC7700X_PLIC_ENABLE_HART);
modifyreg32(addr + (4 * (extirq / 32)),
0, 1 << (extirq % 32));
Expand Down
2 changes: 1 addition & 1 deletion arch/risc-v/src/eic7700x/eic7700x_irq_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
void *riscv_dispatch_irq(uintptr_t vector, uintptr_t *regs)
{
int irq = (vector >> RV_IRQ_MASK) | (vector & 0xf);
uintptr_t claim = EIC7700X_PLIC_CLAIM0 +
uintptr_t claim = EIC7700X_PLIC_CLAIM0 +
(g_boot_hart * EIC7700X_PLIC_CLAIM_HART);

/* Firstly, check if the irq is machine external interrupt */
Expand Down
29 changes: 15 additions & 14 deletions arch/risc-v/src/eic7700x/eic7700x_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,19 +241,19 @@ static sbiret_t sbi_ecall(unsigned int extid, unsigned int fid,
*
****************************************************************************/

static int boot_secondary(uintreg_t hartid, uintreg_t addr)
{
sbiret_t ret = sbi_ecall(SBI_EXT_HSM, SBI_EXT_HSM_HART_START,
hartid, addr, 0, 0, 0, 0);
if (ret.error < 0)
{
_err("Boot Hart %d failed\n", hartid);
PANIC();
}
return 0;
}
static int boot_secondary(uintreg_t hartid, uintreg_t addr)
{
sbiret_t ret = sbi_ecall(SBI_EXT_HSM, SBI_EXT_HSM_HART_START,
hartid, addr, 0, 0, 0, 0);

if (ret.error < 0)
{
_err("Boot Hart %d failed\n", hartid);
PANIC();
}

return 0;
}

/****************************************************************************
* Public Functions
Expand Down Expand Up @@ -364,7 +364,8 @@ void eic7700x_start(int mhartid)
while (true)
{
asm("WFI");
}
}

PANIC(); /* Should not come here */
}

Expand Down

0 comments on commit 0dc73c7

Please sign in to comment.