]> git.baikalelectronics.ru Git - kernel.git/commit
can: at91_can: make can_id of mailbox 0 configurable
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 10 Jan 2011 19:44:22 +0000 (20:44 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 24 Jan 2011 13:56:37 +0000 (14:56 +0100)
commit86d9652b77f9c0f90433db5ced1da2643eba24d9
tree5cadf4eaf9b3631b498a4ddfbee8c7458463b37c
parent391eead040d2da35c2e6b5248d87088070b8b6a5
can: at91_can: make can_id of mailbox 0 configurable

Due to a chip bug (errata 50.2.6.3 & 50.3.5.3 in
"AT91SAM9263 Preliminary 6249H-ATARM-27-Jul-09") the contents of mailbox
0 may be send under certain conditions (even if disabled or in rx mode).

The workaround in the errata suggests not to use the mailbox and load it
with an unused identifier.

This patch implements the second part of the workaround. A sysfs entry
"mb0_id" is introduced. While the interface is down it can be used to
configure the can_id of mailbox 0. The default value id 0x7ff.

In order to use an extended can_id add the CAN_EFF_FLAG (0x80000000U)
to the can_id. Example:

- standard id 0x7ff:
echo 0x7ff      > /sys/class/net/can0/mb0_id

- extended id 0x1fffffff:
echo 0x9fffffff > /sys/class/net/can0/mb0_id

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
For the Documentation-part:
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Documentation/ABI/testing/sysfs-platform-at91 [new file with mode: 0644]
drivers/net/can/at91_can.c