public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 14/27] Introduce generic pre-relocation board_f.c
Date: Thu, 15 Mar 2012 14:09:00 -0500	[thread overview]
Message-ID: <4F623E4C.1080000@freescale.com> (raw)
In-Reply-To: <1331777784-8528-15-git-send-email-sjg@chromium.org>

On 03/14/2012 09:16 PM, Simon Glass wrote:
> +/*
> + * sjg: IMO this code should be
> + * refactored to a single function, something like:
> + *
> + * void led_set_state(enum led_colour_t colour, int on);
> + */
> +/************************************************************************
> + * Coloured LED functionality
> + ************************************************************************
> + * May be supplied by boards if desired
> + */
> +inline void __coloured_LED_init(void) {}
> +void coloured_LED_init(void)
> +	__attribute__((weak, alias("__coloured_LED_init")));
> +inline void __red_led_on(void) {}
> +void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
> +inline void __red_led_off(void) {}
> +void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
> +inline void __green_led_on(void) {}
> +void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
> +inline void __green_led_off(void) {}
> +void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
> +inline void __yellow_led_on(void) {}
> +void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
> +inline void __yellow_led_off(void) {}
> +void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
> +inline void __blue_led_on(void) {}
> +void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
> +inline void __blue_led_off(void) {}
> +void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));

Is this really the right file for this?

> +/*
> + * Why is gd allocated a register? Prior to reloc it might be better to
> + * just pass it around to each function in this file?

You're assuming that this is the only file that needs gd.

> +static int reserve_stacks(void)
> +{
> +	/* setup stack pointer for exceptions */
> +	gd->irq_sp = gd->dest_addr_sp;
> +#ifdef CONFIG_USE_IRQ
> +	gd->dest_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ);
> +	debug("Reserving %zu Bytes for IRQ stack at: %08lx\n",
> +		CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ, gd->dest_addr_sp);
> +
> +	/* 8-byte alignment for ARM ABI compliance */
> +	gd->dest_addr_sp &= ~0x07;
> +#endif
> +	/* leave 3 words for abort-stack, plus 1 for alignment */
> +	gd->dest_addr_sp -= 16;
> +
> +	return 0;
> +}

What does "leave 3 words for abort-stack, plus 1 for alignment" mean in
a generic context?  Certainly we shouldn't have references to things
like FIQ or ARM ABI.

Do all architectures U-Boot supports have a stack that grows downward?

PowerPC requires 16-byte stack alignment, not 8-byte.

-Scott

  reply	other threads:[~2012-03-15 19:09 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15  2:15 [U-Boot] [PATCH v4 0/27] Create generic board init for ARM, x86, PPC Simon Glass
2012-03-15  2:15 ` [U-Boot] [PATCH v4 01/27] arm: Change board baud_rate to ulong Simon Glass
2012-03-15  2:15 ` [U-Boot] [PATCH v4 02/27] x86: " Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 03/27] arm: Only display frame buffer info if there is LCD/video support Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 04/27] x86: Remove dead code in eNET Simon Glass
2012-03-15  2:27   ` Graeme Russ
2012-03-15  2:28     ` Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 05/27] x86: Add initial memory barrier macros Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 06/27] ppc: " Simon Glass
2012-03-15 17:56   ` Scott Wood
2012-03-15  2:16 ` [U-Boot] [PATCH v4 07/27] Introduce generic global_data Simon Glass
2012-03-15  2:30   ` Graeme Russ
2012-03-15  2:35   ` Graeme Russ
2012-03-15  2:50     ` Simon Glass
2012-03-15  3:02       ` Graeme Russ
2012-03-15  3:41         ` Simon Glass
2012-03-24  6:40           ` Simon Glass
2012-03-24 11:14             ` Graeme Russ
2012-03-24 23:10               ` Simon Glass
2012-03-24 23:54                 ` Graeme Russ
2012-03-15  2:16 ` [U-Boot] [PATCH v4 08/27] Introduce generic u-boot.h file Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 09/27] Introduce generic link section.h symbol files Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 10/27] arm: Use sections header to obtain link symbols Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 11/27] x86: Change stub example to use asm-generic/sections.h Simon Glass
2012-03-15  2:29   ` Graeme Russ
2012-03-15  2:44     ` Simon Glass
2012-03-15  2:48       ` Graeme Russ
2012-03-15  2:16 ` [U-Boot] [PATCH v4 12/27] Introduce a basic initcall implementation Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 13/27] Define CONFIG_SYS_LEGACY_BOARD everywhere Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 14/27] Introduce generic pre-relocation board_f.c Simon Glass
2012-03-15 19:09   ` Scott Wood [this message]
2012-03-15 21:23     ` Simon Glass
2012-03-15 21:25       ` Scott Wood
2012-03-16  5:31       ` Wolfgang Denk
2012-03-15  2:16 ` [U-Boot] [PATCH v4 15/27] Introduce generic post-relocation board_r.c Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 16/27] Add spl load feature Simon Glass
2012-03-15 19:29   ` Scott Wood
2012-03-15  2:16 ` [U-Boot] [PATCH v4 17/27] arm: Enable generic board support Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 18/27] Add CONFIG_SYS_SYM_OFFSETS to support offset symbols Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 19/27] x86: Use sections header to obtain link symbols Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 20/27] Add x86 fields to generic global_data Simon Glass
2012-03-15  2:36   ` Graeme Russ
2012-03-15  2:54     ` Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 21/27] x86: Enable generic board support Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 22/27] Add ppc fields to generic global data Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 23/27] Adjust board_f for ppc Simon Glass
2012-03-15 19:12   ` Scott Wood
2012-03-15 21:25     ` Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 24/27] Adjust board_r.c for PowerPC Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 25/27] ppc: Enable generic board board Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 26/27] tegra: Mark board init files for ARMv4t Simon Glass
2012-03-15  2:16 ` [U-Boot] [PATCH v4 27/27] tegra: Enable generic board for Seaboard Simon Glass
2012-03-16 19:23 ` [U-Boot] [PATCH v4 0/27] Create generic board init for ARM, x86, PPC Tom Rini
2012-03-16 19:34   ` Simon Glass
2012-03-16 20:07     ` Tom Rini
2012-03-16 21:53       ` Tom Rini
2012-03-16 22:19         ` Simon Glass
2012-03-16 22:26           ` Tom Rini

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=4F623E4C.1080000@freescale.com \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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