Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194656
b: refs/heads/master
c: ea2db49
h: refs/heads/master
v: v3
  • Loading branch information
Rafał Miłecki authored and John W. Linville committed Apr 26, 2010
1 parent 43bdffd commit 06657f9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 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: d53cdbb94a52a920d5420ed64d986c3523a56743
refs/heads/master: ea2db495f92ad2cf3301623e60cb95b4062bc484
9 changes: 6 additions & 3 deletions trunk/drivers/ssb/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ int ssb_pci_xtal(struct ssb_bus *bus, u32 what, int turn_on)
}

/* Get the word-offset for a SSB_SPROM_XXX define. */
#define SPOFF(offset) (((offset) - SSB_SPROM_BASE) / sizeof(u16))
#define SPOFF(offset) (((offset) - SSB_SPROM_BASE1) / sizeof(u16))
/* Helper to extract some _offset, which is one of the SSB_SPROM_XXX defines. */
#define SPEX16(_outvar, _offset, _mask, _shift) \
out->_outvar = ((in[SPOFF(_offset)] & (_mask)) >> (_shift))
Expand Down Expand Up @@ -253,7 +253,7 @@ static int sprom_do_read(struct ssb_bus *bus, u16 *sprom)
int i;

for (i = 0; i < bus->sprom_size; i++)
sprom[i] = ioread16(bus->mmio + SSB_SPROM_BASE + (i * 2));
sprom[i] = ioread16(bus->mmio + bus->sprom_offset + (i * 2));

return 0;
}
Expand Down Expand Up @@ -284,7 +284,7 @@ static int sprom_do_write(struct ssb_bus *bus, const u16 *sprom)
ssb_printk("75%%");
else if (i % 2)
ssb_printk(".");
writew(sprom[i], bus->mmio + SSB_SPROM_BASE + (i * 2));
writew(sprom[i], bus->mmio + bus->sprom_offset + (i * 2));
mmiowb();
msleep(20);
}
Expand Down Expand Up @@ -625,6 +625,9 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
return -ENODEV;
}

bus->sprom_offset = (bus->chipco.dev->id.revision < 31) ?
SSB_SPROM_BASE1 : SSB_SPROM_BASE31;

buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL);
if (!buf)
goto out;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/ssb/ssb.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ struct ssb_bus {
/* ID information about the Chip. */
u16 chip_id;
u16 chip_rev;
u16 sprom_offset;
u16 sprom_size; /* number of words in sprom */
u8 chip_package;

Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/ssb/ssb_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
#define SSB_SPROMSIZE_WORDS_R4 220
#define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16))
#define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16))
#define SSB_SPROM_BASE 0x1000
#define SSB_SPROM_BASE1 0x1000
#define SSB_SPROM_BASE31 0x0800
#define SSB_SPROM_REVISION 0x107E
#define SSB_SPROM_REVISION_REV 0x00FF /* SPROM Revision number */
#define SSB_SPROM_REVISION_CRC 0xFF00 /* SPROM CRC8 value */
Expand Down

0 comments on commit 06657f9

Please sign in to comment.