[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Access to R_PORT_PB_DATA



Hi,

You should use shadow variables for the registers to keep the old
value. Take a look in the gpio driver (arch/cris/drivers/gpio.c).
Also note that some of the PB pins are unavailable if you enable
certain interfaces (e.g. SCSI, USB, Sync serial).

Regards
/Mikael

-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com
To: dev-etrax
Sent: 8/23/2001 3:24 PM
Subject: Access to R_PORT_PB_DATA

Hi there

I'm trying to write a device driver that uses PB general I/O. In order
to do
that, the driver accesses pins of the register R_PORT_PB_DATA (they are
set
to output) in the following ways:

  (*R_PORT_PB_DATA)|=(1<<pin);
  (*R_PORT_PB_DATA)&=(~(1<<pin));

What happens is that the system crashes. The same happens, when I'm
addressing the discrete general ports, too.

I'm using the development board with the ETRAX 100LX, Linux 2.4.5,
devboard_lx-R2_0_0 and cris compiler 1.13.

Does anyone know what's wrong about my code?

CU Marco
_______________________
currently @xxxxxxx.ch

Marco Nef
www.shima.ch