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>
18 #include <asm/global_data.h>
21 #include <asm/arch/stm32.h>
23 DECLARE_GLOBAL_DATA_PTR;
30 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
32 debug("DRAM init failed: %d\n", rv);
36 if (fdtdec_setup_mem_size_base() != 0)
42 int dram_init_banksize(void)
44 fdtdec_setup_memory_banksize();
54 #ifdef CONFIG_MISC_INIT_R
58 uint32_t u_id_low, u_id_mid, u_id_high;
60 if (!env_get("serial#")) {
61 u_id_low = readl(&STM32_U_ID->u_id_low);
62 u_id_mid = readl(&STM32_U_ID->u_id_mid);
63 u_id_high = readl(&STM32_U_ID->u_id_high);
64 sprintf(serialno, "%08x%08x%08x",
65 u_id_high, u_id_mid, u_id_low);
66 env_set("serial#", serialno);