aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-08-27 06:01:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:28 -0400
commite5cf1b75f5675c3169d638f914d1212a5b9071fa (patch)
tree1158c1e0809f10e1b11a212b209bc36b6bc2d7a0
parentdf482a0916a0ad7473687745e363475e8ce9cd5a (diff)
Staging: et131x: clean up MMC_SRAM_
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/et131x/et1310_address_map.h34
-rw-r--r--drivers/staging/et131x/et131x_debug.c12
2 files changed, 13 insertions, 33 deletions
diff --git a/drivers/staging/et131x/et1310_address_map.h b/drivers/staging/et131x/et1310_address_map.h
index 3f87d3fef780..5abaee918a04 100644
--- a/drivers/staging/et131x/et1310_address_map.h
+++ b/drivers/staging/et131x/et1310_address_map.h
@@ -2264,7 +2264,7 @@ typedef struct _MAC_STAT_t { /* Location: */
2264/* START OF MMC REGISTER ADDRESS MAP */ 2264/* START OF MMC REGISTER ADDRESS MAP */
2265 2265
2266/* 2266/*
2267 * structure for Main Memory Controller Control reg in mmc address map. 2267 * Main Memory Controller Control reg in mmc address map.
2268 * located at address 0x7000 2268 * located at address 0x7000
2269 */ 2269 */
2270 2270
@@ -2277,31 +2277,13 @@ typedef struct _MAC_STAT_t { /* Location: */
2277#define ET_MMC_FORCE_CE 64 2277#define ET_MMC_FORCE_CE 64
2278 2278
2279/* 2279/*
2280 * structure for Main Memory Controller Host Memory Access Address reg in mmc 2280 * Main Memory Controller Host Memory Access Address reg in mmc
2281 * address map. Located at address 0x7004 2281 * address map. Located at address 0x7004. Top 16 bits hold the address bits
2282 */ 2282 */
2283typedef union _MMC_SRAM_ACCESS_t { 2283
2284 u32 value; 2284#define ET_SRAM_REQ_ACCESS 1
2285 struct { 2285#define ET_SRAM_WR_ACCESS 2
2286#ifdef _BIT_FIELDS_HTOL 2286#define ET_SRAM_IS_CTRL 4
2287 u32 byte_enable:16; /* bits 16-31 */
2288 u32 reserved2:2; /* bits 14-15 */
2289 u32 req_addr:10; /* bits 4-13 */
2290 u32 reserved1:1; /* bit 3 */
2291 u32 is_ctrl_word:1; /* bit 2 */
2292 u32 wr_access:1; /* bit 1 */
2293 u32 req_access:1; /* bit 0 */
2294#else
2295 u32 req_access:1; /* bit 0 */
2296 u32 wr_access:1; /* bit 1 */
2297 u32 is_ctrl_word:1; /* bit 2 */
2298 u32 reserved1:1; /* bit 3 */
2299 u32 req_addr:10; /* bits 4-13 */
2300 u32 reserved2:2; /* bits 14-15 */
2301 u32 byte_enable:16; /* bits 16-31 */
2302#endif
2303 } bits;
2304} MMC_SRAM_ACCESS_t, *PMMC_SRAM_ACCESS_t;
2305 2287
2306/* 2288/*
2307 * structure for Main Memory Controller Host Memory Access Data reg in mmc 2289 * structure for Main Memory Controller Host Memory Access Data reg in mmc
@@ -2314,7 +2296,7 @@ typedef union _MMC_SRAM_ACCESS_t {
2314 */ 2296 */
2315typedef struct _MMC_t { /* Location: */ 2297typedef struct _MMC_t { /* Location: */
2316 u32 mmc_ctrl; /* 0x7000 */ 2298 u32 mmc_ctrl; /* 0x7000 */
2317 MMC_SRAM_ACCESS_t sram_access; /* 0x7004 */ 2299 u32 sram_access; /* 0x7004 */
2318 u32 sram_word1; /* 0x7008 */ 2300 u32 sram_word1; /* 0x7008 */
2319 u32 sram_word2; /* 0x700C */ 2301 u32 sram_word2; /* 0x700C */
2320 u32 sram_word3; /* 0x7010 */ 2302 u32 sram_word3; /* 0x7010 */
diff --git a/drivers/staging/et131x/et131x_debug.c b/drivers/staging/et131x/et131x_debug.c
index 4346c8223a7f..61203c181557 100644
--- a/drivers/staging/et131x/et131x_debug.c
+++ b/drivers/staging/et131x/et131x_debug.c
@@ -115,18 +115,16 @@ void DumpTxQueueContents(int dbgLvl, struct et131x_adapter *etdev)
115 115
116 if (DBG_FLAGS(et131x_dbginfo) & dbgLvl) { 116 if (DBG_FLAGS(et131x_dbginfo) & dbgLvl) {
117 for (TxQueueAddr = 0x200; TxQueueAddr < 0x3ff; TxQueueAddr++) { 117 for (TxQueueAddr = 0x200; TxQueueAddr < 0x3ff; TxQueueAddr++) {
118 MMC_SRAM_ACCESS_t sram_access; 118 u32 sram_access = readl(&mmc->sram_access);
119 119 sram_access &= 0xFFFF;
120 sram_access.value = readl(&mmc->sram_access.value); 120 sram_access |= (TxQueueAddr << 16) | ET_SRAM_REQ_ACCESS;
121 sram_access.bits.req_addr = TxQueueAddr; 121 writel(sram_access, &mmc->sram_access);
122 sram_access.bits.req_access = 1;
123 writel(sram_access.value, &mmc->sram_access.value);
124 122
125 DBG_PRINT("Addr 0x%x, Access 0x%08x\t" 123 DBG_PRINT("Addr 0x%x, Access 0x%08x\t"
126 "Value 1 0x%08x, Value 2 0x%08x, " 124 "Value 1 0x%08x, Value 2 0x%08x, "
127 "Value 3 0x%08x, Value 4 0x%08x, \n", 125 "Value 3 0x%08x, Value 4 0x%08x, \n",
128 TxQueueAddr, 126 TxQueueAddr,
129 readl(&mmc->sram_access.value), 127 readl(&mmc->sram_access),
130 readl(&mmc->sram_word1), 128 readl(&mmc->sram_word1),
131 readl(&mmc->sram_word2), 129 readl(&mmc->sram_word2),
132 readl(&mmc->sram_word3), 130 readl(&mmc->sram_word3),