From 3554f337df59fc960d2dd2e8ee517037959752e9 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 28 Nov 2008 10:16:39 +0000 Subject: [PATCH] qi-add-totrst-clear-before-linux.patch Before leaving for Linux, gratuitously clear down the totrst / timeout counter to help stop us dying partway through boot on effective power-off. In the case we have no battery or battery < ~3V, we still somehow need to do more in kernel because it can switch itself off more than 8 seconds after this point. Signed-off-by: Andy Green --- qiboot/src/gta02/gta02.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qiboot/src/gta02/gta02.c b/qiboot/src/gta02/gta02.c index df4fe48..f6710b4 100644 --- a/qiboot/src/gta02/gta02.c +++ b/qiboot/src/gta02/gta02.c @@ -348,6 +348,10 @@ static void putc_gta02(char c) static void close_gta02(void) { + /* explicitly clear any pending 8s timeout */ + + i2c_write_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_OOCSHDWN, 0x04); + /* clear any pending timeouts by reading interrupts */ i2c_read_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_INT1);