From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ladislav Michl Date: Mon, 16 Mar 2009 23:30:25 +0100 Subject: [U-Boot] [PATCH 4/5] NetStar: add RTC support In-Reply-To: <20090316222620.GA1879@localhost.localdomain> References: <20090313133139.GA6797@localhost.localdomain> <20090316222620.GA1879@localhost.localdomain> Message-ID: <20090316223025.GE1879@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add RTC support. Signed-off-by: Ladislav Michl --- a/include/configs/netstar.h 2009-03-16 15:42:01.000000000 +0100 +++ b/include/configs/netstar.h 2009-03-16 15:43:33.000000000 +0100 @@ -110,6 +110,14 @@ #define CONFIG_SYS_NAND_BASE 0x04000000 + (2 << 23) #define NAND_ALLOW_ERASE_ALL 1 +#define CONFIG_HARD_I2C +#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C_SLAVE 1 +#define CONFIG_DRIVER_OMAP1510_I2C + +#define CONFIG_RTC_DS1307 +#define CONFIG_SYS_I2C_RTC_ADDR 0x68 + #define CONFIG_CONS_INDEX 1 #define CONFIG_BAUDRATE 115200 @@ -133,6 +141,7 @@ */ #define CONFIG_CMD_BDI #define CONFIG_CMD_BOOTD +#define CONFIG_CMD_DATE #define CONFIG_CMD_DHCP #define CONFIG_CMD_SAVEENV #define CONFIG_CMD_FLASH --- a/board/netstar/netstar.c 2009-03-16 15:43:59.000000000 +0100 +++ b/board/netstar/netstar.c 2009-03-16 15:44:51.000000000 +0100 @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -56,6 +57,10 @@ int misc_init_r(void) { +#if defined(CONFIG_RTC_DS1307) + /* enable trickle charge */ + i2c_reg_write(CONFIG_SYS_I2C_RTC_ADDR, 0x10, 0xaa); +#endif return 0; }