Files
OpenCellular/core/nds32/cpu.c
Dino Li 2ea7b194d9 nds32: fix interrupt
1. To enable INT_PRI (hardware interrupt priority level 0~3)
   register, bit0@INT_CTRL = 0.
2. GIE need to be enabled before UART is initialized.
   [symptom]
   To define CONFIG_RWSIG / CONFIG_RSA / CONFIG_SHA256, then power on:
   after RW image is verified, firmware stuck in uart_flush_output().

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=1. bit0@INT_CTRL = 0.
     2. The RW image is verified and jump to image RW.

Change-Id: I393a3d5f87ea257885b872c91bfce43aecbaea8b
Reviewed-on: https://chromium-review.googlesource.com/309400
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-11-01 19:45:58 -08:00

25 lines
627 B
C

/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Set up the N8 core
*/
#include "cpu.h"
#include "registers.h"
void cpu_init(void)
{
/* DLM initialization is done in init.S */
uint32_t image_type = (uint32_t)cpu_init;
/* To change interrupt vector base if at RW image */
if (image_type > CONFIG_RW_MEM_OFF)
/* Interrupt Vector Table Base Address, in 64k Byte unit */
IT83XX_GCTRL_IVTBAR = (CONFIG_RW_MEM_OFF >> 16) & 0xFF;
/* Global interrupt enable */
asm volatile ("setgie.e");
}