avionic design with actual uboot and tooling
submodule of avionic design uboot bootloader and with included tools to get you started , read readme.md and readme-tk1-loader.md
This commit is contained in:
14
u-boot/arch/nds32/lib/Makefile
Normal file
14
u-boot/arch/nds32/lib/Makefile
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# Copyright (C) 2011 Andes Technology Corporation
|
||||
# Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com>
|
||||
# Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += cache.o
|
||||
obj-$(CONFIG_CMD_BOOTM) += bootm.o
|
||||
obj-y += interrupts.o
|
||||
82
u-boot/arch/nds32/lib/asm-offsets.c
Normal file
82
u-boot/arch/nds32/lib/asm-offsets.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* Generate definitions needed by assembly language modules.
|
||||
* This code generates raw asm output which is post-processed to extract
|
||||
* and format the required data.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <common.h>
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/*
|
||||
* TODO : Check if each entry in this file is really necessary.
|
||||
* - struct ftahbc02s
|
||||
* - struct ftsdmc021
|
||||
* - struct andes_pcu
|
||||
* - struct dwcddr21mctl
|
||||
* are used only for generating asm-offsets.h.
|
||||
* It means their offset addresses are referenced only from assembly
|
||||
* code. Is it better to define the macros directly in headers?
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_FTSMC020
|
||||
OFFSET(FTSMC020_BANK0_CR, ftsmc020, bank[0].cr);
|
||||
OFFSET(FTSMC020_BANK0_TPR, ftsmc020, bank[0].tpr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTAHBC020S
|
||||
OFFSET(FTAHBC020S_SLAVE_BSR_4, ftahbc02s, s_bsr[4]);
|
||||
OFFSET(FTAHBC020S_SLAVE_BSR_6, ftahbc02s, s_bsr[6]);
|
||||
OFFSET(FTAHBC020S_CR, ftahbc02s, cr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTPMU010
|
||||
OFFSET(FTPMU010_PDLLCR0, ftpmu010, PDLLCR0);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTSDMC021
|
||||
OFFSET(FTSDMC021_TP1, ftsdmc021, tp1);
|
||||
OFFSET(FTSDMC021_TP2, ftsdmc021, tp2);
|
||||
OFFSET(FTSDMC021_CR1, ftsdmc021, cr1);
|
||||
OFFSET(FTSDMC021_CR2, ftsdmc021, cr2);
|
||||
OFFSET(FTSDMC021_BANK0_BSR, ftsdmc021, bank0_bsr);
|
||||
OFFSET(FTSDMC021_BANK1_BSR, ftsdmc021, bank1_bsr);
|
||||
OFFSET(FTSDMC021_BANK2_BSR, ftsdmc021, bank2_bsr);
|
||||
OFFSET(FTSDMC021_BANK3_BSR, ftsdmc021, bank3_bsr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_ANDES_PCU
|
||||
OFFSET(ANDES_PCU_PCS4, andes_pcu, pcs4.parm); /* 0x104 */
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_DWCDDR21MCTL
|
||||
OFFSET(DWCDDR21MCTL_CCR, dwcddr21mctl, ccr); /* 0x04 */
|
||||
OFFSET(DWCDDR21MCTL_DCR, dwcddr21mctl, dcr); /* 0x04 */
|
||||
OFFSET(DWCDDR21MCTL_IOCR, dwcddr21mctl, iocr); /* 0x08 */
|
||||
OFFSET(DWCDDR21MCTL_CSR, dwcddr21mctl, csr); /* 0x0c */
|
||||
OFFSET(DWCDDR21MCTL_DRR, dwcddr21mctl, drr); /* 0x10 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR0, dwcddr21mctl, dllcr[0]); /* 0x24 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR1, dwcddr21mctl, dllcr[1]); /* 0x28 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR2, dwcddr21mctl, dllcr[2]); /* 0x2c */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR3, dwcddr21mctl, dllcr[3]); /* 0x30 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR4, dwcddr21mctl, dllcr[4]); /* 0x34 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR5, dwcddr21mctl, dllcr[5]); /* 0x38 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR6, dwcddr21mctl, dllcr[6]); /* 0x3c */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR7, dwcddr21mctl, dllcr[7]); /* 0x40 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR8, dwcddr21mctl, dllcr[8]); /* 0x44 */
|
||||
OFFSET(DWCDDR21MCTL_DLLCR9, dwcddr21mctl, dllcr[9]); /* 0x48 */
|
||||
OFFSET(DWCDDR21MCTL_RSLR0, dwcddr21mctl, rslr[0]); /* 0x4c */
|
||||
OFFSET(DWCDDR21MCTL_RDGR0, dwcddr21mctl, rdgr[0]); /* 0x5c */
|
||||
OFFSET(DWCDDR21MCTL_DTAR, dwcddr21mctl, dtar); /* 0xa4 */
|
||||
OFFSET(DWCDDR21MCTL_MR, dwcddr21mctl, mr); /* 0x1f0 */
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
234
u-boot/arch/nds32/lib/bootm.c
Normal file
234
u-boot/arch/nds32/lib/bootm.c
Normal file
@@ -0,0 +1,234 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Andes Technology Corporation
|
||||
* Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com>
|
||||
* Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <image.h>
|
||||
#include <u-boot/zlib.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
|
||||
defined(CONFIG_CMDLINE_TAG) || \
|
||||
defined(CONFIG_INITRD_TAG) || \
|
||||
defined(CONFIG_SERIAL_TAG) || \
|
||||
defined(CONFIG_REVISION_TAG)
|
||||
static void setup_start_tag(bd_t *bd);
|
||||
|
||||
# ifdef CONFIG_SETUP_MEMORY_TAGS
|
||||
static void setup_memory_tags(bd_t *bd);
|
||||
# endif
|
||||
static void setup_commandline_tag(bd_t *bd, char *commandline);
|
||||
|
||||
# ifdef CONFIG_INITRD_TAG
|
||||
static void setup_initrd_tag(bd_t *bd, ulong initrd_start, ulong initrd_end);
|
||||
# endif
|
||||
static void setup_end_tag(bd_t *bd);
|
||||
|
||||
static struct tag *params;
|
||||
#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */
|
||||
|
||||
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
|
||||
{
|
||||
bd_t *bd = gd->bd;
|
||||
char *s;
|
||||
int machid = bd->bi_arch_number;
|
||||
void (*theKernel)(int zero, int arch, uint params);
|
||||
|
||||
#ifdef CONFIG_CMDLINE_TAG
|
||||
char *commandline = getenv("bootargs");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* allow the PREP bootm subcommand, it is required for bootm to work
|
||||
*/
|
||||
if (flag & BOOTM_STATE_OS_PREP)
|
||||
return 0;
|
||||
|
||||
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
|
||||
return 1;
|
||||
|
||||
theKernel = (void (*)(int, int, uint))images->ep;
|
||||
|
||||
s = getenv("machid");
|
||||
if (s) {
|
||||
machid = simple_strtoul(s, NULL, 16);
|
||||
printf("Using machid 0x%x from environment\n", machid);
|
||||
}
|
||||
|
||||
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||
|
||||
debug("## Transferring control to Linux (at address %08lx) ...\n",
|
||||
(ulong)theKernel);
|
||||
|
||||
#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
|
||||
defined(CONFIG_CMDLINE_TAG) || \
|
||||
defined(CONFIG_INITRD_TAG) || \
|
||||
defined(CONFIG_SERIAL_TAG) || \
|
||||
defined(CONFIG_REVISION_TAG)
|
||||
setup_start_tag(bd);
|
||||
#ifdef CONFIG_SERIAL_TAG
|
||||
setup_serial_tag(¶ms);
|
||||
#endif
|
||||
#ifdef CONFIG_REVISION_TAG
|
||||
setup_revision_tag(¶ms);
|
||||
#endif
|
||||
#ifdef CONFIG_SETUP_MEMORY_TAGS
|
||||
setup_memory_tags(bd);
|
||||
#endif
|
||||
#ifdef CONFIG_CMDLINE_TAG
|
||||
setup_commandline_tag(bd, commandline);
|
||||
#endif
|
||||
#ifdef CONFIG_INITRD_TAG
|
||||
if (images->rd_start && images->rd_end)
|
||||
setup_initrd_tag(bd, images->rd_start, images->rd_end);
|
||||
#endif
|
||||
setup_end_tag(bd);
|
||||
#endif
|
||||
|
||||
/* we assume that the kernel is in place */
|
||||
printf("\nStarting kernel ...\n\n");
|
||||
|
||||
#ifdef CONFIG_USB_DEVICE
|
||||
{
|
||||
extern void udc_disconnect(void);
|
||||
udc_disconnect();
|
||||
}
|
||||
#endif
|
||||
|
||||
cleanup_before_linux();
|
||||
|
||||
theKernel(0, machid, bd->bi_boot_params);
|
||||
/* does not return */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
|
||||
defined(CONFIG_CMDLINE_TAG) || \
|
||||
defined(CONFIG_INITRD_TAG) || \
|
||||
defined(CONFIG_SERIAL_TAG) || \
|
||||
defined(CONFIG_REVISION_TAG)
|
||||
static void setup_start_tag(bd_t *bd)
|
||||
{
|
||||
params = (struct tag *)bd->bi_boot_params;
|
||||
|
||||
params->hdr.tag = ATAG_CORE;
|
||||
params->hdr.size = tag_size(tag_core);
|
||||
|
||||
params->u.core.flags = 0;
|
||||
params->u.core.pagesize = 0;
|
||||
params->u.core.rootdev = 0;
|
||||
|
||||
params = tag_next(params);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_SETUP_MEMORY_TAGS
|
||||
static void setup_memory_tags(bd_t *bd)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
|
||||
params->hdr.tag = ATAG_MEM;
|
||||
params->hdr.size = tag_size(tag_mem32);
|
||||
|
||||
params->u.mem.start = bd->bi_dram[i].start;
|
||||
params->u.mem.size = bd->bi_dram[i].size;
|
||||
|
||||
params = tag_next(params);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_SETUP_MEMORY_TAGS */
|
||||
|
||||
|
||||
static void setup_commandline_tag(bd_t *bd, char *commandline)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (!commandline)
|
||||
return;
|
||||
|
||||
/* eat leading white space */
|
||||
for (p = commandline; *p == ' '; p++)
|
||||
;
|
||||
|
||||
/* skip non-existent command lines so the kernel will still
|
||||
* use its default command line.
|
||||
*/
|
||||
if (*p == '\0')
|
||||
return;
|
||||
|
||||
params->hdr.tag = ATAG_CMDLINE;
|
||||
params->hdr.size =
|
||||
(sizeof(struct tag_header) + strlen(p) + 1 + 4) >> 2;
|
||||
|
||||
strcpy(params->u.cmdline.cmdline, p)
|
||||
;
|
||||
|
||||
params = tag_next(params);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_INITRD_TAG
|
||||
static void setup_initrd_tag(bd_t *bd, ulong initrd_start, ulong initrd_end)
|
||||
{
|
||||
/* an ATAG_INITRD node tells the kernel where the compressed
|
||||
* ramdisk can be found. ATAG_RDIMG is a better name, actually.
|
||||
*/
|
||||
params->hdr.tag = ATAG_INITRD2;
|
||||
params->hdr.size = tag_size(tag_initrd);
|
||||
|
||||
params->u.initrd.start = initrd_start;
|
||||
params->u.initrd.size = initrd_end - initrd_start;
|
||||
|
||||
params = tag_next(params);
|
||||
}
|
||||
#endif /* CONFIG_INITRD_TAG */
|
||||
|
||||
#ifdef CONFIG_SERIAL_TAG
|
||||
void setup_serial_tag(struct tag **tmp)
|
||||
{
|
||||
struct tag *params = *tmp;
|
||||
struct tag_serialnr serialnr;
|
||||
void get_board_serial(struct tag_serialnr *serialnr);
|
||||
|
||||
get_board_serial(&serialnr);
|
||||
params->hdr.tag = ATAG_SERIAL;
|
||||
params->hdr.size = tag_size(tag_serialnr);
|
||||
params->u.serialnr.low = serialnr.low;
|
||||
params->u.serialnr.high = serialnr.high;
|
||||
params = tag_next(params);
|
||||
*tmp = params;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_REVISION_TAG
|
||||
void setup_revision_tag(struct tag **in_params)
|
||||
{
|
||||
u32 rev = 0;
|
||||
u32 get_board_rev(void);
|
||||
|
||||
rev = get_board_rev();
|
||||
params->hdr.tag = ATAG_REVISION;
|
||||
params->hdr.size = tag_size(tag_revision);
|
||||
params->u.revision.rev = rev;
|
||||
params = tag_next(params);
|
||||
}
|
||||
#endif /* CONFIG_REVISION_TAG */
|
||||
|
||||
|
||||
static void setup_end_tag(bd_t *bd)
|
||||
{
|
||||
params->hdr.tag = ATAG_NONE;
|
||||
params->hdr.size = 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */
|
||||
144
u-boot/arch/nds32/lib/cache.c
Normal file
144
u-boot/arch/nds32/lib/cache.c
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Andes Technology Corporation
|
||||
* Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com>
|
||||
* Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
static inline unsigned long CACHE_LINE_SIZE(enum cache_t cache)
|
||||
{
|
||||
if (cache == ICACHE)
|
||||
return 8 << (((GET_ICM_CFG() & ICM_CFG_MSK_ISZ) \
|
||||
>> ICM_CFG_OFF_ISZ) - 1);
|
||||
else
|
||||
return 8 << (((GET_DCM_CFG() & DCM_CFG_MSK_DSZ) \
|
||||
>> DCM_CFG_OFF_DSZ) - 1);
|
||||
}
|
||||
|
||||
void flush_dcache_range(unsigned long start, unsigned long end)
|
||||
{
|
||||
unsigned long line_size;
|
||||
|
||||
line_size = CACHE_LINE_SIZE(DCACHE);
|
||||
|
||||
while (end > start) {
|
||||
asm volatile (
|
||||
"\n\tcctl %0, L1D_VA_WB"
|
||||
"\n\tcctl %0, L1D_VA_INVAL"
|
||||
:
|
||||
: "r" (start)
|
||||
);
|
||||
start += line_size;
|
||||
}
|
||||
}
|
||||
|
||||
void invalidate_icache_range(unsigned long start, unsigned long end)
|
||||
{
|
||||
unsigned long line_size;
|
||||
|
||||
line_size = CACHE_LINE_SIZE(ICACHE);
|
||||
while (end > start) {
|
||||
asm volatile (
|
||||
"\n\tcctl %0, L1I_VA_INVAL"
|
||||
:
|
||||
: "r"(start)
|
||||
);
|
||||
start += line_size;
|
||||
}
|
||||
}
|
||||
|
||||
void invalidate_dcache_range(unsigned long start, unsigned long end)
|
||||
{
|
||||
unsigned long line_size;
|
||||
|
||||
line_size = CACHE_LINE_SIZE(DCACHE);
|
||||
while (end > start) {
|
||||
asm volatile (
|
||||
"\n\tcctl %0, L1D_VA_INVAL"
|
||||
:
|
||||
: "r"(start)
|
||||
);
|
||||
start += line_size;
|
||||
}
|
||||
}
|
||||
|
||||
void flush_cache(unsigned long addr, unsigned long size)
|
||||
{
|
||||
flush_dcache_range(addr, addr + size);
|
||||
invalidate_icache_range(addr, addr + size);
|
||||
}
|
||||
|
||||
void icache_enable(void)
|
||||
{
|
||||
asm volatile (
|
||||
"mfsr $p0, $mr8\n\t"
|
||||
"ori $p0, $p0, 0x01\n\t"
|
||||
"mtsr $p0, $mr8\n\t"
|
||||
"isb\n\t"
|
||||
);
|
||||
}
|
||||
|
||||
void icache_disable(void)
|
||||
{
|
||||
asm volatile (
|
||||
"mfsr $p0, $mr8\n\t"
|
||||
"li $p1, ~0x01\n\t"
|
||||
"and $p0, $p0, $p1\n\t"
|
||||
"mtsr $p0, $mr8\n\t"
|
||||
"isb\n\t"
|
||||
);
|
||||
}
|
||||
|
||||
int icache_status(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
asm volatile (
|
||||
"mfsr $p0, $mr8\n\t"
|
||||
"andi %0, $p0, 0x01\n\t"
|
||||
: "=r" (ret)
|
||||
:
|
||||
: "memory"
|
||||
);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dcache_enable(void)
|
||||
{
|
||||
asm volatile (
|
||||
"mfsr $p0, $mr8\n\t"
|
||||
"ori $p0, $p0, 0x02\n\t"
|
||||
"mtsr $p0, $mr8\n\t"
|
||||
"isb\n\t"
|
||||
);
|
||||
}
|
||||
|
||||
void dcache_disable(void)
|
||||
{
|
||||
asm volatile (
|
||||
"mfsr $p0, $mr8\n\t"
|
||||
"li $p1, ~0x02\n\t"
|
||||
"and $p0, $p0, $p1\n\t"
|
||||
"mtsr $p0, $mr8\n\t"
|
||||
"isb\n\t"
|
||||
);
|
||||
}
|
||||
|
||||
int dcache_status(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
asm volatile (
|
||||
"mfsr $p0, $mr8\n\t"
|
||||
"andi %0, $p0, 0x02\n\t"
|
||||
: "=r" (ret)
|
||||
:
|
||||
: "memory"
|
||||
);
|
||||
|
||||
return ret;
|
||||
}
|
||||
117
u-boot/arch/nds32/lib/interrupts.c
Normal file
117
u-boot/arch/nds32/lib/interrupts.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Alex Zuepke <azu@sysgo.de>
|
||||
*
|
||||
* Copyright (C) 2011 Andes Technology Corporation
|
||||
* Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com>
|
||||
* Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/system.h>
|
||||
#undef INTERRUPT_MODE
|
||||
|
||||
static int int_flag;
|
||||
|
||||
int irq_flags; /* needed by asm-nds32/system.h */
|
||||
|
||||
int GIE_STATUS(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"mfsr $p0, $psw\n\t"
|
||||
"andi %0, %0, 0x1\n\t"
|
||||
: "=r" (ret)
|
||||
:
|
||||
: "memory"
|
||||
);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USE_INTERRUPT
|
||||
|
||||
int interrupt_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/* enable interrupts */
|
||||
void enable_interrupts(void)
|
||||
{
|
||||
local_irq_restore(int_flag);
|
||||
}
|
||||
|
||||
/*
|
||||
* disable interrupts
|
||||
* Return true if GIE is enabled before we disable it.
|
||||
*/
|
||||
int disable_interrupts(void)
|
||||
{
|
||||
|
||||
int gie_ori_status;
|
||||
|
||||
gie_ori_status = GIE_STATUS();
|
||||
|
||||
local_irq_save(int_flag);
|
||||
|
||||
return gie_ori_status;
|
||||
}
|
||||
#endif
|
||||
|
||||
void bad_mode(void)
|
||||
{
|
||||
panic("Resetting CPU ...\n");
|
||||
reset_cpu(0);
|
||||
}
|
||||
|
||||
void show_regs(struct pt_regs *regs)
|
||||
{
|
||||
const char *processor_modes[] = {"USER", "SuperUser" , "HyperVisor"};
|
||||
|
||||
printf("\n");
|
||||
printf("pc : [<%08lx>] sp: [<%08lx>]\n"
|
||||
"lp : %08lx gp : %08lx fp : %08lx\n",
|
||||
regs->ipc, regs->sp, regs->lp, regs->gp, regs->fp);
|
||||
printf("D1H: %08lx D1L: %08lx D0H: %08lx D0L: %08lx\n",
|
||||
regs->d1hi, regs->d1lo, regs->d0hi, regs->d0lo);
|
||||
printf("r27: %08lx r26: %08lx r25: %08lx r24: %08lx\n",
|
||||
regs->p1, regs->p0, regs->r[25], regs->r[24]);
|
||||
printf("r23: %08lx r22: %08lx r21: %08lx r20: %08lx\n",
|
||||
regs->r[23], regs->r[22], regs->r[21], regs->r[20]);
|
||||
printf("r19: %08lx r18: %08lx r17: %08lx r16: %08lx\n",
|
||||
regs->r[19], regs->r[18], regs->r[17], regs->r[16]);
|
||||
printf("r15: %08lx r14: %08lx r13: %08lx r12: %08lx\n",
|
||||
regs->r[15], regs->r[14], regs->r[13], regs->r[12]);
|
||||
printf("r11: %08lx r10: %08lx r9 : %08lx r8 : %08lx\n",
|
||||
regs->r[11], regs->r[10], regs->r[9], regs->r[8]);
|
||||
printf("r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n",
|
||||
regs->r[7], regs->r[6], regs->r[5], regs->r[4]);
|
||||
printf("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
|
||||
regs->r[3], regs->r[2], regs->r[1], regs->r[0]);
|
||||
printf(" Interrupts %s Mode %s\n",
|
||||
interrupts_enabled(regs) ? "on" : "off",
|
||||
processor_modes[processor_mode(regs)]);
|
||||
}
|
||||
|
||||
void do_interruption(struct pt_regs *pt_regs, int EVIC_num)
|
||||
{
|
||||
const char *interruption_type[] = {
|
||||
"Reset",
|
||||
"TLB Fill",
|
||||
"TLB Not Present",
|
||||
"TLB Misc",
|
||||
"VLPT Miss",
|
||||
"Cache Parity Error",
|
||||
"Debug",
|
||||
"General Exception",
|
||||
"External Interrupt"
|
||||
};
|
||||
|
||||
printf("%s\n", interruption_type[EVIC_num]);
|
||||
show_regs(pt_regs);
|
||||
bad_mode();
|
||||
}
|
||||
Reference in New Issue
Block a user