diff options
| author | Petter Mabäcker <petter@technux.se> | 2016-02-28 14:46:10 +0100 |
|---|---|---|
| committer | Andrei Gherzan <andrei@gherzan.ro> | 2016-03-01 14:10:21 +0100 |
| commit | b3319339387d65ece69f32df050f906cfcef2a4a (patch) | |
| tree | 8cc7dbddfae2cbd3122c4e748579fbd2067af59e | |
| parent | 6c6f6cf7b3738ff5f8b321295eddd99a118afd1e (diff) | |
| download | meta-raspberrypi-b3319339387d65ece69f32df050f906cfcef2a4a.tar.gz | |
rpi-config: I2C support
With newer kernels (>=3.18) that supports device-trees I2C
should be enabled with device-trees.
This is now support by adding:
ENABLE_I2C = "1"
in local.conf
This will enable the dtparams:
i2c1
i2c_arm
Signed-off-by: Petter Mabäcker <petter@technux.se>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
| -rw-r--r-- | README | 7 | ||||
| -rw-r--r-- | recipes-bsp/bootfiles/rpi-config_git.bb | 6 |
2 files changed, 13 insertions, 0 deletions
| @@ -27,6 +27,7 @@ Contents: | |||
| 27 | 3.J. Image with Initramfs | 27 | 3.J. Image with Initramfs |
| 28 | 3.K. Device tree support | 28 | 3.K. Device tree support |
| 29 | 3.L. Enable SPI bus | 29 | 3.L. Enable SPI bus |
| 30 | 3.M. Enable I2C | ||
| 30 | 4. Extra apps | 31 | 4. Extra apps |
| 31 | 4.A. omxplayer | 32 | 4.A. omxplayer |
| 32 | 5. Board Configuration | 33 | 5. Board Configuration |
| @@ -207,6 +208,12 @@ NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disable | |||
| 207 | When using device tree kernels, set this variable to enable the SPI bus | 208 | When using device tree kernels, set this variable to enable the SPI bus |
| 208 | ENABLE_SPI_BUS = "1" | 209 | ENABLE_SPI_BUS = "1" |
| 209 | 210 | ||
| 211 | 3.M. Enable I2C | ||
| 212 | =============== | ||
| 213 | When using device tree kernels, set this variable to enable I2C | ||
| 214 | ENABLE_I2C = "1" | ||
| 215 | |||
| 216 | |||
| 210 | 4. Extra apps | 217 | 4. Extra apps |
| 211 | ============= | 218 | ============= |
| 212 | 219 | ||
diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index 4cdffca..138cb37 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb | |||
| @@ -75,6 +75,12 @@ do_deploy() { | |||
| 75 | echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 75 | echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 76 | echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 76 | echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 77 | fi | 77 | fi |
| 78 | |||
| 79 | if [ -n "${ENABLE_I2C}" ]; then | ||
| 80 | echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | ||
| 81 | echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | ||
| 82 | echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | ||
| 83 | fi | ||
| 78 | } | 84 | } |
| 79 | 85 | ||
| 80 | addtask deploy before do_package after do_install | 86 | addtask deploy before do_package after do_install |
