From: H. Nikolaus Schaller Date: Thu, 7 Apr 2016 17:40:17 +0000 (+0200) Subject: Pyra: activate peripheral reset to bring tca6424 and is31fl96 into defined state X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df48247eee28e8ddf0dab1833f1dbb175feb24a9;p=pandora-u-boot.git Pyra: activate peripheral reset to bring tca6424 and is31fl96 into defined state Signed-off-by: H. Nikolaus Schaller --- diff --git a/board/pandora/pyra+lc15/pyra+lc15.c b/board/pandora/pyra+lc15/pyra+lc15.c index 50077f36cb0..32ad2f5b367 100644 --- a/board/pandora/pyra+lc15/pyra+lc15.c +++ b/board/pandora/pyra+lc15/pyra+lc15.c @@ -148,7 +148,26 @@ int bq2429x_set_iinlim(int mA) int board_init(void) { int ilim; - board_init_overwritten(); /* do everything inherited from LC15 board */ + + /* do the same as on LC15 board/EVM */ + gpmc_init(); + gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM; + gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ + +#if 1 + printk("reset peripherals\n"); + /* but now reset peripherals */ + gpio_request(144, "peripheral-reset"); + gpio_direction_output(144, 0); /* reset all peripheral chips (incl. tca6424) */ + udelay(1000); /* 1ms should suffice */ + gpio_direction_output(144, 1); + gpio_free(144); + udelay(5000); /* 5ms should suffice */ +#endif + +// UNDERSTAND ME: it is important that we program the bq2429x first before +// we initialize the tca6424! Why? What is turned on and draws too much energy? + if (bq24297_i2c_write_u8(0x05, 0x8a)) printf("bq24297: could not turn off 40 sec watchdog\n"); /* set bq24297 current limit to 2 A if we operate from no battery and 100 mA if we have */