public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] sunxi: support board-specific configuration options
Date: Sat, 22 Aug 2015 16:02:13 +0200	[thread overview]
Message-ID: <55D880E5.2040407@redhat.com> (raw)
In-Reply-To: <1440244364-11752-2-git-send-email-bernhard.nortmann@web.de>

Hi Bernhard,

On 22-08-15 13:52, Bernhard Nortmann wrote:
> Extend sunxi-common.h to include sunxi-boards.h - which in turn
> can support multiple configurations/options/includes, based on
> board-specific symbols (preprocessor definitions). These might
> be supplied by the respective *_defconfig files.
>
> Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
> ---
>
>   configs/Bananapi_defconfig     |  2 +-
>   include/configs/bananapi.h     | 23 +++++++++++++++++++++++
>   include/configs/sunxi-boards.h |  5 +++++
>   include/configs/sunxi-common.h |  1 +
>   4 files changed, 30 insertions(+), 1 deletion(-)
>   create mode 100644 include/configs/bananapi.h
>   create mode 100644 include/configs/sunxi-boards.h
>
> diff --git a/configs/Bananapi_defconfig b/configs/Bananapi_defconfig
> index 560295f..6bd0f3e 100644
> --- a/configs/Bananapi_defconfig
> +++ b/configs/Bananapi_defconfig
> @@ -7,7 +7,7 @@ CONFIG_VIDEO_COMPOSITE=y
>   CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapi"
>   # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
>   CONFIG_SPL=y
> -CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI"
> +CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI,BOARD_BANANAPI"
>   # CONFIG_CMD_IMLS is not set
>   # CONFIG_CMD_FLASH is not set
>   # CONFIG_CMD_FPGA is not set

We want to move away from using CONFIG_SYS_EXTRA_OPTIONS, not start using
more of them.

The proper way to deal with this would be to allow defining one or more
LED gpio pins in Kconfig, like e.g. the USB?_VBUS_PIN config options
in board/sunxi/Kconfig, and then modify the generic code paths so that
these will be used when set.

This way we get led support for all boards in one go (once all the
defconfig-s are updated to set the gpio pins), and we do not end up
with board specific code.

Regards,

Hans



> diff --git a/include/configs/bananapi.h b/include/configs/bananapi.h
> new file mode 100644
> index 0000000..f14a6b4
> --- /dev/null
> +++ b/include/configs/bananapi.h
> @@ -0,0 +1,23 @@
> +/*
> + * bananapi.h
> + * board-specific options for Banana Pi
> + */
> +
> +/* Note that this example currently (v2015.10-rc2) requires
> + * patching U-Boot support of GPIO LEDs.
> + * see http://lists.denx.de/pipermail/u-boot/2015-August/224713.html
> + */
> +
> +#define CONFIG_STATUS_LED
> +#define CONFIG_BOARD_SPECIFIC_LED
> +#define CONFIG_GPIO_LED
> +#define CONFIG_GPIO_LED_STUBS
> +#define CONFIG_CMD_LED
> +
> +#define GREEN_LED_GPIO		248 /* = PH24 */
> +
> +#define STATUS_LED_BIT		GREEN_LED_GPIO
> +#define STATUS_LED_STATE	STATUS_LED_ON
> +#define STATUS_LED_PERIOD	(CONFIG_SYS_HZ / 2)
> +
> +#define STATUS_LED_GREEN	GREEN_LED_GPIO
> diff --git a/include/configs/sunxi-boards.h b/include/configs/sunxi-boards.h
> new file mode 100644
> index 0000000..b2b7c59
> --- /dev/null
> +++ b/include/configs/sunxi-boards.h
> @@ -0,0 +1,5 @@
> +/* support specific (sunxi) board configurations */
> +
> +#ifdef CONFIG_BOARD_BANANAPI
> +#include <configs/bananapi.h>
> +#endif
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 1abf73c..424c2d4 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -40,6 +40,7 @@
>   #endif
>
>   #include <asm/arch/cpu.h>	/* get chip and board defs */
> +#include <configs/sunxi-boards.h>	/* board-specific config */
>
>   #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM_SERIAL)
>   # define CONFIG_DW_SERIAL
>

  reply	other threads:[~2015-08-22 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-22 11:52 [U-Boot] [RFC PATCH 0/1] sunxi board-specific options Bernhard Nortmann
2015-08-22 11:52 ` [U-Boot] [RFC PATCH] sunxi: support board-specific configuration options Bernhard Nortmann
2015-08-22 14:02   ` Hans de Goede [this message]
2015-08-24  9:18     ` Bernhard Nortmann
2015-08-24  9:22       ` Hans de Goede

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=55D880E5.2040407@redhat.com \
    --to=hdegoede@redhat.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