diff options
author | Jakub Luzny <jakub@luzny.cz> | 2020-07-16 14:39:38 +0200 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.ro> | 2020-08-10 11:10:11 +0100 |
commit | c2cbafe78f6d97cd74f2604cac7066cf2e7861bd (patch) | |
tree | 4fb83a19ca361ed14612858ed7bf652e7270520c | |
parent | 7ee3131628bba4f236a8ed136e0a614c7b96eab8 (diff) | |
download | meta-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.bb | 8 |
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" | |||
28 | GPIO_IR ?= "18" | 28 | GPIO_IR ?= "18" |
29 | GPIO_IR_TX ?= "17" | 29 | GPIO_IR_TX ?= "17" |
30 | 30 | ||
31 | CAN_OSCILLATOR ?= "16000000" | ||
32 | |||
31 | inherit deploy nopackages | 33 | inherit deploy nopackages |
32 | 34 | ||
33 | do_deploy() { | 35 | do_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 |