- 论坛徽章:
- 0
|
接上
如下也是:
Author: Steven Scholz
Date: 2006-08-09 16:07 +800
CC: linux-arm-kernel
Subject: Re: using SPI from user space (at91)?
Carsten,
thanks for you reply.
> In function spidev_rd_wr() the following change was necessary for me:
>
> down_read(&mm->mmap_sem);
> -> flush_cache_all(); <-
> err= get_user_pages(current, mm, (unsigned long)buf, pgcount, 1, 0, maplist, NULL);
> up_read(&mm->mmap_sem);
>
> The line in -> <- is new.
The preferred way would be sending unified diffs like
down_read(&mm->mmap_sem);
+ flush_cache_all();
err= get_user_pages(...
up_read(&mm->mmap_sem);
> adaption logic circuitry was necessary (see for yourself on:
> http://www.siski.de/~carsten/diplomarbeit.html).
Cool.
> The next thing you should check is wether your bootloader correctly
> initializes the PAxx lines needed for SPI to be peripheral function A,
> especially the NPCS0...3 lines if needed.
I want to use PA3 as IRQ5 and not as NPCS0.
Funny enough the SPI stops working when this pin is pulled low externaly.
The AT91 User Manual states:
"A mode fault is detected when the SPI is programmed in Master Mode and a
low level is driven by an external master on the NPCS0/NSS signal.
When a mode fault is detected, the MODF bit in the SPI_SR is set until the
SPI_SR is read and the SPI is disabled until re-enabled by bit SPIEN in the
SPI_CR (Control Register).
By default, Mode Fault Detection is enabled. It is disabled by setting the
MODFDIS bit in the SPI Mode Register."
IIUC I can do whatever I want with the pin PA3 (especially when it's not
configured for SPI at all) iff "Mode Fault Detection" is disabled.
But this is apparently not true.
I am still waiting for ATMEL to confirm on this.
So after leaving PA3 alone SPI works for me.
--
Steven |
|