1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2011, 2012, 2013
19 #include <asm/arch/stm32.h>
21 DECLARE_GLOBAL_DATA_PTR;
28 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
30 debug("DRAM init failed: %d\n", rv);
34 if (fdtdec_setup_mem_size_base() != 0)
40 int dram_init_banksize(void)
42 fdtdec_setup_memory_banksize();
47 u32 get_board_rev(void)
52 int board_early_init_f(void)
59 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
64 #ifdef CONFIG_MISC_INIT_R
68 uint32_t u_id_low, u_id_mid, u_id_high;
70 if (!env_get("serial#")) {
71 u_id_low = readl(&STM32_U_ID->u_id_low);
72 u_id_mid = readl(&STM32_U_ID->u_id_mid);
73 u_id_high = readl(&STM32_U_ID->u_id_high);
74 sprintf(serialno, "%08x%08x%08x",
75 u_id_high, u_id_mid, u_id_low);
76 env_set("serial#", serialno);