diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2020-11-27 18:35:05 +0530 |
---|---|---|
committer | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2020-12-15 13:18:06 +0530 |
commit | 6236804f35b0c04f3687e7ff39211a2b8f247535 (patch) | |
tree | ae815afdd0282ddd604c8610427a1601a5b54111 | |
parent | e12574f5cc637421ac409653532a2778615a2803 (diff) | |
download | skiboot-6236804f35b0c04f3687e7ff39211a2b8f247535.zip skiboot-6236804f35b0c04f3687e7ff39211a2b8f247535.tar.gz skiboot-6236804f35b0c04f3687e7ff39211a2b8f247535.tar.bz2 |
hw/ocmb: Clear top bit from offset before searching addr range
Looks like HBRT sets top bit in pcbaddress before making OCMB SCOM request.
We have to clear that bit so that we can find proper address range
for SCOM operation.
Sample failure:
[ 2578.156011925,3] OCMB: no matching address range!
[ 2578.156044481,3] scom_read: to 80000028 off: 8006430d4008c000 rc = -26
Also move HRMOR_BIT macro to common include file (hdata/spira.h -> skiboot.h).
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r-- | hdata/spira.h | 6 | ||||
-rw-r--r-- | hw/ocmb.c | 3 | ||||
-rw-r--r-- | include/skiboot.h | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/hdata/spira.h b/hdata/spira.h index 2b2955f..18d73bd 100644 --- a/hdata/spira.h +++ b/hdata/spira.h @@ -7,12 +7,6 @@ #include "hdif.h" /* - * To help the FSP to distinguish between physical address and TCE mapped address. - * Also to help hostboot to distinguish physical and relative address. - */ -#define HRMOR_BIT (1ul << 63) - -/* * The SPIRA structure * * NOTE: This is one of the only HDIF structure that we layout entirely @@ -35,12 +35,13 @@ struct ocmb { static const struct ocmb_range *find_range(const struct ocmb *o, uint64_t offset) { int i; + uint64_t addr = offset & ~(HRMOR_BIT); for (i = 0; i < o->range_count; i++) { uint64_t start = o->ranges[i].start; uint64_t end = o->ranges[i].end; - if (offset >= start && offset <= end) + if (addr >= start && addr <= end) return &o->ranges[i]; } diff --git a/include/skiboot.h b/include/skiboot.h index 7b71ebd..d33c025 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -143,6 +143,12 @@ static inline bool is_pow2(unsigned long val) #define PCI_DEV(bdfn) (((bdfn) >> 3) & 0x1f) #define PCI_FUNC(bdfn) ((bdfn) & 0x07) +/* + * To help the FSP to distinguish between physical address and TCE mapped address. + * Also to help hostboot to distinguish physical and relative address. + */ +#define HRMOR_BIT (1ul << 63) + /* Clean the stray high bit which the FSP inserts: we only have 52 bits real */ static inline u64 cleanup_addr(u64 addr) { |