Comments
Patch
@@ -232,6 +232,10 @@ int env_import(const char *buf, int check)
void env_relocate(void)
{
+#ifdef CONFIG_BAUDRATE_UPDATE_ON_RELOC
+ const char *baudrate_str;
+#endif
+
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
env_reloc();
#endif
@@ -253,6 +257,21 @@ void env_relocate(void)
else
gd->flags &= ~GD_FLG_SILENT;
#endif
+
+#ifdef CONFIG_BAUDRATE_UPDATE_ON_RELOC
+ baudrate_str = getenv("baudrate");
+ if (baudrate_str != NULL) {
+ int baudrate = simple_strtoul(baudrate_str, NULL, 10);
+
+ if (baudrate != gd->baudrate) {
+ gd->baudrate = baudrate;
+#if defined(CONFIG_PPC) || defined(CONFIG_MCF52x2)
+ gd->bd->bi_baudrate = baudrate;
+#endif
+ serial_setbrg();
+ }
+ }
+#endif
}
#ifdef CONFIG_AUTO_COMPLETE
After the env is relocated, make sure that the serial baudrate is applied in case it's different (such as the env_nand case). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> --- common/env_common.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)