diff options
| -rw-r--r-- | conf/machine/include/rpi-base.inc | 1 | ||||
| -rw-r--r-- | docs/extra-build-config.md | 9 | ||||
| -rw-r--r-- | recipes-bsp/bootfiles/rpi-config_git.bb | 6 | ||||
| -rw-r--r-- | recipes-core/udev/udev-rules-rpi.bb | 6 | ||||
| -rw-r--r-- | recipes-core/udev/udev-rules-rpi/can.rules | 1 |
5 files changed, 22 insertions, 1 deletions
diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc index 4bbd576..57ad8e1 100644 --- a/conf/machine/include/rpi-base.inc +++ b/conf/machine/include/rpi-base.inc | |||
| @@ -26,6 +26,7 @@ RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \ | |||
| 26 | overlays/iqaudio-dac.dtbo \ | 26 | overlays/iqaudio-dac.dtbo \ |
| 27 | overlays/iqaudio-dacplus.dtbo \ | 27 | overlays/iqaudio-dacplus.dtbo \ |
| 28 | overlays/lirc-rpi.dtbo \ | 28 | overlays/lirc-rpi.dtbo \ |
| 29 | overlays/mcp2515-can0.dtbo \ | ||
| 29 | overlays/pi3-disable-bt.dtbo \ | 30 | overlays/pi3-disable-bt.dtbo \ |
| 30 | overlays/pi3-miniuart-bt.dtbo \ | 31 | overlays/pi3-miniuart-bt.dtbo \ |
| 31 | overlays/pitft22.dtbo \ | 32 | overlays/pitft22.dtbo \ |
diff --git a/docs/extra-build-config.md b/docs/extra-build-config.md index 931ed0f..b44dece 100644 --- a/docs/extra-build-config.md +++ b/docs/extra-build-config.md | |||
| @@ -243,6 +243,15 @@ When using device tree kernels, set this variable to enable the 802.15.4 hat: | |||
| 243 | 243 | ||
| 244 | See: <https://openlabs.co/OSHW/Raspberry-Pi-802.15.4-radio> | 244 | See: <https://openlabs.co/OSHW/Raspberry-Pi-802.15.4-radio> |
| 245 | 245 | ||
| 246 | ## Enable CAN with Pican2 | ||
| 247 | |||
| 248 | In order to use Pican2 CAN module, set the following variables: | ||
| 249 | |||
| 250 | ENABLE_SPI_BUS = "1" | ||
| 251 | ENABLE_CAN = "1" | ||
| 252 | |||
| 253 | See: <http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-23-p-1475.html> | ||
| 254 | |||
| 246 | ## Manual additions to config.txt | 255 | ## Manual additions to config.txt |
| 247 | 256 | ||
| 248 | The `RPI_EXTRA_CONFIG` variable can be used to manually add additional lines to | 257 | The `RPI_EXTRA_CONFIG` variable can be used to manually add additional lines to |
diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index d92b8e4..d0d1fba 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb | |||
| @@ -183,6 +183,12 @@ do_deploy() { | |||
| 183 | echo "dtoverlay=at86rf233,speed=3000000" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 183 | echo "dtoverlay=at86rf233,speed=3000000" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 184 | fi | 184 | fi |
| 185 | 185 | ||
| 186 | # ENABLE CAN | ||
| 187 | if [ "${ENABLE_CAN}" = "1" ]; then | ||
| 188 | echo "# Enable CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | ||
| 189 | echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | ||
| 190 | fi | ||
| 191 | |||
| 186 | # Append extra config if the user has provided any | 192 | # Append extra config if the user has provided any |
| 187 | echo "${RPI_EXTRA_CONFIG}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 193 | echo "${RPI_EXTRA_CONFIG}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 188 | } | 194 | } |
diff --git a/recipes-core/udev/udev-rules-rpi.bb b/recipes-core/udev/udev-rules-rpi.bb index edef0db..42cfcdd 100644 --- a/recipes-core/udev/udev-rules-rpi.bb +++ b/recipes-core/udev/udev-rules-rpi.bb | |||
| @@ -2,7 +2,10 @@ DESCRIPTION = "udev rules for Raspberry Pi Boards" | |||
| 2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
| 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
| 4 | 4 | ||
| 5 | SRC_URI = " file://99-com.rules" | 5 | SRC_URI = " \ |
| 6 | file://99-com.rules \ | ||
| 7 | file://can.rules \ | ||
| 8 | " | ||
| 6 | 9 | ||
| 7 | S = "${WORKDIR}" | 10 | S = "${WORKDIR}" |
| 8 | 11 | ||
| @@ -11,4 +14,5 @@ INHIBIT_DEFAULT_DEPS = "1" | |||
| 11 | do_install () { | 14 | do_install () { |
| 12 | install -d ${D}${sysconfdir}/udev/rules.d | 15 | install -d ${D}${sysconfdir}/udev/rules.d |
| 13 | install -m 0644 ${WORKDIR}/99-com.rules ${D}${sysconfdir}/udev/rules.d/ | 16 | install -m 0644 ${WORKDIR}/99-com.rules ${D}${sysconfdir}/udev/rules.d/ |
| 17 | install -m 0644 ${WORKDIR}/can.rules ${D}${sysconfdir}/udev/rules.d/ | ||
| 14 | } | 18 | } |
diff --git a/recipes-core/udev/udev-rules-rpi/can.rules b/recipes-core/udev/udev-rules-rpi/can.rules new file mode 100644 index 0000000..a47d57d --- /dev/null +++ b/recipes-core/udev/udev-rules-rpi/can.rules | |||
| @@ -0,0 +1 @@ | |||
| SUBSYSTEM=="net", DEVPATH=="/devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.0/net/can0", RUN+="/sbin/ip link set can0 up type can bitrate 500000" | |||
