From: Stefan Agner Date: Sun, 27 Aug 2017 12:17:01 -0700 Subject: [U-Boot] [PATCH v1 2/2] imx: use BOOT_DEVICE_BOARD instead of UART In-Reply-To: <7100B737-9110-4EC8-B865-4019AA2CB8C4@armadeus.com> References: <20170816004943.5325-1-stefan@agner.ch> <20170816004943.5325-2-stefan@agner.ch> <7100B737-9110-4EC8-B865-4019AA2CB8C4@armadeus.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On 2017-08-27 01:45, S=C3=A9bastien Szymanski wrote: > Hello, >=20 >> On 25 Aug 2017, at 13:33, Stefano Babic wrote: >> >> On 16/08/2017 02:49, Stefan Agner wrote: >>> From: Stefan Agner >>> >>> i.MX 6 serial downloader is not necessarily booting via UART but can >>> also boot from USB. In fact only some i.MX chips have serial >>> downloader support via UART (e.g. 6UL/ULL and Vybrid) but all of >>> them have serial downloader support via USB. Use the more appropriate >>> BOOT_DEVICE_BOARD define which is used for ROM provided recovery >>> mechanisms in general. >>> >>> Signed-off-by: Stefan Agner >>> --- >>> >>> arch/arm/mach-imx/spl.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c >>> index 836b334fa9..bcd1033fdb 100644 >>> --- a/arch/arm/mach-imx/spl.c >>> +++ b/arch/arm/mach-imx/spl.c >>> @@ -27,7 +27,7 @@ u32 spl_boot_device(void) >>> * BOOT_MODE - see IMX6DQRM Table 8-1 >>> */ >>> if (((bmode >> 24) & 0x03) =3D=3D 0x01) /* Serial Downloader */ >>> - return BOOT_DEVICE_UART; >=20 > Returning BOOT_DEVICE_UART here makes the SPL to load U-Boot from the > debug UART using a ymodem transfer when enabled with > CONFIG_SPL_YMODEM_SUPPORT like it is on the OPOS6ULDev board. This is > now broken. For reference, the change has been discussed here: https://www.mail-archive.com/u-boot at lists.denx.de/msg259729.html Returning UART is definitely wrong, because the boot ROM can also boot from USB...=20 As I mentioned in the other thread, ideally we should be able to do a runtime detection to discriminate between UART and USB loader. I think Stefano did not like that since it relies on undocumented features. So BOOT_DEVICE is really ambiguous. Maybe BOOT_DEVICE_* should be a bitfield? Then we could return BOOT_DEVICE_UART and BOOT_DEVICE_USB, and boards can just compile in the support they need. Changing the Y-Modem support to boot device BOOT_DEVICE_BOARD is not possible since other SoCs use BOOT_DEVICE_UART. I guess we could just add a second SPL_LOAD_IMAGE_METHOD in common/spl/spl_ymodem.c for BOOT_DEVICE_BOARD. -- Stefan >=20 > Regards, >=20 >>> + return BOOT_DEVICE_BOARD; >>> >>> /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */ >>> switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) { >>> @@ -43,7 +43,7 @@ u32 spl_boot_device(void) >>> } >>> /* Reserved: Used to force Serial Downloader */ >>> case IMX6_BMODE_RESERVED: >>> - return BOOT_DEVICE_UART; >>> + return BOOT_DEVICE_BOARD; >>> /* SATA: See 8.5.4, Table 8-20 */ >>> case IMX6_BMODE_SATA: >>> return BOOT_DEVICE_SATA; >>> >> >> Applied to u-boot-imx, -master, thanks ! >> >> Best regards, >> Stefano Babic >> >> >> -- >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk >> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany >> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> _______________________________________________ >> U-Boot mailing list >> U-Boot at lists.denx.de >> https://lists.denx.de/listinfo/u-boot