1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) STMicroelectronics SA 2017
4 * Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics.
11 #include <asm/arch/stm32.h>
13 DECLARE_GLOBAL_DATA_PTR;
20 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
22 debug("DRAM init failed: %d\n", rv);
26 if (fdtdec_setup_mem_size_base() != 0)
32 int dram_init_banksize(void)
34 fdtdec_setup_memory_banksize();
39 u32 get_board_rev(void)
44 int board_early_init_f(void)
51 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
56 #ifdef CONFIG_MISC_INIT_R
60 u32 u_id_low, u_id_mid, u_id_high;
62 if (!env_get("serial#")) {
63 u_id_low = readl(&STM32_U_ID->u_id_low);
64 u_id_mid = readl(&STM32_U_ID->u_id_mid);
65 u_id_high = readl(&STM32_U_ID->u_id_high);
66 sprintf(serialno, "%08x%08x%08x",
67 u_id_high, u_id_mid, u_id_low);
68 env_set("serial#", serialno);