[linux-yocto] I2C, SPI

Simone dev simone.bra.dev at gmail.com
Tue Jul 1 10:17:45 PDT 2014


Hello,
I made the build of poky 1.4.4 with kernel 3.4.43. Then I mounted the image
on my beagleboard xm rev c, and see that the I2C and SPI of the expansion
header wasn't on /dev of the board.
Then I tried to made the following patch:

arch/arm/mach-omap2/board-omap3beagle.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c
b/arch/arm/mach-omap2/board-omap3beagle.c
index 7be8d65..e103f5c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -30,6 +30,7 @@
 #include <linux/mtd/nand.h>
 #include <linux/mmc/host.h>

+#include <linux/spi/spi.h>
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>

@@ -384,6 +385,7 @@ static int __init omap3_beagle_i2c_init(void)
  beagle_twldata.vpll2->constraints.name = "VDVI";

  omap3_pmic_init("twl4030", &beagle_twldata);
+ omap_register_i2c_bus(2, 400, NULL, 0);
  /* Bus 3 is attached to the DVI port where devices like the pico DLP
   * projector don't work reliably with 400kHz */
  omap_register_i2c_bus(3, 100, beagle_i2c_eeprom,
ARRAY_SIZE(beagle_i2c_eeprom));
@@ -444,6 +446,17 @@ static struct platform_device keys_gpio = {
  },
 };

+static struct spi_board_info beagle_mcspi_board_info[] = {
+ // spi 3.0
+ {
+ .modalias = "spidev",
+ .max_speed_hz = 48000000, //48 Mbps
+ .bus_num = 3,
+ .chip_select = 0,
+ .mode = SPI_MODE_1,
+ },
+};
+
 static struct platform_device madc_hwmon = {
  .name = "twl4030_madc_hwmon",
  .id = -1,
@@ -469,6 +482,17 @@ static const struct usbhs_omap_board_data usbhs_bdata
__initconst = {

 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
+ OMAP3_MUX(I2C2_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(I2C2_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(UART2_CTS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(UART2_TX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+ OMAP3_MUX(MCBSP3_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
+ OMAP3_MUX(UART2_RTS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
+ OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
+ OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
+ OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
+ OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
  { .reg_offset = OMAP_MUX_TERMINATOR },
 };
 #endif
@@ -533,6 +557,8 @@ static void __init omap3_beagle_init(void)
  ARRAY_SIZE(omap3_beagle_devices));
  omap_display_init(&beagle_dss_data);
  omap_serial_init();
+ spi_register_board_info(beagle_mcspi_board_info,
+ ARRAY_SIZE(beagle_mcspi_board_info));
  omap_sdrc_init(mt46h32m32lf6_sdrc_params,
    mt46h32m32lf6_sdrc_params);

-- 
1.8.2.3

but nothing has changed. I tried to do many other changes but no one
worked. I don't know what to do please help me!
Best Regards       Lorenzo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/linux-yocto/attachments/20140701/ec5e6ac7/attachment.html>


More information about the linux-yocto mailing list