Igor Grinberg | a937fd1 | 2014-11-03 11:32:18 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il> |
| 3 | * |
| 4 | * Authors: Igor Grinberg <grinberg@compulab.co.il> |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <asm/bootm.h> |
Igor Grinberg | 959bc1d | 2014-11-03 11:32:19 +0200 | [diff] [blame^] | 11 | #include <asm/gpio.h> |
Igor Grinberg | a937fd1 | 2014-11-03 11:32:18 +0200 | [diff] [blame] | 12 | |
| 13 | #include "common.h" |
| 14 | #include "eeprom.h" |
| 15 | |
| 16 | void cl_print_pcb_info(void) |
| 17 | { |
| 18 | u32 board_rev = get_board_rev(); |
| 19 | u32 rev_major = board_rev / 100; |
| 20 | u32 rev_minor = board_rev - (rev_major * 100); |
| 21 | |
| 22 | if ((rev_minor / 10) * 10 == rev_minor) |
| 23 | rev_minor = rev_minor / 10; |
| 24 | |
| 25 | printf("PCB: %u.%u\n", rev_major, rev_minor); |
| 26 | } |
Igor Grinberg | 959bc1d | 2014-11-03 11:32:19 +0200 | [diff] [blame^] | 27 | |
| 28 | #ifdef CONFIG_CMD_USB |
| 29 | int cl_usb_hub_init(int gpio, const char *label) |
| 30 | { |
| 31 | if (gpio_request(gpio, label)) { |
| 32 | printf("Error: can't obtain GPIO%d for %s", gpio, label); |
| 33 | return -1; |
| 34 | } |
| 35 | |
| 36 | gpio_direction_output(gpio, 0); |
| 37 | udelay(10); |
| 38 | gpio_set_value(gpio, 1); |
| 39 | udelay(1000); |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | void cl_usb_hub_deinit(int gpio) |
| 44 | { |
| 45 | gpio_free(gpio); |
| 46 | } |
| 47 | #endif |