1

I'm trying to configure my can-bus module. I'm following these steps .

My branch is 3.18.y-rebase (from github)

When I came to device drivers->spi support step I couldn't see BCM2798 SPI controller driver (SPI0) option.

Resultant options are,

SPI Master Controller Driver

  • Altera SPI controller(NEW)
  • Utilities for bitbanging SPI masters(NEW)
  • Cadence SPI controller(NEW)
  • Freescale SPI controller and aeroflex gaisler grlib GPI controller
  • Rockchip SPI controller common module(NEW)
  • Xilinx SPI controller core support(NEW)
  • DesignWare SPI controller core support(NEW)

SPI Protocol Masters

  • Usermode SPI device driver support (NEW)
  • Infinean TLE62X0 (for power switching)(NEW)

How can I choose BCM2798 driver?

  • I'm not familiar with CAN but isn't BCM2798 a typo for BCM2708? – joan Apr 13 '15 at 11:03
  • also I'm beginner for CAN, i follow steps in this website (elinux.org/RPi_CANBus) and wrote there BCM2798. I guess it is a typo because in next steps it was BCM2708. Anyway i coundnt find this driver in kernel configuration. :) – mezzocannone Apr 13 '15 at 11:06
1

Have a look in /proc/config.gz for the options used to build the (running) Raspberry Pi kernel.

E.g.

cd
cp /proc/config.gz .
gunzip config.gz
grep _SPI_ config

This produces

# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
# CONFIG_SPI_ALTERA is not set
CONFIG_SPI_BCM2835=m
CONFIG_SPI_BCM2708=m
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_FSL_SPI is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PL022 is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_ROCKCHIP is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set
CONFIG_SPI_SPIDEV=y
# CONFIG_SPI_TLE62X0 is not set

You can see that the needed settings are

CONFIG_SPI_MASTER=y
CONFIG_SPI_BCM2835=m
CONFIG_SPI_BCM2708=m
CONFIG_SPI_SPIDEV=y
| improve this answer | |
  • 3 of them are set except CONFIG_SPI_BCM2835 in my system – mezzocannone Apr 13 '15 at 11:53
  • I don't know how these modules interact. The bcm2835 is the Pi's System On a Chip (SOC), it contains the peripherals (SPI/I2C/gpios etc.), ARM CPU, and GPU. – joan Apr 13 '15 at 12:33
  • While tweaking the config this way might work in this specific case, and probably is harmless to try, note that in general this often may not work; kernel options are inter-related and just hacking one into the .config will not set whatever it may depend on, etc. As it says at the top, "Automatically generated file; DO NOT EDIT". Again, though, it is probably harmless enough to try (unless you are working on the pi itself and two or three hours leading to a failed compilation = pain). – goldilocks Apr 13 '15 at 13:50
1

In order to be valid, some kernel options first require other options be set, which is why you may not find them in menuconfig. To figure out what the prerequisites are, you need the option CONFIG_ tag name. You can then search for it in menuconfig by pressing /. Searching for SPI_BCM2708 in the 3.18.6 kernel shows:

Symbol: SPI_BCM2708 [=n]
 Type  : tristateg20
 Prompt: BCM2708 SPI controller driver (SPI0)
 Location:
    -> Device Drivers
 (1)   -> SPI support (SPI [=n])
   Defined at drivers/spi/Kconfig:89
   Depends on: SPI [=n] && SPI_MASTER [=n] && (MACH_BCM2708 [=n]  MACH_BCM2709 [=y])   

Right now, if I go into "Device Drivers" I will not see this option. First I have to enable "SPI support", which activates the first two above. Then, since MACH_BCM2709 is enabled (this is actually ARMv7 for the pi 2; for earlier pi's it would have been MACH_BCM2708), I can go into the submenu and find both

  • BCM2835 SPI controller
  • BCM2708 SPI controller driver

You can similarly look at SPI_BCM2835 via /.

MACH_BCM2709 (or 08) is automatically selected by ARCH_BCM2709, which requires a bunch of other stuff; you can look at them by / searching for the latter, but those presumably should have been set by using the .config from that elinux page. If not, try make clean, make bcmrpi_defconfig, make menuconfig.

Note that presumes you've set environment variables for your cross-compiler (e.g. export ARCH=arm), if you are not doing it on the pi itself. That must be done for menuconfig, not just the actual build.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.