Commit bc05aa6e authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Rich Felker

arch/sh: add sh7786_mm_sel() function

The SH7786 has different physical memory layout configurations,
configurable through the MMSELR register. The configuration is
typically defined by the bootloader, so Linux generally doesn't care.

Except that depending on the configuration, some PCI MEM areas may or
may not be available. This commit adds a helper function that allows
to retrieve the current physical memory layout configuration. It will
be used in a following patch to exclude unusable PCI MEM areas during
the PCI initialization.
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarRich Felker <dalias@libc.org>
parent 96a59899
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#ifndef __CPU_SH7786_H__ #ifndef __CPU_SH7786_H__
#define __CPU_SH7786_H__ #define __CPU_SH7786_H__
#include <linux/io.h>
enum { enum {
/* PA */ /* PA */
GPIO_PA7, GPIO_PA6, GPIO_PA5, GPIO_PA4, GPIO_PA7, GPIO_PA6, GPIO_PA5, GPIO_PA4,
...@@ -131,4 +133,9 @@ enum { ...@@ -131,4 +133,9 @@ enum {
GPIO_FN_IRL7, GPIO_FN_IRL6, GPIO_FN_IRL5, GPIO_FN_IRL4, GPIO_FN_IRL7, GPIO_FN_IRL6, GPIO_FN_IRL5, GPIO_FN_IRL4,
}; };
static inline u32 sh7786_mm_sel(void)
{
return __raw_readl(0xFC400020) & 0x7;
}
#endif /* __CPU_SH7786_H__ */ #endif /* __CPU_SH7786_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment