Chinaunix首页 | 论坛 | 博客
  • 博客访问: 117139
  • 博文数量: 22
  • 博客积分: 488
  • 博客等级: 下士
  • 技术积分: 265
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-09 09:31
文章分类

全部博文(22)

文章存档

2013年(1)

2011年(20)

2009年(1)

分类: LINUX

2011-05-24 11:51:36

最近遇到开发板软复位的问题,一直得不到解决。联系了以前的工程师得知在ST官网的Bugzilla 上面有解决的方法。从而得知是因为uboot和内核的版本问题。
在更新了新的uboot 之后 问题得到解决。
旧版本 stm23-0044
新版本 stm23-0053
将新版本下的board/st/pdk7105/init-pdk7105.S 复制到 board/pdk7105/ 下面
将新版本下的cpu/sh/init_ram.S 和 cpu/sh/pokeloop.S 复制到 cpu/sh/ 下面
将新版本下的inclue/asm-sh 文件夹 复制到 include/asm-sh 下面
将新版本下的lib_sh/time.c 复制到 lib_sh/下面
这样uboot的软复位就可以用了。
至于内核的软复位则参考了http://www.cublog.cn/u3/111328/showart_2268152.html
[root@localhost kernel]# cat linux-sh4-2.6.23.17_stm23_0122-7105machine_restart-kernel122.patch
--- linux-sh4-2.6.23.17_stm23_0122/arch/sh/kernel/process.c     2009-08-28 13:07:14.000000000 +0100
+++ linux-sh4-2.6.23.17_stm23_0122new/arch/sh/kernel/process.c  2009-09-29 13:41:35.000000000 +0100
@@ -26,6 +26,7 @@
 #include
 #include
 #include
+#include
 
 static int hlt_counter;
 int ubc_usercnt = 0;
@@ -106,10 +107,20 @@ static void watchdog_trigger_immediate(v
 
 void machine_restart(char *__unused)
 {
-       /* Use watchdog timer to trigger reset */
-       local_irq_disable();
-       watchdog_trigger_immediate();
-       while (1) {};
+   struct sysconf_field *sc1;
+   struct sysconf_field *sc2;
+        /* Use watchdog timer to trigger reset */
+        local_irq_disable();
+        /* ensure the reset period is short and that the reset is */
+        /* not masked */
+        if (! (sc1 = sysconf_claim (SYS_CFG, 9, 29, 29, "kernel")))
+           printk (KERN_EMERG "Cant claim sysconf9\n");
+        if (! (sc2 = sysconf_claim (SYS_CFG, 9, 0, 25, "kernel")))
+           printk (KERN_EMERG "Cant claim sysconf9\n");
+        sysconf_write (sc1, 0x0);
+        sysconf_write (sc2, 0x00000a8c);
+        watchdog_trigger_immediate();
+        while (1) {};
 }
 
 void machine_halt(void)
 
 
--- linux-sh4-2.6.23.17_stm23_0122/arch/sh/boards/st/pdk7105/setup.c    2009-08-28 13:07:14.000000000 +0100
+++ linux-sh4-2.6.23.17_stm23_0122-new/arch/sh/boards/st/pdk7105/setup.c        2009-09-29 13:44:53.000000000 +0100
@@ -313,6 +313,12 @@ static int __init device_init(void)
        struct sysconf_field *sc;
        u32 boot_mode;
 
+        /* Get the reset chain correct to start with */
+        sc = sysconf_claim(SYS_CFG, 9, 27, 28, "reset_chain");
+        sysconf_write(sc, 0);
+        /* release the sysconf bits so the coprocessor driver can claim them*/
+        sysconf_release (sc);
+
        bank1_start = emi_bank_base(1);
        bank2_start = emi_bank_base(2);
 
 
 
阅读(1885) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

网络安全服务2011-06-01 14:45:15

dj4now: www.fengxiongseo.com 丰胸产品哪种好
www.jfmama.com     妈妈减肥网
www.52qingzhou.com  青州减肥网
www.taobaoboygirl.com  怎样收缩毛孔

希望大牛们指导.....