[RFC PATCHv1 1/7] ARM: extend machine_desc with additional flags

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed May 14 08:50:35 PDT 2014

Processors implementing hardware I/O coherency rely on certain
SMP-related features to be enabled even on UP configurations: the
write allocate cache policy or the shareable attribute. These
decisions are made very early by the ARM core code, in
build_mem_type_table(), even before the machine specific
->init_early() function has been called.

In order to allow these machines to tell the ARM core code about these
specificities, while still preserving multiplatform support, this
commit extends the machine_desc structure with an additional 'flags'
field, and defines two flags: one that allows the machine to tell the
ARM core code that the cache policy should be write allocate, and
another that tells the ARM core code that the shareable attribute
should be set on page tables.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
 arch/arm/include/asm/mach/arch.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 17a3fa2..f2a9b39 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -25,6 +25,10 @@ struct smp_operations;
 #define smp_init_ops(ops) (bool (*)(void))NULL
+/* Possible flags in struct machine_desc */
 struct machine_desc {
 	unsigned int		nr;		/* architecture number	*/
 	const char		*name;		/* architecture name	*/
@@ -46,6 +50,7 @@ struct machine_desc {
 	unsigned char		reserve_lp2 :1;	/* never has lp2	*/
 	enum reboot_mode	reboot_mode;	/* default restart mode	*/
 	struct smp_operations	*smp;		/* SMP operations	*/
+	unsigned long		flags;
 	bool			(*smp_init)(void);
 	void			(*fixup)(struct tag *, char **,
 					 struct meminfo *);

More information about the linux-arm-kernel mailing list