From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 01/12] ARM: SoC: Introduce per SoC descriptor
Date: Thu, 7 Jun 2012 17:09:18 +0100 [thread overview]
Message-ID: <1339085369-26073-2-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1339085369-26073-1-git-send-email-marc.zyngier@arm.com>
The ARM core code expects the various SoCs to hide their
implementation differences behind a well established API.
The various sub-arch-specific bit are often either at
the machine descriptor level, or provided at link time
by the sub-arch code.
The SoC descriptor is a container that holds the SoC
specific bits that can be moved away from the machine
descriptor as well as an indirection point for the
global symbols (SMP and CPU hotplug support, for example).
This patch introduce this SoC descriptor, with the only field
being the name of the SoC.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
arch/arm/include/asm/mach/arch.h | 2 ++
arch/arm/include/asm/soc.h | 19 +++++++++++++++++++
arch/arm/kernel/setup.c | 7 +++++++
3 files changed, 28 insertions(+)
create mode 100644 arch/arm/include/asm/soc.h
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 0b1c94b..8217517 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -14,6 +14,7 @@ struct tag;
struct meminfo;
struct sys_timer;
struct pt_regs;
+struct arm_soc_desc;
struct machine_desc {
unsigned int nr; /* architecture number */
@@ -35,6 +36,7 @@ struct machine_desc {
unsigned char reserve_lp1 :1; /* never has lp1 */
unsigned char reserve_lp2 :1; /* never has lp2 */
char restart_mode; /* default restart mode */
+ struct arm_soc_desc *soc; /* SoC descriptor */
void (*fixup)(struct tag *, char **,
struct meminfo *);
void (*reserve)(void);/* reserve mem blocks */
diff --git a/arch/arm/include/asm/soc.h b/arch/arm/include/asm/soc.h
new file mode 100644
index 0000000..2d73e35
--- /dev/null
+++ b/arch/arm/include/asm/soc.h
@@ -0,0 +1,19 @@
+/*
+ * linux/arch/arm/include/asm/soc.h
+ *
+ * Copyright (C) 2011 ARM Ltd.
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARM_SOC_H
+#define __ASM_ARM_SOC_H
+
+struct arm_soc_desc {
+ const char *name;
+};
+
+#endif /* __ASM_ARM_SOC_H */
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index e15d83b..69c345c 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -45,6 +45,7 @@
#include <asm/cacheflush.h>
#include <asm/cachetype.h>
#include <asm/tlbflush.h>
+#include <asm/soc.h>
#include <asm/prom.h>
#include <asm/mach/arch.h>
@@ -144,6 +145,7 @@ static const char *cpu_name;
static const char *machine_name;
static char __initdata cmd_line[COMMAND_LINE_SIZE];
struct machine_desc *machine_desc __initdata;
+static const struct arm_soc_desc *soc_desc __initdata;
static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
@@ -947,6 +949,11 @@ void __init setup_arch(char **cmdline_p)
mdesc = setup_machine_tags(machine_arch_type);
machine_desc = mdesc;
machine_name = mdesc->name;
+ if (mdesc->soc) {
+ soc_desc = mdesc->soc;
+ pr_info("SoC: %s\n", soc_desc->name);
+ } else
+ soc_desc = NULL;
setup_dma_zone(mdesc);
--
1.7.10.1
next prev parent reply other threads:[~2012-06-07 16:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 16:09 [PATCH v7 00/12] Per SoC descriptor Marc Zyngier
2012-06-07 16:09 ` Marc Zyngier [this message]
2012-06-07 16:09 ` [PATCH v7 02/12] ARM: SoC: Add per SoC SMP and CPU hotplug operations Marc Zyngier
2012-06-11 3:47 ` Shawn Guo
2012-06-07 16:09 ` [PATCH v7 03/12] ARM: SoC: convert VExpress/RealView to SoC descriptor Marc Zyngier
2012-06-08 9:31 ` Pawel Moll
2012-06-07 16:09 ` [PATCH v7 04/12] ARM: SoC: convert OMAP4 " Marc Zyngier
2012-06-12 7:04 ` Tony Lindgren
2012-06-07 16:09 ` [PATCH v7 05/12] ARM: SoC: convert Tegra " Marc Zyngier
2012-06-07 16:09 ` [PATCH v7 06/12] ARM: SoC: convert Exynos4 " Marc Zyngier
2012-06-07 16:09 ` [PATCH v7 07/12] ARM: SoC: convert MSM SMP " Marc Zyngier
2012-06-07 20:23 ` David Brown
2012-06-07 16:09 ` [PATCH v7 08/12] ARM: SoC: convert ux500 " Marc Zyngier
2012-06-07 16:09 ` [PATCH v7 09/12] ARM: SoC: convert shmobile SMP " Marc Zyngier
2012-06-07 16:09 ` [PATCH v7 10/12] ARM: SoC: convert highbank " Marc Zyngier
2012-06-08 0:52 ` Rob Herring
2012-06-07 16:09 ` [PATCH v7 11/12] ARM: SoC: convert imx6q " Marc Zyngier
2012-06-11 3:48 ` Shawn Guo
2012-06-07 16:09 ` [PATCH v7 12/12] ARM: smp: Make SoC descriptor mandatory for SMP platforms Marc Zyngier
2012-06-08 14:54 ` [PATCH v7 00/12] Per SoC descriptor Arnd Bergmann
2012-06-12 10:39 ` Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339085369-26073-2-git-send-email-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).