Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352292
b: refs/heads/master
c: c7a4a9e
h: refs/heads/master
v: v3
  • Loading branch information
Rafał Miłecki authored and John W. Linville committed Jan 30, 2013
1 parent fbd0f20 commit fcf0fc0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 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: f1ab57e3a114173fdb94219937191f0c673e87dd
refs/heads/master: c7a4a9e3880cc8cdc1f2958796e517d9d96ff7e0
29 changes: 28 additions & 1 deletion trunk/drivers/ssb/driver_mipscore.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,33 @@

#include <linux/ssb/ssb.h>

#include <linux/mtd/physmap.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/serial_reg.h>
#include <linux/time.h>

#include "ssb_private.h"

static const char *part_probes[] = { "bcm47xxpart", NULL };

static struct physmap_flash_data ssb_pflash_data = {
.part_probe_types = part_probes,
};

static struct resource ssb_pflash_resource = {
.name = "ssb_pflash",
.flags = IORESOURCE_MEM,
};

struct platform_device ssb_pflash_dev = {
.name = "physmap-flash",
.dev = {
.platform_data = &ssb_pflash_data,
},
.resource = &ssb_pflash_resource,
.num_resources = 1,
};

static inline u32 mips_read32(struct ssb_mipscore *mcore,
u16 offset)
Expand Down Expand Up @@ -197,7 +217,7 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
pflash->buswidth = 2;
pflash->window = SSB_FLASH1;
pflash->window_size = SSB_FLASH1_SZ;
return;
goto ssb_pflash;
}

/* There is ChipCommon, so use it to read info about flash */
Expand All @@ -219,6 +239,13 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
pflash->buswidth = 2;
break;
}

ssb_pflash:
if (pflash->present) {
ssb_pflash_data.width = pflash->buswidth;
ssb_pflash_resource.start = pflash->window;
ssb_pflash_resource.end = pflash->window + pflash->window_size;
}
}

u32 ssb_cpu_clock(struct ssb_mipscore *mcore)
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/ssb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ static int ssb_devices_register(struct ssb_bus *bus)
dev_idx++;
}

#ifdef CONFIG_SSB_DRIVER_MIPS
if (bus->mipscore.pflash.present) {
err = platform_device_register(&ssb_pflash_dev);
if (err)
pr_err("Error registering parallel flash\n");
}
#endif

return 0;
error:
/* Unwind the already registered devices. */
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/ssb/ssb_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ static inline int ssb_sflash_init(struct ssb_chipcommon *cc)
}
#endif /* CONFIG_SSB_SFLASH */

#ifdef CONFIG_SSB_DRIVER_MIPS
extern struct platform_device ssb_pflash_dev;
#endif

#ifdef CONFIG_SSB_DRIVER_EXTIF
extern u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks);
extern u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);
Expand Down

0 comments on commit fcf0fc0

Please sign in to comment.