summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Luzny <jakub@luzny.cz>2020-07-16 14:39:38 +0200
committerAndrei Gherzan <andrei@gherzan.ro>2020-08-10 11:10:11 +0100
commitc2cbafe78f6d97cd74f2604cac7066cf2e7861bd (patch)
tree4fb83a19ca361ed14612858ed7bf652e7270520c
parent7ee3131628bba4f236a8ed136e0a614c7b96eab8 (diff)
downloadmeta-raspberrypi-c2cbafe78f6d97cd74f2604cac7066cf2e7861bd.tar.gz
rpi-config: Add CAN_OSCILLATOR variable to set mcp2515 crystal frequency
Current configuration (16MHz) is made for the PiCAN2 board that uses 16MHz crystal. This setting allows for use of Waveshare RS485 CAN HAT that has 8MHz crystal soldered (although according to Waveshare there is also a 12MHz crystal version of the board). Signed-off-by: Jakub Luzny <jakub@luzny.cz>
-rw-r--r--recipes-bsp/bootfiles/rpi-config_git.bb8
1 files changed, 5 insertions, 3 deletions
diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb
index afdbce6..be84aa6 100644
--- a/recipes-bsp/bootfiles/rpi-config_git.bb
+++ b/recipes-bsp/bootfiles/rpi-config_git.bb
@@ -28,6 +28,8 @@ VC4DTBO ?= "vc4-kms-v3d"
28GPIO_IR ?= "18" 28GPIO_IR ?= "18"
29GPIO_IR_TX ?= "17" 29GPIO_IR_TX ?= "17"
30 30
31CAN_OSCILLATOR ?= "16000000"
32
31inherit deploy nopackages 33inherit deploy nopackages
32 34
33do_deploy() { 35do_deploy() {
@@ -201,12 +203,12 @@ do_deploy() {
201 # ENABLE DUAL CAN 203 # ENABLE DUAL CAN
202 if [ "${ENABLE_DUAL_CAN}" = "1" ]; then 204 if [ "${ENABLE_DUAL_CAN}" = "1" ]; then
203 echo "# Enable DUAL CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 205 echo "# Enable DUAL CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
204 echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 206 echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
205 echo "dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=24" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 207 echo "dtoverlay=mcp2515-can1,oscillator=${CAN_OSCILLATOR},interrupt=24" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
206 # ENABLE CAN 208 # ENABLE CAN
207 elif [ "${ENABLE_CAN}" = "1" ]; then 209 elif [ "${ENABLE_CAN}" = "1" ]; then
208 echo "# Enable CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 210 echo "# Enable CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
209 echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt 211 echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
210 fi 212 fi
211 213
212 # Append extra config if the user has provided any 214 # Append extra config if the user has provided any