diff options
| author | Rafał Miłecki <zajec5@gmail.com> | 2016-01-19 02:45:26 -0500 |
|---|---|---|
| committer | Kalle Valo <kvalo@codeaurora.org> | 2016-02-06 06:36:11 -0500 |
| commit | b3c47afbf54d86daa0473895e8ca9e8b663f5c1a (patch) | |
| tree | 026a844f184d844c53855df61c614aa59ae9950e /include/linux/bcma | |
| parent | 67edf354faaf93156646e741483b2313bc756c0f (diff) | |
bcma: support PMU present as separated bus core
On recent Broadcom chipsets PMU is present as separated core and it
can't be accessed using ChipCommon anymore as it fails with e.g.:
[ 0.000577] Unhandled fault: external abort on non-linefetch (0x1008) at 0xf1000604
Solve it by using a new (PMU) core pointer set to ChipCommon or PMU
depending on the hardware capabilities.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'include/linux/bcma')
| -rw-r--r-- | include/linux/bcma/bcma_driver_chipcommon.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 96d8d56f240f..700d0c6f7480 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -217,6 +217,11 @@ | |||
| 217 | #define BCMA_CC_CLKDIV_JTAG_SHIFT 8 | 217 | #define BCMA_CC_CLKDIV_JTAG_SHIFT 8 |
| 218 | #define BCMA_CC_CLKDIV_UART 0x000000FF | 218 | #define BCMA_CC_CLKDIV_UART 0x000000FF |
| 219 | #define BCMA_CC_CAP_EXT 0x00AC /* Capabilities */ | 219 | #define BCMA_CC_CAP_EXT 0x00AC /* Capabilities */ |
| 220 | #define BCMA_CC_CAP_EXT_SECI_PRESENT 0x00000001 | ||
| 221 | #define BCMA_CC_CAP_EXT_GSIO_PRESENT 0x00000002 | ||
| 222 | #define BCMA_CC_CAP_EXT_GCI_PRESENT 0x00000004 | ||
| 223 | #define BCMA_CC_CAP_EXT_SECI_PUART_PRESENT 0x00000008 /* UART present */ | ||
| 224 | #define BCMA_CC_CAP_EXT_AOB_PRESENT 0x00000040 | ||
| 220 | #define BCMA_CC_PLLONDELAY 0x00B0 /* Rev >= 4 only */ | 225 | #define BCMA_CC_PLLONDELAY 0x00B0 /* Rev >= 4 only */ |
| 221 | #define BCMA_CC_FREFSELDELAY 0x00B4 /* Rev >= 4 only */ | 226 | #define BCMA_CC_FREFSELDELAY 0x00B4 /* Rev >= 4 only */ |
| 222 | #define BCMA_CC_SLOWCLKCTL 0x00B8 /* 6 <= Rev <= 9 only */ | 227 | #define BCMA_CC_SLOWCLKCTL 0x00B8 /* 6 <= Rev <= 9 only */ |
| @@ -566,6 +571,7 @@ | |||
| 566 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | 571 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) |
| 567 | */ | 572 | */ |
| 568 | struct bcma_chipcommon_pmu { | 573 | struct bcma_chipcommon_pmu { |
| 574 | struct bcma_device *core; /* Can be separated core or just ChipCommon one */ | ||
| 569 | u8 rev; /* PMU revision */ | 575 | u8 rev; /* PMU revision */ |
| 570 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ | 576 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ |
| 571 | }; | 577 | }; |
| @@ -660,6 +666,19 @@ struct bcma_drv_cc_b { | |||
| 660 | #define bcma_cc_maskset32(cc, offset, mask, set) \ | 666 | #define bcma_cc_maskset32(cc, offset, mask, set) \ |
| 661 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) | 667 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) |
| 662 | 668 | ||
| 669 | /* PMU registers access */ | ||
| 670 | #define bcma_pmu_read32(cc, offset) \ | ||
| 671 | bcma_read32((cc)->pmu.core, offset) | ||
| 672 | #define bcma_pmu_write32(cc, offset, val) \ | ||
| 673 | bcma_write32((cc)->pmu.core, offset, val) | ||
| 674 | |||
| 675 | #define bcma_pmu_mask32(cc, offset, mask) \ | ||
| 676 | bcma_pmu_write32(cc, offset, bcma_pmu_read32(cc, offset) & (mask)) | ||
| 677 | #define bcma_pmu_set32(cc, offset, set) \ | ||
| 678 | bcma_pmu_write32(cc, offset, bcma_pmu_read32(cc, offset) | (set)) | ||
| 679 | #define bcma_pmu_maskset32(cc, offset, mask, set) \ | ||
| 680 | bcma_pmu_write32(cc, offset, (bcma_pmu_read32(cc, offset) & (mask)) | (set)) | ||
| 681 | |||
| 663 | extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks); | 682 | extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks); |
| 664 | 683 | ||
| 665 | extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc); | 684 | extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc); |
