@@ -56,12 +56,12 @@ void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi)
56
56
QE_CR_PROTOCOL_UNSPECIFIED , 0 );
57
57
} else {
58
58
if (mspi -> flags & SPI_CPM1 ) {
59
- out_be32 ( & mspi -> pram -> rstate , 0 );
60
- out_be16 ( & mspi -> pram -> rbptr ,
61
- in_be16 ( & mspi -> pram -> rbase ) );
62
- out_be32 ( & mspi -> pram -> tstate , 0 );
63
- out_be16 ( & mspi -> pram -> tbptr ,
64
- in_be16 ( & mspi -> pram -> tbase ) );
59
+ iowrite32be ( 0 , & mspi -> pram -> rstate );
60
+ iowrite16be ( ioread16be ( & mspi -> pram -> rbase ) ,
61
+ & mspi -> pram -> rbptr );
62
+ iowrite32be ( 0 , & mspi -> pram -> tstate );
63
+ iowrite16be ( ioread16be ( & mspi -> pram -> tbase ) ,
64
+ & mspi -> pram -> tbptr );
65
65
} else {
66
66
cpm_command (CPM_SPI_CMD , CPM_CR_INIT_TRX );
67
67
}
@@ -75,24 +75,24 @@ static void fsl_spi_cpm_bufs_start(struct mpc8xxx_spi *mspi)
75
75
struct cpm_buf_desc __iomem * rx_bd = mspi -> rx_bd ;
76
76
unsigned int xfer_len = min (mspi -> count , SPI_MRBLR );
77
77
unsigned int xfer_ofs ;
78
- struct fsl_spi_reg * reg_base = mspi -> reg_base ;
78
+ struct fsl_spi_reg __iomem * reg_base = mspi -> reg_base ;
79
79
80
80
xfer_ofs = mspi -> xfer_in_progress -> len - mspi -> count ;
81
81
82
82
if (mspi -> rx_dma == mspi -> dma_dummy_rx )
83
- out_be32 ( & rx_bd -> cbd_bufaddr , mspi -> rx_dma );
83
+ iowrite32be ( mspi -> rx_dma , & rx_bd -> cbd_bufaddr );
84
84
else
85
- out_be32 ( & rx_bd -> cbd_bufaddr , mspi -> rx_dma + xfer_ofs );
86
- out_be16 ( & rx_bd -> cbd_datlen , 0 );
87
- out_be16 ( & rx_bd -> cbd_sc , BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP );
85
+ iowrite32be ( mspi -> rx_dma + xfer_ofs , & rx_bd -> cbd_bufaddr );
86
+ iowrite16be ( 0 , & rx_bd -> cbd_datlen );
87
+ iowrite16be ( BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP , & rx_bd -> cbd_sc );
88
88
89
89
if (mspi -> tx_dma == mspi -> dma_dummy_tx )
90
- out_be32 ( & tx_bd -> cbd_bufaddr , mspi -> tx_dma );
90
+ iowrite32be ( mspi -> tx_dma , & tx_bd -> cbd_bufaddr );
91
91
else
92
- out_be32 ( & tx_bd -> cbd_bufaddr , mspi -> tx_dma + xfer_ofs );
93
- out_be16 ( & tx_bd -> cbd_datlen , xfer_len );
94
- out_be16 ( & tx_bd -> cbd_sc , BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP |
95
- BD_SC_LAST );
92
+ iowrite32be ( mspi -> tx_dma + xfer_ofs , & tx_bd -> cbd_bufaddr );
93
+ iowrite16be ( xfer_len , & tx_bd -> cbd_datlen );
94
+ iowrite16be ( BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP | BD_SC_LAST ,
95
+ & tx_bd -> cbd_sc );
96
96
97
97
/* start transfer */
98
98
mpc8xxx_spi_write_reg (& reg_base -> command , SPCOM_STR );
@@ -102,7 +102,7 @@ int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
102
102
struct spi_transfer * t , bool is_dma_mapped )
103
103
{
104
104
struct device * dev = mspi -> dev ;
105
- struct fsl_spi_reg * reg_base = mspi -> reg_base ;
105
+ struct fsl_spi_reg __iomem * reg_base = mspi -> reg_base ;
106
106
107
107
if (is_dma_mapped ) {
108
108
mspi -> map_tx_dma = 0 ;
@@ -123,7 +123,7 @@ int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
123
123
}
124
124
if (t -> bits_per_word == 16 && t -> tx_buf ) {
125
125
const u16 * src = t -> tx_buf ;
126
- u16 * dst ;
126
+ __le16 * dst ;
127
127
int i ;
128
128
129
129
dst = kmalloc (t -> len , GFP_KERNEL );
@@ -202,12 +202,12 @@ EXPORT_SYMBOL_GPL(fsl_spi_cpm_bufs_complete);
202
202
void fsl_spi_cpm_irq (struct mpc8xxx_spi * mspi , u32 events )
203
203
{
204
204
u16 len ;
205
- struct fsl_spi_reg * reg_base = mspi -> reg_base ;
205
+ struct fsl_spi_reg __iomem * reg_base = mspi -> reg_base ;
206
206
207
207
dev_dbg (mspi -> dev , "%s: bd datlen %d, count %d\n" , __func__ ,
208
- in_be16 (& mspi -> rx_bd -> cbd_datlen ), mspi -> count );
208
+ ioread16be (& mspi -> rx_bd -> cbd_datlen ), mspi -> count );
209
209
210
- len = in_be16 (& mspi -> rx_bd -> cbd_datlen );
210
+ len = ioread16be (& mspi -> rx_bd -> cbd_datlen );
211
211
if (len > mspi -> count ) {
212
212
WARN_ON (1 );
213
213
len = mspi -> count ;
@@ -328,7 +328,7 @@ int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi)
328
328
}
329
329
330
330
if (mspi -> flags & SPI_CPM1 ) {
331
- void * pram ;
331
+ void __iomem * pram ;
332
332
333
333
pram = devm_platform_ioremap_resource (to_platform_device (dev ),
334
334
1 );
@@ -374,21 +374,21 @@ int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi)
374
374
mspi -> rx_bd = cpm_muram_addr (bds_ofs + sizeof (* mspi -> tx_bd ));
375
375
376
376
/* Initialize parameter ram. */
377
- out_be16 ( & mspi -> pram -> tbase , cpm_muram_offset ( mspi -> tx_bd ) );
378
- out_be16 ( & mspi -> pram -> rbase , cpm_muram_offset ( mspi -> rx_bd ) );
379
- out_8 ( & mspi -> pram -> tfcr , CPMFCR_EB | CPMFCR_GBL );
380
- out_8 ( & mspi -> pram -> rfcr , CPMFCR_EB | CPMFCR_GBL );
381
- out_be16 ( & mspi -> pram -> mrblr , SPI_MRBLR );
382
- out_be32 ( & mspi -> pram -> rstate , 0 );
383
- out_be32 ( & mspi -> pram -> rdp , 0 );
384
- out_be16 ( & mspi -> pram -> rbptr , 0 );
385
- out_be16 ( & mspi -> pram -> rbc , 0 );
386
- out_be32 ( & mspi -> pram -> rxtmp , 0 );
387
- out_be32 ( & mspi -> pram -> tstate , 0 );
388
- out_be32 ( & mspi -> pram -> tdp , 0 );
389
- out_be16 ( & mspi -> pram -> tbptr , 0 );
390
- out_be16 ( & mspi -> pram -> tbc , 0 );
391
- out_be32 ( & mspi -> pram -> txtmp , 0 );
377
+ iowrite16be ( cpm_muram_offset ( mspi -> tx_bd ), & mspi -> pram -> tbase );
378
+ iowrite16be ( cpm_muram_offset ( mspi -> rx_bd ), & mspi -> pram -> rbase );
379
+ iowrite8 ( CPMFCR_EB | CPMFCR_GBL , & mspi -> pram -> tfcr );
380
+ iowrite8 ( CPMFCR_EB | CPMFCR_GBL , & mspi -> pram -> rfcr );
381
+ iowrite16be ( SPI_MRBLR , & mspi -> pram -> mrblr );
382
+ iowrite32be ( 0 , & mspi -> pram -> rstate );
383
+ iowrite32be ( 0 , & mspi -> pram -> rdp );
384
+ iowrite16be ( 0 , & mspi -> pram -> rbptr );
385
+ iowrite16be ( 0 , & mspi -> pram -> rbc );
386
+ iowrite32be ( 0 , & mspi -> pram -> rxtmp );
387
+ iowrite32be ( 0 , & mspi -> pram -> tstate );
388
+ iowrite32be ( 0 , & mspi -> pram -> tdp );
389
+ iowrite16be ( 0 , & mspi -> pram -> tbptr );
390
+ iowrite16be ( 0 , & mspi -> pram -> tbc );
391
+ iowrite32be ( 0 , & mspi -> pram -> txtmp );
392
392
393
393
return 0 ;
394
394
0 commit comments