Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a59f2bba
Commit
a59f2bba
authored
Aug 18, 2008
by
Jesse Barnes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'x86-merge' into for-linus
parents
056c58e8
ce675423
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
17 deletions
+86
-17
arch/x86/pci/mmconfig-shared.c
arch/x86/pci/mmconfig-shared.c
+48
-17
drivers/pci/probe.c
drivers/pci/probe.c
+3
-0
drivers/pci/setup-bus.c
drivers/pci/setup-bus.c
+35
-0
No files found.
arch/x86/pci/mmconfig-shared.c
View file @
a59f2bba
...
...
@@ -293,7 +293,7 @@ static acpi_status __init find_mboard_resource(acpi_handle handle, u32 lvl,
return
AE_OK
;
}
static
int
__init
is_acpi_reserved
(
u
nsigned
long
start
,
unsigned
long
en
d
)
static
int
__init
is_acpi_reserved
(
u
64
start
,
u64
end
,
unsigned
not_use
d
)
{
struct
resource
mcfg_res
;
...
...
@@ -310,6 +310,41 @@ static int __init is_acpi_reserved(unsigned long start, unsigned long end)
return
mcfg_res
.
flags
;
}
typedef
int
(
*
check_reserved_t
)(
u64
start
,
u64
end
,
unsigned
type
);
static
int
__init
is_mmconf_reserved
(
check_reserved_t
is_reserved
,
u64
addr
,
u64
size
,
int
i
,
typeof
(
pci_mmcfg_config
[
0
])
*
cfg
,
int
with_e820
)
{
u64
old_size
=
size
;
int
valid
=
0
;
while
(
!
is_reserved
(
addr
,
addr
+
size
-
1
,
E820_RESERVED
))
{
size
>>=
1
;
if
(
size
<
(
16UL
<<
20
))
break
;
}
if
(
size
>=
(
16UL
<<
20
)
||
size
==
old_size
)
{
printk
(
KERN_NOTICE
"PCI: MCFG area at %Lx reserved in %s
\n
"
,
addr
,
with_e820
?
"E820"
:
"ACPI motherboard resources"
);
valid
=
1
;
if
(
old_size
!=
size
)
{
/* update end_bus_number */
cfg
->
end_bus_number
=
cfg
->
start_bus_number
+
((
size
>>
20
)
-
1
);
printk
(
KERN_NOTICE
"PCI: updated MCFG configuration %d: base %lx "
"segment %hu buses %u - %u
\n
"
,
i
,
(
unsigned
long
)
cfg
->
address
,
cfg
->
pci_segment
,
(
unsigned
int
)
cfg
->
start_bus_number
,
(
unsigned
int
)
cfg
->
end_bus_number
);
}
}
return
valid
;
}
static
void
__init
pci_mmcfg_reject_broken
(
int
early
)
{
typeof
(
pci_mmcfg_config
[
0
])
*
cfg
;
...
...
@@ -324,21 +359,22 @@ static void __init pci_mmcfg_reject_broken(int early)
for
(
i
=
0
;
i
<
pci_mmcfg_config_num
;
i
++
)
{
int
valid
=
0
;
u32
size
=
(
cfg
->
end_bus_number
+
1
)
<<
20
;
u64
addr
,
size
;
cfg
=
&
pci_mmcfg_config
[
i
];
addr
=
cfg
->
start_bus_number
;
addr
<<=
20
;
addr
+=
cfg
->
address
;
size
=
cfg
->
end_bus_number
+
1
-
cfg
->
start_bus_number
;
size
<<=
20
;
printk
(
KERN_NOTICE
"PCI: MCFG configuration %d: base %lx "
"segment %hu buses %u - %u
\n
"
,
i
,
(
unsigned
long
)
cfg
->
address
,
cfg
->
pci_segment
,
(
unsigned
int
)
cfg
->
start_bus_number
,
(
unsigned
int
)
cfg
->
end_bus_number
);
if
(
!
early
&&
is_acpi_reserved
(
cfg
->
address
,
cfg
->
address
+
size
-
1
))
{
printk
(
KERN_NOTICE
"PCI: MCFG area at %Lx reserved "
"in ACPI motherboard resources
\n
"
,
cfg
->
address
);
valid
=
1
;
}
if
(
!
early
)
valid
=
is_mmconf_reserved
(
is_acpi_reserved
,
addr
,
size
,
i
,
cfg
,
0
);
if
(
valid
)
continue
;
...
...
@@ -347,16 +383,11 @@ static void __init pci_mmcfg_reject_broken(int early)
printk
(
KERN_ERR
"PCI: BIOS Bug: MCFG area at %Lx is not"
" reserved in ACPI motherboard resources
\n
"
,
cfg
->
address
);
/* Don't try to do this check unless configuration
type 1 is available. how about type 2 ?*/
if
(
raw_pci_ops
&&
e820_all_mapped
(
cfg
->
address
,
cfg
->
address
+
size
-
1
,
E820_RESERVED
))
{
printk
(
KERN_NOTICE
"PCI: MCFG area at %Lx reserved in E820
\n
"
,
cfg
->
address
);
valid
=
1
;
}
if
(
raw_pci_ops
)
valid
=
is_mmconf_reserved
(
e820_all_mapped
,
addr
,
size
,
i
,
cfg
,
1
);
if
(
!
valid
)
goto
reject
;
...
...
drivers/pci/probe.c
View file @
a59f2bba
...
...
@@ -383,6 +383,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
res
->
start
=
base
;
if
(
!
res
->
end
)
res
->
end
=
limit
+
0xfff
;
printk
(
KERN_INFO
"PCI: bridge %s io port: [%llx, %llx]
\n
"
,
pci_name
(
dev
),
res
->
start
,
res
->
end
);
}
res
=
child
->
resource
[
1
];
...
...
@@ -394,6 +395,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
res
->
flags
=
(
mem_base_lo
&
PCI_MEMORY_RANGE_TYPE_MASK
)
|
IORESOURCE_MEM
;
res
->
start
=
base
;
res
->
end
=
limit
+
0xfffff
;
printk
(
KERN_INFO
"PCI: bridge %s 32bit mmio: [%llx, %llx]
\n
"
,
pci_name
(
dev
),
res
->
start
,
res
->
end
);
}
res
=
child
->
resource
[
2
];
...
...
@@ -429,6 +431,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
res
->
flags
=
(
mem_base_lo
&
PCI_MEMORY_RANGE_TYPE_MASK
)
|
IORESOURCE_MEM
|
IORESOURCE_PREFETCH
;
res
->
start
=
base
;
res
->
end
=
limit
+
0xfffff
;
printk
(
KERN_INFO
"PCI: bridge %s %sbit mmio pref: [%llx, %llx]
\n
"
,
pci_name
(
dev
),
(
res
->
flags
&
PCI_PREF_RANGE_TYPE_64
)
?
"64"
:
"32"
,
res
->
start
,
res
->
end
);
}
}
...
...
drivers/pci/setup-bus.c
View file @
a59f2bba
...
...
@@ -530,6 +530,36 @@ void __ref pci_bus_assign_resources(struct pci_bus *bus)
}
EXPORT_SYMBOL
(
pci_bus_assign_resources
);
static
void
pci_bus_dump_res
(
struct
pci_bus
*
bus
)
{
int
i
;
for
(
i
=
0
;
i
<
PCI_BUS_NUM_RESOURCES
;
i
++
)
{
struct
resource
*
res
=
bus
->
resource
[
i
];
if
(
!
res
)
continue
;
printk
(
KERN_INFO
"bus: %02x index %x %s: [%llx, %llx]
\n
"
,
bus
->
number
,
i
,
(
res
->
flags
&
IORESOURCE_IO
)
?
"io port"
:
"mmio"
,
res
->
start
,
res
->
end
);
}
}
static
void
pci_bus_dump_resources
(
struct
pci_bus
*
bus
)
{
struct
pci_bus
*
b
;
struct
pci_dev
*
dev
;
pci_bus_dump_res
(
bus
);
list_for_each_entry
(
dev
,
&
bus
->
devices
,
bus_list
)
{
b
=
dev
->
subordinate
;
if
(
!
b
)
continue
;
pci_bus_dump_resources
(
b
);
}
}
void
__init
pci_assign_unassigned_resources
(
void
)
{
...
...
@@ -545,4 +575,9 @@ pci_assign_unassigned_resources(void)
pci_bus_assign_resources
(
bus
);
pci_enable_bridges
(
bus
);
}
/* dump the resource on buses */
list_for_each_entry
(
bus
,
&
pci_root_buses
,
node
)
{
pci_bus_dump_resources
(
bus
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment