Re: mcp251xfd on RPi 5.4 downstream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/2/20 7:47 PM, Patrick Menschel wrote:
>>>     https://www.waveshare.com/w/upload/e/e2/2-CH-CAN-FD-HAT-Schematic.pdf
>>>
>>> Grmpf :/
>>>
>>>> This means that can1 cs is connected to pi header pin 26 
>>>
>>> Both of rpi's SPI host drivers prefer to use GPIO chip selects by default, as
>>> native chip selects have some limitations. And all three mcp251xfd overlays use
>>> GPIO chip selects, this means you can use any free GPIO in the system for the
>>> SPI chip select.
>>>
>>> Marc
>>>
>>
>> It took me a while to realize but those pin numbers on the PCB are
>> WPI := WiringPi numbers, not header pin numbers and not BCM pin numbers.
>>
>> The schematics also has the WPI column in the lower left section.
>>
>> https://pinout.xyz/pinout/wiringpi#
>>
>> --
>> Patrick
>>
> 
> It may be a blunt guess, but according to page 99
> 
> https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0.pdf
> 
> Pin 26 is pulldown. So it works if it remains unused because the pin is
> input with pulldown thus the chip is selected by default.
> 
> I don't know if the CE pin can actually work if there is no matching alt
> function in pinselect register.

Both rpi SPI drivers don't use native chip selects, they use GPIOs. This means
you can use any gpio as chip select.

This is why this setup works.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux