Hi Stefano, On Mon, Apr 17, 2017 at 9:18 PM, Jagan Teki <jagannadh.t...@gmail.com> wrote: > On Wed, Apr 12, 2017 at 9:27 PM, Stefano Babic <sba...@denx.de> wrote: >> On 07/04/2017 19:50, Jagan Teki wrote: >>> Hi Stefano, >>> >>> On Mon, Mar 27, 2017 at 11:32 PM, Jagan Teki <ja...@openedev.com> wrote: >>>> From: Jagan Teki <ja...@amarulasolutions.com> >>>> >>>> Add runtime, modeboot env which is setting mmcboot, or >>>> nandboot based on the bootdevice so-that conditional >>>> macros b/w MMC and NAND for CONFIG_BOOTCOMMAND should >>>> be avoided in config files. >>>> >>>> Cc: Matteo Lisi <matteo.l...@engicam.com> >>>> Cc: Michael Trimarchi <mich...@amarulasolutions.com> >>>> Cc: Stefano Babic <sba...@denx.de> >>>> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com> >>> >>> Can you take this series? >>> >> >> I could take, but I am just asking if you do not find another way to >> avoid code duplication. You have very similar boards, and code is simply >> duplicated. Let's see Pathch 1/5 and Patch 3/5: >> >> >> +int board_late_init(void) >> +{ >> + switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >> >> + IMX6_BMODE_SHIFT) { >> + case IMX6_BMODE_SD: >> + case IMX6_BMODE_ESD: >> + setenv("modeboot", "mmcboot"); >> + break; >> + case IMX6_BMODE_NAND: >> + setenv("modeboot", "nandboot"); >> + break; >> + default: >> + setenv("modeboot", ""); >> + break; >> + } >> + >> + return 0; >> +} >> >> And patch 3/5: >> >> +int board_late_init(void) >> +{ >> + switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >> >> + IMX6_BMODE_SHIFT) { >> + case IMX6_BMODE_SD: >> + case IMX6_BMODE_ESD: >> + setenv("modeboot", "mmcboot"); >> + break; >> + case IMX6_BMODE_NAND: >> + setenv("modeboot", "nandboot"); >> + break; >> + default: >> + setenv("modeboot", ""); >> + break; >> + } >> + >> + return 0; >> +} >> + >> >> >> Why do you not use the same factorization as for Freescale's boards ? A >> board/engicam/common could contain shared code, and you reuse it among >> boards. The same for the default environment: it is duplicated again. > > Yes, I understand completely. will factorized the code in coming MW.
Any help? thanks! -- Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot