Skip to content
  • Marek Vasut's avatar
    can: ifi: Add obscure bit swap for EFF frame IDs · 6cc64266
    Marek Vasut authored
    
    
    In case of CAN2.0 EFF frame, the controller handles frame IDs in a
    rather bizzare way. The ID is split into an extended part, IDX[28:11]
    and standard part, ID[10:0]. In the TX path, the core first sends the
    top 11 bits of the IDX, followed by ID and finally the rest of IDX.
    In the RX path, the core stores the ID the LSbit part of IDX field,
    followed by the LSbit parts of real IDX. The MSbit parts of IDX are
    stored in ID field of the register.
    
    This patch implements the necessary bit shuffling to mitigate this
    obscure behavior. In case two of these controllers are connected
    together, the RX and TX bit swapping nullifies itself and the issue
    does not manifest. The issue only manifests when talking to another
    different CAN controller.
    
    Signed-off-by: default avatarMarek Vasut <marex@denx.de>
    Cc: Marc Kleine-Budde <mkl@pengutronix.de>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Oliver Hartkopp <socketcan@hartkopp.net>
    Cc: Wolfgang Grandegger <wg@grandegger.com>
    Reviewed-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    6cc64266