pci.c (c1f3ee120bb61045b1c0a3ead620d1d65af47130) | pci.c (ffc7689ddae5cbe12bde437ae0f2b386d568b5cd) |
---|---|
1/* 2 * Sonics Silicon Backplane PCI-Hostbus related functions. 3 * 4 * Copyright (C) 2005-2006 Michael Buesch <mb@bu3sch.de> 5 * Copyright (C) 2005 Martin Langer <martin-langer@gmx.de> 6 * Copyright (C) 2005 Stefano Brivio <st3@riseup.net> 7 * Copyright (C) 2005 Danny van Dyk <kugelfang@gentoo.org> 8 * Copyright (C) 2005 Andreas Jaggi <andreas.jaggi@waterwave.ch> --- 558 unchanged lines hidden (view full) --- 567} 568#else /* DEBUG */ 569static inline int ssb_pci_assert_buspower(struct ssb_bus *bus) 570{ 571 return 0; 572} 573#endif /* DEBUG */ 574 | 1/* 2 * Sonics Silicon Backplane PCI-Hostbus related functions. 3 * 4 * Copyright (C) 2005-2006 Michael Buesch <mb@bu3sch.de> 5 * Copyright (C) 2005 Martin Langer <martin-langer@gmx.de> 6 * Copyright (C) 2005 Stefano Brivio <st3@riseup.net> 7 * Copyright (C) 2005 Danny van Dyk <kugelfang@gentoo.org> 8 * Copyright (C) 2005 Andreas Jaggi <andreas.jaggi@waterwave.ch> --- 558 unchanged lines hidden (view full) --- 567} 568#else /* DEBUG */ 569static inline int ssb_pci_assert_buspower(struct ssb_bus *bus) 570{ 571 return 0; 572} 573#endif /* DEBUG */ 574 |
575static u8 ssb_pci_read8(struct ssb_device *dev, u16 offset) 576{ 577 struct ssb_bus *bus = dev->bus; 578 579 if (unlikely(ssb_pci_assert_buspower(bus))) 580 return 0xFF; 581 if (unlikely(bus->mapped_device != dev)) { 582 if (unlikely(ssb_pci_switch_core(bus, dev))) 583 return 0xFF; 584 } 585 return ioread8(bus->mmio + offset); 586} 587 |
|
575static u16 ssb_pci_read16(struct ssb_device *dev, u16 offset) 576{ 577 struct ssb_bus *bus = dev->bus; 578 579 if (unlikely(ssb_pci_assert_buspower(bus))) 580 return 0xFFFF; 581 if (unlikely(bus->mapped_device != dev)) { 582 if (unlikely(ssb_pci_switch_core(bus, dev))) --- 10 unchanged lines hidden (view full) --- 593 return 0xFFFFFFFF; 594 if (unlikely(bus->mapped_device != dev)) { 595 if (unlikely(ssb_pci_switch_core(bus, dev))) 596 return 0xFFFFFFFF; 597 } 598 return ioread32(bus->mmio + offset); 599} 600 | 588static u16 ssb_pci_read16(struct ssb_device *dev, u16 offset) 589{ 590 struct ssb_bus *bus = dev->bus; 591 592 if (unlikely(ssb_pci_assert_buspower(bus))) 593 return 0xFFFF; 594 if (unlikely(bus->mapped_device != dev)) { 595 if (unlikely(ssb_pci_switch_core(bus, dev))) --- 10 unchanged lines hidden (view full) --- 606 return 0xFFFFFFFF; 607 if (unlikely(bus->mapped_device != dev)) { 608 if (unlikely(ssb_pci_switch_core(bus, dev))) 609 return 0xFFFFFFFF; 610 } 611 return ioread32(bus->mmio + offset); 612} 613 |
614static void ssb_pci_write8(struct ssb_device *dev, u16 offset, u8 value) 615{ 616 struct ssb_bus *bus = dev->bus; 617 618 if (unlikely(ssb_pci_assert_buspower(bus))) 619 return; 620 if (unlikely(bus->mapped_device != dev)) { 621 if (unlikely(ssb_pci_switch_core(bus, dev))) 622 return; 623 } 624 iowrite8(value, bus->mmio + offset); 625} 626 |
|
601static void ssb_pci_write16(struct ssb_device *dev, u16 offset, u16 value) 602{ 603 struct ssb_bus *bus = dev->bus; 604 605 if (unlikely(ssb_pci_assert_buspower(bus))) 606 return; 607 if (unlikely(bus->mapped_device != dev)) { 608 if (unlikely(ssb_pci_switch_core(bus, dev))) --- 12 unchanged lines hidden (view full) --- 621 if (unlikely(ssb_pci_switch_core(bus, dev))) 622 return; 623 } 624 iowrite32(value, bus->mmio + offset); 625} 626 627/* Not "static", as it's used in main.c */ 628const struct ssb_bus_ops ssb_pci_ops = { | 627static void ssb_pci_write16(struct ssb_device *dev, u16 offset, u16 value) 628{ 629 struct ssb_bus *bus = dev->bus; 630 631 if (unlikely(ssb_pci_assert_buspower(bus))) 632 return; 633 if (unlikely(bus->mapped_device != dev)) { 634 if (unlikely(ssb_pci_switch_core(bus, dev))) --- 12 unchanged lines hidden (view full) --- 647 if (unlikely(ssb_pci_switch_core(bus, dev))) 648 return; 649 } 650 iowrite32(value, bus->mmio + offset); 651} 652 653/* Not "static", as it's used in main.c */ 654const struct ssb_bus_ops ssb_pci_ops = { |
655 .read8 = ssb_pci_read8, |
|
629 .read16 = ssb_pci_read16, 630 .read32 = ssb_pci_read32, | 656 .read16 = ssb_pci_read16, 657 .read32 = ssb_pci_read32, |
658 .write8 = ssb_pci_write8, |
|
631 .write16 = ssb_pci_write16, 632 .write32 = ssb_pci_write32, 633}; 634 635static int sprom2hex(const u16 *sprom, char *buf, size_t buf_len, u16 size) 636{ 637 int i, pos = 0; 638 --- 152 unchanged lines hidden --- | 659 .write16 = ssb_pci_write16, 660 .write32 = ssb_pci_write32, 661}; 662 663static int sprom2hex(const u16 *sprom, char *buf, size_t buf_len, u16 size) 664{ 665 int i, pos = 0; 666 --- 152 unchanged lines hidden --- |