OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [reset.S] - Diff between revs 355 and 375

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 355 Rev 375
Line 1... Line 1...
#include "spr-defs.h"
#include "spr-defs.h"
#include "board.h"
#include "board.h"
#include "mc.h"
#include "mc.h"
 
 
        .extern _reset_support
 
        .extern _eth_int
 
        .extern _src_beg
        .extern _src_beg
        .extern _dst_beg
        .extern _dst_beg
        .extern _dst_end
        .extern _dst_end
        .extern _c_reset
        .extern int_main
        .extern _int_main
        .extern tick_interrupt
        .extern _tick_interrupt
 
        .extern _crc32
        .extern _crc32
 
 
        /* Used by global.src_addr for default value */
 
        .extern _src_addr
 
 
 
        .global _align
        .global _align
        .global _calc_mycrc32
        .global _calc_mycrc32
        .global _mycrc32
        .global _mycrc32
        .global _mysize
        .global _mysize
 
 
Line 103... Line 97...
.else
.else
        .org (0x500 - 0x100 + _reset)
        .org (0x500 - 0x100 + _reset)
.endif
.endif
_tickint:
_tickint:
#define TIMER_RELOAD_VALUE (SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD))
#define TIMER_RELOAD_VALUE (SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD))
        //UNHANDLED_EXCEPTION
 
        /* Simply load timer_ticks variable and increment */
        /* Simply load timer_ticks variable and increment */
        .extern _timer_ticks
        .extern _timer_ticks
        l.addi  r1, r1, -8
        l.addi  r1, r1, -8
        l.sw    0(r1), r25
        l.sw    0(r1), r25
        l.sw    4(r1), r26
        l.sw    4(r1), r26
        l.movhi r25, hi(_timestamp)
        l.movhi r25, hi(timestamp)
        l.ori   r25, r25, lo(_timestamp)
        l.ori   r25, r25, lo(timestamp)
        l.lwz   r26, 0(r25)                     /* Load variable addr.*/
        l.lwz   r26, 0(r25)                     /* Load variable addr.*/
        l.addi  r26, r26, 1                     /* Increment variable */
        l.addi  r26, r26, 1                     /* Increment variable */
        l.sw    0(r25), r26                     /* Store variable */
        l.sw    0(r25), r26                     /* Store variable */
        l.movhi r25, hi(TIMER_RELOAD_VALUE)     /* Load timer value */
        l.movhi r25, hi(TIMER_RELOAD_VALUE)     /* Load timer value */
        l.ori   r25, r25, lo(TIMER_RELOAD_VALUE)
        l.ori   r25, r25, lo(TIMER_RELOAD_VALUE)
        l.mtspr r0, r25, SPR_TTMR               /* Reset timer */
        l.mtspr r0, r25, SPR_TTMR               /* Reset timer */
        l.lwz   r25, 0(r1)
        l.lwz   r25, 0(r1)
        l.lwz   r26, 4(r1)
        l.lwz   r26, 4(r1)
        l.addi  r1, r1, 8
        l.addi  r1, r1, 8
        l.rfe
        l.rfe
/*
 
        l.addi  r1,r1,-128
 
        l.sw    0(r1), r2
 
        l.addi  r2, r1, 128
 
        l.sw    0x4(r1),r3
 
        l.movhi r3,hi(_tick)
 
        l.ori   r3,r3,lo(_tick)
 
        l.jr    r3
 
        l.nop
 
*/
 
.if IN_FLASH
.if IN_FLASH
        .section .vectors, "ax"
        .section .vectors, "ax"
        .org 0x600
        .org 0x600
.else
.else
        .org (0x600 - 0x100 + _reset)
        .org (0x600 - 0x100 + _reset)
Line 338... Line 322...
        l.ori   r1,r1,lo(_stack-4)
        l.ori   r1,r1,lo(_stack-4)
        l.addi  r2,r0,-3
        l.addi  r2,r0,-3
        l.and   r1,r1,r2
        l.and   r1,r1,r2
/*      l.or    r2, r1, r1 - remove this helped with odd UART output problem?!*/
/*      l.or    r2, r1, r1 - remove this helped with odd UART output problem?!*/
 
 
        l.movhi r3,hi(_main)
        l.movhi r3,hi(main)
        l.ori   r3,r3,lo(_main)
        l.ori   r3,r3,lo(main)
        l.jr    r3
        l.jr    r3
        l.nop
        l.nop
 
 
 
 
