All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [PATCH] common: update_tftp: remove unnecessary build check
Date: Mon, 2 Mar 2020 08:12:09 +0100	[thread overview]
Message-ID: <144b3bc0-8612-3494-7375-b4b7a579c47f@gmx.de> (raw)
In-Reply-To: <20200302001143.GD13880@linaro.org>

On 3/2/20 1:11 AM, AKASHI Takahiro wrote:
> On Fri, Feb 28, 2020 at 07:26:25PM +0100, Heinrich Schuchardt wrote:
>> On 2/28/20 1:06 AM, AKASHI Takahiro wrote:
>>> Logically, the current update_tftp() should and does compile and work
>>> correctly even without satisfying the following condition:
>>>
>>>> #if defined(CONFIG_UPDATE_TFTP) && !defined(CONFIG_MTD_NOR_FLASH)
>>>> #error "CONFIG_UPDATE_TFTP and !CONFIG_MTD_NOR_FLASH needed for
>>>>    legacy behaviour"
>>>> #endif
>>>
>>> It would be better to just drop it so that this function will be
>>> used on wider range of platforms.
>>
>> Function update_tftp() calls update_flash(). update_flash() does nothing
>> if CONFIG_MTD_NOR_FLASH=n.
>>
>> Please, describe which configuration would be additionally usable if
>> your patch is applied.
>
> update_tftp() takes additional two parameters, interface and devstring,
> since the commit c7ff5528439a ("update: tftp: dfu: Extend update_tftp()
> function to support DFU").
> CONFIG_DFU and COFIG_DFU_XXX, without MTD_NOR_FLASH, does work.

But would you use CONFIG_UPDATE_TFTP in conjunction with CONFIG_DFU*?

common/Kconfig describes UPDATE_TFTP as: "This option allows performing
update of NOR with data in fitImage sent via TFTP boot."

doc/README.dfutftp says:
"* Update TFTP (CONFIG_UPDATE_TFTP) only supports writing
code to NAND memory via TFTP.
* DFU supports writing data to the variety of mediums (NAND,
eMMC, SD, partitions, RAM, etc) via USB."

I assume README.dfutftp saying "NAND" and not "NOR" is a documentation
error.

So why do you specifically need to allow
CONFIG_UPDATE_TFTP=y && CONFIG_MTD_NOR_FLASH=n ?

Best regards

Heinrich

>
> Thanks,
> -Takahiro Akashi
>
>
>> Best regards
>>
>> Heinrich
>>
>>>
>>> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
>>> ---
>>>    common/update.c | 7 ++-----
>>>    1 file changed, 2 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/common/update.c b/common/update.c
>>> index c8dd346a0956..ade029851dbd 100644
>>> --- a/common/update.c
>>> +++ b/common/update.c
>>> @@ -14,10 +14,6 @@
>>>    #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
>>>    #endif
>>>
>>> -#if defined(CONFIG_UPDATE_TFTP) && !defined(CONFIG_MTD_NOR_FLASH)
>>> -#error "CONFIG_UPDATE_TFTP and !CONFIG_MTD_NOR_FLASH needed for legacy behaviour"
>>> -#endif
>>> -
>>>    #include <command.h>
>>>    #include <env.h>
>>>    #include <flash.h>
>>> @@ -210,8 +206,9 @@ static int update_flash(ulong addr_source, ulong addr_first, ulong size)
>>>    		printf("Error: could not protect flash sectors\n");
>>>    		return 1;
>>>    	}
>>> +#else
>>> +	return -1;
>>>    #endif
>>> -	return 0;
>>>    }
>>>
>>>    static int update_fit_getparams(const void *fit, int noffset, ulong *addr,
>>>
>>

  reply	other threads:[~2020-03-02  7:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  0:06 [PATCH] common: update_tftp: remove unnecessary build check AKASHI Takahiro
2020-02-28 18:26 ` Heinrich Schuchardt
2020-03-02  0:11   ` AKASHI Takahiro
2020-03-02  7:12     ` Heinrich Schuchardt [this message]
2020-03-02  7:53       ` AKASHI Takahiro
2020-05-26 16:16 ` Heinrich Schuchardt

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=144b3bc0-8612-3494-7375-b4b7a579c47f@gmx.de \
    --to=xypron.glpk@gmx.de \
    --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.