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