update restart_device()
This commit is contained in:
1 parent
b649709cb0
commit
025ebd009e
2 files changed
+67
-2
No files matched your search
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2011, James Sullins
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _PLATFORM_APQ_TOUCHPAD_RESTART_H
|
||||
#define _PLATFORM_APQ_TOUCHPAD_RESTART_H
|
||||
|
||||
/* Palm specific */
|
||||
#define RESTART_REASON_SHUTDOWN 0x6f656d00
|
||||
#define RESTART_REASON_RECOVER 0x6f656d11
|
||||
#define RESTART_REASON_PANIC 0x6f656d22
|
||||
#define RESTART_REASON_DFU 0x6f656d33
|
||||
#define RESTART_REASON_REBOOT 0x6f656d44
|
||||
#define RESTART_REASON_LATE_BOOT 0x6f656d55
|
||||
#define RESTART_REASON_UPDATE 0x6f656d66
|
||||
#define RESTART_REASON_UNKNOWN 0x77665501
|
||||
|
||||
/* misc */
|
||||
#define RESTART_REASON_BOOTLOADER 0x77665500
|
||||
#define RESTART_REASON_RECOVERY 0x77665502
|
||||
|
||||
#endif
|
||||
@@ -138,8 +138,27 @@ uint32_t board_machtype(void)
|
||||
|
||||
void reboot_device(uint32_t reboot_reason)
|
||||
{
|
||||
/* TODO: Not implemented yet. */
|
||||
ASSERT(0);
|
||||
|
||||
/* TBD - set download mode? */
|
||||
|
||||
pm8058_reset_pwr_off(1);
|
||||
|
||||
writel(reboot_reason, RESTART_REASON_ADDR);
|
||||
dmb();
|
||||
|
||||
writel(0, MSM_WDT0_EN);
|
||||
writel(0, PSHOLD_CTL_SU);
|
||||
mdelay(5000);
|
||||
|
||||
writel(0x31F3, MSM_WDT0_BARK_TIME);
|
||||
writel(0x31F3, MSM_WDT0_BITE_TIME);
|
||||
writel(3, MSM_WDT0_EN);
|
||||
dmb();
|
||||
|
||||
secure_writel(3, MSM_TCSR_WDOG_CFG);
|
||||
mdelay(10000);
|
||||
|
||||
dprintf(CRITICAL, "Shutdown failed\n");
|
||||
}
|
||||
|
||||
uint32_t check_reboot_mode(void)
|
||||
|
||||
Reference in new issue
Block a user