diff options
Diffstat (limited to 'arch/arm/mach-stm32mp/cpu.c')
-rw-r--r-- | arch/arm/mach-stm32mp/cpu.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c index 3faa4ec18a..bc2db535be 100644 --- a/arch/arm/mach-stm32mp/cpu.c +++ b/arch/arm/mach-stm32mp/cpu.c @@ -223,8 +223,10 @@ static void early_enable_caches(void) if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) return; - gd->arch.tlb_size = PGTABLE_SIZE; - gd->arch.tlb_addr = (unsigned long)&early_tlb; + if (!(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))) { + gd->arch.tlb_size = PGTABLE_SIZE; + gd->arch.tlb_addr = (unsigned long)&early_tlb; + } dcache_enable(); @@ -265,7 +267,8 @@ int arch_cpu_init(void) boot_mode = get_bootmode(); - if ((boot_mode & TAMP_BOOT_DEVICE_MASK) == BOOT_SERIAL_UART) + if (IS_ENABLED(CONFIG_CMD_STM32PROG_SERIAL) && + (boot_mode & TAMP_BOOT_DEVICE_MASK) == BOOT_SERIAL_UART) gd->flags |= GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE; #if defined(CONFIG_DEBUG_UART) && \ !defined(CONFIG_TFABOOT) && \ @@ -465,7 +468,6 @@ static void setup_boot_mode(void) unsigned int instance = (boot_mode & TAMP_BOOT_INSTANCE_MASK) - 1; u32 forced_mode = (boot_ctx & TAMP_BOOT_FORCED_MASK); struct udevice *dev; - int alias; log_debug("%s: boot_ctx=0x%x => boot_mode=%x, instance=%d forced=%x\n", __func__, boot_ctx, boot_mode, instance, forced_mode); @@ -473,19 +475,23 @@ static void setup_boot_mode(void) case BOOT_SERIAL_UART: if (instance > ARRAY_SIZE(serial_addr)) break; - /* serial : search associated alias in devicetree */ + /* serial : search associated node in devicetree */ sprintf(cmd, "serial@%x", serial_addr[instance]); - if (uclass_get_device_by_name(UCLASS_SERIAL, cmd, &dev)) - break; - if (fdtdec_get_alias_seq(gd->fdt_blob, "serial", - dev_of_offset(dev), &alias)) + if (uclass_get_device_by_name(UCLASS_SERIAL, cmd, &dev)) { + /* restore console on error */ + if (IS_ENABLED(CONFIG_CMD_STM32PROG_SERIAL)) + gd->flags &= ~(GD_FLG_SILENT | + GD_FLG_DISABLE_CONSOLE); + printf("uart%d = %s not found in device tree!\n", + instance, cmd); break; - sprintf(cmd, "%d", alias); + } + sprintf(cmd, "%d", dev_seq(dev)); env_set("boot_device", "serial"); env_set("boot_instance", cmd); /* restore console on uart when not used */ - if (gd->cur_serial_dev != dev) { + if (IS_ENABLED(CONFIG_CMD_STM32PROG_SERIAL) && gd->cur_serial_dev != dev) { gd->flags &= ~(GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE); printf("serial boot with console enabled!\n"); |