Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3949ba3b
Commit
3949ba3b
authored
Mar 15, 2019
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'spi-5.1' into spi-5.2 for stm32
parents
6d850281
5356c2c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
30 deletions
+26
-30
drivers/spi/spi-imx.c
drivers/spi/spi-imx.c
+1
-1
drivers/spi/spi-rspi.c
drivers/spi/spi-rspi.c
+22
-26
drivers/spi/spi-stm32-qspi.c
drivers/spi/spi-stm32-qspi.c
+1
-3
drivers/spi/spi.c
drivers/spi/spi.c
+2
-0
No files found.
drivers/spi/spi-imx.c
View file @
3949ba3b
...
...
@@ -1501,7 +1501,7 @@ static int spi_imx_transfer(struct spi_device *spi,
/* flush rxfifo before transfer */
while
(
spi_imx
->
devtype_data
->
rx_available
(
spi_imx
))
spi_imx
->
rx
(
spi_imx
);
readl
(
spi_imx
->
base
+
MXC_CSPIRXDATA
);
if
(
spi_imx
->
slave_mode
)
return
spi_imx_pio_transfer_slave
(
spi
,
transfer
);
...
...
drivers/spi/spi-rspi.c
View file @
3949ba3b
...
...
@@ -271,7 +271,8 @@ static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
/* Sets parity, interrupt mask */
rspi_write8
(
rspi
,
0x00
,
RSPI_SPCR2
);
/* Sets SPCMD */
/* Resets sequencer */
rspi_write8
(
rspi
,
0
,
RSPI_SPSCR
);
rspi
->
spcmd
|=
SPCMD_SPB_8_TO_16
(
access_size
);
rspi_write16
(
rspi
,
rspi
->
spcmd
,
RSPI_SPCMD0
);
...
...
@@ -315,7 +316,8 @@ static int rspi_rz_set_config_register(struct rspi_data *rspi, int access_size)
rspi_write8
(
rspi
,
0x00
,
RSPI_SSLND
);
rspi_write8
(
rspi
,
0x00
,
RSPI_SPND
);
/* Sets SPCMD */
/* Resets sequencer */
rspi_write8
(
rspi
,
0
,
RSPI_SPSCR
);
rspi
->
spcmd
|=
SPCMD_SPB_8_TO_16
(
access_size
);
rspi_write16
(
rspi
,
rspi
->
spcmd
,
RSPI_SPCMD0
);
...
...
@@ -366,7 +368,8 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
/* Sets buffer to allow normal operation */
rspi_write8
(
rspi
,
0x00
,
QSPI_SPBFCR
);
/* Sets SPCMD */
/* Resets sequencer */
rspi_write8
(
rspi
,
0
,
RSPI_SPSCR
);
rspi_write16
(
rspi
,
rspi
->
spcmd
,
RSPI_SPCMD0
);
/* Sets RSPI mode */
...
...
@@ -868,28 +871,6 @@ static int qspi_transfer_one(struct spi_controller *ctlr,
}
}
static
int
rspi_setup
(
struct
spi_device
*
spi
)
{
struct
rspi_data
*
rspi
=
spi_controller_get_devdata
(
spi
->
controller
);
rspi
->
max_speed_hz
=
spi
->
max_speed_hz
;
rspi
->
spcmd
=
SPCMD_SSLKP
;
if
(
spi
->
mode
&
SPI_CPOL
)
rspi
->
spcmd
|=
SPCMD_CPOL
;
if
(
spi
->
mode
&
SPI_CPHA
)
rspi
->
spcmd
|=
SPCMD_CPHA
;
/* CMOS output mode and MOSI signal from previous transfer */
rspi
->
sppcr
=
0
;
if
(
spi
->
mode
&
SPI_LOOP
)
rspi
->
sppcr
|=
SPPCR_SPLP
;
set_config_register
(
rspi
,
8
);
return
0
;
}
static
u16
qspi_transfer_mode
(
const
struct
spi_transfer
*
xfer
)
{
if
(
xfer
->
tx_buf
)
...
...
@@ -959,8 +940,24 @@ static int rspi_prepare_message(struct spi_controller *ctlr,
struct
spi_message
*
msg
)
{
struct
rspi_data
*
rspi
=
spi_controller_get_devdata
(
ctlr
);
struct
spi_device
*
spi
=
msg
->
spi
;
int
ret
;
rspi
->
max_speed_hz
=
spi
->
max_speed_hz
;
rspi
->
spcmd
=
SPCMD_SSLKP
;
if
(
spi
->
mode
&
SPI_CPOL
)
rspi
->
spcmd
|=
SPCMD_CPOL
;
if
(
spi
->
mode
&
SPI_CPHA
)
rspi
->
spcmd
|=
SPCMD_CPHA
;
/* CMOS output mode and MOSI signal from previous transfer */
rspi
->
sppcr
=
0
;
if
(
spi
->
mode
&
SPI_LOOP
)
rspi
->
sppcr
|=
SPPCR_SPLP
;
set_config_register
(
rspi
,
8
);
if
(
msg
->
spi
->
mode
&
(
SPI_TX_DUAL
|
SPI_TX_QUAD
|
SPI_RX_DUAL
|
SPI_RX_QUAD
))
{
/* Setup sequencer for messages with multiple transfer modes */
...
...
@@ -1267,7 +1264,6 @@ static int rspi_probe(struct platform_device *pdev)
init_waitqueue_head
(
&
rspi
->
wait
);
ctlr
->
bus_num
=
pdev
->
id
;
ctlr
->
setup
=
rspi_setup
;
ctlr
->
auto_runtime_pm
=
true
;
ctlr
->
transfer_one
=
ops
->
transfer_one
;
ctlr
->
prepare_message
=
rspi_prepare_message
;
...
...
drivers/spi/spi-stm32-qspi.c
View file @
3949ba3b
...
...
@@ -76,7 +76,6 @@
#define QSPI_PSMAR 0x28
#define QSPI_PIR 0x2c
#define QSPI_LPTR 0x30
#define LPTR_DFT_TIMEOUT 0x10
#define STM32_QSPI_MAX_MMAP_SZ SZ_256M
#define STM32_QSPI_MAX_NORCHIP 2
...
...
@@ -372,8 +371,7 @@ static int stm32_qspi_setup(struct spi_device *spi)
flash
->
presc
=
presc
;
mutex_lock
(
&
qspi
->
lock
);
writel_relaxed
(
LPTR_DFT_TIMEOUT
,
qspi
->
io_base
+
QSPI_LPTR
);
cr
=
FIELD_PREP
(
CR_FTHRES_MASK
,
3
)
|
CR_TCEN
|
CR_SSHIFT
|
CR_EN
;
cr
=
FIELD_PREP
(
CR_FTHRES_MASK
,
3
)
|
CR_SSHIFT
|
CR_EN
;
writel_relaxed
(
cr
,
qspi
->
io_base
+
QSPI_CR
);
/* set dcr fsize to max address */
...
...
drivers/spi/spi.c
View file @
3949ba3b
...
...
@@ -1039,6 +1039,8 @@ static int spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg)
if
(
max_tx
||
max_rx
)
{
list_for_each_entry
(
xfer
,
&
msg
->
transfers
,
transfer_list
)
{
if
(
!
xfer
->
len
)
continue
;
if
(
!
xfer
->
tx_buf
)
xfer
->
tx_buf
=
ctlr
->
dummy_tx
;
if
(
!
xfer
->
rx_buf
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment