mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
MIPS: mips-cm: Check availability of config registers
Prevent reading unsupported config register during probing process. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
parent
aa45787c0d
commit
e1aa1dfef6
1 changed files with 7 additions and 2 deletions
|
@ -181,11 +181,16 @@ static DEFINE_PER_CPU_ALIGNED(unsigned long, cm_core_lock_flags);
|
|||
|
||||
phys_addr_t __mips_cm_phys_base(void)
|
||||
{
|
||||
u32 config3 = read_c0_config3();
|
||||
unsigned long cmgcr;
|
||||
|
||||
/* Check the CMGCRBase register is implemented */
|
||||
if (!(config3 & MIPS_CONF3_CMGCR))
|
||||
if (!(read_c0_config() & MIPS_CONF_M))
|
||||
return 0;
|
||||
|
||||
if (!(read_c0_config2() & MIPS_CONF_M))
|
||||
return 0;
|
||||
|
||||
if (!(read_c0_config3() & MIPS_CONF3_CMGCR))
|
||||
return 0;
|
||||
|
||||
/* Read the address from CMGCRBase */
|
||||
|
|
Loading…
Reference in a new issue