From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 15 Aug 2009 16:24:57 +0200 Subject: [U-Boot] [PATCH] Add ability for arch code to make changes before we boot In-Reply-To: <402B1A5F-C03C-4C22-9B31-9FDEB2E39CD4@kernel.crashing.org> References: <1250276442-28463-1-git-send-email-galak@kernel.crashing.org> <20090814201357.GA27137@game.jcrosoft.org> <402B1A5F-C03C-4C22-9B31-9FDEB2E39CD4@kernel.crashing.org> Message-ID: <20090815142457.GA13386@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 15:45 Fri 14 Aug , Kumar Gala wrote: > > On Aug 14, 2009, at 3:13 PM, Jean-Christophe PLAGNIOL-VILLARD wrote: > > >On 14:00 Fri 14 Aug , Kumar Gala wrote: > >>Added a arch_preboot() function that cpu specific code can > >>implement to > >>allow for various modifications to the state of the machine > >>right before > >>we boot. This can be useful to setup register state to a specific > >>configuration. > >> > >>Signed-off-by: Kumar Gala > >>--- > >>common/cmd_bootm.c | 10 ++++++++++ > >>1 files changed, 10 insertions(+), 0 deletions(-) > >> > >>diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c > >>index 86c8122..766889a 100644 > >>--- a/common/cmd_bootm.c > >>+++ b/common/cmd_bootm.c > >>@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) > >>} > >>void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, > >>alias("__arch_lmb_reserve"))); > >> > >>+/* Allow for arch specific config before we boot */ > >>+void __arch_preboot(void) > >>+{ > >>+ /* please define platform specific arch_preboot() */ > >>+} > >>+void arch_preboot(void) __attribute__((weak, > >>alias("__arch_preboot"))); > >>+ > >why not a section so you will be able to have multiple callback so > >it can be > >arch or soc or board too in any combination > > Because the use I have for it is a simple single case at this point. > > If and when we need more complexity we can add it. we have already it as example the usb drivers that need to be stop before start an os I forget some but I'm sure to have seen oher Best Regards, J.