3 * Vikas Manocha, <vikas.manocha@st.com>
5 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/armv7m.h>
13 #include <asm/arch/stm32.h>
14 #include <asm/arch/gpio.h>
15 #include <dm/platdata.h>
16 #include <dm/platform_data/serial_stm32x7.h>
17 #include <asm/arch/stm32_periph.h>
18 #include <asm/arch/stm32_defs.h>
19 #include <asm/arch/syscfg.h>
22 DECLARE_GLOBAL_DATA_PTR;
30 rv = uclass_get_device(UCLASS_RAM, 0, &dev);
32 debug("DRAM init failed: %d\n", rv);
35 rv = ram_get_info(dev, &ram);
37 debug("Cannot get DRAM size: %d\n", rv);
40 debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size);
41 gd->ram_size = ram.size;
44 * Fill in global info with description of SRAM configuration
46 gd->bd->bi_dram[0].start = CONFIG_SYS_RAM_BASE;
47 gd->bd->bi_dram[0].size = ram.size;
52 #ifdef CONFIG_ETH_DESIGNWARE
53 static int stmmac_setup(void)
55 clock_setup(SYSCFG_CLOCK_CFG);
57 STM32_SYSCFG->pmc |= SYSCFG_PMC_MII_RMII_SEL;
58 clock_setup(STMMAC_CLOCK_CFG);
63 int board_early_init_f(void)
71 u32 get_board_rev(void)
76 int board_late_init(void)
78 struct gpio_desc gpio = {};
81 node = fdt_node_offset_by_compatible(gd->fdt_blob, 0, "st,led1");
85 gpio_request_by_name_nodev(gd->fdt_blob, node, "led-gpio", 0, &gpio,
88 if (dm_gpio_is_valid(&gpio)) {
89 dm_gpio_set_value(&gpio, 0);
91 dm_gpio_set_value(&gpio, 1);
95 node = fdt_node_offset_by_compatible(gd->fdt_blob, 0, "st,button1");
99 gpio_request_by_name_nodev(gd->fdt_blob, node, "button-gpio", 0, &gpio,
102 if (dm_gpio_is_valid(&gpio)) {
103 if (dm_gpio_get_value(&gpio))
104 puts("usr button is at HIGH LEVEL\n");
106 puts("usr button is at LOW LEVEL\n");
114 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;