developer | 862f505 | 2019-11-07 19:28:44 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2019 MediaTek Inc. |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <dm.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 8 | #include <init.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
Simon Glass | bdd5f81 | 2023-09-14 18:21:46 -0600 | [diff] [blame] | 11 | #include <linux/printk.h> |
developer | 862f505 | 2019-11-07 19:28:44 +0800 | [diff] [blame] | 12 | |
| 13 | DECLARE_GLOBAL_DATA_PTR; |
| 14 | |
| 15 | int board_init(void) |
| 16 | { |
| 17 | /* address of boot parameters */ |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 18 | gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100; |
developer | 862f505 | 2019-11-07 19:28:44 +0800 | [diff] [blame] | 19 | |
| 20 | debug("gd->fdt_blob is %p\n", gd->fdt_blob); |
| 21 | return 0; |
| 22 | } |
developer | cabebda | 2020-01-16 16:11:38 +0800 | [diff] [blame] | 23 | |
| 24 | int 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 | } |