Index: linux-2.6.16.13-ezx3/arch/arm/mach-pxa/ezx.c =================================================================== --- linux-2.6.16.13-ezx3.orig/arch/arm/mach-pxa/ezx.c 2006-05-14 16:48:38.000000000 +0200 +++ linux-2.6.16.13-ezx3/arch/arm/mach-pxa/ezx.c 2006-05-14 16:58:57.000000000 +0200 @@ -81,6 +81,27 @@ } EXPORT_SYMBOL(ezx_bt_reset); +static void ezx_bp_reset(void) +{ + unsigned int i; + clr_GPIO(GPIO_BB_RESET); + for (i=0x00080000; i>0; i--) + ; + set_GPIO(GPIO_BB_RESET); +} + +static void ezx_bp_mode_flash(int flash) +{ + if (flash == 0) { + set_GPIO(GPIO_MCU_INT_SW); + pxa_gpio_mode(GPIO_MCU_INT_SW | GPIO_IN); + } else { + pxa_gpio_mode(GPIO_MCU_INT_SW | GPIO_OUT); + clr_GPIO(GPIO_MCU_INT_SW); + } + ezx_bp_reset(); +} + /* check power down condition */ inline void check_power_off(void) { @@ -849,6 +870,7 @@ ssp_pcap_init(); emu_switch_to(EMU_SWITCH_TO_USB); + ezx_bp_mode_flash(0); /* switch BP to regular mode */ /* enable this line when you want to run FFUART on the USB plug */ //emu_switch_to(EMU_SWITCH_TO_UART);