Tim Schendekehl | 024b61c | 2011-11-01 23:55:01 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2011 |
| 3 | * egnite GmbH <info@egnite.de> |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Tim Schendekehl | 024b61c | 2011-11-01 23:55:01 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Ethernut 5 power management support |
| 10 | * |
| 11 | * For additional information visit the project home page at |
| 12 | * http://www.ethernut.de/ |
| 13 | */ |
| 14 | |
| 15 | /* I2C address of the PMC */ |
| 16 | #define PWRMAN_I2C_ADDR 0x22 |
| 17 | |
| 18 | /* PMC registers */ |
| 19 | #define PWRMAN_REG_VERS 0 /* Version register */ |
| 20 | #define PWRMAN_REG_STA 1 /* Feature status register */ |
| 21 | #define PWRMAN_REG_ENA 2 /* Feature enable register */ |
| 22 | #define PWRMAN_REG_DIS 3 /* Feature disable register */ |
| 23 | #define PWRMAN_REG_TEMP 4 /* Board temperature */ |
| 24 | #define PWRMAN_REG_VAUX 6 /* Auxiliary input voltage */ |
| 25 | #define PWRMAN_REG_LEDCTL 8 /* LED blinking timer. */ |
| 26 | |
| 27 | /* Feature flags used in status, enable and disable registers */ |
| 28 | #define PWRMAN_BOARD 0x01 /* 1.8V and 3.3V supply */ |
| 29 | #define PWRMAN_VBIN 0x02 /* VBUS input at device connector */ |
| 30 | #define PWRMAN_VBOUT 0x04 /* VBUS output at host connector */ |
| 31 | #define PWRMAN_MMC 0x08 /* Memory card supply */ |
| 32 | #define PWRMAN_RS232 0x10 /* RS-232 driver shutdown */ |
| 33 | #define PWRMAN_ETHCLK 0x20 /* Ethernet clock enable */ |
| 34 | #define PWRMAN_ETHRST 0x40 /* Ethernet PHY reset */ |
| 35 | #define PWRMAN_WAKEUP 0x80 /* RTC wake-up */ |
| 36 | |
| 37 | /* Features, which are not essential to keep u-boot alive */ |
| 38 | #define PWRMAN_DISPENSIBLE (PWRMAN_VBOUT | PWRMAN_MMC | PWRMAN_ETHCLK) |
| 39 | |
| 40 | /* Enable Ethernut 5 power management. */ |
| 41 | extern void ethernut5_power_init(void); |
| 42 | |
| 43 | /* Reset Ethernet PHY. */ |
| 44 | extern void ethernut5_phy_reset(void); |
| 45 | |
| 46 | extern void ethernut5_print_version(void); |
| 47 | |
| 48 | #ifdef CONFIG_CMD_BSP |
| 49 | extern void ethernut5_print_power(void); |
| 50 | extern void ethernut5_print_celsius(void); |
| 51 | extern void ethernut5_print_voltage(void); |
| 52 | #endif |