From: plasmaphase <mar...@jh...> - 2010-07-06 20:27:48
|
I have recently moved to 2.6.33 kernel and noticed there were a few changes to the board-overo.c file. I have not yet been able to get MMC SPI working, but have ported what I had in the previous board-overo.c file and am now getting this error: mmc_spi_data: undeclared here (not in a function) For some reason it is not able to see the mmc_spi_data, even though it's clearly in the board-overo.c file. I've attached my board-overo.c file for reference. If I change the .platform_data = &mmc_spi_data, to .platform_data = 0x0, it compiles, so I know that particular line of code is causing the problem. Any suggestions? http://old.nabble.com/file/p29089733/board-overo.c board-overo.c Bernhard Wörndl-Aichriedler wrote: > > Send your setup file please. > > Is anything else connected to the SPI bus? > Or the better question - do you use a breakout board with a touchscreen? > Normally the touchscreen controller is connected to the SPI bus - if you > are not using it, just remove it's setup. > > Regards > > *Bernhard Wörndl-Aichriedler* > > Am 12.05.2010 21:48, schrieb plasmaphase: >> New error: >> >> mmc_spi spi1.0: can't share SPI bus >> mmc_spi: probe of spi1.0 failed with error -16 >> >> >> >> >> >> >> >> >> >> >> >> plasmaphase wrote: >> >>> I forgot to do the level translation from 1.8V to 3.3V...so that's one >>> problem. I did not see any toggling of SCK, which I would expect to see >>> (even if @ 1.8V). I am using a microSD card...which does not have a WP >>> pin...can I just pull this high? I also am not certain where to place >>> the >>> WP and CD pins on the header, as: >>> >>> #define S1_MMC_SPI_CD_PIN 144 >>> #define S1_MMC_SPI_WP_PIN 145 >>> >>> We will only be using one card, and so I don't think these are necessary >>> except to fake out for the driver...is CD active high or low? >>> >>> Thanks for your quick and helpful responses! >>> >>> >>> >>> >>> Bernhard Wörndl-Aichriedler wrote: >>> >>>> Currently not really, >>>> >>>> Are you sure the hardware and the level conversion works? >>>> Do you get anything on CS, DI, DO and SCK? >>>> >>>> Can you send me your board setup? >>>> >>>> >>>> Regards >>>> >>>> *Bernhard Wörndl-Aichriedler* >>>> >>>> >>>> Am 12.05.2010 20:07, schrieb plasmaphase: >>>> >>>>> overo mmc_spi: probe of spi1.0 failed with error -16 >>>>> >>>>> Any ideas? >>>>> >>>>> >>>>> >>>>> >>>>> Bernhard Wörndl-Aichriedler wrote: >>>>> >>>>> >>>>>> Hey =) >>>>>> >>>>>> This should do the trick: >>>>>> >>>>>> >>>>>> #include<linux/spi/spi.h> >>>>>> #include<linux/spi/mmc_spi.h> >>>>>> >>>>>> >>>>>> int s1_mmc_spi_card_detect(struct device *dev) >>>>>> { >>>>>> return !gpio_get_value(S1_MMC_SPI_CD_PIN); >>>>>> } >>>>>> >>>>>> int s1_mmc_spi_write_protect(struct device *dev) >>>>>> { >>>>>> return gpio_get_value(S1_MMC_SPI_WP_PIN); >>>>>> } >>>>>> >>>>>> int s1_mmc_spi_init(struct device *dev,irqreturn_t (*cd)(int, void >>>>>> *),void *mmc) >>>>>> { >>>>>> int ret; >>>>>> ret = request_irq(gpio_to_irq(S1_MMC_SPI_CD_PIN), >>>>>> cd, >>>>>> IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, >>>>>> "mmc_spi-detect", mmc); >>>>>> if (ret) { >>>>>> printk(KERN_WARNING "mmc_spi_int: could not request IRQ %d >>>>>> for >>>>>> detect pin\n", >>>>>> gpio_to_irq(S1_MMC_SPI_CD_PIN)); >>>>>> } >>>>>> return 0; >>>>>> } >>>>>> >>>>>> void s1_mmc_spi_exit(struct device *dev, void *data) >>>>>> { >>>>>> free_irq(gpio_to_irq(S1_MMC_SPI_CD_PIN), data); >>>>>> } >>>>>> >>>>>> >>>>>> static struct mmc_spi_platform_data mmc_spi_data = { >>>>>> .init = s1_mmc_spi_init, >>>>>> .exit = s1_mmc_spi_exit, >>>>>> .get_ro = s1_mmc_spi_write_protect, >>>>>> .get_cd = s1_mmc_spi_card_detect, >>>>>> }; >>>>>> >>>>>> >>>>>> static struct spi_board_info spi1_board_info[] __initdata = { >>>>>> { >>>>>> .modalias = "mmc_spi", >>>>>> .max_speed_hz = 12000000, >>>>>> .chip_select = 0, >>>>>> .platform_data =&mmc_spi_data, >>>>>> .mode = SPI_MODE_3, >>>>>> }, >>>>>> }; >>>>>> >>>>>> ... >>>>>> >>>>>> at32_add_device_spi(1, spi1_board_info, >>>>>> ARRAY_SIZE(spi1_board_info)); >>>>>> >>>>>> from the kernel side, at least after some modification to adopt to >>>>>> the >>>>>> omap3. >>>>>> >>>>>> And the hardware setup is really easy: >>>>>> >>>>>> >>>>>> >>>>>> at least for the AP7000, that run on 3.3V >>>>>> >>>>>> >>>>>> Regards >>>>>> >>>>>> *Bernhard Wörndl-Aichriedler* >>>>>> >>>>>> Am 05.05.2010 19:56, schrieb plasmaphase: >>>>>> >>>>>> >>>>>>> Could you expand upon the SPI solution? How do you enable it in the >>>>>>> Linux >>>>>>> Board Setup? What is it that is required to get this working (links >>>>>>> would >>>>>>> be adequate/helpful as well). Thanks! >>>>>>> >>>>>>> >>>>>>> Bernhard Wörndl-Aichriedler wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Hey =) >>>>>>>> >>>>>>>> Using SD over SPI is generally not that of a problem, you just need >>>>>>>> to >>>>>>>> enable it in the Linux Board Setup. >>>>>>>> (I did that some time ago, not for the overo/omap, but for a AP7000 >>>>>>>> and >>>>>>>> it worked pretty well). >>>>>>>> >>>>>>>> But the Overo breaks out an additional MMC interface, that you >>>>>>>> might >>>>>>>> be >>>>>>>> able to use, in order to get higher speed (4bit SD mode instead of >>>>>>>> 1 >>>>>>>> bit >>>>>>>> MMC-SPI mode). >>>>>>>> I have that solution ready, but haven't changed the kernel yet, to >>>>>>>> work >>>>>>>> with it. I'll report to you if i get everything running (hopefully >>>>>>>> in >>>>>>>> 2 >>>>>>>> two 3 days) >>>>>>>> >>>>>>>> >>>>>>>> Regards >>>>>>>> >>>>>>>> *Bernhard Wörndl-Aichriedler* >>>>>>>> >>>>>>>> Am 05.05.2010 15:30, schrieb plasmaphase: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> Has anyone attempted using SPI for communications to an SD Card >>>>>>>>> (not >>>>>>>>> the >>>>>>>>> onboard SD card)? If so, would you please provide any information >>>>>>>>> you >>>>>>>>> would >>>>>>>>> consider helpful in getting this working. I'm very new to the >>>>>>>>> gumstix. >>>>>>>>> I'm >>>>>>>>> simply looking to get SPI Mode communication to an SD Card (I have >>>>>>>>> SD >>>>>>>>> Card >>>>>>>>> spi driver, and have solved the 1.8V to 3.3V issue). Thanks. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> ------------------------------------------------------------------------------ >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> gumstix-users mailing list >>>>>>>> gum...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/gumstix-users >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> >>>>>> _______________________________________________ >>>>>> gumstix-users mailing list >>>>>> gum...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/gumstix-users >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> >>>> _______________________________________________ >>>> gumstix-users mailing list >>>> gum...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gumstix-users >>>> >>>> >>>> >>> >>> >> > > ------------------------------------------------------------------------------ > > > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > http://old.nabble.com/file/p29089733/board-overo.c board-overo.c -- View this message in context: http://old.nabble.com/SD-Card-SPI-tp28460935p29089733.html Sent from the Gumstix mailing list archive at Nabble.com. |