From: Rodolfo Giometti <giometti@linux.it>
To: linux-mips@linux-mips.org
Subject: [PATCH] 2/7 AU1100 MMC support
Date: Wed, 9 Aug 2006 23:08:43 +0200 [thread overview]
Message-ID: <20060809210843.GC13145@enneenne.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
Protect code on "BCSR" device.
Signed-off-by: Rodolfo Giometti <giometti@linux.it>
--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@gnudd.com
Embedded Systems giometti@linux.it
UNIX programming phone: +39 349 2432127
[-- Attachment #2: patch-mmc-de-bcsr --]
[-- Type: text/plain, Size: 1885 bytes --]
diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c
index b0dc1d0..6084bb8 100644
--- a/drivers/mmc/au1xmmc.c
+++ b/drivers/mmc/au1xmmc.c
@@ -65,8 +65,8 @@ #endif
const struct {
u32 iobase;
u32 tx_devid, rx_devid;
- u16 bcsrpwr;
- u16 bcsrstatus;
+ u16 power;
+ u16 status;
u16 wpstatus;
} au1xmmc_card_table[] = {
{ SD0_BASE, DSCR_CMD0_SDMS_TX0, DSCR_CMD0_SDMS_RX0,
@@ -138,24 +138,42 @@ static inline void SEND_STOP(struct au1x
static void au1xmmc_set_power(struct au1xmmc_host *host, int state)
{
- u32 val = au1xmmc_card_table[host->id].bcsrpwr;
+ u32 val;
+ val = au1xmmc_card_table[host->id].power;
+
+#if defined(CONFIG_MIPS_DB1200)
bcsr->board &= ~val;
if (state) bcsr->board |= val;
+#endif
au_sync_delay(1);
}
static inline int au1xmmc_card_inserted(struct au1xmmc_host *host)
{
- return (bcsr->sig_status & au1xmmc_card_table[host->id].bcsrstatus)
- ? 1 : 0;
+ u32 val, data = 1;
+
+ val = au1xmmc_card_table[host->id].status;
+
+#if defined(CONFIG_MIPS_DB1200)
+ data = bcsr->sig_status & val;
+#endif
+
+ return !!data;
}
static inline int au1xmmc_card_readonly(struct au1xmmc_host *host)
{
- return (bcsr->status & au1xmmc_card_table[host->id].wpstatus)
- ? 1 : 0;
+ u32 val, data = 0;
+
+ val = au1xmmc_card_table[host->id].wpstatus;
+
+#if defined(CONFIG_MIPS_DB1200)
+ data = bcsr->status & val;
+#endif
+
+ return !!data;
}
static void au1xmmc_finish_request(struct au1xmmc_host *host)
@@ -175,7 +193,9 @@ static void au1xmmc_finish_request(struc
host->status = HOST_S_IDLE;
+#if defined(CONFIG_MIPS_DB1200)
bcsr->disk_leds |= (1 << 8);
+#endif
mmc_request_done(host->mmc, mrq);
}
@@ -670,7 +690,9 @@ static void au1xmmc_request(struct mmc_h
host->mrq = mrq;
host->status = HOST_S_CMD;
+#if defined(CONFIG_MIPS_DB1200)
bcsr->disk_leds &= ~(1 << 8);
+#endif
if (mrq->data) {
FLUSH_FIFO(host);
next reply other threads:[~2006-08-09 21:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-09 21:08 Rodolfo Giometti [this message]
2006-08-10 13:29 ` [PATCH] 2/7 AU1100 MMC support Sergei Shtylyov
2006-08-10 13:36 ` Rodolfo Giometti
2006-08-10 14:29 ` Manuel Lauss
2006-08-10 16:12 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060809210843.GC13145@enneenne.com \
--to=giometti@linux.it \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox