Stefan Roese | ae9996c | 2015-11-18 11:06:09 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 Stefan Roese <sr@denx.de> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <i2c.h> |
| 9 | #include <miiphy.h> |
| 10 | #include <asm/arch/reset_manager.h> |
| 11 | #include <asm/gpio.h> |
| 12 | #include <asm/io.h> |
| 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
| 16 | void s_init(void) {} |
| 17 | |
| 18 | /* |
| 19 | * Miscellaneous platform dependent initialisations |
| 20 | */ |
| 21 | int board_init(void) |
| 22 | { |
| 23 | /* Address of boot parameters for ATAG (if ATAG is used) */ |
| 24 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
| 25 | |
| 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | int board_early_init_f(void) |
| 30 | { |
| 31 | int ret; |
| 32 | |
| 33 | /* Reset the Marvell PHY 88E1510 */ |
| 34 | ret = gpio_request(63, "PHY reset"); |
| 35 | if (ret) |
| 36 | return ret; |
| 37 | |
| 38 | gpio_direction_output(63, 0); |
| 39 | mdelay(1); |
| 40 | gpio_set_value(63, 1); |
| 41 | mdelay(10); |
| 42 | |
| 43 | return 0; |
| 44 | } |