fix PSC3 interrupt level and prio

fix PIC communication in PSC3 interrupt handler
This commit is contained in:
Markus Fröschle
2016-02-07 12:28:13 +00:00
parent 43c8c067d0
commit 6438f6dc3a
3 changed files with 8 additions and 10 deletions

View File

@@ -41,7 +41,8 @@ CFLAGS= -Wall \
-fomit-frame-pointer \ -fomit-frame-pointer \
-ffreestanding \ -ffreestanding \
-fleading-underscore \ -fleading-underscore \
-Wa,--register-prefix-optional -Wa,--register-prefix-optional \
-g
CFLAGS_OPTIMIZED = -mcpu=5474 \ CFLAGS_OPTIMIZED = -mcpu=5474 \
-Wall \ -Wall \
-O2 \ -O2 \

View File

@@ -37,7 +37,7 @@
#include "dma.h" #include "dma.h"
#include "pci.h" #include "pci.h"
//#define IRQ_DEBUG // #define IRQ_DEBUG
#if defined(IRQ_DEBUG) #if defined(IRQ_DEBUG)
#define dbg(format, arg...) do { xprintf("DEBUG %s(): " format, __FUNCTION__, ##arg); } while (0) #define dbg(format, arg...) do { xprintf("DEBUG %s(): " format, __FUNCTION__, ##arg); } while (0)
#else #else
@@ -247,20 +247,20 @@ bool pic_interrupt_handler(void *arg1, void *arg2)
dbg("PIC interrupt\r\n"); dbg("PIC interrupt\r\n");
rcv_byte = MCF_PSC3_PSCRB_8BIT; rcv_byte = * (volatile uint8_t *) (&MCF_PSC3_PSCRB_8BIT);
if (rcv_byte == 2) /* PIC requests RTC data */ if (rcv_byte == 2) /* PIC requests RTC data */
{ {
uint8_t *rtc_reg = (uint8_t *) 0xffff8961; volatile uint8_t *rtc_reg = (uint8_t *) 0xffff8961;
uint8_t *rtc_data = (uint8_t *) 0xffff8963; volatile uint8_t *rtc_data = (uint8_t *) 0xffff8963;
int index = 0; int index = 0;
err("PIC interrupt: requesting RTC data\r\n"); err("PIC interrupt: requesting RTC data\r\n");
MCF_PSC3_PSCTB_8BIT = 0x82; // header byte to PIC * (volatile uint8_t *) (&MCF_PSC3_PSCTB_8BIT) = 0x82; // header byte to PIC
do do
{ {
*rtc_reg = 0; *rtc_reg = 0;
MCF_PSC3_PSCTB_8BIT = *rtc_data; * (volatile uint8_t *) (&MCF_PSC3_PSCTB_8BIT) = *rtc_data;
} while (index++ < 64); } while (index++ < 64);
} }
return true; return true;

View File

@@ -265,9 +265,6 @@ static void init_serial(void)
MCF_PSC3_PSCCR = 0x05; MCF_PSC3_PSCCR = 0x05;
#endif /* MACHINE_FIREBEE */ #endif /* MACHINE_FIREBEE */
MCF_INTC_ICR32 = MCF_INTC_ICR_IL(7) |
MCF_INTC_ICR_IL(4); /* PSC3 interrupt vector. Do we need it? */
xprintf("\r\nserial interfaces initialization: finished\r\n"); xprintf("\r\nserial interfaces initialization: finished\r\n");
} }