From: Alex Dubov <oakad@yahoo.com>
MemoryStick storage cards, when in parallel mode, send several meaningful
bits of their "INT" register as part of command response. This data is
stored by host and can be used to spare invocation of "GET_INT" TPC on
each data page transferred between host and card.
Signed-off-by: Alex Dubov <oakad@yahoo.com>
---
drivers/memstick/core/memstick.c | 9 ++----
drivers/memstick/core/mspro_block.c | 15 ++++++----
drivers/memstick/host/jmb38x_ms.c | 48 +++++++++++++++++++---------------
drivers/memstick/host/tifm_ms.c | 17 +++++++-----
include/linux/memstick.h | 1 -
5 files changed, 49 insertions(+), 41 deletions(-)
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index de80dba..946e3d3 100644
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -276,8 +276,6 @@ void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc,
mrq->need_card_int = 1;
else
mrq->need_card_int = 0;
-
- mrq->get_int_reg = 0;
}
EXPORT_SYMBOL(memstick_init_req_sg);
@@ -311,8 +309,6 @@ void memstick_init_req(struct memstick_request *mrq, unsigned char tpc,
mrq->need_card_int = 1;
else
mrq->need_card_int = 0;
-
- mrq->get_int_reg = 0;
}
EXPORT_SYMBOL(memstick_init_req);
@@ -342,6 +338,7 @@ static int h_memstick_read_dev_id(struct memstick_dev *card,
card->id.class = id_reg.class;
}
complete(&card->mrq_complete);
+ dev_dbg(&card->dev, "if_mode = %02x\n", id_reg.if_mode);
return -EAGAIN;
}
}
@@ -422,7 +419,6 @@ static void memstick_power_on(struct memstick_host *host)
{
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON);
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_SERIAL);
- msleep(1);
}
static void memstick_check(struct work_struct *work)
@@ -579,7 +575,8 @@ EXPORT_SYMBOL(memstick_suspend_host);
void memstick_resume_host(struct memstic...From: Alex Dubov <oakad@yahoo.com>
Newer MemoryStick (HG) cards and hosts support 8-bit parallel mode of
operation in addition to original 4-bit and 1-bit modes.
Signed-off-by: Alex Dubov <oakad@yahoo.com>
---
drivers/memstick/core/mspro_block.c | 81 +++++++++++++++++++++++-----------
1 files changed, 55 insertions(+), 26 deletions(-)
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index e5356f9..557dbbb 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -816,12 +816,13 @@ static int mspro_block_wait_for_ced(struct memstick_dev *card)
return card->current_mrq.error;
}
-static int mspro_block_switch_to_parallel(struct memstick_dev *card)
+static int mspro_block_set_interface(struct memstick_dev *card,
+ unsigned char sys_reg)
{
struct memstick_host *host = card->host;
struct mspro_block_data *msb = memstick_get_drvdata(card);
struct mspro_param_register param = {
- .system = MEMSTICK_SYS_PAR4,
+ .system = sys_reg,
.data_count = 0,
.data_address = 0,
.tpc_param = 0
@@ -833,41 +834,70 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card)
sizeof(param));
memstick_new_req(host);
wait_for_completion(&card->mrq_complete);
- if (card->current_mrq.error)
- return card->current_mrq.error;
+ return card->current_mrq.error;
+}
+
+static int mspro_block_switch_interface(struct memstick_dev *card)
+{
+ struct memstick_host *host = card->host;
+ struct mspro_block_data *msb = memstick_get_drvdata(card);
+ int rc = 0;
+
+ if (msb->caps & MEMSTICK_CAP_PAR4)
+ rc = mspro_block_set_interface(card, MEMSTICK_SYS_PAR4);
+ else
+ return 0;
+
+ if (rc) {
+ printk(KERN_WARNING
+ "%s: could not switch to 4-bit mode, error %d\n",
+ card->dev.bus_id, rc);
+ return 0;
+ }
msb->system = MEMSTICK_SYS_PAR4;
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_PAR4);...From: Alex Dubov <oakad@yahoo.com>
Set correct clock management values to improve over-all performance.
Signed-off-by: Alex Dubov <oakad@yahoo.com>
---
drivers/memstick/host/jmb38x_ms.c | 60 ++++++++++++++++++------------------
1 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
index e5a52f2..ed90a43 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -130,6 +130,12 @@ struct jmb38x_ms {
#define PAD_PU_PD_ON_MS_SOCK0 0x5f8f0000
#define PAD_PU_PD_ON_MS_SOCK1 0x0f0f0000
+#define CLOCK_CONTROL_40MHZ 0x00000001
+#define CLOCK_CONTROL_50MHZ 0x00000002
+#define CLOCK_CONTROL_60MHZ 0x00000008
+#define CLOCK_CONTROL_62_5MHZ 0x0000000c
+#define CLOCK_CONTROL_OFF 0x00000000
+
enum {
CMD_READY = 0x01,
FIFO_READY = 0x02,
@@ -604,19 +610,18 @@ static void jmb38x_ms_reset(struct jmb38x_ms_host *host)
{
unsigned int host_ctl = readl(host->addr + HOST_CONTROL);
- writel(host_ctl | HOST_CONTROL_RESET_REQ | HOST_CONTROL_RESET,
- host->addr + HOST_CONTROL);
+ writel(HOST_CONTROL_RESET_REQ, host->addr + HOST_CONTROL);
while (HOST_CONTROL_RESET_REQ
& (host_ctl = readl(host->addr + HOST_CONTROL))) {
- ndelay(100);
- dev_dbg(&host->chip->pdev->dev, "reset\n");
+ ndelay(20);
+ dev_dbg(&host->chip->pdev->dev, "reset %08x\n", host_ctl);
}
- writel(INT_STATUS_ALL, host->addr + INT_STATUS_ENABLE);
+ writel(HOST_CONTROL_RESET, host->addr + HOST_CONTROL);
+ mmiowb();
writel(INT_STATUS_ALL, host->addr + INT_SIGNAL_ENABLE);
-
- dev_dbg(&host->chip->pdev->dev, "reset\n");
+ writel(INT_STATUS_ALL, host->addr + INT_STATUS_ENABLE);
}
static void jmb38x_ms_set_param(struct memstick_host *msh,
@@ -624,10 +629,8 @@ static void jmb38x_ms_set_param(struct memstick_host *msh,
int value)
{
struct jmb38x_ms_host *host = memstick_...
| Andi Kleen | [PATCH x86] [6/16] Add a new arch_early_alloc() interface for x86-64 |
| Jay L. T. Cornwall | 2.6.22-rc5: pdflush oops under heavy disk load |
| Adrian Bunk | If you want me to quit I will quit |
| H. Willstrand | Re: AMD Quad Core clock problem? |
git: | |
| Pietro Mascagni | GIT vs Other: Need argument |
| Wink Saville | Resolving conflicts |
| Wink Saville | Using git with Eclipse |
| Toby White | Using Filemerge.app as a git-diff viewer |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Beavis | mutiple pptp pass-through PF |
| Andrei Pirvan | apache 1.3.29 + PHP 5.2.6 on OpenBSD 4.4 |
| STeve Andre' | Re: Perpetually Current |
| Herbert Xu | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Denys | r8169 crash |
| David Miller | Re: [crash] BUG: unable to handle kernel NULL pointer dereference at 0000000000000... |
| Jianjun Kong | [PATCH 2/6] nets: clean up net/ipv4/ipip.c raw.c tcp.c tcp_minisocks.c tcp_yeah.c ... |
