Autor Thema: ARM PI PI2B IVT IRQ  (Gelesen 3789 mal)

Relbmessa

  • Beiträge: 73
    • Profil anzeigen
Gespeichert
« am: 09. September 2015, 13:37 »
Hallo,

wieder mal komme ich nicht weiter.

Habe ein kleines Test-Programm für Pi und Pi2 entworfen.

Auf dem Pi macht es alles was ich erwarte. Der Pi2B macht im wesentlichen auch alles, nur beim ARM_Timer IRQ
hängt er sich auf.
Soweit ich gelesen habe, soll er aber abwärts Kompatibel sein.

Frage: :?

Hat sich schon Jemand damit befast ?
Wenn ja, würde ich einen kleinen Gedankenaustausch begrüßen.

Leider ist der komplette Code etwas umfangreich.
Also erstmal nur einen Code-Auschnitt.

Gruß
Relbmessa


/********************************************************/
/* DANK PETER LEMON */
/*Dual Raspberry Pi */ /*Test IRQ */

 .section .init
 .globl _start
 _start:

/*; Setup Frame Buffer */
SCREEN_X       = 1024
SCREEN_Y       = 768
BITS_PER_PIXEL = 24

BASIS_ADD      =0x20000000 /* Pi 2B 0x3F000000 */

@CS_TIMER       =0x3000

/*; Setup  */


/*; Setup SMP (Boot Offset = $4000008C + ($10 * Core), Core = 1..3)
/*;Core1Boot = $4000008C + ($10 * 1) ; Core 1 Boot Offset */
 Core1Boot = 0x4000009C            @ ; Core 1 Boot Offset
/*;Core2Boot = $4000008C + ($10 * 2) ; Core 2 Boot Offset */
 Core2Boot = 0x400000AC            @ ; Core 2 Boot Offset
/*;Core3Boot = $4000008C + ($10 * 3) ; Core 3 Boot Offset */
 Core3Boot = 0x400000BC            @ ; Core 3 Boot Offset
@/*-------------------------------------------------------------------*/
  mov sp , #0x8000
b FB_Init 
@/*-------------------------------------------------------------------*/
    ldr pc,reset_handler
    ldr pc,undefined_handler
    ldr pc,swi_handler
    ldr pc,prefetch_handler
    ldr pc,data_handler
    ldr pc,unused_handler
    ldr pc,irq_handler
    ldr pc,fiq_handler
reset_handler:      .word resetVector
undefined_handler:  .word undVector
swi_handler:        .word swiVector
prefetch_handler:   .word prefVector
data_handler:       .word dataVector
unused_handler:     .word reservVector
irq_handler:        .word irqVector
fiq_handler:        .word fiqVector
/*--------------------------------------------------------------*/
  mov r0,r0
  mov r0,r0
/*--------------------------------------------------------------*/
FB_Init:
/*;---------------------------------------------------------------*/
  mov r0 ,#FB_STRUCT     @ mov r0,#FB_STRUCT @ 0xB0
  orr r0,#8 /*; MAIL_TAGS*/
  orr r0,r0 ,#0x8000
  orr r0,r0 ,#0
/*;--------------------------------------------------------------- -------- */
mov r1 ,#BASIS_ADD @0x3F000000 /*;@ Address Mail_Box */
orr r1,r1,#0xB800
orr r1,r1,#0xA0
orr r1,r1,#0                                                  ;
/*;------------------------------------------------------------------------*/
 str r0,[r1] @ /*; Mail Box Write */   ;70-7F   */
/*;------------------------------------------------------------------------*/
  mov r1 ,#FB_POINTER @FB_POINTER 0x2C ;
  orr r1 ,r1,#0x8100
  orr r1 ,r1,#0
  orr r1 ,r1,#0
@;/*;----------------------------------------------------------------------*/ 
  ldr r10,[r1] /* ; R10 = Frame Buffer Pointer ;A0-AF */
  cmp r10,#0   /* Compare Frame Buffer Pointer To Zero */
  beq FB_Init  /* IF Zero Re-Initialize Frame Buffer */
  mov r12 , r10
b weiter_programm
/*;----------------------------------------------------------------------------------------------------------*/
Ersatz_align:
  .word 0xFFFFFFFF
  .word 0xFFFFFFFF @ der achte
/* align 8 */
FB_STRUCT:
  .word FB_STRUCT_END - FB_STRUCT
  .word 0
       
  .word 0x00048003 /*,Set_Physical_Display*/
  .word 0x8
  .word 0x8
  .word SCREEN_X
  .word SCREEN_Y

  .word 0x00048004 /*Set_Virtual_Buffer  */
  .word 0x8
  .word 0x8
  .word SCREEN_X
  .word SCREEN_Y
 
  .word 0x00048005 /*Set_Depth        */
  .word 0x4
  .word 0x4
  .word BITS_PER_PIXEL

  .word 0x00048009 /*Set_Virtual_Offset */
  .word 0x8
  .word 0x8
FB_OFFSET_X:
  .word 0
FB_OFFSET_Y:
  .word 0
 
  .word 0x00040001 /*Allocate_Buffer */
  .word 0x8      
  .word 0x8
FB_POINTER:
  .word 0
  .word 0
 
  .word 0x0            
FB_STRUCT_END:
/*-----------------------------------------------------------*/
/*////////////////////////////////////////////////////////*/
 .align 8
resetVector:

  push {r0-r12 ,r14}
  /* nur Message-------------*/
     mov r0 ,#0 /*Spalte */
     mov r1 ,#1  /*Zeile   */   
 bl upcurserPos  /* Start-Position    */
      mov r0 , #16 /* 0x10 zeichen */
 bl upconvbyte 
     
haltreset:
 b haltreset
 
  pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
      subs r15 ,r14,#4     

/*////////////////////////////////////////////////////////*/

 .align 8
undVector:

  push {r0-r12 ,r14}
    /* nur Message-------------*/
     mov r0 ,#0 /*Spalte */
     mov r1 ,#2  /*Zeile   */   
 bl upcurserPos  /* Start-Position    */
      mov r0 , #16+1 /* zeichen */
 bl upconvbyte
haltund:
  b haltund
  pop {r0-r12 ,r14}
/*---IRQ-Ende----*/

movs r15 ,r14
 
/*////////////////////////////////////////////////////////*/

/*////////////////////////////////////////////////////////*/
 .align 8
swiVector:



  push {r0-r12 ,r14}
 
    /* nur Message-------------*/
     mov r0 ,#0 /*Spalte */
     mov r1 ,#3  /*Zeile   */   
 bl upcurserPos  /* Start-Position    */
      mov r0 , #16+2 /* zeichen */
 bl upconvbyte
@ haltswi:
@  b haltswi
  pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
movs r15 ,r14
 
/*////////////////////////////////////////////////////////*/

/*////////////////////////////////////////////////////////*/
 .align 8
prefVector:

  push {r0-r12 ,r14}
   /* nur Message-------------*/
     mov r0 ,#0 /*Spalte */
     mov r1 ,#4  /*Zeile   */   
 bl upcurserPos  /* Start-Position    */
      mov r0 , #16+3 /* zeichen */
 bl upconvbyte

HALTVector:
b HALTVector
     
    pop {r0-r12 ,r14}   

subs r15,r14,#4
/*////////////////////////////////////////////////////////*/
/*////////////////////////////////////////////////////////*/
 .align 8
dataVector:

push {r0-r12 ,r14}
    /* nur Message-------------*/
     mov r0 ,#0 /*Spalte */
     mov r1 ,#5  /*Zeile   */   
 bl upcurserPos  /* Start-Position    */
      mov r0 , #16+4 /* zeichen */
 bl upconvbyte
 
haltdata:
 b haltdata

  pop {r0-r12 ,r14}
@/*---IRQ-Ende----*/
     subs r15 ,r14 ,#8   

/*////////////////////////////////////////////////////////*/
/*////////////////////////////////////////////////////////*/
 .align 8
reservVector:

  push {r0-r12 ,r14}
 
    /* nur Message-------------*/
     mov r0 ,#0 /*Spalte */
     mov r1 ,#6  /*Zeile   */   
 bl upcurserPos  /* Start-Position    */
      mov r0 , #16+5 /* zeichen */
 bl upconvbyte
 

haltreserv:
 b haltreserv
 
  pop {r0-r12 ,r14}
/*---IRQ-Ende----*/

 movs r15 ,r14
/*////////////////////////////////////////////////////////*/

/*//////////////////////////////////////////////////////////*/
 .align 8
irqVector:

  push {r0-r12 ,r14}
 
  ldr r0 , =BASIS_ADD
  ldr r1 , =0xB40C
  add r0 , r1 /* Ziel  */
   
  ldr r1 , =0x01
  str r1 , [r0]
 
 ldr r0 ,=startProgr
 mov r1 ,#1 /* startProgramm ein */
 str r1 ,[r0] /* heute */
/*********************************************************/
  mov r1 , #1
  ldr r0 , =uhrzeitzaehl
  ldr r2 , [r0]
  add r2 , r1
  str r2 , [r0]
   /* nur Message-------------*/
@     mov r0 ,#0 /*Spalte */
@     mov r1 ,#7  /*Zeile   */   
@ bl upcurserPos  /* Start-Position    */
@      mov r0 , #16+6 /* zeichen */
@ bl upconvbyte
 
  pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
      subs r15 ,r14,#4     
/*---IRQ-Ende----*/
/*////////////////////////////////////////////////////////*/
 .align 8
fiqVector:

  push {r0-r12 ,r14}
 
      /* nur Message-------------*/
     mov r0 ,#0 /*Spalte */
     mov r1 ,#8  /*Zeile   */   
 bl upcurserPos  /* Start-Position    */
      mov r0 , #16+7 /* zeichen */
 bl upconvbyte

haltfiq:
b haltfiq

  pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
     subs r15 ,r14 ,#4   
/**********************************************************/
/*////////////////////////////////////////////////////////*/
@/*------------ UP ---------------------------------------*/
up_cursor:
  push {r4-r12}
  mov r6 ,r4 @ offset /startpunkt
  mov r4 ,#16 @ anzahl spalte
  mov r5 ,r4 @ anzahl zeile
loop_cursor: 
  strb r1 , [r0,r6] @ blue
   add r0 , #1
  strb r2 , [r0,r6] @ gruen
   add r0 , #1
  strb r3 , [r0,r6] @ rot
   add r0 , #1
   sub r4 , #1 @ spalte
   cmp r4 , #0
   bne loop_cursor
   mov r4 , #16 @ reset spalte
   add r6 , #1024*3     @ nächste zeile
   sub r6 , #16*3 @ offset
   sub r5 ,#1
   cmp r5 ,#0
   bne loop_cursor
   pop {r4-r12}     
mov pc , lr

@/*////////////////////////////////////////////////////////*/
 .align 2
 .section .data

bws_pointer:
  .word 0x0
/*-----------------------------------------------------------*/
bws_hell_rot:
  .word 0xFF
 
bws_hell_gruen:
  .word 0x0

bws_hell_blue:
  .word 0xFF
 
bws_anzahl_point:
  .word 1024*16 @1024*768
/*-----------------*/ 
pause_value:
  .word 0x003F0000
/*-----------------*/
pause_valueA:
  .word 0x000F0000
/*----------------*/
pause_valueB:
  .word 0x000F0000*2
/*---------------------------------------------------------------------*/
 .align 2
meValueAnzbyte: @ Parameter upsiebenzweiBWS
 .int 0x4
meValueAnzZeil:
 .int 0x8 @ 20d
@--------------Anzeige zeile 1-8 --------------------------------------*/
 .align 8
data_bws0:
  .word 0x11111111
data_bws4:
  .word 0x22222222
data_bws8:
  .word 0x33333333 
data_bwsC:
  .word 0x44444444
data_bws10:
  .word 0x55555555 
data_bws14:
  .word 0x66666666
data_bws18:
  .word 0x77777777
data_bws1C:
  .word 0x88888888 
data_bws20:
  .word 0x0
/*---------------------------------------------------------------------*/
data_bws24:
  .word 0x24
data_bws28:
  .word 0x0 
data_bws2C:
  .word 0x0
data_bws30:
  .word 0x0 
data_bws34:
  .word 0x0
data_bws38:
  .word 0x0
data_bws3C:
  .word 0x0 
data_bws40:
  .word 0x40
/*-------------------------------------------------------------------*/
data_bws44:
  .word 0x44
data_bws48:
  .word 0x0 
data_bws4C:
  .word 0x0
data_bws50:
  .word 0x0 
data_bws54:
  .word 0x0
data_bws58:
  .word 0x0
data_bws5C:
  .word 0x0 
data_bws60:
  .word 0x60
/*-------------------------------------------------------------------*/
/*------------------*/
uhrzeitzaehl:
  .int 0x0
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
/*=======================================================*/
startProgr:
  .int 0x01
weitermitProgramm:
  .int 0x0
prMatrixXXX:
  .int Proffset
  .int Pr001 , Pr002 , Pr003 , Pr004 , Pr005 , Pr006 , Pr007 , Pr008 , Pr009 , Pr010
  .int Pr011 , Pr012 , Pr013 , Pr014 , Pr015 , Pr016 , Pr017 , Pr018 , Pr019 , Pr020
 /*;--------------------------------------------------------------------*/
weiter_programm:
@/*-------------------------------*/
/*============================================================*/
/*    ISR Vectoren      */
/************************************************************/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ ------------- IVT Pointer -------------------------------

mov r0 , #8 @;Anzahl
ldr r1 , =0xEA000006 @;value sprung
mov r2 , #0 @; ram null
ivt_pointer0:
str r1 ,[r2]
add r1 ,#2
add r2 ,#4
sub r0 ,#1
cmp r0 ,#0
bne ivt_pointer0
@----------------ENDE------------------------------------
@;;;;;; lade E59FF000------------------------------------
mov r0 , #8 @;Anzahl
ldr r1 , =0xE59FF000 @;ldr PC, [PC]
mov r2 , #32 @; ram start 0x20
ivt_pointer1:
str r1 ,[r2]
@add r1 ,#2
add r2 ,#12 @ Abstand 0x0C
sub r0 ,#1
cmp r0 ,#0
bne ivt_pointer1
@----------------ENDE------------------------------------
@;;;;;;;;; address händler-------------------------------
mov r0 , #8 @;Anzahl
ldr r1 , =0x00008008 @;Erster reset_handler
mov r2 , #40 @; ram 40 0x28
ivt_pointer2:
str r1 ,[r2]
add r1 ,#4
add r2 ,#12 @ Abstand 0x0C
sub r0 ,#1
cmp r0 ,#0
bne ivt_pointer2
@----------------ENDE-------------------------------------------
   
« Letzte Änderung: 09. September 2015, 20:56 von Relbmessa »

Relbmessa

  • Beiträge: 73
    • Profil anzeigen
Gespeichert
« Antwort #1 am: 09. October 2015, 22:56 »
Hi,
habe das Problem gelöst.

BCM2836 und ARM Timer lösen IRQ aus und werden erkannt.

Sollte Jemand noch Intresse haben, dann sollte er jetzt aktiv werden so lange es noch in meinem Kopf aktiv ist.

Ab und zu schaue ich  ja auch Hier rein.

Gruß
Relbmessa




« Letzte Änderung: 09. October 2015, 23:00 von Relbmessa »

Relbmessa

  • Beiträge: 73
    • Profil anzeigen
Gespeichert
« Antwort #2 am: 11. October 2015, 23:51 »
So,
ich habe diesen Teil gelöst und daß gesetzte Ziel erreicht.
Das Programm macht das was es soll.

BCM2836 und ARM Timer lösen eine IRQ aus und werden aufgelöst ohne sich zu stören.
Die restlichen Kerne werden geweckt und jeweils L1-cache gestartet.
Jeder Kern kann unabhängig SVC (SWI) auslösen.

Wer Fragen  dazu hat kann sie stellen, vielleicht kann ich ja helfen.
 
Gruß
Relbmessa
« Letzte Änderung: 18. October 2015, 19:39 von Relbmessa »

 

Einloggen