linux各种重启命令 及STi7105不能重启原因分析

news/2024/11/29 2:54:27/
最近发现STlinux系统无法reboot,执行了如下几个命令都是一样的结果
root@wtCAB7167jffs2 :~# reboot
INIT: Switching to runlevel: 6
root@xxha:~#
Broadcast message from root (console) (Sat Jan  1 00:09:00 2000):
The system is going down for reboot NOW!
INIT: Sending processes the TERM signal
INIT: Sending processes the KILL signal
Stopping portmap daemon: portmap.
Stopping sshd:ok
Saving random seed...done.
Stopping xinetd: ok
Stopping kernel log daemon: klogd.
not deconfiguring network interfaces: network file systems still mounted.
Stopping system log daemon: syslogd.
Stopping kernel event manager...
Sending all processes the TERM signal...done.
Sending all processes the KILL signal...done.
Unmounting remote and non-toplevel virtual filesystems...done.
Deactivating swap...umount: invalid option -- t
done.
Unmounting local filesystems...umount: invalid option -- t
done.
Rebooting... Restarting

root@xxha :~# init 6
INIT: Switching to runlevel: 6
INIT: Sending processes the TERM signal
INIT: Sending processes the KILL signal
Stopping portmap daemon: portmap.
Stopping sshd:ok
Saving random seed...done.
Stopping xinetd: ok
Stopping kernel log daemon: klogd.
not deconfiguring network interfaces: network file systems still mounted.
Stopping system log daemon: syslogd.
Stopping kernel event manager...
Sending all processes the TERM signal...done.
Sending all processes the KILL signal...done.
Unmounting remote and non-toplevel virtual filesystems...done.
Deactivating swap...umount: invalid option -- t
done.
Unmounting local filesystems...umount: invalid option -- t
done.
Rebooting... Restarting

root@xxha :~# shutdown -r now
INIT: Switching to runlevel: 6
root@xxha:~#
Broadcast message from root (console) (Sat Jan  1 00:06:13 2000):
The system is going down for reboot NOW!
INIT: Sending processes the TERM signal
INIT: Sending processes the KILL signal
Stopping portmap daemon: portmap.
Stopping sshd:ok
Saving random seed...done.
Stopping xinetd: ok
Stopping kernel log daemon: klogd.
not deconfiguring network interfaces: network file systems still mounted.
Stopping system log daemon: syslogd.
Stopping kernel event manager...
Sending all processes the TERM signal...done.
Sending all processes the KILL signal...done.
Unmounting remote and non-toplevel virtual filesystems...done.
Deactivating swap...umount: invalid option -- t
done.
Unmounting local filesystems...umount: invalid option -- t
done.
Rebooting... Restarting
root@xxha :~# reboot -f
Restarting
分析,应该是kernel和uboot出了问题。
在uboot里执行reset,也没重起反应,说明uboot的重起也有问题。
后来联系了支持,得到几个补丁。打上后,果然就好了。
补丁如下:
1.内核部分,有2个patch:
[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 <asm/system.h>
 #include <asm/ubc.h>
 #include <asm/watchdog.h>
+#include <linux/stm/sysconf.h>
 
 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)
[root@localhost kernel]#

[ root@localhost kernel]# cat linux-sh4-2.6.23.17_stm23_0122-pdk7105setup.patch
--- 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);
 
[root@localhost kernel]#
2.uboot部分内核:
把 pdk7105.romgen 拷贝到
[root@localhost u-boot-sh4-1.3.1_stm23_0046]# cp -f pdk7105.romgen board/st/pdk7105/pdk7105.romgen
[root@localhost kernel]# cat u-boot_0042_reset_7105.patch
--- u-boot-sh4-1.3.1_stm23_0042/cpu/sh/stx7105/stx7105.c        2008-10-15 00:09:42.000000000 +0100
+++ u-boot-sh4-1.3.1_stm23_0042-mb680/cpu/sh/stx7105/stx7105.c  2009-03-23 13:47:15.000000000 +0000
@@ -181,10 +181,9 @@ int soc_init(void)
 
        bd->bi_devid = *STX7105_SYSCONF_DEVICEID_0;
 
-#if QQQ        /* QQQ - TO FIX */
-       /*  Make sure reset period is shorter than WDT timeout */
-       *STX7105_SYSCONF_SYS_CFG09 = (*STX7105_SYSCONF_SYS_CFG09 & 0xFF000000) | 0x000A8C;
-#endif /* QQQ - TO FIX */
+       /*  Make sure reset period is shorter than WDT timeout and that */
+        /*  the reset is not bypassed                                   */
+       *STX7105_SYSCONF_SYS_CFG09 = (*STX7105_SYSCONF_SYS_CFG09 & 0xF7000000) | 0x000A8C;
 
        return 0;
 }
[root@localhost kernel]#
打完上述4个补丁,重新编译u-boot,kernel,烧写进nandflash,启动,就可以reboot成功了~,u-boot也可以成功reset了~


http://www.ppmy.cn/news/181331.html

相关文章

STi7105用nand flash启动的问题

7105支持从nand flash启动&#xff0c;首先需要把nand flash的片选一定要从A片选开始&#xff0c;nand flash使用flex mode。再把uboot、kernel、filesystem放在nand flash上。但是笔者通过切身经历验证发现&#xff0c;在nand flash上使用JFFS2文件系统&#xff0c;稳定性不好…

ST7105不支持MLC的Nand Flash

ST7105不支持MLC的Nand Flash&#xff0c;但是MLC得便宜啊!ST的nand控制器看来比那些做PMP的芯片厂商在这一块差远了&#xff0c;芯片还买那么贵&#xff0c;竞争力在逐渐减弱似的&#xff0c;这样下去以后的市场份额还会进一步被mstar、amlogic、mtk这些公司一刀一刀的切下去哦…

dm642解码芯片SAA7115及7105…

原文地址&#xff1a;dm642解码芯片SAA7115及7105的配置 作者&#xff1a;mkingdom 注:以下的配置均是指AV信号输入,PAL制式输出的条件 1.SAA7115配置 SAA7115结构体定义如下&#xff1a; typedef struct { Int cmode; Int fldOp; Int scale; Int resmpl; Int bpk10Bit; Int…

[转]MS Sql 7105错误

转自&#xff1a;http://hi.baidu.com/ylj798/blog/item/4878077ab64fe7ea2f73b300.html 有的时候发现查询数据库会出现以下类似的提示&#xff1a; [Microsoft][ODBC SQL Server Driver][SQL Server]text、ntext 或 image 节点的页 (1:220)&#xff0c;槽 14 不存在。[Microso…

jni学习实例(三)-a7105模块驱动之activity

package com.example.a7105demo;public class a7105Class {/*声明函数*///初始化函数 public native int Init();public native String stringFromJNI();public native int Read(int buf[], int length);public native int Write(int buf[], int length);public native int CLO…

无线发射芯片A7105在RF短距离通信的应用

一&#xff1a;主流的三种RF方案及其优缺点比较 1&#xff09;&#xff1a;蓝牙方案&#xff08;IEEE802.15&#xff09; 蓝牙&#xff0c;是一种支持设备短距离通信&#xff08;一般10m内&#xff09;的无线电技术。能在包括移动电话、PDA、无线耳机、笔记本电脑、相关外设等众…

jni学习实例(二)-a7105模块驱动之jni

#include <stdio.h> #include <string.h> #include <jni.h> #include <fcntl.h> /*包括文件操作&#xff0c;如open() read() close()write()等*/ #include <android/log.h> #define LOG_TAG "a7105" #define LOGI(...) __…

pdk7105的I2C配置

pdk7105的I2C配置stm23-0047版本中增加了I2C的配置<<include/configs/pdk7105.h>>已知&#xff1a;PIO3[4] SCLPIO3[5] SDA根据board/st/pdk7105.c代码中static void configI2c(void){ /* * The I2C busses are routed as follows: * * Bus SCL SDA * -…