@@ -210,15 +210,21 @@ static int parse_discovery_table(struct pci_dev *dev, int die,
210
210
void __iomem * io_addr ;
211
211
resource_size_t addr ;
212
212
unsigned long size ;
213
- u32 val ;
213
+ u32 val , val2 ;
214
214
int i ;
215
215
216
216
pci_read_config_dword (dev , bar_offset , & val );
217
217
218
- if (val & UNCORE_DISCOVERY_MASK )
218
+ if (val & ~ PCI_BASE_ADDRESS_MEM_MASK & ~ PCI_BASE_ADDRESS_MEM_TYPE_64 )
219
219
return - EINVAL ;
220
220
221
- addr = (resource_size_t )(val & ~UNCORE_DISCOVERY_MASK );
221
+ addr = (resource_size_t )(val & PCI_BASE_ADDRESS_MEM_MASK );
222
+ #ifdef CONFIG_PHYS_ADDR_T_64BIT
223
+ if ((val & PCI_BASE_ADDRESS_MEM_TYPE_MASK ) == PCI_BASE_ADDRESS_MEM_TYPE_64 ) {
224
+ pci_read_config_dword (dev , bar_offset + 4 , & val2 );
225
+ addr |= ((resource_size_t )val2 ) << 32 ;
226
+ }
227
+ #endif
222
228
size = UNCORE_DISCOVERY_GLOBAL_MAP_SIZE ;
223
229
io_addr = ioremap (addr , size );
224
230
if (!io_addr )
@@ -444,7 +450,7 @@ static struct intel_uncore_ops generic_uncore_pci_ops = {
444
450
445
451
#define UNCORE_GENERIC_MMIO_SIZE 0x4000
446
452
447
- static unsigned int generic_uncore_mmio_box_ctl (struct intel_uncore_box * box )
453
+ static u64 generic_uncore_mmio_box_ctl (struct intel_uncore_box * box )
448
454
{
449
455
struct intel_uncore_type * type = box -> pmu -> type ;
450
456
@@ -456,7 +462,7 @@ static unsigned int generic_uncore_mmio_box_ctl(struct intel_uncore_box *box)
456
462
457
463
void intel_generic_uncore_mmio_init_box (struct intel_uncore_box * box )
458
464
{
459
- unsigned int box_ctl = generic_uncore_mmio_box_ctl (box );
465
+ u64 box_ctl = generic_uncore_mmio_box_ctl (box );
460
466
struct intel_uncore_type * type = box -> pmu -> type ;
461
467
resource_size_t addr ;
462
468
0 commit comments