1. 具体实现步骤
①在./common文件夹下新建cmd_suspend.c,并在此文件中添加如下内容
+#include <common.h>+#include <command.h>
+#include <def.h>
+#include <nand.h>
+#include <s3c24x0.h>
+
+extern void s3c2440_cpu_suspend(void); //调用外部函数,调用下面用汇编写的函数
+
+static void delay(volatile int d)
+{
+ while(d--);
+}
+
+int do_suspend (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+//查询2440芯片手册第七章就可以得出2440的工作模式设置:现在我们主要设置休眠模式,根据数据手册设置相关寄存器即可
+ /* 休眠: */+
+ /* 1. 配置GPIO: 比如想维持LED亮或灭, 用于唤醒CPU的引脚要设为中断功能 */
+ /* 对于NAND启动: 要设置EINT23,22,21为输入引脚 */ S3c24x0.h文件中有引脚的宏定义
+ rGPGCON &= ~((3<<30) | (3<<28) | (3<<26));
+
+ /*