projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://www.denx.de/git/u-boot-ppc4xx
[platform/kernel/u-boot.git]
/
lib_arm
/
board.c
diff --git
a/lib_arm/board.c
b/lib_arm/board.c
index
6f35aa0
..
80b149b
100644
(file)
--- a/
lib_arm/board.c
+++ b/
lib_arm/board.c
@@
-44,6
+44,9
@@
#include <devices.h>
#include <version.h>
#include <net.h>
#include <devices.h>
#include <version.h>
#include <net.h>
+#include <serial.h>
+#include <nand.h>
+#include <onenand_uboot.h>
#ifdef CONFIG_DRIVER_SMC91111
#include "../drivers/net/smc91111.h"
#ifdef CONFIG_DRIVER_SMC91111
#include "../drivers/net/smc91111.h"
@@
-54,14
+57,6
@@
DECLARE_GLOBAL_DATA_PTR;
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_CMD_NAND)
-void nand_init (void);
-#endif
-
-#if defined(CONFIG_CMD_ONENAND)
-void onenand_init(void);
-#endif
-
ulong monitor_flash_len;
#ifdef CONFIG_HAS_DATAFLASH
ulong monitor_flash_len;
#ifdef CONFIG_HAS_DATAFLASH
@@
-84,6
+79,11
@@
extern void cs8900_get_enetaddr (uchar * addr);
extern void rtl8019_get_enetaddr (uchar * addr);
#endif
extern void rtl8019_get_enetaddr (uchar * addr);
#endif
+#if defined(CONFIG_HARD_I2C) || \
+ defined(CONFIG_SOFT_I2C)
+#include <i2c.h>
+#endif
+
/*
* Begin and End of memory area for malloc(), and current "brk"
*/
/*
* Begin and End of memory area for malloc(), and current "brk"
*/
@@
-115,6
+115,20
@@
void *sbrk (ptrdiff_t increment)
return ((void *) old);
}
return ((void *) old);
}
+char *strmhz(char *buf, long hz)
+{
+ long l, n;
+ long m;
+
+ n = hz / 1000000L;
+ l = sprintf (buf, "%ld", n);
+ m = (hz % 1000000L) / 1000L;
+ if (m != 0)
+ sprintf (buf + l, ".%03ld", m);
+ return (buf);
+}
+
+
/************************************************************************
* Coloured LED functionality
************************************************************************
/************************************************************************
* Coloured LED functionality
************************************************************************
@@
-209,6
+223,16
@@
static void display_flash_config (ulong size)
}
#endif /* CFG_NO_FLASH */
}
#endif /* CFG_NO_FLASH */
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+static int init_func_i2c (void)
+{
+ puts ("I2C: ");
+ i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+ puts ("ready\n");
+ return (0);
+}
+#endif
+
/*
* Breathe some life into the board...
*
/*
* Breathe some life into the board...
*
@@
-251,6
+275,9
@@
init_fnc_t *init_sequence[] = {
#if defined(CONFIG_DISPLAY_BOARDINFO)
checkboard, /* display board info */
#endif
#if defined(CONFIG_DISPLAY_BOARDINFO)
checkboard, /* display board info */
#endif
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+ init_func_i2c,
+#endif
dram_init, /* configure available RAM banks */
display_dram_config,
NULL,
dram_init, /* configure available RAM banks */
display_dram_config,
NULL,
@@
-260,7
+287,7
@@
void start_armboot (void)
{
init_fnc_t **init_fnc_ptr;
char *s;
{
init_fnc_t **init_fnc_ptr;
char *s;
-#if
ndef CFG_NO_FLASH
+#if
!defined(CFG_NO_FLASH) || defined (CONFIG_VFD) || defined(CONFIG_LCD)
ulong size;
#endif
#if defined(CONFIG_VFD) || defined(CONFIG_LCD)
ulong size;
#endif
#if defined(CONFIG_VFD) || defined(CONFIG_LCD)
@@
-304,16
+331,19
@@
void start_armboot (void)
#endif /* CONFIG_VFD */
#ifdef CONFIG_LCD
#endif /* CONFIG_VFD */
#ifdef CONFIG_LCD
-# ifndef PAGE_SIZE
-# define PAGE_SIZE 4096
-# endif
- /*
- * reserve memory for LCD display (always full pages)
- */
- /* bss_end is defined in the board-specific linker script */
- addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
- size = lcd_setmem (addr);
- gd->fb_base = addr;
+ /* board init may have inited fb_base */
+ if (!gd->fb_base) {
+# ifndef PAGE_SIZE
+# define PAGE_SIZE 4096
+# endif
+ /*
+ * reserve memory for LCD display (always full pages)
+ */
+ /* bss_end is defined in the board-specific linker script */
+ addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+ size = lcd_setmem (addr);
+ gd->fb_base = addr;
+ }
#endif /* CONFIG_LCD */
/* armboot_start is defined in the board-specific linker script */
#endif /* CONFIG_LCD */
/* armboot_start is defined in the board-specific linker script */
@@
-430,6
+460,10
@@
extern void dm644x_eth_set_mac_addr (const u_int8_t *addr);
puts ("Net: ");
#endif
eth_initialize(gd->bd);
puts ("Net: ");
#endif
eth_initialize(gd->bd);
+#if defined(CONFIG_RESET_PHY_R)
+ debug ("Reset Ethernet PHY\n");
+ reset_phy();
+#endif
#endif
/* main_loop() can return to retry autoboot, if so just run it again. */
for (;;) {
#endif
/* main_loop() can return to retry autoboot, if so just run it again. */
for (;;) {