Subject: Re: Unable to write to SIMASK

From: Ricardo Scop <[email-masked]>
Date: Wed, 20 Feb 2002 18:27:52 -0300

On Wednesday 20 February 2002 21:53, [email-masked] wrote:
> hi..
>
>   We have an MPC860T based custom board.
>
>   We wanted to control interrupt on one of the irqs by writing to SIMASK
> register using a small driver with two ioctls which will will do
> the following:
>
>   // WRITE_MASK_IOCTL
>   simask_write_ioctl(mask) {
>     cli();
better use save_flags(flags); cli();

>     (volatile unsigned int *)(IMMR + simask_offset) = mask;
You're missing a * operator here (don't know about your actual source code,
though...)

>     written_value = *(volatile unsigned int *)(IMMR + simask_offset);
>     sti();
better use restore_flags(flags)... and flags must be defined as an unsigned
long.

>     printk (written_value);
>   }
>
>   // READ_MASK_IOCTL
>   simask_read_ioctl() {
>     cli(); // Not really needed..
>     read_value = *(volatile unsigned int *)(IMMR + simask_offset);
>     sti();
>     printk (read_value);
>   }
>
>
<snip>

HTH,

R. Scop

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/