diff options
Diffstat (limited to 'lib_arm')
-rw-r--r-- | lib_arm/armlinux.c | 10 | ||||
-rw-r--r-- | lib_arm/board.c | 18 |
2 files changed, 27 insertions, 1 deletions
diff --git a/lib_arm/armlinux.c b/lib_arm/armlinux.c index 6d32a411fd..62185f047d 100644 --- a/lib_arm/armlinux.c +++ b/lib_arm/armlinux.c @@ -78,6 +78,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], void (*theKernel)(int zero, int arch, uint params); image_header_t *hdr = &header; bd_t *bd = gd->bd; + int machid = bd->bi_arch_number; + char *s; #ifdef CONFIG_CMDLINE_TAG char *commandline = getenv ("bootargs"); @@ -85,6 +87,12 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep); + s = getenv ("machid"); + if (s) { + machid = simple_strtoul (s, NULL, 16); + printf ("Using machid 0x%x from environment\n", machid); + } + /* * Check if there is an initrd image */ @@ -260,7 +268,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], cleanup_before_linux (); - theKernel (0, bd->bi_arch_number, bd->bi_boot_params); + theKernel (0, machid, bd->bi_boot_params); } diff --git a/lib_arm/board.c b/lib_arm/board.c index 7e7a28271d..22d573a398 100644 --- a/lib_arm/board.c +++ b/lib_arm/board.c @@ -84,6 +84,11 @@ extern void cs8900_get_enetaddr (uchar * addr); 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" */ @@ -209,6 +214,16 @@ static void display_flash_config (ulong size) } #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... * @@ -251,6 +266,9 @@ init_fnc_t *init_sequence[] = { #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, |