1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) STMicroelectronics SA 2017
13 #include <asm/arch/stm32.h>
15 DECLARE_GLOBAL_DATA_PTR;
22 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
24 debug("DRAM init failed: %d\n", rv);
28 if (fdtdec_setup_mem_size_base() != 0)
34 int dram_init_banksize(void)
36 fdtdec_setup_memory_banksize();
41 u32 get_board_rev(void)
46 int board_early_init_f(void)
53 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
58 #ifdef CONFIG_MISC_INIT_R
62 u32 u_id_low, u_id_mid, u_id_high;
64 if (!env_get("serial#")) {
65 u_id_low = readl(&STM32_U_ID->u_id_low);
66 u_id_mid = readl(&STM32_U_ID->u_id_mid);
67 u_id_high = readl(&STM32_U_ID->u_id_high);
68 sprintf(serialno, "%08x%08x%08x",
69 u_id_high, u_id_mid, u_id_low);
70 env_set("serial#", serialno);