1*14c32614STim Schendekehl /*
2*14c32614STim Schendekehl  * (C) Copyright 2011
3*14c32614STim Schendekehl  * egnite GmbH <info@egnite.de>
4*14c32614STim Schendekehl  *
5*14c32614STim Schendekehl  * See file CREDITS for list of people who contributed to this
6*14c32614STim Schendekehl  * project.
7*14c32614STim Schendekehl  *
8*14c32614STim Schendekehl  * This program is free software; you can redistribute it and/or
9*14c32614STim Schendekehl  * modify it under the terms of the GNU General Public License as
10*14c32614STim Schendekehl  * published by the Free Software Foundation; either version 2 of
11*14c32614STim Schendekehl  * the License, or (at your option) any later version.
12*14c32614STim Schendekehl  *
13*14c32614STim Schendekehl  * This program is distributed in the hope that it will be useful,
14*14c32614STim Schendekehl  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*14c32614STim Schendekehl  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16*14c32614STim Schendekehl  * GNU General Public License for more details.
17*14c32614STim Schendekehl  *
18*14c32614STim Schendekehl  * You should have received a copy of the GNU General Public License
19*14c32614STim Schendekehl  * along with this program; if not, write to the Free Software
20*14c32614STim Schendekehl  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21*14c32614STim Schendekehl  * MA 02111-1307 USA
22*14c32614STim Schendekehl  */
23*14c32614STim Schendekehl 
24*14c32614STim Schendekehl /*
25*14c32614STim Schendekehl  * Ethernut 5 power management support
26*14c32614STim Schendekehl  *
27*14c32614STim Schendekehl  * For additional information visit the project home page at
28*14c32614STim Schendekehl  * http://www.ethernut.de/
29*14c32614STim Schendekehl  */
30*14c32614STim Schendekehl 
31*14c32614STim Schendekehl /* I2C address of the PMC */
32*14c32614STim Schendekehl #define PWRMAN_I2C_ADDR 0x22
33*14c32614STim Schendekehl 
34*14c32614STim Schendekehl /* PMC registers */
35*14c32614STim Schendekehl #define PWRMAN_REG_VERS		0	/* Version register */
36*14c32614STim Schendekehl #define PWRMAN_REG_STA		1	/* Feature status register */
37*14c32614STim Schendekehl #define PWRMAN_REG_ENA		2	/* Feature enable register */
38*14c32614STim Schendekehl #define PWRMAN_REG_DIS		3	/* Feature disable register */
39*14c32614STim Schendekehl #define PWRMAN_REG_TEMP		4	/* Board temperature */
40*14c32614STim Schendekehl #define PWRMAN_REG_VAUX		6	/* Auxiliary input voltage */
41*14c32614STim Schendekehl #define PWRMAN_REG_LEDCTL	8	/* LED blinking timer. */
42*14c32614STim Schendekehl 
43*14c32614STim Schendekehl /* Feature flags used in status, enable and disable registers */
44*14c32614STim Schendekehl #define PWRMAN_BOARD	0x01	/* 1.8V and 3.3V supply */
45*14c32614STim Schendekehl #define PWRMAN_VBIN	0x02	/* VBUS input at device connector */
46*14c32614STim Schendekehl #define PWRMAN_VBOUT	0x04	/* VBUS output at host connector */
47*14c32614STim Schendekehl #define PWRMAN_MMC	0x08	/* Memory card supply */
48*14c32614STim Schendekehl #define PWRMAN_RS232	0x10	/* RS-232 driver shutdown */
49*14c32614STim Schendekehl #define PWRMAN_ETHCLK	0x20	/* Ethernet clock enable */
50*14c32614STim Schendekehl #define PWRMAN_ETHRST	0x40	/* Ethernet PHY reset */
51*14c32614STim Schendekehl #define PWRMAN_WAKEUP	0x80	/* RTC wake-up */
52*14c32614STim Schendekehl 
53*14c32614STim Schendekehl /* Features, which are not essential to keep u-boot alive */
54*14c32614STim Schendekehl #define PWRMAN_DISPENSIBLE	(PWRMAN_VBOUT | PWRMAN_MMC | PWRMAN_ETHCLK)
55*14c32614STim Schendekehl 
56*14c32614STim Schendekehl /* Enable Ethernut 5 power management. */
57*14c32614STim Schendekehl extern void ethernut5_power_init(void);
58*14c32614STim Schendekehl 
59*14c32614STim Schendekehl /* Reset Ethernet PHY. */
60*14c32614STim Schendekehl extern void ethernut5_phy_reset(void);
61*14c32614STim Schendekehl 
62*14c32614STim Schendekehl extern void ethernut5_print_version(void);
63*14c32614STim Schendekehl 
64*14c32614STim Schendekehl #ifdef CONFIG_CMD_BSP
65*14c32614STim Schendekehl extern void ethernut5_print_power(void);
66*14c32614STim Schendekehl extern void ethernut5_print_celsius(void);
67*14c32614STim Schendekehl extern void ethernut5_print_voltage(void);
68*14c32614STim Schendekehl #endif
69