1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2011, 2012, 2013
4 * Yuri Tikhonov, Emcraft Systems, yur@emcraft.com
5 * Alexander Potashev, Emcraft Systems, aspotashev@emcraft.com
6 * Vladimir Khusainov, Emcraft Systems, vlad@emcraft.com
7 * Pavel Boldin, Emcraft Systems, paboldin@emcraft.com
10 * Kamil Lulko, <kamil.lulko@gmail.com>
20 #include <asm/arch/stm32.h>
22 DECLARE_GLOBAL_DATA_PTR;
29 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
31 debug("DRAM init failed: %d\n", rv);
35 if (fdtdec_setup_mem_size_base() != 0)
41 int dram_init_banksize(void)
43 fdtdec_setup_memory_banksize();
48 u32 get_board_rev(void)
53 int board_early_init_f(void)
60 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
65 #ifdef CONFIG_MISC_INIT_R
69 uint32_t u_id_low, u_id_mid, u_id_high;
71 if (!env_get("serial#")) {
72 u_id_low = readl(&STM32_U_ID->u_id_low);
73 u_id_mid = readl(&STM32_U_ID->u_id_mid);
74 u_id_high = readl(&STM32_U_ID->u_id_high);
75 sprintf(serialno, "%08x%08x%08x",
76 u_id_high, u_id_mid, u_id_low);
77 env_set("serial#", serialno);