CAN

The CAN controller in sunxi devices supports RX, TX and filtering. Currently the controller is almost identical across each chip with small variations.

= Versions =

There are three variants of the CAN controller:


 * 1) A10: Present in the A10 and A20
 * 2) R40: Present in the R40 and T3
 * D1: Present in the D1 and T113-s3

The R40 variant is identical to the A10 variant but requires a clock reset.

The D1 variant is identical to the R40 variant but has moved the filter registers.

The D1 variant introduces a version register but on the D1 it seems to read 0 rather than 1 as described in the datasheet.

= Datasheets =

Information about this controller is scattered across multiple datasheets: Make sure to check all available revisions if the controller registers are not listed for a device.


 * The A10, A20 datasheets specify pins and interrupts
 * Allwinner A20 Manual v1.40 gives a register map for the A10 and A20 CAN controller
 * [[:File:Sun7i-CANbus.pdf] is just the register map for the A10 and A20 CAN controller
 * [[File:Allwinner T3 User Manual V1.0 cleaned.pdf]] specifies pins, interrupts and the register map for the T3. Applies to the R40 too

= Filtering =

The controllers support a complex input filtering algorithm. This algorithm by default rejects all traffic aside from empty traffic from address 000.

This algorithm is described in the T113 datasheet. It heavily implies that filtered traffic is not stored in the RX buffer but this is not the case (on the D1 at least), filtered traffic only avoids an interrupt.