diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-02-20 13:08:10 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:26 -0500 |
commit | ffc7689ddae5cbe12bde437ae0f2b386d568b5cd (patch) | |
tree | 638e7dcf083c88cf45763953aa244504d357a220 /drivers/ssb/main.c | |
parent | 004c872e78d433f84f0a5cd4db7a6c780c0946e1 (diff) |
ssb: Add support for 8bit register access
This adds support for 8bit wide register reads/writes.
This is needed in order to support the gigabit ethernet core.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/main.c')
-rw-r--r-- | drivers/ssb/main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index bedb2b4ee9d2..8db40c4b86e9 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -505,6 +505,14 @@ error: | |||
505 | return err; | 505 | return err; |
506 | } | 506 | } |
507 | 507 | ||
508 | static u8 ssb_ssb_read8(struct ssb_device *dev, u16 offset) | ||
509 | { | ||
510 | struct ssb_bus *bus = dev->bus; | ||
511 | |||
512 | offset += dev->core_index * SSB_CORE_SIZE; | ||
513 | return readb(bus->mmio + offset); | ||
514 | } | ||
515 | |||
508 | static u16 ssb_ssb_read16(struct ssb_device *dev, u16 offset) | 516 | static u16 ssb_ssb_read16(struct ssb_device *dev, u16 offset) |
509 | { | 517 | { |
510 | struct ssb_bus *bus = dev->bus; | 518 | struct ssb_bus *bus = dev->bus; |
@@ -521,6 +529,14 @@ static u32 ssb_ssb_read32(struct ssb_device *dev, u16 offset) | |||
521 | return readl(bus->mmio + offset); | 529 | return readl(bus->mmio + offset); |
522 | } | 530 | } |
523 | 531 | ||
532 | static void ssb_ssb_write8(struct ssb_device *dev, u16 offset, u8 value) | ||
533 | { | ||
534 | struct ssb_bus *bus = dev->bus; | ||
535 | |||
536 | offset += dev->core_index * SSB_CORE_SIZE; | ||
537 | writeb(value, bus->mmio + offset); | ||
538 | } | ||
539 | |||
524 | static void ssb_ssb_write16(struct ssb_device *dev, u16 offset, u16 value) | 540 | static void ssb_ssb_write16(struct ssb_device *dev, u16 offset, u16 value) |
525 | { | 541 | { |
526 | struct ssb_bus *bus = dev->bus; | 542 | struct ssb_bus *bus = dev->bus; |
@@ -539,8 +555,10 @@ static void ssb_ssb_write32(struct ssb_device *dev, u16 offset, u32 value) | |||
539 | 555 | ||
540 | /* Ops for the plain SSB bus without a host-device (no PCI or PCMCIA). */ | 556 | /* Ops for the plain SSB bus without a host-device (no PCI or PCMCIA). */ |
541 | static const struct ssb_bus_ops ssb_ssb_ops = { | 557 | static const struct ssb_bus_ops ssb_ssb_ops = { |
558 | .read8 = ssb_ssb_read8, | ||
542 | .read16 = ssb_ssb_read16, | 559 | .read16 = ssb_ssb_read16, |
543 | .read32 = ssb_ssb_read32, | 560 | .read32 = ssb_ssb_read32, |
561 | .write8 = ssb_ssb_write8, | ||
544 | .write16 = ssb_ssb_write16, | 562 | .write16 = ssb_ssb_write16, |
545 | .write32 = ssb_ssb_write32, | 563 | .write32 = ssb_ssb_write32, |
546 | }; | 564 | }; |