From: Stefan Roese Date: Thu, 4 Mar 2021 14:22:15 +0100 Subject: [PATCH 4/5] ds414: Auto-populate env if appropriate In-Reply-To: <20210304132005.GM22016@orbyte.nwl.cc> References: <20210303005526.15056-1-phil@nwl.cc> <20210303005526.15056-5-phil@nwl.cc> <326825c5-93f0-2a3d-43c7-301bfaa4e17e@denx.de> <20210304132005.GM22016@orbyte.nwl.cc> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04.03.21 14:20, Phil Sutter wrote: > On Thu, Mar 04, 2021 at 02:06:01PM +0100, Stefan Roese wrote: >> On 03.03.21 01:55, Phil Sutter wrote: >>> Define a misc_init_r() which calls "syno populate_env" if the >>> environment seems incomplete (or default), indicated by missing >>> "ethaddr" variable. With this in place, no random MAC address fallback >>> is needed anymore. >>> >>> Signed-off-by: Phil Sutter >>> --- >>> board/Synology/ds414/cmd_syno.c | 2 +- >>> board/Synology/ds414/ds414.c | 13 +++++++++++++ >>> configs/ds414_defconfig | 4 +--- >>> 3 files changed, 15 insertions(+), 4 deletions(-) >>> >>> diff --git a/board/Synology/ds414/cmd_syno.c b/board/Synology/ds414/cmd_syno.c >>> index a120c3123ffb3..07bb395da3acc 100644 >>> --- a/board/Synology/ds414/cmd_syno.c >>> +++ b/board/Synology/ds414/cmd_syno.c >>> @@ -22,7 +22,7 @@ >>> #define SYNO_CHKSUM_TAG "CHK=" >>> >>> >>> -static int do_syno_populate(int argc, char *const argv[]) >>> +int do_syno_populate(int argc, char *const argv[]) >>> { >>> unsigned int bus = CONFIG_SF_DEFAULT_BUS; >>> unsigned int cs = CONFIG_SF_DEFAULT_CS; >>> diff --git a/board/Synology/ds414/ds414.c b/board/Synology/ds414/ds414.c >>> index 9c4ce670ddfbd..c2469d6665255 100644 >>> --- a/board/Synology/ds414/ds414.c >>> +++ b/board/Synology/ds414/ds414.c >>> @@ -179,6 +179,19 @@ int board_init(void) >>> return 0; >>> } >>> >>> +#ifndef CONFIG_SPL_BUILD >>> +int do_syno_populate(int argc, char *const argv[]); >> >> I suspect that this prototype in a C file will trigger at least a >> checkpatch warning? > > What is checkpatch? ;) Provided with Linux and your favorite bootloader: ;) ./scripts/checkpatch.pl > Mea culpa, sometimes past me's dirty hacks slip my review. I'll go find > a checkpatch-compliant way. NP. Thanks for working on this. Thanks, Stefan