From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 12 Feb 2013 16:32:20 -0600 Subject: [U-Boot] [PATCH v5 16/23] Adjust board_f.c for ppc In-Reply-To: <1360336339-10703-17-git-send-email-sjg@chromium.org> (from sjg@chromium.org on Fri Feb 8 09:12:12 2013) References: <1360336339-10703-1-git-send-email-sjg@chromium.org> <1360336339-10703-17-git-send-email-sjg@chromium.org> Message-ID: <1360708340.24612.12@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02/08/2013 09:12:12 AM, Simon Glass wrote: > #ifndef CONFIG_SPL_BUILD > static int reserve_stacks(void) > { > +#ifdef CONFIG_PPC > + ulong *s; > +#endif > + > /* setup stack pointer for exceptions */ > gd->dest_addr_sp -= 16; > gd->dest_addr_sp &= ~0xf; > @@ -398,6 +532,14 @@ static int reserve_stacks(void) > /* leave 3 words for abort-stack, plus 1 for alignment */ > gd->dest_addr_sp -= 16; > > +#ifdef CONFIG_PPC > + /* Clear initial stack frame */ > + s = (ulong *) gd->dest_addr_sp; > + *s = 0; /* Terminate back chain */ > + *++s = 0; /* NULL return address */ > + gd->dest_addr_sp = (ulong) s; > +#endif > + PPC ABI requires 16-byte stack alignment, which would be broken by the CONFIG_USE_IRQ section (which even still has an "ARM ABI" comment). I think this entire function should be kept in arch code. Stack layout is inherently architecture/ABI specific. Some architectures even have a stack that grows upward (not sure if any such are supported by U-Boot). -Scott