1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) STMicroelectronics SA 2017
4 * Author(s): Patrice CHOTARD, <patrice.chotard@foss.st.com> for STMicroelectronics.
14 #include <asm/arch/stm32.h>
16 DECLARE_GLOBAL_DATA_PTR;
23 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
25 debug("DRAM init failed: %d\n", rv);
29 if (fdtdec_setup_mem_size_base() != 0)
35 int dram_init_banksize(void)
37 fdtdec_setup_memory_banksize();
42 u32 get_board_rev(void)
47 int board_early_init_f(void)
54 gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
59 #ifdef CONFIG_MISC_INIT_R
63 u32 u_id_low, u_id_mid, u_id_high;
65 if (!env_get("serial#")) {
66 u_id_low = readl(&STM32_U_ID->u_id_low);
67 u_id_mid = readl(&STM32_U_ID->u_id_mid);
68 u_id_high = readl(&STM32_U_ID->u_id_high);
69 sprintf(serialno, "%08x%08x%08x",
70 u_id_high, u_id_mid, u_id_low);
71 env_set("serial#", serialno);