From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/6] ARM: introduce SoC description
Date: Thu, 28 Nov 2013 19:06:44 +0100 [thread overview]
Message-ID: <1385662007-13057-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1385662007-13057-1-git-send-email-plagnioj@jcrosoft.com>
This will allow to do have runtime SoC init level based on the current machine
running.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/cpu/machine.c | 6 ++++++
arch/arm/include/asm/mach/arch.h | 17 +++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/arch/arm/cpu/machine.c b/arch/arm/cpu/machine.c
index ad0d8cb..55266f5 100644
--- a/arch/arm/cpu/machine.c
+++ b/arch/arm/cpu/machine.c
@@ -107,6 +107,12 @@ static void arm_mach_only_one_machine(void)
if (__ret) \
break; \
} \
+ \
+ if (!machine_desc->soc_desc) \
+ break; \
+ \
+ if (machine_desc->soc_desc->level##_init) \
+ __ret = machine_desc->soc_desc->level##_init(); \
} while(0); \
__ret; \
})
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 91f1d2e..71dbb83 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -14,12 +14,29 @@
#ifndef __ASM_MACH_ARCH_H__
#define __ASM_MACH_ARCH_H__
+struct soc_desc {
+ const char *name; /* architecture name */
+
+ int (*pure_init)(void);
+ int (*core_init)(void);
+ int (*postcore_init)(void);
+ int (*console_init)(void);
+ int (*postconsole_init)(void);
+ int (*mem_init)(void);
+ int (*postmmu_init)(void);
+ int (*coredevice_init)(void);
+ int (*device_init)(void);
+ int (*late_init)(void);
+};
+
struct machine_desc {
unsigned int nr; /* architecture number */
const char *name; /* architecture name */
const char *const *dt_compat; /* array of device tree
* 'compatible' strings */
+ struct soc_desc *soc_desc;
+
int (*pure_init)(void);
int (*core_init)(void);
int (*postcore_init)(void);
--
1.8.4.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-11-28 18:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-28 18:05 [PATCH 0/6] ARM: machine struct support Jean-Christophe PLAGNIOL-VILLARD
2013-11-28 18:06 ` [PATCH 1/6] arm: gen-mach-types: add MAX_MACH_TYPE Jean-Christophe PLAGNIOL-VILLARD
2013-11-28 18:06 ` [PATCH 2/6] ARM: introduce machine description Jean-Christophe PLAGNIOL-VILLARD
2013-11-28 18:19 ` Alexander Aring
2013-11-28 19:00 ` Jean-Christophe PLAGNIOL-VILLARD
2013-11-28 19:02 ` Alexander Aring
2013-12-02 9:01 ` Sascha Hauer
2013-12-02 11:04 ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-02 11:54 ` Sascha Hauer
2013-11-28 18:06 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-11-28 18:06 ` [PATCH 4/6] AT91: detect SoC earlier Jean-Christophe PLAGNIOL-VILLARD
2013-11-28 18:06 ` [PATCH 5/6] AT91: switch to machine description Jean-Christophe PLAGNIOL-VILLARD
2013-11-28 18:06 ` [PATCH 6/6] vexpress: " Jean-Christophe PLAGNIOL-VILLARD
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=1385662007-13057-3-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@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