Registers read-only

Moloko Vellocet allanjos at gmail.com
Tue Jan 24 02:15:37 EST 2006


Hi, I'm writing a driver to manage the serial communication in a
MPC5200 board, but the interrupt I don't have obtained the call to
interrupt routine, I've configured the registers in the initialization
code as the following:

#define REG_MBAR     MPC5xxx_MBAR
#define REG_BASE_PSC MPC5xxx_PSC3
#define REG_CR       (REG_BASE_PSC + 0x08)
#define REG_RXTX     (REG_BASE_PSC + 0x0C)
#define REG_IMR      (REG_BASE_PSC + 0x14)
#define REG_SICR     (REG_BASE_PSC + 0x40)
#define REG_RFALARM  (REG_BASE_PSC + 0x6E)
#define REG_TFALARM  (REG_BASE_PSC + 0x8E)

outb(0x0A, REG_CR);
wmb();
printk("REG_CR=%x\n", inb(REG_CR));
rmb();
outb(0x221000, REG_SICR);
wmb();
printk("REG_SICR=%x\n", inb(REG_SICR));
rmb();
outb(0x0004, REG_RFALARM);
wmb();
printk("REG_RFALARM=%x\n", inb(REG_RFALARM));
rmb();
outb(0x0004, REG_TFALARM);
wmb();
printk("REG_TFALARM=%x\n", inb(REG_TFALARM));
rmb();
outb(0x00000300, REG_IMR);
wmb();
printk("REG_IMR=%x\n", inb(REG_IMR));
rmb();

I'm getting always:
REG_CR=0
REG_SICR=0
REG_RFALARM=0
REG_TFALARM=0
REG_IMR=0

I have to configure 'port config' register doing a 'or' with the
actual value in the register, but I can't get the values contained in
the registers. Are the register write-only.

I've registered the following interrupts:
if ((err = request_irq(MPC5xxx_IR_RX_IRQ,  /*RX_IRQ_NUMBER,*/
 interrupt_handler,
 SA_INTERRUPT,
 DEVICE_NAME,
 NULL)) < 0)
 goto fail_rx_req_irq;

if ((err = request_irq(MPC5xxx_IR_TX_IRQ,  /*TX_IRQ_NUMBER,*/
 interrupt_handler_tx,
 SA_INTERRUPT,
 DEVICE_NAME,
 NULL)) < 0)
 goto fail_tx_req_irq;

But the interrupts are not activated when I execute a ioctl to the
board the interrupt handler are not called.

Does anyone know the problem with this code?



--
_______________________________
Allann J. O. Silva
Genius Instituto de Tecnologia
Tel.:+55 (92) 3614-6586
www.genius.org.br
_______________________________
"I received the fundamentals of my education in school, but that was
not enough. My real education, the superstructure, the details, the
true architecture, I got out of the public library. For an
impoverished child whose family could not afford to buy books, the
library was the open door to wonder and achievement, and I can never
be sufficiently grateful that I had the wit to charge through that
door and make the most of it." (from I. Asimov, 1994)



More information about the Linuxppc-embedded mailing list