• Dario Binacchi's avatar
    can: bxcan: add support for ST bxCAN controller · f00647d8
    Dario Binacchi authored
    Add support for the basic extended CAN controller (bxCAN) found in many
    low- to middle-end STM32 SoCs. It supports the Basic Extended CAN
    protocol versions 2.0A and B with a maximum bit rate of 1 Mbit/s.
    
    The controller supports two channels (CAN1 as primary and CAN2 as
    secondary) and the driver can enable either or both of the channels. They
    share some of the required logic (e. g. clocks and filters), and that means
    you cannot use the secondary CAN without enabling some hardware resources
    managed by the primary CAN.
    
    Each channel has 3 transmit mailboxes, 2 receive FIFOs with 3 stages and
    28 scalable filter banks.
    It also manages 4 dedicated interrupt vectors:
    - transmit interrupt
    - FIFO 0 receive interrupt
    - FIFO 1 receive interrupt
    - status change error interrupt
    
    Driver uses all 3 available mailboxes for transmission and FIFO 0 for
    reception. Rx filter rules are configured to the minimum. They accept
    all messages and assign filter 0 to CAN1 and filter 14 to CAN2 in
    identifier mask mode with 32 bits width. It enables and uses transmit,
    receive buffers for FIFO 0 and error and status change interrupts.
    Signed-off-by: default avatarDario Binacchi <dario.binacchi@amarulasolutions.com>
    Reviewed-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
    Link: https://lore.kernel.org/all/20230328073328.3949796-6-dario.binacchi@amarulasolutions.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    f00647d8
bxcan.c 27.1 KB