- 论坛徽章:
- 0
|
add reboot function for atsam9263
From 140887cd3ef96043944937ca2050eae80c39643d Mon Sep 17 00:00:00 2001
From: = <=>
Date: Mon, 2 Nov 2009 18:53:10 +0800
Subject: [PATCH] add reboot function for atsam9263
---
app/boot/reboot.c | 1 -
arch/arm/atmel/at91sam9263-plat.c | 8 +++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/boot/reboot.c b/app/boot/reboot.c
index fe7551d..a464bbf 100644
--- a/app/boot/reboot.c
+++ b/app/boot/reboot.c
@@ -16,7 +16,6 @@ int GkRegistReBoot(void (*fun)(void))
int main(int argc, char *argv[])
{
- printf("0x=%x\n",ReBoot);
if (ReBoot)
ReBoot();
diff --git a/arch/arm/atmel/at91sam9263-plat.c b/arch/arm/atmel/at91sam9263-plat.c
index 27164c6..ba5f9fc 100644
--- a/arch/arm/atmel/at91sam9263-plat.c
+++ b/arch/arm/atmel/at91sam9263-plat.c
@@ -53,12 +53,16 @@ int At91DisableClock(int nClockID)
WriteLong(1 << nClockID, AT91SAM926X_PA_PMC + PMC_PCDR);
}
+static void AtSam9263ReBoot(void)
+{
+ WriteLong(0xa5 << 24 | 0xd, AT91SAM926X_PA_RSTC);
+}
+
static int __INIT__ MW9263Init(void)
{
UINT32 dwMask;
-
At91PioConfInput(PIOE, 1 << 31, 0);
// WriteLong(1 << 31, AT91SAM926X_PA_PIOE + PIO_IFER);
@@ -87,6 +91,8 @@ static int __INIT__ MW9263Init(void)
GuSysConfInitPartTabTmpl(g_v9263PartTab, ARRAY_ELEM_NUM(g_v9263PartTab));
+ GkRegistReBoot(AtSam9263ReBoot);
+
return 0;
}
--
1.6.0.4 |
|