Skip to contentSkip to conversation

rpi-config: SPI bus support

PATCH Applied Gary Thomas 2 participants 4 messages Nov 19, 2015 – Dec 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpi-config: SPI bus support

With the newer kernels that use device tree, the SPI bus is only enabled by a device tree setting. This is now supported by adding
ENABLE_SPI_BUS = "1"
in local.conf

---
 README                                  | 5 +++++
 recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++
 2 files changed, 11 insertions(+)
README +5 -0
index e16dee9..bef13a3 100644
@@ -189,6 +189,11 @@ kernels.
 NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
       older kernel versions.
 
+2.M. Optional - enable SPI bus
+==============================
+When using device tree kernels, set this variable to enable the SPI bus
+ENABLE_SPI_BUS = "1"
+
 3. Extra apps
 =============
 
recipes-bsp/bootfiles/rpi-config_git.bb +6 -0
index 45b9f1d..aa11b25 100644
@@ -66,6 +66,12 @@ do_deploy() {
         echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
         echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
     fi
+
+    # SPI bus support
+    if [ -n "${ENABLE_SPI_BUS}" ]; then
+        echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
 }
 
 addtask deploy before do_package after do_install
Signature · 1 line
1.9.1
#1 lore raw

Ping?

Quoted 45 lines · Gary Thomas

With the newer kernels that use device tree, the SPI bus is only enabled by a device tree setting. This is now supported by adding
ENABLE_SPI_BUS = "1"
in local.conf

---
  README                                  | 5 +++++
  recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++
  2 files changed, 11 insertions(+)
README +5 -0
index e16dee9..bef13a3 100644
@@ -189,6 +189,11 @@ kernels.
  NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
        older kernel versions.
 
+2.M. Optional - enable SPI bus
+==============================
+When using device tree kernels, set this variable to enable the SPI bus
+ENABLE_SPI_BUS = "1"
+
  3. Extra apps
  =============
 
recipes-bsp/bootfiles/rpi-config_git.bb +6 -0
index 45b9f1d..aa11b25 100644
@@ -66,6 +66,12 @@ do_deploy() {
          echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
          echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
      fi
+
+    # SPI bus support
+    if [ -n "${ENABLE_SPI_BUS}" ]; then
+        echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
  }
 
  addtask deploy before do_package after do_install
Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#2 lore raw
Quoted 46 lines · Gary Thomas

Ping?

Quoted 43 lines · Gary Thomas

With the newer kernels that use device tree, the SPI bus is only enabled by a device tree setting. This is now supported by adding
ENABLE_SPI_BUS = "1"
in local.conf

---
 README                                  | 5 +++++
 recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++
 2 files changed, 11 insertions(+)
README +5 -0
index e16dee9..bef13a3 100644
@@ -189,6 +189,11 @@ kernels.
 NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
       older kernel versions.
 
+2.M. Optional - enable SPI bus
+==============================
+When using device tree kernels, set this variable to enable the SPI bus
+ENABLE_SPI_BUS = "1"
+
 3. Extra apps
 =============
 
recipes-bsp/bootfiles/rpi-config_git.bb +6 -0
index 45b9f1d..aa11b25 100644
@@ -66,6 +66,12 @@ do_deploy() {
         echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
         echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
     fi
+
+    # SPI bus support
+    if [ -n "${ENABLE_SPI_BUS}" ]; then
+        echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
 }
 
Quoted 2 lines

recipes-bsp/bootfiles/rpi-config_git.bb do_deploy() { · line 77

Quoted 2 lines
recipes-bsp/bootfiles/rpi-config_git.bb +0 -0
 addtask deploy before do_package after do_install

Looks good to me. Compiling and merging soon.

Signature · 1 line
Andrei Gherzan
#3 lore raw
Quoted 47 lines · Andrei Gherzan
Quoted 46 lines · Gary Thomas

Ping?

Quoted 43 lines · Gary Thomas

With the newer kernels that use device tree, the SPI bus is only enabled by a device tree setting. This is now supported by adding
ENABLE_SPI_BUS = "1"
in local.conf

---
 README                                  | 5 +++++
 recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++
 2 files changed, 11 insertions(+)
README +5 -0
index e16dee9..bef13a3 100644
@@ -189,6 +189,11 @@ kernels.
 NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
       older kernel versions.
 
+2.M. Optional - enable SPI bus
+==============================
+When using device tree kernels, set this variable to enable the SPI bus
+ENABLE_SPI_BUS = "1"
+
 3. Extra apps
 =============
 
recipes-bsp/bootfiles/rpi-config_git.bb +6 -0
index 45b9f1d..aa11b25 100644
@@ -66,6 +66,12 @@ do_deploy() {
         echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
         echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
     fi
+
+    # SPI bus support
+    if [ -n "${ENABLE_SPI_BUS}" ]; then
+        echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
 }
 
Quoted 7 lines
Quoted 2 lines

recipes-bsp/bootfiles/rpi-config_git.bb do_deploy() { · line 77

Quoted 2 lines
recipes-bsp/bootfiles/rpi-config_git.bb +0 -0
 addtask deploy before do_package after do_install

Looks good to me. Compiling and merging soon.

Signature · 1 line
Andrei Gherzan

Merged to master. Thank you.

Signature · 1 line
Andrei Gherzan