_tick:
 
 
 
        l.sw    0x8(r1), r4
 
        l.sw    0xc(r1), r5
 
        l.sw    0x10(r1), r6
 
        l.sw    0x14(r1), r7
 
        l.sw    0x18(r1), r8
 
        l.sw    0x1c(r1), r9
 
        l.sw    0x20(r1), r10
 
        l.sw    0x24(r1), r11
 
        l.sw    0x28(r1), r12
 
        l.sw    0x2c(r1), r13
 
        l.sw    0x30(r1), r14
 
        l.sw    0x34(r1), r15
 
        l.sw    0x38(r1), r16
 
        l.sw    0x3c(r1), r17
 
        l.sw    0x40(r1), r18
 
        l.sw    0x44(r1), r19
 
        l.sw    0x48(r1), r20
 
        l.sw    0x4c(r1), r21
 
        l.sw    0x50(r1), r22
 
        l.sw    0x54(r1), r23
 
        l.sw    0x58(r1), r24
 
        l.sw    0x5c(r1), r25
 
        l.sw    0x60(r1), r26
 
        l.sw    0x64(r1), r27
 
        l.sw    0x68(r1), r28
 
        l.sw    0x6c(r1), r29
 
        l.sw    0x70(r1), r30
 
        l.sw    0x74(r1), r31
 
 
 
        l.movhi r3,hi(_tick_interrupt)
 
        l.ori   r3,r3,lo(_tick_interrupt)
 
        l.jalr  r3
 
        l.nop
 
 
 
        l.lwz   r3,0x4(r1)
 
        l.lwz   r4,0x8(r1)
 
        l.lwz   r5,0xc(r1)
 
        l.lwz   r6,0x10(r1)
 
        l.lwz   r7,0x14(r1)
 
        l.lwz   r8,0x18(r1)
 
        l.lwz   r9,0x1c(r1)
 
        l.lwz   r10,0x20(r1)
 
        l.lwz   r11,0x24(r1)
 
        l.lwz   r12,0x28(r1)
 
        l.lwz   r13,0x2c(r1)
 
        l.lwz   r14,0x30(r1)
 
        l.lwz   r15,0x34(r1)
 
        l.lwz   r16,0x38(r1)
 
        l.lwz   r17,0x3c(r1)
 
        l.lwz   r18,0x40(r1)
 
        l.lwz   r19,0x44(r1)
 
        l.lwz   r20,0x48(r1)
 
        l.lwz   r21,0x4c(r1)
 
        l.lwz   r22,0x50(r1)
 
        l.lwz   r23,0x54(r1)
 
        l.lwz   r24,0x58(r1)
 
        l.lwz   r25,0x5c(r1)
 
        l.lwz   r26,0x60(r1)
 
        l.lwz   r27,0x64(r1)
 
        l.lwz   r28,0x68(r1)
 
        l.lwz   r29,0x6c(r1)
 
        l.lwz   r30,0x70(r1)
 
        l.lwz   r31,0x74(r1)
 
 
 
        l.lwz   r2, 0x0(r1)
 
        l.addi  r1,r1,128
 
        l.rfe
 
        l.nop
 
 
 
_int_wrapper:
_int_wrapper:
 
 
        l.sw    0x8(r1), r4
        l.sw    0x8(r1), r4
        l.sw    0xc(r1), r5
        l.sw    0xc(r1), r5
        l.sw    0x10(r1), r6
        l.sw    0x10(r1), r6
Line 446... Line 358...
        l.sw    0x68(r1), r28
        l.sw    0x68(r1), r28
        l.sw    0x6c(r1), r29
        l.sw    0x6c(r1), r29
        l.sw    0x70(r1), r30
        l.sw    0x70(r1), r30
        l.sw    0x74(r1), r31
        l.sw    0x74(r1), r31
 
 
        l.movhi r3,hi(_int_main)
        l.movhi r3,hi(int_main)
        l.ori   r3,r3,lo(_int_main)
        l.ori   r3,r3,lo(int_main)
        l.jalr  r3
        l.jalr  r3
        l.nop
        l.nop
 
 
        l.lwz   r3,0x4(r1)
        l.lwz   r3,0x4(r1)
        l.lwz   r4,0x8(r1)
        l.lwz   r4,0x8(r1)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.