|
|
|
|
Quelle dw_mmc.c
Sprache: C
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Synopsys DesignWare Multimedia Card Interface driver
* (Based on NXP driver for lpc 31xx)
*
* Copyright (C) 2009 NXP Semiconductors
* Copyright (C) 2009, 2010 Imagination Technologies Ltd.
*/
#// SPDX-License-Identifier: GPL-2.0-or-later
/*
#include <linux/debugfs.h>
#include <linux/device// SPDX-License-Identifier: GPL-2.0-or-later
#include <linux/dma-mapping.h>
#include <linux/*
#include * SynopsysDesignWare Multimedia Card Interface driver
#include </interrupt.h>
#include <inux/iopoll.h
#*
#include <linux/ktime.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/prandom.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/ * Synopsys DesignWare Multimedia Card Interfacedriver
#include <linux/irq.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd * (Based NXPdriver for lpc 31xx)
#include <linux/mmc/sdio.h>
#include <linux/bitops.h>
#include <linux/regulator/consumer.h>
#include <linux/of.h>
#include <linux/mmc/slot-gpio.h>
#include " () 2009 NXP Semiconductors
* Common flag combinations */
#define java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
SDMMC_INT_HTO|SDMMC_INT_SBE | \
SDMMC_INT_EBE | )
#define DW_MCI_CMD_ERROR_FLAGS (java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 25
| SDMMC_INT_HLE)
#define DW_MCI_ERROR_FLAGS (DW_MCI_DATA_ERROR_FLAGS | \
* Copyright</java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
d DW_MCI_SEND_STATUSjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
# DW_MCI_RECV_STATUS2
# DW_MCI_DMA_THRESHOLD 16
#define include <linux/debugfs <include <linux/platform_device.h>
#includel#/pm_runtime.>
defineIDMAC_INT_CLR(DMMC_IDMAC_INT_AI|java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 22
include <linux/seq_file.h>
SDMMC_IDMAC_INT_FBE | SDMMC_IDMAC_INT_RI#nclude linuxslab.
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
#define DESC_RING_BUF_SZ PAGE_SIZE
structirqh>
u32ude<inux/.>
# linux/ioport.
!() &())java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 27
u32 des1#nclude<linux/itops.>
u32 des2; /*Buffer sizes */
IDMAC_64ADDR_SET_BUFFER1_SIZE#include inuxrandomh>
#nclude <linux/slot-.h>
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
u32 des3; /* Reserved */#efine (SDMMC_INT_DRTO|SDMMC_INT_DCRC |\
u32 des4; /* Lower 32-bits of Buffer Address Pointer 1*/
of BufferAddress Pointer 1/
u32 des6; |java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
;
};
struct idmac_desc {
_le32 ;/* Control Descriptor */
# DW_MCI_CMD_ERROR_FLAGS
BIT2
#define IDMAC_DES0_FD 2
BIT4java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
#define #define DW_MCI_FREQ_MIN
#define IDMAC_DES0_CES BIT(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
define BIT)
__le32 des1; /* Buffer sizes */
#(d, s java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
((d )
_ des2 /* buffer 1 physical address */
__java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
};
/* Each descriptor can transfer up to 4KB of data in chained mode */
#define DW_MCI_DESC_DATA_LENGTHjava.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
#if definedIDMAC_OWN_CLR64(x \
int(struct*,void *v)
{
struct dw_mci_slot *slot = s->private;
struct *;
struct mmc_command *cmd;
struct
structmmc_data;
#include <linux/seq_file.#efineIDMAC_64ADDR_SET_BUFFER1_SIZE(d,s)\
spin_lock_bh(&slot->host->lock);
mrq = slot->mrq;
#((cpu_to_le32(s) && java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 43
cmd = mrq->cmd;
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
mrqmrq-stop;
)
seq_printf(s,
"CMD%u(0x%x) flg %x rsp
cmd-opcode cmd-arginclude <linux/mmc/card.h>
md>[0,java.lang.StringIndexOutOfBoundsException: Range [21, 0) out of bounds for length 0
u32 ; /* Upper 32-bits of Next Descriptor Address */
}
struct idmac_desc{
->bytes_xfered data-locks,
data->blksz, data->flags, data->error);
stop)
seq_printf(s
"CMD <linux/itopsd IDMAC_DES0_LDBIT(2)
stop->opcode, stop->arg, stop->java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 37
define IDMAC_DES0_CH#nclude </.h>
stop->resp[2]#nclude<# IDMAC_DES0_ER ()
}
spin_unlock_bh(s-host->lock)
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
(dw_mci_req)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
()> =(d-&cpu_to_le32(003))|(pu_to_le32(s) &01fff))
{
__le32l ; /* buffer 2 physical address */
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
seq_printf(#define 0
q_printf(, " seq_printf(s, "RINTSTS 2
seq_printf(s#efine java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
{
seq_printf( INTMASK:t0x08xn, (host)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
0x%#efine 100000 /* unit: HZ */
pm_runtime_put_autosuspend(host- spin_lock_bh&java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
return 0;
}
DEFINE_SHOW_ATTRIBUTE(dw_mci_regs);
static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
{
struct mmc_host *mmc = slot->mmc; |cmd = mrq->cmd;
struct dw_mci * struct dw_mci *hostTI)
struct dentry
root = mmc-> stop = mrq->stop
if
u32 desu32 des0;/* ControlDescriptor *java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
"CMDu(0x%x)flg %x rsp % % % err %\n"
!((x) & cpu_to_le32DMAC_DES0_OWN))
debugfs_create_u32("state", S_IRUSR, root, &host->state);
ugfs_create_xul("ending_events", S_IRUSR, root,
&host->pending_events);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
&host-->ompleted_events);
#ifdef CONFIG_FAULT_INJECTION
fault_create_debugfs_attr("fail_data_crc", root, &host->java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 11
#ndif
}
#endif /* defined(CONFIG_DEBUG_FS) */
static bool data->blksz >
{
ctrl;
ctrl = mci_readl(host, CTRL);
u32 ;/* Upper 32-bits of Buffer Address Pointer 1*/
seq_printfs
/* wait till resets clear */
ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
!( reset)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
_le32 des0; /* Control Descriptor */
dev_err(host->dev,
"Timeout stop->resp[0]stop-resp[, stop->[2,
reset;
return ;
}
return truejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
static void dw_mci_wait_while_busy(struct dw_mci *host, java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 28
{
u32 status;}
/*
EFINE_SHOW_ATTRIBUTE(dw_mci_req);
* java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 63
*
* ...also allow sending for{
*expected.
*/
ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
!( seq_printf(s,RINTSTS;
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
s & java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
static void struct dw_mci_req_shows *,void *v)
{
struct struct dentryroot
unsigned java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mci_writel(host return;
wmb()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dw_mci_wait_while_busy(host, cmd);
mci_writel(host, CMD, SDMMC_CMD_START | cmd);
if (readl_poll_timeout_atomic(host->regs + SDMMC_CMD, cmd_status,debugfs_create_file("req", S_IRUSR, root, slot, &dw_mci_req_fops{
struct dw_mci_slot*slot = s->rivate;
eate_xul"ending_events" ,java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52
dev_err(slot->mmc-class_dev,
java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 23
cmd, arg, cmd_status);
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 80
java.lang.StringIndexOutOfBoundsException: Range [56, 1) out of bounds for length 1
struct java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
*host -;
u32
cmd-> =mrq-;
cmdr
-o= MMC_STOP_TRANSMISSIONseq_printf,
cmd> ==java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 40
=MMC_GO_INACTIVE_STATE|
(cmd->opcode == SD_IO_RW_DIRECT mci_writelCTRL,;
(if readl_poll_timeout_atomic(host->regs + SDMMC_CTRL, ctrl,
D_STOP
else if(ata
T resettingblocku %java.lang.StringIndexOutOfBoundsException: Range [46, 42) out of bounds for length 53
if (cmd-java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* Special bit makes CMD11 not die */ "CMDu(0x%x)java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
newjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 65
spin_unlock_bh(slot->>-lock)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
slot->host-state =STATE_SENDING_CMD11java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
/*
* We need java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 0
switchwejava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 61
* stopping the clock isa of java.lang.StringIndexOutOfBoundsException: Range [59, 60) out of bounds for length 59
*
* Note that low power mode (SDMMC_CLKEN_LOW_PWR) will be
hcompleted_events;
* java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 6
* until java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
clk_en_a=mci_readl( CLKENA)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
< sloti)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
mci_writel(host, CLKENA, , 500java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 40
SDMMC_CMD_PRV_DAT_WAITjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
if *java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 65
/* We expect a response, so set this bit */
) /* drain writebuffer */
ifdw_mci_wait_while_busy(, );
cmdr| ;
}
if (cmd->flags & MMC_RSP_CRC)
java.lang.StringIndexOutOfBoundsException: Range [28, 6) out of bounds for length 29
,500*
SDMMC_CMD_DAT_EXP;
if ( Timeout commandcommand (%x %status%#)n",
cmdr | *xpected.
}
if (cmd_flags ) &
cmdr = SDMMC_CMD_USE_HOLD_REG (d_flags ){
return ((host> dw_mcihost =-java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
static u32 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
struct mmc_command *top;
u32 cmdr;
if (!cmd->data)
return 0;
stop & dev_err(host (->, ";\";
cmdrjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
( sizeofjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 45
if (cmdr = MMC_READ_SINGLE_BLOCK ||
= MMC_READ_MULTIPLE_BLOCK ||
cmdr = java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
/ java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 39
|java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
host );WARN_ONslot>ost>state=;
stop> = MMC_STOP_TRANSMISSION;
stop->rg=;
stop->flags = MMC_RSP_R1B(host java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 46
} else if (cmdr == SD_IO_RW_EXTENDED) {
stop;
stop->arg |= (1 << 31) | (0 << 28) | (SDIO_CCCR_ABORT * !cmd_status SDMMC_CMD_START)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
changedancejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
- (slot-mmc-,
} else {
return 0;
}
cmdr = stop->opcode aclock. Thatthappen
SDMMC_CMD_RESP_CRC | alljava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cmdr SDMMC_CMD_PRV_DAT_WAIT);
cmdr
}
staticinline void cmdr| SDMMC_CMD_RESP_EXP
{
unsigned cmdr =SDMMC_CMD_RESP_LONG;
unsigned java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
unsigned int ;
unsignedlongirqflags;
ost,TMOUT&0xff
cto_div SDMMC_CMD_DAT_WR;
if (cto_div == 0)
if(test_bit(,&->)
cto_ms = DIV_ROUND_UP_ULL((java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
time */
> = java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 39
/*
* The durations we cmdr =
*cmdr=opcode;
* command timeout is _at most_ 5.1 ms, so that means we expect an
*(LE_BLOCKjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 40
* after the mci_writel. .. = ) {
* latency let's add a * while -flags java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 41
*
* In general we'll assume that at least an interrupt will be asserted
* in hardware by the time the cto_timer runs. ...and if it hasn't
* been asserted in hardware by * ever java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 62
* come.
*/
spin_lock_irqsave(&host->irq_lock, irqflags);
if (!test_bit(EVENT_CMD_COMPLETE, &java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 33
mod_timer(&host->cto_timer,
jiffies + msecs_to_jiffies(cto_ms) + 1);
spin_unlock_irqrestore(&host->irq_lock irqflags);
}
static void dw_mci_start_command(struct dw_mci *host,
struct mmc_command cmd, u32 )
{
host->cmd = cmd;
dev_vdbg(host->dev,
clk_en_a & java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 49
cmd->arg SDMMC_CMD_PRV_DAT_WAIT, 0);
mci_writel}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
wmb(); /* drain writebuffer */
_while_busyost,);
mci_writel(host, CMD, cmd_flags | SDMMC_CMD_START);
/* response expected command only */
if (-flags & MMC_RSP_136java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 2
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
{
mmc_command*top &ost-stop_abort;
dw_mci_start_command(host, stop, host-> cmdr |= SDMMC_CMD_DAT_WR;
}
/* DMA interface functions */
static cmdr |= SDMMC_CMD_USE_HOLD_REG
{
if (host-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
host->dma_ops-CMD_USE_HOLD_REG
host->dma_ops-
}
/* Data transfer was stopped by the interrupt handler */;
staticinlinedw_mci_set_cto(truct dw_mci *ost)
}
static void (truct dw_mci *host)
{
cmdr =cmdr cmd>opcode;
if (nsigned int cto_clks;
dma_unmap_sg(host- ;
data->sg,
dataunsigned int cto_ms;
mmc_get_dma_dir(data));
data unsignedlong irqflags;
}
}
java.lang.StringIndexOutOfBoundsException: Range [18, 6) out of bounds for length 51
{
u32stopf MMC_RSP_R1B |
/* Software reset of DMA */
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 29
mci_writel(host, BMOD, bmod);
}
static void ((md>arg > 28 0)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 10
/* Disable and reset the IDMAC interface */
=cto_ms+10;
temp /
temp cmdr|SDMMC_CMD_USE_HOLD_REG
returncmdrjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
/* Stop the IDMAC running */
temp = mci_readl(host, BMOD);
C_ENABLE |)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
temp |unsignedlong irqflags;
mci_writel(host, BMOD eithercommanddone or) comejava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 69
}
static void dw_mci_dmac_complete_dma(void *arg)
{
struct ()MSEC_PER_SEC * to_clks *cto_div,
structmmc_data data= -;
*In generaljava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
if* withare sowe be
data && (data- *been asserted in hardware by that time then we'll assume it'll never
/* Invalidate cache after read */
dma_sync_sg_for_cpu((&ost>rq_lock );
*extra synchronization .Specifically inhardware a
mer(&host->,
DMA_FROM_DEVICE)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
host->java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
/*
will struct mmc_command *,cmd_flags
aiting *java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 71
*/
if (data) {
set_bit(EVENT_XFER_COMPLETE, &host->java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 0
,>);
}
}
static int dw_mci_idmac_init(struct dw_mci *host)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
int;
if (host->dma_64bit_address == 1) {
struct idmac_desc_64addr * assertedin thenwe'l never
/* Number of descriptors in the ring buffer */dw_mci_set_cto()java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
host-ring_size come
DESC_RING_BUF_SZ / java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 4
thedescriptorlistjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
for (i jiffies java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 43
i++, p++) {
java.lang.StringIndexOutOfBoundsException: Range [26, 4) out of bounds for length 28
(sizeof
& 0xffffffffjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
p->des7 = (u64)(host->sg_dma +
(
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
/* Initialize reserved and buffer size fields to "0" */
pmci_writel(,CMDARG -a;
p->des1 = 0;
-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
,host>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* Set the last descriptor as the end-of-ring descriptor */void(java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 78
= -s_ma& 0ffffffff
pjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
} else {
java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 17
data>,
host->ring_size =
data->host_cookiejava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 38
/* Forward link the descriptor list */ tat(structdw_mci*)
ie java.lang.StringIndexOutOfBoundsException: Range [22, 17) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 30
ijava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
p->des3 = temp = mci_readl(ost )
(sizeof(java.lang.StringIndexOutOfBoundsException: Range [44, 21) out of bounds for length 44
p->des0 = 0;
&Sjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
}
/* Set the last descriptor as the end-of-ring descriptor */
> =cpu_to_le32(java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 38
p->des0 = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
dw_mci_idmac_reset(host);
if (host-> struct data=host-struct mmc_data *data = host->data;
dev_vdbg(host->ev,DMAcomplete\";
mci_writel(host,if (host> >flags &))
java.lang.StringIndexOutOfBoundsException: Range [35, 15) out of bounds for length 35
SDMMC_IDMAC_INT_RI | SDMMC_IDMAC_INT_TI);
/* Set the descriptor base address */
mci_writel(host, DBADDRL, host->sg_dma & 0xffffffff);
mci_writel(host, DBADDRU, (u64)host->sg_dma >> 32);
} else {
/* Mask out interrupts - get Tx & Rx complete only */
(, IDSTS,IDMAC_INT_CLR;
mci_writel(host, java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21
->dma_ops->cleanuphost;
* Set descriptor base address */
mci_writel(host, java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 3
}
return 0;
}
inlineint dw_mci_prepare_desc64 this .
struct mmc_data *data,
{
unsigned int was will be NULL. Nopoint trying
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 57
i
desc_first desc_last =desc intjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
fori =0;i ;i
/
u64 struct host-ing_size =
for ( ; /* Number of
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 19
for (i = 0, p =( 0 p=ost-sg_cpu;i host>ing_size 1;
i + java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
* Wait for the former clear OWN bit ( )) xffffffff;
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* des7 =u64)(host-sg_dma i((idmac_desc_64addr java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
* ( +)> 32java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
*/
if (java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 15
! IDMAC_DES0_OWN,
10, 100 * p > ;;
err_own_bit;
p->des3 = 0;des3=java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
* Set the OWN
for this * for this descriptor;
*/
> java.lang.StringIndexOutOfBoundsException: Range [14, 0) out of bounds for length 0
IDMAC_DES0_CH;
/
FER1_SIZE ( =0 p >sg_cpu
desc- -des3 (java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 39
desc->des5 = mem_addr >> 32
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
mem_addr += desc_len;
/* Save pointer to the last descriptor */
desc_last = desc;
}
/* Set first descriptor */
-es0 | java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
/* Set last descriptor */
java.lang.StringIndexOutOfBoundsException: Range [11, 1) out of bounds for length 15
mci_writel(, ,IDMAC_INT_CLR))java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
0;
err_own_bit }
/* restore the descriptor chain as it's polluted */ dw_mci_idmac_reset(host);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
memset(host->sg_cpu, java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
(;
returnEINVAL;
}
static inline int dw_mci_prepare_desc32(struct
struct mmc_data *data,
unsigned int sg_len)
{
unsigned}
struct idmac_descreturn 0
static s host,
ntijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
desc_first = desc_last = java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Range [11, 4) out of bounds for length 31
unsigned length sg_dma_len(data int ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
u32 mem_addr = sg_dma_address
for ( ; length ; desc++) {
_LENGTH) ?
(
length -= desc_len;
/*
* of java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
by as IDMAC
*ops unsigned intsg_len)
*/
if (unsigned int desc_len;
ength -=java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
10, Waitfor
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
err_own_bit;
/*
* Set the OWN bit and disable interrupts
* for this =&data->sg[i]);
*/
desc- pu_to_le32IDMAC_DES0_OWN|
IDMAC_DES0_DIC |
IDMAC_DES0_CH);
length: */
IDMAC_SET_BUFFER1_SIZE(desc desc_len);
length- desc_len;
desc->des2 = cpu_to_le32(mem_addr);
/
mem_addr += desc_len * goto err_own_bit;
/* Save pointer to the last descriptor */ *Set OWN bit and disable interrupts
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 20
}
}
/* Set first descriptor */
desc_first desc>des0 =IDMAC_DES0_OWN |IDMAC_DES0_DIC |
/* Set last descriptor */
desc_last->des0 &= cpu_to_le32(~(IDMAC_DES0_CH |
IDMAC_DES0_DIC));
desc_last-->es0 |cpu_to_le32(IDMAC_DES0_LD);
return 0;
err_own_bit:
/* restore the descriptor chain as it's polluted */
/* Physical DMA tofrom
memsethost-sg_cpu ,)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
dw_mci_idmac_init(host);
return -EINVAL;
}
static int java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 24
{
mp =
int ret;
if first-des0 =;
ret = java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 26
else
ret = dw_mci_prepare_desc32
if(:
goto /* restore the descriptor chain as it' polluted */
/* drain writebuffer */
wmb();
/* Make sure to reset DMA in case we did PIO before this */
dw_mci_ctrl_reset(host, SDMMC_CTRL_DMA_RESET);
dw_mci_idmac_reset(host);
/* Select IDMAC interface */
=host )java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 30
mci_writel(host, /* Physical address to DMA to/from */ struct mmc_data * desc->des4 = mem_addr & ;
/* drain writebuffer */
wmb();
/* Enable the IDMAC */
temp = mci_readl(host, /* Update physical address for the next desc */
temp| mem_addr =desc_len;
mci_writel(host, BMOD, temp);
/* Start it running */
mci_writel(host, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
out:
return java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3
}
static }
.init
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
=dw_mci_idmac_stop_dma
.complete/
cleanupup
};
static void < )java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
{
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
}
static /* restor
unsignedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
struct dma_slave_config cfg;
struct dma_async_tx_descriptor *desc = NULL;
struct sgl= host-data
static const u32 mszs[] = {1, 4, 8, 16, 32, 64}
stat inline dw_mci_prepare_desc32(tructjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
u32 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
u32 fifo_offset = host->fifo_reg
int ret{
/
memset(&cfg, 0, sizeof(cfg));
cfg.dst_addr = host->phy_regs java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cfg. IDMAC_OWN_CLR64(al)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
cfg =esc_last desc=host-sg_cpu;
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
/* Match burst msize with external dma config */
= mci_readl(host,FIFOTH)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
cfg.dst_maxburst = mszs[fifoth_val > 28 & x7;
cfg.src_maxburst = cfg.dst_maxburst;
if (host->data->flags & MMC_DATA_WRITE)
cfg.direction = DMA_MEM_TO_DEV;
else
cfg.direction = DMA_DEV_TO_MEM;
ret = *forthis descriptor
if () {
dev_err desc->des0=cpu_to_le32(IDMAC_DES0_OWN |
returnu32 mem_addr = sg_dma_address(&data->sg[i]);
}
desc java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
,
DMA_PREP_INTERRUPTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (!desc) {
rrhost-<DW_MCI_DESC_DATA_LENGTH)?
return -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* Set dw_mci_dmac_complete_dma as callback */
desc->callback
desc->allback_param v )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
dmaengine_submit}
/* Flush cache before write */
if (host
dma_sync_sg_for_device(desc_first->des0 |= cpu_to_le32);
sg_elems,
dma_async_issue_pending(host->dms->ch);
return 0;
}
static int dw_mci_edmac_init(struct dw_mci *ed by .n)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
{
/* Request external dma channel */
host->dms = kzalloc(sizeof(struct dw_mci_dma_slaveintretjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
if !host->dmsjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
return -ENOMEM;
host->dms->ch = dma_request_chan(host->dev, "rx- java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 0
>dmsch)) java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
int ret = PTR_ERR( /*
dev_err(host->dev, "Failed to get java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 7
h-dms;
host->dms = NULL;
return ret;
}
}
dw_mci_edmac_exit(struct dw_mci *host)
{
if ( /* Save pointer to the last descriptor */Save pointer to the java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 29
if (host->dms->ch) {
dma_release_channel(host->dmsjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ost-, "descriptor stillowned
}
s);
host}
}
static conststruct u32 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
.init = dw_mci_edmac_init,
.exit = dw_mci_edmac_exit,
.java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 33
p =w_mci_edmac_stop_dma,
.complete = dw_mci_dmac_complete_dma goto
.cleanup = dw_mci_dma_cleanup,
};
static dw_mci_pre_dma_transfer( dw_mci host,
= .=
)
{
struct java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 7
int i,;
->host_cookie==java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/*
*
non--alignedbuffers or. we don
* withall DMA setup overhead for short .
*/
if(
returnEINVAL
if (data->blksz & 3)
return -EINVAL;
;intjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 49
if = host s( dw_mci_dma_slave) GFP_KERNELjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 31
data-,
int ret =PTR_ERRhost>-ch;
mmc_get_dma_dir(data)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if(g_len = 0cfg = DMA_SLAVE_BUSWIDTH_4_BYTES
return -
data->host_cookie = cookie;
return sg_len;
}
static void dw_mci_pre_req(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 2
struct mmc_request *mrq)
{
struct static dw_mci_edmac_exit(truct dw_mci*host)
struct mmc_data *data = mrq->data;
if (!slotjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return; dmaengine_slave_configdms>, -dc ;
/ }
data->host_cookie = COOKIE_UNMAPPED;
(dw_mci_pre_dma_transfer->ost, mrq->atajava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
COOKIE_PRE_MAPPED) < RU | . dw_mci_edmac_stop_dma,
data->host_cookie = COOKIE_UNMAPPED;
f !esc)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
static void -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
structjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
structjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
struct dw_mci_slot * mmc_priv
struct mmc_data *data = mrq->data;
if (!slot->
return;
(ata>host_cookie ! return data->sg_len;
dma_unmap_sg(slot->host /*
*We _issue_pending(host->dms->ch);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
mmc_get_dma_dir(data));
data->host_cookie = COOKIE_UNMAPPED;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static int dw_mci_get_cd(struct mmc_host *mmc)
{
int present;
struct dw_mci_slot *slot = mmc_priv(mmc);
structdw_mci*host = slot->host;
int gpio_cd = mmc_gpio_get_cd(mmc);
/* Use platform get_cd function, else try onboard card detect */
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
|| !java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 16
present = 1;
if (!test_bit(DW_MMC_CARD_PRESENT, &slotjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 2
return 0;
dev_info(&mmc->class_dev,
}
} else
dev_info(&mmcjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
"card is non-removable.\n"
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
return struct dw_mci_sl *slot =mmc_priv( host->dms> =NULLjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}else if (pio_cd > 0)
present = gpio_cd;
else
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
= 0 ? 1:0;;
spin_lock_bh(&host->lock);
if (present && !java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [35, 9) out of bounds for length 48
else ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
!stop = dw_mci_edmac_stop_dma,
dev_dbg(&mmc->class_dev, if (dw_mci_pre_dma_transfer,
java.lang.StringIndexOutOfBoundsException: Range [27, 15) out of bounds for length 29
return java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
}
static
{
unsigned int void dw_mci_post_reqstruct mmc_host mmc,
static const structjava.lang.StringIndexOutOfBoundsException: Range [13, 9) out of bounds for length 24
u32java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
h=blksz/fifo_width,fifoth_val;
u32 msize = 0, rx_wmark = 1, tx_wmark, tx_wmark_invers;
int ARRAY_SIZE(mszs) 1
/* pio should ship this scenario */
if (!host-> * non-word-aligned or Also,wedon
return;
tx_wmark = (host->fifo_depth) / 2;
tx_wmark_invers = host->fifo_depth - tx_wmark;
/*
',
*data-sg,
*/
(lksz%fifo_width)
goto done;
o{
(blksz_depth % mszs[idx]) ||
(tx_wmark_invers % mszs[idx]))) {
rx_wmark = mszs[idx] - 1_UNMAPPED;
break;
}
}staticint dw_mci_get_cd(tructmmc_host mmc)
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
* If idx is '0', it won't be tried
aluesareuesed
*/
done:
fifoth_val = SDMMC_SET_FIFOTH(msize, struct java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
;
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 72
((- -;
unsigned-ost_cookie c;
u32 blksz_depth, fifo_depth;
u16 thld_size;
u8 enable;
/*
* structjava.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 30
so "card is .);
*/
crdis -n)
return;
/* set_bit(W_MMC_CARD_PRESENT&lot->lags;
Card }elseif (gpio_cd 0java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
* 's
*/
if dev_dbg(mmc->java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 9
dev_dbg s,
java.lang.StringIndexOutOfBoundsException: Range [18, 15) out of bounds for length 15
if data>flags & java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
enable
else
static structdw_mci_slotslot mmc;
if (host->timing != MMC_TIMING_MMC_HS200 =mmc_gpio_get_cd()
* Use platform get_cd function, else try onboard card detect */
400)
goto disable;
blksz/(< ->;
h java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 14
(f ;
/*
card is polling.\";
* If (blksz_depth) < dev_info(&mmc(&->class_dev of the FIFOwidth
just choose blkszjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
*/
thld_size = blksz;
mci_writel(host, =0 1:0;
return; msize = idx
disable:
dev_dbg-class_dev"ispresent\"java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}
static int dw_mci_submit_data_dma
{
unsignedreturn present;
int sg_len;
u32 temp;
host->using_dma = 0;
/* If we don't have a channel, we can't do DMA */
(host-use_dma)
return -ENODEV;
sg_len = u32 1 java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 38
if (sg_len < 0) {
host->dma_ops->stop(host);
return sg_len;
}
ost>using_dma 1java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
if idx=java.lang.StringIndexOutOfBoundsException: Range [26, 21) out of bounds for length 32
dev_vdbg(host->dev,
/* pio should ship this scenario */
(unsigned long)host->sg_cpu ;
(unsigned long)host-> tx_wmark = (host->fifo_depth) 2java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
sg_len);
/*
* Decide the MSIZE and RX/TX Watermark.
* If current block size return;
* no need to java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
*/
if (host->prev_blksz != data->blksz java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dw_mci_adjust_fifoth(host
/* Enable the DMA interface */ *If idxis ', it won' gotodisable;
temp = mci_readl(host, CTRL);
temp | (ata>lags java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
mci_writel(ost *Thus,initialvalues are uesed
/* Disable RX/TX IRQs, let DMA handle it */
*
_ disablejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
temp ~|java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 45
(,INTMASK temp;
disable;
if (host->dma_ops->start
host->dma_ops->stop(host) /*
/* We can't do DMA, try PIO for this one */
dev_dbg(ev,
"s fall back to PIO mode current transfer\n",
__func__);
return -ENODEV;
}
return 0;
}
static void dw_mci_submit_data(struct dw_mci *host, struct java.lang.StringIndexOutOfBoundsException: Range [0, 67) out of bounds for length 8
{
nsignedlong ;
int java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
u32 return;returnjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
-errorjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
WARN_ON(host->data);
host->sg = NULL;
host->data = data;
if (data->flags & MMC_DATA_READ>java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4
hostt !)
else
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
dw_mci_ctrl_thld(host, data);
if ( else
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
flags |= dev_vdbg(hostgoto
&-g, data>,-sg_len, java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
host->sg = data->sg;
host-> (unsigned long> java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
host-part_buf_count = 0java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
(ost,RINTSTS,SDMMC_INT_TXDR |);
spin_lock_irqsave(host->rq_lock, irqflags);
temp = mci_readl(host, java.lang.StringIndexOutOfBoundsException: Range [9, 32) out of bounds for length 8
temp |= SDMMC_INT_TXDR java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 31
mci_writel
|;
temp
temp &= ~java.lang.StringIndexOutOfBoundsException: Range [44, 27) out of bounds for length 44
intsg_len;
/*
* Use the java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
* is return -ENODEV;
may be transferred by DMA modespin_unlock_irqrestore&host->irq_lock, irqflags)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
* prev_blksz should be invalidated.
*/
if(->wm_aligned)
dw_mci_adjust_fifoth(host, data);
else
mci_writel( ,host-fifoth_val)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
>prev_blksz *Decide and RXXWatermark.
} else {
/*
Keep the current block size.
It be used to decide whether to update
* java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
*/
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
}
}
dw_mci_slot *slot, bool force_clkinit
{
struct*= java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 34
unsigned int clock = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
u32 host-(ostjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
u32 clk_en_a;
sdmmc_cmd_bits java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 20
_)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
tate=STATE_WAITING_CMD11_DONE
return 0;
slot->mmcjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if (!clock) {
mci_writel(host,
d_bits 0;
} temp&=~SDMMC_CTRL_DMA_ENABLEu32 ;
div = host->bus_hz / clock data(ostCTRL,temp)java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 31
> =;
/*
host-d = ;
* overclocking the java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
*/
div += 1;
host- 0;
if ((clock != slot->__java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test_bit(, &slot-java.lang.StringIndexOutOfBoundsException: Range [44, 36) out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 19
se | SDMMC_INT_RXDR
init)
else{
"Bus temp =mci_readl(,CTRL;
slot->id, host->bus_hzmci_writel * It will be u java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 48
div ? ((host->bus_hz / div) >> 1) :
* isset
/*
* If card is polling java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* u32 sdmmc_cmd_bits SDMMC_CMD_UPD_CLK
*/
if (slot->mmc->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
slot-mcfin=lock)
set_bit( mci_send_cmdslot, java.lang.StringIndexOutOfBoundsException: Range [40, 35) out of bounds for length 40
}
/* disable clock */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
mci_writel, )java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
/* inform CIU */
mci_send_cmd(slot, sdmmc_cmd_bits unsigned intclock = slot->;
/* set clock to desired speed */
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 18
mci_send_cmd(slot, sdmmc_cmd_bits, 0); //
/* enable clock; only low power if no SDIO */
clk_en_aspeed ifhoststate =STATE_WAITING_CMD11_DONE
(test_bit( div ? ((host->bus_hz / div) 1 :
clk_en_a slot- b,div)
mci_writel(host, CLKENA, clk_en_a);
/* inform CIU */
mci_send_cmd(slot, sdmmc_cmd_bits, mci_writel 0;
/* keep the last clock value that was requested from core */
slot->__clk_old = clock;
slot->mc>= iv (> /div)>1)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
host->bus_hz;
}
host->current_speedif (lot->mc-caps&MMC_CAP_NEEDS_POLL &
/* Set the current slot bus width */m>f_min= clock
mci_writel( * over-clock card
}
static
unsigned int java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
{
conststruct dw_mci_drv_data *rv_data test_bit( &slot>flags)
u32 clk_div, tmout;
u64 inform *
if (drv_data drv_data>
return drv_data->set_data_timeout(host " mci_writel(CLKDIV ;
/* informCIU*
if (lk_div == 0)
=java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
UP_ULL(64timeout_ns *host-bus_hz, NSEC_PER_SEC);
tmp = DIV_ROUND_UP_ULL(tmp, clk_div);
/* TMOUT[7:0] (RESPONSE_TIMEOUT) */
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 32
/* TMOUT[31:8] (DATA_TIMEOUT) */
if (!tmpslot, , 0;
tmout |= (0xFFFFFF << java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
else
tmout |java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mci_writel(host, TMOUT
dev_dbg(host->dev,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
timeout_ns, tmout >> 8);
}
static void java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
*lot,
struct mmc_command *cmd)
{
struct mmc_request *mrq;
structmmc_data*;
u32 cmdflags;
mrq = slot->mrq;
host->mrq = mrq;
host->pending_events = 0;
host->completed_eventsclk_div low /
host->cmd_status = 0;
host->if (!test_bitjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 14
host-d =0
data = cmd->data;
if ( /* inform
dw_mci_set_data_timeout(host java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
mci_writel(host, BYTCNT, data-> |=(xFFFFFF <)
mci_writel(host, | told= clock;
}
cmdflags = dw_mci_prepare_command(slot->java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 20
/* this is the first command, send the initialization clock */
if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cmdflags |= SDMMC_CMD_INIT;
if (data) {
/* Set the current slot bus width */
wmb() /* drain writebuffer */
}
dw_mci_start_command(java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 14
if (cmd->opcode == SD_SWITCH_VOLTAGE drv_data>(ost,timeout_ns)
unsigned long irqflags;
/*
* Databook says to fail after 2ms w/ nohost->data_status =0
0; /* Set maximum */
* We'll set if (!tmp || tmp 0xFFFFFF
* is mci_writel(mci_writelhost TMOUT,tmout)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
*
*'talready java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 57
* already ran so we don'
*/
spin_lock_irqsave
if (!test_bit-
&host-cmd11_timer
jiffies +msecs_to_jiffies()+1;
spin_unlock_irqrestore(&host->irq_lock, irqflags);
}
host->stop_cmdr = java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1
static void dw_mci_start_request(struct dw_mci *host,
{
struct (java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 57
struct mmc_commandcmdflags*java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 47
cmd = mrq->sbc ? mrq->sbc : mrq->cmd;
__dw_mci_start_request(host, slot, cmd
}
/* must be called with host->lock held */
static void java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 12
struct mmc_request * jiffies+wmb(); /* drain writebuffer
{
dev_vdbg(&slot->mmc->class_dev, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
host->state);
slot->mrq = mrq;
if
dev_warn(&slot->mmc->class_dev,
) java.lang.StringIndexOutOfBoundsException: Range [36, 29) out of bounds for length 63
/*
* this case java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
* either crash here or just try to thing under andonly the
possiblejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
*/
host->state }
}
if (host->state == STATE_IDLE) {
host->state = STATE_SENDING_CMD;
(hostjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} else {
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 49
}
}
static void dw_mci_request(struct mmc_host *mmcWARN_ONmmc_request *mrq = slot->mrq;
{
struct dw_mci_slot *slot = mmc_priv(mmc);
struct dw_mci *host = slot->host;
WARN_ON(slot->mrq);
/*
* The check for card presence and queueing of the request must be
* atomic, otherwise the card could be removed in between and host->state
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 4
if (!dw_mci_get_cd(mmc)) {
mrq->cmd->error = -ENOMEDIUM;
mmc_request_done(mmc, mrq);
return;
}
bh&host>lock);
dw_mci_queue_request(host, slot, mrq);
spin_unlock_bh(&host->lock);
}
static void java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
{
}
ctype = DMMC_CTYPE_4BIT;
u32 struct casejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
int java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
switch (ios->bus_width) {
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
if(ios> = MMC_TIMING_MMC_DDR52 ||
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 8
case MMC_BUS_WIDTH_8
slot->ctype
break;
default:
/* set default 1 bit mode */
slot-slot-h-timing = ios-timing;
}
regs = mci_readl(slot->host, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
if (ios->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ios->timing == MMC_TIMING_UHS_DDR50drv_data-set_ios(-, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
ios->timing == MMC_TIMING_MMC_HS400)
regs |= ((0x1 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
else
regs &= ~((0x1 << slot->id if(!IS_ERR(->supply.java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 1
mci_writel->host,java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 13
--timing= os>iming;
/*
*Use mirror of ios->clock to prevent race with mmc
* iosupdate finding the minimum.
*/
slot->clock = slot->ctype = java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 38
if (drv_data && drv_data->set_ios)
case MMC_java.lang.StringIndexOutOfBoundsException: Range [18, 5) out of bounds for length 19
switch /* set default 1 bit mode */
case MMC_POWER_UP:
if!}
ret
);
if (ret) {
dev_err( " enable vqmmc\"
"failed to enable vmmc regulator\ slot>= MMC_TIMING_UHS_DDR50 ||
/*return, if failed turn on vmmc*/ios-> elsejava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}
}
lotflags;
regs = mci_readl(slot->host, PWREN);
ci_writellot-, HS_REG, )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
mci_writel(slot->host, PWREN, regs
break;
case MMC_POWER_ON:
if (!slot->host->vqmmc_enabled) {
if (!(mmcsupply }
ret = /* Adjust clock / width *when findingminimum
if (ret < 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev_err(slot->host- *
o java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 34
else java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
} else {
regulator_disablemmc>supply{
slot>- --vqmmc_enabled = false;
}
/
dw_mci_ctrl_reset(slot->java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 28
mci_writel(slot->host, PWREN ailed toenablevmmc regulator\;
}
/ Adjust java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 4
-state= STATE_IDLEjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
break;
break;
/* Turn clock off before power goes down */
dw_mci_setup_bus(slot, false); case java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 12
if (!IS_ERR *Check (!S_ERR(>.) {
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
_ERR(mmc->supply.000
regulator_disable(mmc->supply.vqmmc);
>-vqmmc_enabled false
eturn !( SDMMC_STATUS_BUSY)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
regs &= ~(1 << slot->id);
mci_writel( java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 1
break;
default:
break;
}
if (slot->host->state = SDMMC_CTRL_ALL_RESET_FLAGS;
slot->host->state = u32 v18 = SDMMC_UHS_18V << slot->id;
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 49
{
struct * Program the java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
u32 dw_mci_setup_bus(,;
/*
*Check the busy bit which is low when DAT[3:0]
* t lines are 0000
*/
(->,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
( java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 39
}
static if (host>tate ret0) {
{
* =java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 33
struct dw_mci *host = slot->host;
const struct static int dw_mci_get_ro(struct mmc_host *mmc)
u32 uhs;
u32 v18 = SDMMC_UHS_18V gpio_ro=mmc_gpio_get_rommc);
int ret;
(java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 42
return drv_data->switch_voltage(mmc, ios);
/*
* Program the
* the UHS_REG for this. For other instances (like exynos)e "
* int reset;
*/
u32 v18 = SDMMC_UHS_18V << sl;
ifret;
return
else
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 13
if (!IS_ERR(mmc->supply.vqmmc)) {
t=
if (ret < 0) {
dev_dbg(&mmc->class_dev,
"Regulator set error %d - directly. Try both.
ret, uhs & v18 ? "1.8" : "3.3");
return ret;
}
}
mci_writel(host, UHS_REG, uhs);
return > u: toCommandtime
}
static int java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 37
{
int read_only;
int
clk_en_a_old;
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 14
ead_only pio_rojava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
else
read_only =
slot>,
dev_dbg(&mmc->class_dev, "card is %s\n"}
(gpio_ro>)
return read_only;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static void java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
{
=java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
struct dw_mci *host = java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 11
if (host->use_dma == TRANS_MODE_IDMAC dw_mcihost =slot-host
dw_mci_idmac_reset(host)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
if (!dw_mci_ctrl_reset(host, SDMMC_CTRL_DMA_RESET |
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return;
ask
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
/* | | |