blob: e03da63b1d922e3d720eb65bc9b99021ad7f3ab8 [file] [log] [blame]
developer862f5052019-11-07 19:28:44 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2019 MediaTek Inc.
4 */
5
6#include <common.h>
7#include <dm.h>
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Simon Glass0f2af882020-05-10 11:40:05 -06009#include <log.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060010#include <asm/global_data.h>
Simon Glassbdd5f812023-09-14 18:21:46 -060011#include <linux/printk.h>
developer862f5052019-11-07 19:28:44 +080012
13DECLARE_GLOBAL_DATA_PTR;
14
15int board_init(void)
16{
17 /* address of boot parameters */
Tom Rinibb4dd962022-11-16 13:10:37 -050018 gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100;
developer862f5052019-11-07 19:28:44 +080019
20 debug("gd->fdt_blob is %p\n", gd->fdt_blob);
21 return 0;
22}
developercabebda2020-01-16 16:11:38 +080023
24int board_late_init(void)
25{
26#ifdef CONFIG_USB_GADGET
27 struct udevice *dev;
28 int ret;
29#endif
30
31#ifdef CONFIG_USB_GADGET
32 ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev);
33 if (ret) {
34 pr_err("%s: Cannot find USB device\n", __func__);
35 return ret;
36 }
37#endif
38
39 return 0;
40}