All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/7] env: Read default speed and mode values from DT
Date: Mon, 10 Dec 2018 12:27:19 +0100	[thread overview]
Message-ID: <CAAh8qswhX5coxU8KxGBez99nahDqyo5MQA0zcyZPueOOvBv=Bg@mail.gmail.com> (raw)
In-Reply-To: <1544439166-5749-7-git-send-email-patrick.delaunay@st.com>

On Mon, Dec 10, 2018 at 11:54 AM Patrick Delaunay
<patrick.delaunay@st.com> wrote:
>
> In case of DT boot, don't read default speed and mode for SPI from
> CONFIG_*, instead read from DT node.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  env/Kconfig | 4 ++--
>  env/sf.c    | 5 ++++-
>  2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/env/Kconfig b/env/Kconfig
> index 9011109..0f760ce 100644
> --- a/env/Kconfig
> +++ b/env/Kconfig
> @@ -329,11 +329,11 @@ config ENV_IS_IN_SPI_FLASH
>
>           Define the SPI bus and chip select. If not defined they will be 0.
>
> -         - CONFIG_ENV_SPI_MAX_HZ (optional):
> +         - CONFIG_ENV_SPI_MAX_HZ (optional if !DM_SPI_FLASH):
>
>           Define the SPI max work clock. If not defined then use 1MHz.
>
> -         - CONFIG_ENV_SPI_MODE (optional):
> +         - CONFIG_ENV_SPI_MODE (optional if !DM_SPI_FLASH):
>
>           Define the SPI work mode. If not defined then use SPI_MODE_3.
>
> diff --git a/env/sf.c b/env/sf.c
> index 2e3c600..edd36f1 100644
> --- a/env/sf.c
> +++ b/env/sf.c
> @@ -24,12 +24,15 @@
>  #ifndef CONFIG_ENV_SPI_CS
>  # define CONFIG_ENV_SPI_CS     CONFIG_SF_DEFAULT_CS
>  #endif
> +
> +#ifndef CONFIG_DM_SPI_FLASH
>  #ifndef CONFIG_ENV_SPI_MAX_HZ
>  # define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
>  #endif
>  #ifndef CONFIG_ENV_SPI_MODE
>  # define CONFIG_ENV_SPI_MODE   CONFIG_SF_DEFAULT_MODE
>  #endif
> +#endif
>
>  #ifndef CONFIG_SPL_BUILD
>  #define CMD_SAVEENV
> @@ -58,7 +61,7 @@ static int setup_flash_device(void)
>
>         /* speed and mode will be read from DT */
>         ret = spi_flash_probe_bus_cs(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
> -                                    CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE,
> +                                    0, 0,
>                                      &new);
>         if (ret) {
>                 set_default_env("spi_flash_probe_bus_cs() failed", 0);

Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

Regards,
Simon

  parent reply	other threads:[~2018-12-10 11:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 10:52 [U-Boot] [PATCH 0/7] Remove defines for SPI default speed and mode Patrick Delaunay
2018-12-10 10:52 ` [U-Boot] [PATCH 1/7] spi: update management of " Patrick Delaunay
2018-12-10 11:24   ` Simon Goldschmidt
2018-12-10 20:49     ` Petr Vorel
2018-12-10 20:57       ` Simon Goldschmidt
2018-12-12 19:58   ` Jagan Teki
2018-12-10 10:52 ` [U-Boot] [PATCH 2/7] spi: add comment for spi_flash_probe_bus_cs function Patrick Delaunay
2018-12-10 11:25   ` Simon Goldschmidt
2018-12-10 20:54     ` Petr Vorel
2018-12-10 10:52 ` [U-Boot] [PATCH 3/7] da850evm: sf: Read default speed and mode values from DT Patrick Delaunay
2018-12-10 20:57   ` Petr Vorel
2018-12-12 20:02   ` Jagan Teki
2018-12-13 14:54     ` Patrick DELAUNAY
2018-12-10 10:52 ` [U-Boot] [PATCH 4/7] dfu: " Patrick Delaunay
2018-12-10 11:22   ` Lukasz Majewski
2018-12-10 21:00   ` Petr Vorel
2018-12-10 10:52 ` [U-Boot] [PATCH 5/7] mips: mt76xx: gardena-smart-gateway: " Patrick Delaunay
2018-12-10 11:47   ` Stefan Roese
2018-12-10 21:01   ` Petr Vorel
2018-12-10 10:52 ` [U-Boot] [PATCH 6/7] env: " Patrick Delaunay
2018-12-10 11:23   ` Lukasz Majewski
2018-12-10 11:27   ` Simon Goldschmidt [this message]
2018-12-10 21:08   ` Petr Vorel
2018-12-12 20:07   ` Jagan Teki
2018-12-10 10:52 ` [U-Boot] [PATCH 7/7] spi: remove define for SPI default SPEED and MODE Patrick Delaunay
2018-12-10 11:26   ` Simon Goldschmidt
2018-12-10 21:10     ` Petr Vorel
2018-12-10 15:42 ` [U-Boot] [PATCH 0/7] Remove defines for SPI default speed and mode Adam Ford
2018-12-10 19:20   ` Simon Goldschmidt
2018-12-10 20:17     ` Adam Ford
2018-12-10 21:08       ` Simon Goldschmidt
2018-12-12  7:51         ` Petr Vorel
2018-12-12  9:54           ` Simon Goldschmidt
2018-12-13 14:46             ` Patrick DELAUNAY

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='CAAh8qswhX5coxU8KxGBez99nahDqyo5MQA0zcyZPueOOvBv=Bg@mail.gmail.com' \
    --to=simon.k.r.goldschmidt@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.