Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327516
b: refs/heads/master
c: 902d9e0
h: refs/heads/master
v: v3
  • Loading branch information
Rafał Miłecki authored and John W. Linville committed Aug 10, 2012
1 parent 3468a03 commit 6942c81
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85ce5ae52690aab0b3a4a6e9a1c2f951d2d8a5cc
refs/heads/master: 902d9e0f48ddc18fb37c1b1edf5e3b27aaba1505
28 changes: 21 additions & 7 deletions trunk/drivers/ssb/driver_mipscore.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,30 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
{
struct ssb_bus *bus = mcore->dev->bus;

mcore->flash_buswidth = 2;
if (bus->chipco.dev) {
mcore->flash_window = 0x1c000000;
mcore->flash_window_size = 0x02000000;
/* When there is no chipcommon on the bus there is 4MB flash */
if (!bus->chipco.dev) {
mcore->flash_buswidth = 2;
mcore->flash_window = SSB_FLASH1;
mcore->flash_window_size = SSB_FLASH1_SZ;
return;
}

/* There is ChipCommon, so use it to read info about flash */
switch (bus->chipco.capabilities & SSB_CHIPCO_CAP_FLASHT) {
case SSB_CHIPCO_FLASHT_STSER:
case SSB_CHIPCO_FLASHT_ATSER:
pr_err("Serial flash not supported\n");
break;
case SSB_CHIPCO_FLASHT_PARA:
pr_debug("Found parallel flash\n");
mcore->flash_window = SSB_FLASH2;
mcore->flash_window_size = SSB_FLASH2_SZ;
if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG)
& SSB_CHIPCO_CFG_DS16) == 0)
mcore->flash_buswidth = 1;
} else {
mcore->flash_window = 0x1fc00000;
mcore->flash_window_size = 0x00400000;
else
mcore->flash_buswidth = 2;
break;
}
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/ssb/ssb_driver_chipcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@
#define SSB_CHIPCO_FLASHCTL_ST_SE 0x02D8 /* Sector Erase */
#define SSB_CHIPCO_FLASHCTL_ST_BE 0x00C7 /* Bulk Erase */
#define SSB_CHIPCO_FLASHCTL_ST_DP 0x00B9 /* Deep Power-down */
#define SSB_CHIPCO_FLASHCTL_ST_RSIG 0x03AB /* Read Electronic Signature */
#define SSB_CHIPCO_FLASHCTL_ST_RES 0x03AB /* Read Electronic Signature */
#define SSB_CHIPCO_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */
#define SSB_CHIPCO_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */

/* Status register bits for ST flashes */
#define SSB_CHIPCO_FLASHSTA_ST_WIP 0x01 /* Write In Progress */
Expand Down

0 comments on commit 6942c81

Please sign in to comment.