最近遇到开发板软复位的问题,一直得不到解决。联系了以前的工程师得知在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的软复位就可以用了。
[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);
阅读(1966) | 评论(1) | 转发(0) |