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
52120ad0
Commit
52120ad0
authored
Oct 19, 2002
by
Tom Rini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: improve the memory size detection for PReP machines.
parent
fd0e8f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
arch/ppc/boot/prep/misc.c
arch/ppc/boot/prep/misc.c
+23
-5
No files found.
arch/ppc/boot/prep/misc.c
View file @
52120ad0
...
...
@@ -132,11 +132,6 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
vga_init
((
unsigned
char
*
)
0xC0000000
);
#endif
/* CONFIG_VGA_CONSOLE */
/*
* Find out how much memory we have.
*/
TotalMemory
=
get_mem_size
();
/*
* Tell the user where we were loaded at and where we were relocated
* to for debugging this process.
...
...
@@ -215,6 +210,29 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
puts
(
"No residual data found.
\n
"
);
}
/* First, figure out what kind of host bridge we are on. If it's
* an MPC10x, we can ask it directly how much memory it has.
* Otherwise, see if the residual data has anything. This isn't
* the best way, but it can be the only way. If there's nothing,
* assume 32MB. -- Tom.
*/
/* See what our host bridge is. */
pci_read_config_32
(
0x00
,
0x00
,
&
pci_viddid
);
pci_did
=
(
pci_viddid
&
0xffff0000
)
>>
16
;
/* See if we are on an MPC10x. */
if
(((
pci_viddid
&
0xffff
)
==
PCI_VENDOR_ID_MOTOROLA
)
&&
((
pci_did
==
PCI_DEVICE_ID_MOTOROLA_MPC105
)
||
(
pci_did
==
PCI_DEVICE_ID_MOTOROLA_MPC106
)
||
(
pci_did
==
PCI_DEVICE_ID_MOTOROLA_MPC107
)))
TotalMemory
=
get_mem_size
();
/* If it's not, see if we have anything in the residual data. */
else
if
(
residual
&&
residual
->
TotalMemory
)
TotalMemory
=
residual
->
TotalMemory
;
/* Fall back to hard-coding 32MB. */
else
TotalMemory
=
32
*
1024
*
1024
;
/* assume the chunk below 8M is free */
end_avail
=
(
char
*
)
0x00800000
;
...
...
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