int board_private_init(void) { unsigned int signature = 0; /*add board privater gpio here ,it while be called by boot_main to nitialization*/ /*init GPIO_KEYPAD_5x5*/ __gpio_clear_pin(GPIO_COL0); __gpio_as_output(GPIO_COL0); __gpio_set_pin(GPIO_ROW0); __gpio_as_output(GPIO_ROW0); __gpio_clear_pin(GPIO_COL2); __gpio_as_output(GPIO_COL2); __gpio_clear_pin(GPIO_COL3); __gpio_as_output(GPIO_COL3); __gpio_clear_pin(GPIO_COL4); __gpio_as_output(GPIO_COL4); /*Add for the hibernate function and the other function*/ /*Do first battery set up detect and then hibernate or power on*/ if ((REG_RTC_HWRSR & 0x10)){ serial_puts_info("Ready to into hibernate mode ... \n"); jz_pm_do_hibernate(); } /*Check the recovery signature,if exist,skip the charge_detect func.*/ signature = cpm_get_scrpad(); if ((signature == RECOVERY_SIGNATURE) || (signature == RECOVERY_SIGNATURE_SEC)) { if (signature == RECOVERY_SIGNATURE_SEC) cpm_set_scrpad(0); goto skip_chgdet; } /*Usb Cable detection ,If connected ,then do charge else skip it*/ if(charge_detect()){ charge_logo_display(); } /* * enable vibrator to tell user power on. */ __gpio_set_pin(32*5+10); __gpio_as_output(32*5+10); mdelay(100); __gpio_clear_pin(32*5+10); skip_chgdet: /*Before Enter the system,check the battery status, If low battery,then Enter the hibernate mode */ while(low_battery_detect() && !charge_detect()){ low_battery_warning(); jz_pm_do_hibernate(); } }
int board_private_init(void) { unsigned int signature = 0; act8600_output_set(1,0x1a); //core 1.2 -> 1.3 soft_reset(); /*add board privater gpio here ,it while be called by boot_main to nitialization*/ /*Check the recovery signature,if exist,skip the charge_detect func.*/ signature = cpm_get_scrpad(); if ((signature == RECOVERY_SIGNATURE) || (signature == RECOVERY_SIGNATURE_SEC)) { if (signature == RECOVERY_SIGNATURE_SEC) cpm_set_scrpad(0); #if defined(CONFIG_XBOOT_LOW_BATTERY_DETECT) goto skip_chgdet; #endif } #if defined(CONFIG_XBOOT_LOW_BATTERY_DETECT) /*Usb Cable detection ,If connected ,then do charge else skip it*/ //if(charge_detect()){ if(charge_detect()&&(low_battery_detect())){ charge_logo_display(); } skip_chgdet: /*Before Enter the system,check the battery status, If low battery,then Enter the hibernate mode */ while(low_battery_detect() && !charge_detect()){ low_battery_warning(); jz_pm_do_hibernate(); } #endif }
int board_private_init(void) { unsigned int signature = 0; /*add board privater gpio here ,it while be called by boot_main to nitialization*/ //for ethernet initialization __gpio_as_nand_16bit(1); __gpio_as_func0(CS_PIN); __gpio_as_func0(RD_N_PIN); __gpio_as_func0(WE_N_PIN); __gpio_as_func0(32 * 1 + 2); __gpio_as_func0(32 * 1 + 3); REG_GPIO_PXFUNS(0) = 0x0000ffff; REG_GPIO_PXTRGC(0) = 0x0000ffff; REG_GPIO_PXSELC(0) = 0x0000ffff; __gpio_as_func0(WAIT_N); REG_NEMC_SMCR6 &= ~NEMC_SMCR_BW_MASK; REG_NEMC_SMCR6 |= NEMC_SMCR_BW_16BIT; /*Check the recovery signature,if exist,skip the charge_detect func.*/ signature = cpm_get_scrpad(); if ((signature == RECOVERY_SIGNATURE) || (signature == RECOVERY_SIGNATURE_SEC)) { if (signature == RECOVERY_SIGNATURE_SEC) cpm_set_scrpad(0); #if defined(CONFIG_XBOOT_LOW_BATTERY_DETECT) goto skip_chgdet; #endif } #if defined(CONFIG_XBOOT_LOW_BATTERY_DETECT) /*Usb Cable detection ,If connected ,then do charge else skip it*/ //if(charge_detect()){ if(charge_detect()&&(low_battery_detect())){ charge_logo_display(); } skip_chgdet: /*Before Enter the system,check the battery status, If low battery,then Enter the hibernate mode */ while(low_battery_detect() && !charge_detect()){ low_battery_warning(); jz_pm_do_hibernate(); } #endif }
/* Put CPU to HIBERNATE mode */ int jz_pm_hibernate(void) { return jz_pm_do_hibernate(); }