> -----Original Message----- > From: Marc Kleine-Budde [mailto:mkl@xxxxxxxxxxxxxx] > Sent: Tuesday, August 14, 2018 12:57 PM > To: Pankaj Bansal <pankaj.bansal@xxxxxxx>; linux-can@xxxxxxxxxxxxxxx > Subject: Re: [PATCH v4 5/5] net: can: flexcan: can FD Format (FDF) changes > > On 08/13/2018 03:35 PM, Pankaj Bansal wrote: > >>> To use flexcan in FD mode, FDEN bit needs to be set. > >> > >> We want to use the controller in CAN-2.0 mode unless the user request > >> CAN-FD mode. Can I send and receive RTR bits with the new controller > >> if the FLEXCAN_MCR_FDEN bit it set? > > > > Can you tell me the steps to test it? I will test and let you know > > Get a 2.0 only CAN adapter, some USB-CAN adapter or an imx6 board. > Connect it to the new board. Configure the new board for CAN-2.0. Use > cansend to send a RTR message and candump to receive it. Then switch > sides: > > Sender: > > cansend can0 123#R > > Reciever: > > candump any,0:0,#FFFFFFFF > > can0 123 [0] remote request I tried connecting one LS1021A-TWR board (CAN 2.0) to LX2160A board (CAN FD), but I could not get it to work. In LX2160A, there are two CAN controllers "can0" and "can1". can0 connected to can1 is working. To test this flexcan driver, I set the compatible field for can1 to "fsl-ls1021ar2-flexcan", so that can1 will operate in can 2.0 only. Then I tested above steps with can0 operating in both CAN 2.0 mode and FD mode, while can1 in 2.0 mode only. Here are the results: # ip link set can0 up type can bitrate 1000000 [ 82.769813] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready # ip link set can1 up type can bitrate 1000000 [ 86.432435] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready # candump any,0:0,#FFFFFFFF & # cansend can0 123#R can0 123 [0] remote request can1 123 [0] remote request # cansend can1 123#R can1 123 [0] remote request can0 123 [0] remote request # cansend can0 123#R can0 123 [0] remote request can1 123 [0] remote request # cansend can1 123#R can1 123 [0] remote request can0 123 [0] remote request # ip link set can1 down # ip link set can1 up type can bitrate 1000000 dbitrate 5000000 fd on RTNETLINK answers: Operation not supported # ip link set can0 down # ip link set can0 up type can bitrate 1000000 dbit[ 207.745419] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready rate 5000000 fd on # ip link set can1 up type can bitrate 1000000 [ 303.976167] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready # cansend can0 123#R can0 123 [0] remote request can1 123 [0] remote request # cansend can1 123#R can1 123 [0] remote request can0 123 [00] # cansend can0 123#R can0 123 [0] remote request can1 123 [0] remote request # cansend can1 123#R can1 123 [0] remote request can0 123 [00] # > > Marc > > -- > Pengutronix e.K. | Marc Kleine-Budde | > Industrial Linux Solutions | Phone: +49-231-2826-924 | > Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | > Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |