mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Jan Lübbe" <jlu@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 6/7] at91: add bootstrap version
Date: Wed, 02 Jan 2013 12:41:31 +0100	[thread overview]
Message-ID: <1357126891.3863.2.camel@coredoba.hi.pengutronix.de> (raw)
In-Reply-To: <1356775697-1849-6-git-send-email-plagnioj@jcrosoft.com>

On Sat, 2012-12-29 at 11:08 +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> diff --git a/arch/arm/mach-at91/bootstrap.c b/arch/arm/mach-at91/bootstrap.c
> new file mode 100644
> index 0000000..2ec16f1
> --- /dev/null
> +++ b/arch/arm/mach-at91/bootstrap.c
> @@ -0,0 +1,86 @@
> +/*
> + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
> + *
> + * Under GPLv2
> + */
> +
> +#include <common.h>
> +#include <bootstrap.h>
> +#include <mach/bootstrap.h>
> +#include <sizes.h>
> +#include <malloc.h>
> +
> +#if defined(CONFIG_MCI_ATMEL)
> +#define is_mmc() 1
> +#else
> +#define is_mmc() 0
> +#endif
> +
> +#ifdef CONFIG_NAND_ATMEL
> +#define is_nand() 1
> +#else
> +#define is_nand() 0
> +#endif
> +
> +#ifdef CONFIG_MTD_M25P80
> +#define is_m25p80() 1
> +#else
> +#define is_m25p80() 0
> +#endif
> +
> +#ifdef CONFIG_MTD_DATAFLASH
> +#define is_dataflash() 1
> +#else
> +#define is_dataflash() 0
> +#endif
> +
> +static void boot_seq(bool is_barebox)
> +{
> +	char *name = is_barebox ? "barebox" : "unknown";
> +	int (*func)(void) = NULL;
> +
> +	if (is_m25p80()) {
> +		func = bootstrap_board_read_m25p80();
> +		printf("Boot %s from m25p80\n", name);
> +		bootstrap_boot(func, is_barebox);
> +		bootstrap_err("... failled\n");
> +		free(func);
> +	}
> +	if (is_dataflash()) {
> +		printf("Boot %s from dataflash\n", name);
> +		func = bootstrap_board_read_dataflash();
> +		bootstrap_boot(func, is_barebox);
> +		bootstrap_err("... failled\n");
> +		free(func);
> +	}
> +	if (is_nand()) {
> +		printf("Boot %s from nand\n", name);
> +		func = bootstrap_read_devfs("nand0", true, SZ_128K, SZ_256K, SZ_1M);
> +		bootstrap_boot(func, is_barebox);
> +		bootstrap_err("... failled\n");
> +		free(func);
> +	}
> +}

Why can't you use IS_ENABLED(CONFIG_xxx) here?


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-01-02 11:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-29 10:04 [PATCH 0/7] at91: add bootstrap support Jean-Christophe PLAGNIOL-VILLARD
2012-12-29 10:08 ` [PATCH 1/7] at91: add test commamd to emulate bootrom boot Jean-Christophe PLAGNIOL-VILLARD
2012-12-29 10:08   ` [PATCH 2/7] at91sam926x: lowlevel add external boot support Jean-Christophe PLAGNIOL-VILLARD
2012-12-29 10:08   ` [PATCH 3/7] at91: sam926x: switch lowlevel param to c code Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 10:18     ` Sascha Hauer
2012-12-29 10:08   ` [PATCH 4/7] at91: usb-a9263 add lowlevel init Jean-Christophe PLAGNIOL-VILLARD
2012-12-29 10:08   ` [PATCH 5/7] introduce common bootstrap code Jean-Christophe PLAGNIOL-VILLARD
2012-12-29 10:08   ` [PATCH 6/7] at91: add bootstrap version Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 11:41     ` Jan Lübbe [this message]
2013-01-04 13:12       ` Sascha Hauer
2012-12-29 10:08   ` [PATCH 7/7] at91: usb_a9263: " Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 10:10   ` [PATCH 1/7] at91: add test commamd to emulate bootrom boot Sascha Hauer
2013-01-19  7:33 [PATCH 0/7 v2] at91: add bootstrap support Jean-Christophe PLAGNIOL-VILLARD
2013-01-19  7:35 ` [PATCH 1/7] at91: add test commamd to emulate bootrom boot Jean-Christophe PLAGNIOL-VILLARD
2013-01-19  7:35   ` [PATCH 6/7] at91: add bootstrap version Jean-Christophe PLAGNIOL-VILLARD
2013-01-19 11:21 [PATCH 0/7 v3] at91: add bootstrap support Jean-Christophe PLAGNIOL-VILLARD
2013-01-19 11:26 ` [PATCH 1/7] at91: add test commamd to emulate bootrom boot Jean-Christophe PLAGNIOL-VILLARD
2013-01-19 11:26   ` [PATCH 6/7] at91: add bootstrap version Jean-Christophe PLAGNIOL-VILLARD
2013-01-19 11:31     ` Sascha Hauer

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=1357126891.3863.2.camel@coredoba.hi.pengutronix.de \
    --to=jlu@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /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