1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-23 00:53:09 +02:00

qi-return-i2c-to-peripheral.patch

Return IO to peripheral mode for i2c at end of init

Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
Andy Green 2008-11-28 10:16:39 +00:00 committed by Andy Green
parent 6e84650e2f
commit 0a72b19c3f
3 changed files with 23 additions and 0 deletions

View File

@ -74,6 +74,7 @@ struct board_api {
int (*is_this_board)(void); int (*is_this_board)(void);
void (*port_init)(void); void (*port_init)(void);
void (*putc)(char); void (*putc)(char);
void (*close)(void);
struct kernel_source kernel_source[8]; struct kernel_source kernel_source[8];
}; };

View File

@ -324,6 +324,21 @@ static void putc_gta02(char c)
serial_putc_s3c24xx(GTA02_DEBUG_UART, c); serial_putc_s3c24xx(GTA02_DEBUG_UART, c);
} }
static void close_gta02(void)
{
/* clear any pending timeouts by reading interrupts */
i2c_read_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_INT1);
i2c_read_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_INT2);
i2c_read_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_INT3);
i2c_read_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_INT4);
i2c_read_sync(&bb_s3c24xx, PCF50633_I2C_ADS, PCF50633_REG_INT5);
/* set I2C GPIO back to peripheral unit */
(bb_s3c24xx.close)();
}
/* /*
* our API for bootloader on this machine * our API for bootloader on this machine
*/ */
@ -338,6 +353,7 @@ const struct board_api board_api_gta02 = {
.is_this_board = is_this_board_gta02, .is_this_board = is_this_board_gta02,
.port_init = port_init_gta02, .port_init = port_init_gta02,
.putc = putc_gta02, .putc = putc_gta02,
.close = close_gta02,
/* these are the ways we could boot GTA02 in order to try */ /* these are the ways we could boot GTA02 in order to try */
.kernel_source = { .kernel_source = {
[0] = { [0] = {

View File

@ -252,6 +252,12 @@ void bootloader_second_phase(void)
params->hdr.tag = ATAG_NONE; params->hdr.tag = ATAG_NONE;
params->hdr.size = 0; params->hdr.size = 0;
/* give board implementation a chance to shut down
* anything it may have going on, leave GPIO set for Linux
*/
if (this_board->close)
(this_board->close)();
puts ("Starting --->\n\n"); puts ("Starting --->\n\n");
/* /*