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
c4b9856b
Commit
c4b9856b
authored
Sep 25, 2014
by
Vineet Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARC: boot: consolidate cross-checking of h/w and s/w
Signed-off-by:
Vineet Gupta
<
vgupta@synopsys.com
>
parent
52e9bae9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
29 deletions
+15
-29
arch/arc/kernel/setup.c
arch/arc/kernel/setup.c
+15
-29
No files found.
arch/arc/kernel/setup.c
View file @
c4b9856b
...
...
@@ -236,10 +236,10 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
return
buf
;
}
static
void
arc_chk_c
cms
(
void
)
static
void
arc_chk_c
ore_config
(
void
)
{
#if defined(CONFIG_ARC_HAS_DCCM) || defined(CONFIG_ARC_HAS_ICCM)
struct
cpuinfo_arc
*
cpu
=
&
cpuinfo_arc700
[
smp_processor_id
()];
int
fpu_enabled
;
#ifdef CONFIG_ARC_HAS_DCCM
/*
...
...
@@ -257,33 +257,20 @@ static void arc_chk_ccms(void)
if
(
CONFIG_ARC_ICCM_SZ
!=
cpu
->
iccm
.
sz
)
panic
(
"Linux built with incorrect ICCM Size
\n
"
);
#endif
#endif
}
/*
* Ensure that FP hardware and kernel config match
* -If hardware contains DPFP, kernel needs to save/restore FPU state
* across context switches
* -If hardware lacks DPFP, but kernel configured to save FPU state then
* kernel trying to access non-existant DPFP regs will crash
*
* We only check for Dbl precision Floating Point, because only DPFP
* hardware has dedicated regs which need to be saved/restored on ctx-sw
* (Single Precision uses core regs), thus kernel is kind of oblivious to it
*/
static
void
arc_chk_fpu
(
void
)
{
struct
cpuinfo_arc
*
cpu
=
&
cpuinfo_arc700
[
smp_processor_id
()];
/*
* FP hardware/software config sanity
* -If hardware contains DPFP, kernel needs to save/restore FPU state
* -If not, it will crash trying to save/restore the non-existant regs
*
* (only DPDP checked since SP has no arch visible regs)
*/
fpu_enabled
=
IS_ENABLED
(
CONFIG_ARC_FPU_SAVE_RESTORE
);
if
(
cpu
->
dpfp
.
ver
)
{
#ifndef CONFIG_ARC_FPU_SAVE_RESTORE
pr_warn
(
"DPFP support broken in this kernel...
\n
"
);
#endif
}
else
{
#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
panic
(
"H/w lacks DPFP support, apps won't work
\n
"
);
#endif
}
if
(
cpu
->
dpfp
.
ver
&&
!
fpu_enabled
)
pr_warn
(
"CONFIG_ARC_FPU_SAVE_RESTORE needed for working apps
\n
"
);
else
if
(
!
cpu
->
dpfp
.
ver
&&
fpu_enabled
)
panic
(
"FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE
\n
"
);
}
/*
...
...
@@ -304,12 +291,11 @@ void setup_processor(void)
arc_mmu_init
();
arc_cache_init
();
arc_chk_ccms
();
printk
(
arc_extn_mumbojumbo
(
cpu_id
,
str
,
sizeof
(
str
)));
printk
(
arc_platform_smp_cpuinfo
());
arc_chk_
fpu
();
arc_chk_
core_config
();
}
static
inline
int
is_kernel
(
unsigned
long
addr
)
...
...
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