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
nexedi
linux
Commits
8b0a9c34
Commit
8b0a9c34
authored
Mar 24, 2003
by
Ivan Kokshaysky
Committed by
Richard Henderson
Mar 24, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] alpha: nautilus_init_pci() cleanup
parent
8d09b87b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
23 deletions
+17
-23
arch/alpha/kernel/sys_nautilus.c
arch/alpha/kernel/sys_nautilus.c
+17
-23
No files found.
arch/alpha/kernel/sys_nautilus.c
View file @
8b0a9c34
...
@@ -183,14 +183,17 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr,
...
@@ -183,14 +183,17 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr,
extern
void
free_reserved_mem
(
void
*
,
void
*
);
extern
void
free_reserved_mem
(
void
*
,
void
*
);
static
struct
resource
irongate_mem
=
{
.
name
=
"Irongate PCI MEM"
,
.
flags
=
IORESOURCE_MEM
,
};
void
__init
void
__init
nautilus_init_pci
(
void
)
nautilus_init_pci
(
void
)
{
{
struct
pci_controller
*
hose
=
hose_head
;
struct
pci_controller
*
hose
=
hose_head
;
struct
pci_bus
*
bus
;
struct
pci_bus
*
bus
;
struct
pci_dev
*
irongate
;
struct
pci_dev
*
irongate
;
unsigned
long
saved_io_start
,
saved_io_end
;
unsigned
long
saved_mem_start
,
saved_mem_end
;
unsigned
long
bus_align
,
bus_size
,
pci_mem
;
unsigned
long
bus_align
,
bus_size
,
pci_mem
;
unsigned
long
memtop
=
max_low_pfn
<<
PAGE_SHIFT
;
unsigned
long
memtop
=
max_low_pfn
<<
PAGE_SHIFT
;
...
@@ -199,50 +202,41 @@ nautilus_init_pci(void)
...
@@ -199,50 +202,41 @@ nautilus_init_pci(void)
hose
->
bus
=
bus
;
hose
->
bus
=
bus
;
hose
->
last_busno
=
bus
->
subordinate
;
hose
->
last_busno
=
bus
->
subordinate
;
/* We're going to size the root bus, so we must
- have a non-NULL PCI device associated with the bus
- preserve hose resources. */
irongate
=
pci_find_slot
(
0
,
0
);
irongate
=
pci_find_slot
(
0
,
0
);
bus
->
self
=
irongate
;
bus
->
self
=
irongate
;
saved_io_start
=
bus
->
resource
[
0
]
->
start
;
bus
->
resource
[
1
]
=
&
irongate_mem
;
saved_io_end
=
bus
->
resource
[
0
]
->
end
;
saved_mem_start
=
bus
->
resource
[
1
]
->
start
;
saved_mem_end
=
bus
->
resource
[
1
]
->
end
;
pci_bus_size_bridges
(
bus
);
pci_bus_size_bridges
(
bus
);
/*
Don't care about IO
. */
/*
IO port range
. */
bus
->
resource
[
0
]
->
start
=
saved_io_start
;
bus
->
resource
[
0
]
->
start
=
0
;
bus
->
resource
[
0
]
->
end
=
saved_io_end
;
bus
->
resource
[
0
]
->
end
=
0xffff
;
/* Set up PCI memory range - limit is hardwired to 0xffffffff,
base must be at aligned to 16Mb. */
bus_align
=
bus
->
resource
[
1
]
->
start
;
bus_align
=
bus
->
resource
[
1
]
->
start
;
bus_size
=
bus
->
resource
[
1
]
->
end
+
1
-
bus_align
;
bus_size
=
bus
->
resource
[
1
]
->
end
+
1
-
bus_align
;
/* Align to 16Mb. */
if
(
bus_align
<
0x1000000UL
)
if
(
bus_align
<
0x1000000UL
)
bus_align
=
0x1000000UL
;
bus_align
=
0x1000000UL
;
/* Restore hose MEM resource. */
bus
->
resource
[
1
]
->
start
=
saved_mem_start
;
bus
->
resource
[
1
]
->
end
=
saved_mem_end
;
pci_mem
=
(
0x100000000UL
-
bus_size
)
&
-
bus_align
;
pci_mem
=
(
0x100000000UL
-
bus_size
)
&
-
bus_align
;
bus
->
resource
[
1
]
->
start
=
pci_mem
;
bus
->
resource
[
1
]
->
end
=
0xffffffffUL
;
if
(
request_resource
(
&
iomem_resource
,
bus
->
resource
[
1
])
<
0
)
printk
(
KERN_ERR
"Failed to request MEM on hose 0
\n
"
);
if
(
pci_mem
<
memtop
&&
pci_mem
>
alpha_mv
.
min_mem_address
)
{
if
(
pci_mem
<
memtop
&&
pci_mem
>
alpha_mv
.
min_mem_address
)
{
free_reserved_mem
(
__va
(
alpha_mv
.
min_mem_address
),
free_reserved_mem
(
__va
(
alpha_mv
.
min_mem_address
),
__va
(
pci_mem
));
__va
(
pci_mem
));
printk
(
"nautilus_init_
arch
: %ldk freed
\n
"
,
printk
(
"nautilus_init_
pci
: %ldk freed
\n
"
,
(
pci_mem
-
alpha_mv
.
min_mem_address
)
>>
10
);
(
pci_mem
-
alpha_mv
.
min_mem_address
)
>>
10
);
}
}
alpha_mv
.
min_mem_address
=
pci_mem
;
if
((
IRONGATE0
->
dev_vendor
>>
16
)
>
0x7006
)
/* Albacore? */
if
((
IRONGATE0
->
dev_vendor
>>
16
)
>
0x7006
)
/* Albacore? */
IRONGATE0
->
pci_mem
=
pci_mem
;
IRONGATE0
->
pci_mem
=
pci_mem
;
pci_bus_assign_resources
(
bus
);
pci_bus_assign_resources
(
bus
);
/* To break the loop in common_swizzle() */
bus
->
self
=
NULL
;
pci_fixup_irqs
(
alpha_mv
.
pci_swizzle
,
alpha_mv
.
pci_map_irq
);
pci_fixup_irqs
(
alpha_mv
.
pci_swizzle
,
alpha_mv
.
pci_map_irq
);
}
}
...
...
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