mingming lee | abf2c68 | 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 | 691d719 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 8 | #include <init.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Simon Glass | 401d1c4 | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
mingming lee | abf2c68 | 2019-11-07 19:28:44 +0800 | [diff] [blame] | 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
| 14 | int board_init(void) |
| 15 | { |
| 16 | /* address of boot parameters */ |
| 17 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
| 18 | |
| 19 | debug("gd->fdt_blob is %p\n", gd->fdt_blob); |
| 20 | return 0; |
| 21 | } |
mingming lee | e650161 | 2020-01-16 16:11:38 +0800 | [diff] [blame] | 22 | |
| 23 | int board_late_init(void) |
| 24 | { |
| 25 | #ifdef CONFIG_USB_GADGET |
| 26 | struct udevice *dev; |
| 27 | int ret; |
| 28 | #endif |
| 29 | |
| 30 | #ifdef CONFIG_USB_GADGET |
| 31 | ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev); |
| 32 | if (ret) { |
| 33 | pr_err("%s: Cannot find USB device\n", __func__); |
| 34 | return ret; |
| 35 | } |
| 36 | #endif |
| 37 | |
| 38 | return 0; |
| 39 | } |