mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Vicente Bergas <vicencb@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 8/9] archos: add atag appender for all features
Date: Mon, 11 Mar 2013 09:36:44 +0100	[thread overview]
Message-ID: <20130311083644.GC1906@pengutronix.de> (raw)
In-Reply-To: <1362871182-25726-9-git-send-email-vicencb@gmail.com>

On Sun, Mar 10, 2013 at 12:19:41AM +0100, Vicente Bergas wrote:
> 
> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
> ---
>  arch/arm/boards/archosg9/archos_features.c | 414 ++++++++++++++++++++++++++---
>  arch/arm/boards/archosg9/archos_features.h |  39 +++
>  2 files changed, 412 insertions(+), 41 deletions(-)
> 
> diff --git a/arch/arm/boards/archosg9/archos_features.c b/arch/arm/boards/archosg9/archos_features.c

[...]

> +#ifdef INSERT_ATAG_HSDPA
> +	features->hdr.tag = FTAG_HAS_HSDPA;
> +	features->hdr.size = feature_tag_size(feature_tag_generic);
> +
> +	memset(&features->u.generic, 0, sizeof(features->u.generic));
> +
> +	features = feature_tag_next(features);
> +#endif
> +}
> +static void setup_feature_nfc(void)
> +{
> +#ifdef INSERT_ATAG_NFC
> +	features->hdr.tag = FTAG_HAS_NFC;
> +	features->hdr.size = feature_tag_size(feature_tag_generic);
> +
> +	memset(&features->u.generic, 0, sizeof(features->u.generic));
> +
> +	features = feature_tag_next(features);
> +#endif

So all features get an additional ifdef,...

>  }
>  static void setup_feature_none(void)
>  {
> @@ -191,6 +495,34 @@ static struct tag *setup_feature_list(struct tag * params)
>  	setup_feature_has_gpio_volume_keys();
>  	setup_feature_screen();
>  	setup_feature_turbo();
> +	setup_feature_product_oem();
> +	setup_feature_product_zone();
> +	setup_feature_clock();
> +	setup_feature_dcin();
> +	setup_feature_ext_screen();
> +	setup_feature_wifi();
> +	setup_feature_bluetooth();
> +	setup_feature_accelerometer();
> +	setup_feature_gps();
> +	setup_feature_harddisk_controller();
> +	setup_feature_harddisk();
> +	setup_feature_touchscreen();
> +	setup_feature_mmcsd();
> +	setup_feature_gpio_keys();
> +	setup_feature_wifi_pa();
> +	setup_feature_speaker();
> +	setup_feature_battery();
> +	setup_feature_electrical_shortcut();
> +	setup_feature_gyroscope();
> +	setup_feature_compass();
> +	setup_feature_camera();
> +	setup_feature_microphone();
> +	setup_feature_ambient_light_sensor();
> +	setup_feature_proximity_sensor();
> +	setup_feature_gsm();
> +	setup_feature_dect();
> +	setup_feature_hsdpa();
> +	setup_feature_nfc();

... they are all called unconditionally, many of them end up being
no-ops ...

>  	setup_feature_none();
>  
>  	fl->size = ((u32)features) - ((u32)(fl->data));
> diff --git a/arch/arm/boards/archosg9/archos_features.h b/arch/arm/boards/archosg9/archos_features.h
> index 5769c6c..a3e1437 100644
> --- a/arch/arm/boards/archosg9/archos_features.h
> +++ b/arch/arm/boards/archosg9/archos_features.h
> @@ -1,6 +1,45 @@
>  #ifndef __ARCHOS_FEATURES_H
>  #define __ARCHOS_FEATURES_H
>  
> +#undef  INSERT_ATAG_PRODUCT_NAME
> +#undef  INSERT_ATAG_PRODUCT_SERIAL_NUMBER
> +#undef  INSERT_ATAG_PRODUCT_MAC_ADDRESS
> +#undef  INSERT_ATAG_BOARD_PCB_REVISION
> +#define INSERT_ATAG_SDRAM
> +#undef  INSERT_ATAG_PMIC
> +#define INSERT_ATAG_SERIAL_PORT
> +#define INSERT_ATAG_HAS_GPIO_VOLUME_KEYS
> +#define INSERT_ATAG_SCREEN
> +#define INSERT_ATAG_TURBO

And then you use a header file to configure this.

I don't see a point in obfuscating this so much. Please call only call
the features you want to have setup in the first place. For your own
debugging purposes it makes no difference whether you edit the C file
above or this header file. For different tablets with different features
you need to find another solution anyway.

Sascha

-- 
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-03-11  8:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
2013-03-09 23:19 ` [PATCH 1/9] defaultenv-2: don't load nonexistent file Vicente Bergas
2013-03-09 23:19 ` [PATCH 2/9] omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data Vicente Bergas
2013-03-09 23:19 ` [PATCH 3/9] omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx Vicente Bergas
2013-03-09 23:19 ` [PATCH 4/9] omap_uart: add low level port serial initialization Vicente Bergas
2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-10 22:16     ` vj
2013-03-10 22:35       ` Sascha Hauer
2013-03-10 22:44         ` vj
2013-03-10 23:01           ` Sascha Hauer
2013-03-10 23:09             ` vj
2013-03-09 23:19 ` [PATCH 5/9] panda: remove unused configuration items Vicente Bergas
2013-03-09 23:19 ` [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb Vicente Bergas
2013-03-14  7:50   ` Sascha Hauer
2013-03-09 23:19 ` [PATCH 7/9] menu: avoid errors when building submenus Vicente Bergas
2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-10 22:29     ` vj
2013-03-11  8:50       ` Sascha Hauer
2013-03-09 23:19 ` [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
2013-03-11  8:36   ` Sascha Hauer [this message]
2013-03-09 23:19 ` [PATCH 9/9] archosg9: enable booting from sd-card Vicente Bergas
2013-03-11 21:25 ` [PATCH 0/9] Add support for booting ArchosG9 " Sascha Hauer
2013-03-11 22:24 [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
2013-03-15  7:25 ` 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=20130311083644.GC1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=vicencb@gmail.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