Index: cpu/xscale/start.S =================================================================== RCS file: /cvsroot/u-boot/u-boot/cpu/xscale/start.S,v retrieving revision 1.2 diff -u -b -B -w -p -u -r1.2 start.S --- cpu/xscale/start.S 3 Nov 2002 18:03:56 -0000 1.2 +++ cpu/xscale/start.S 4 Nov 2002 11:41:19 -0000 @@ -167,6 +167,12 @@ IC_BASE: .word 0x40d00000 RST_BASE: .word 0x40f00030 #define RCSR 0x00 +/* Operating System Timer */ +OSTIMER_BASE: .word 0x40a00000 +#define OSMR3 0x0C +#define OSCR 0x10 +#define OWER 0x18 +#define OIER 0x1C /* Clock Manager Registers */ CC_BASE: .word 0x41300000 @@ -394,18 +400,38 @@ fiq: #endif -/* - * FIXME How do we reset??? Watchdog timeout?? - */ + +/****************************************************************************/ +/* */ +/* Reset function: the PXA250 doesn't have a reset function, so we have to */ +/* perform a watchdog timeout for a soft reset. */ +/* */ +/****************************************************************************/ + .align 5 .globl reset_cpu + + /* FIXME: this code is PXA250 specific. How is this handled on */ + /* other XScale processors? */ + reset_cpu: - /* - ldr r0, RST_BASE - mov r1, #0x0 @ set bit 3-0 ... - str r1, [r0, #RCSR] @ ... to clear in RCSR - mov r1, #0x1 - str r1, [r0, #RCSR] @ and perform reset - */ - b reset_cpu @ silly, but repeat endlessly + + /* We set OWE:WME (watchdog enable) and wait until timeout happens */ + + ldr r0, OSTIMER_BASE + ldr r1, [r0, #OWER] + orr r1, r1, #0x0001 /* bit0: WME */ + str r1, [r0, #OWER] + + /* OS timer does only wrap every 1165 seconds, so we have to set */ + /* the match register as well. */ + + ldr r1, [r0, #OSCR] /* read OS timer */ + add r1, r1, #0x800 /* let OSMR3 match after */ + add r1, r1, #0x800 /* 4096*(1/3.6864MHz)=1ms */ + str r1, [r0, #OSMR3] + +reset_endless: + + b reset_endless Index: lib_arm/board.c =================================================================== RCS file: /cvsroot/u-boot/u-boot/lib_arm/board.c,v retrieving revision 1.2 diff -u -b -B -w -p -u -r1.2 board.c --- lib_arm/board.c 3 Nov 2002 18:03:56 -0000 1.2 +++ lib_arm/board.c 4 Nov 2002 11:41:25 -0000 @@ -194,6 +194,7 @@ void start_armboot (void) gd->bd = &bd_data; memset (gd->bd, 0, sizeof (bd_t)); + /* Call all init_* functions */ for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { if ((*init_fnc_ptr)() != 0) { hang (); Index: lib_arm/armlinux.c =================================================================== RCS file: /cvsroot/u-boot/u-boot/lib_arm/armlinux.c,v retrieving revision 1.2 diff -u -b -B -w -p -u -r1.2 armlinux.c --- lib_arm/armlinux.c 3 Nov 2002 18:03:56 -0000 1.2 +++ lib_arm/armlinux.c 4 Nov 2002 11:41:24 -0000 @@ -32,6 +32,12 @@ #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2) #define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size)) +#ifdef CONFIG_SHOW_BOOT_PROGRESS +# define SHOW_BOOT_PROGRESS(arg) show_boot_progress(arg) +#else +# define SHOW_BOOT_PROGRESS(arg) +#endif + #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ defined (CONFIG_CMDLINE_TAG) || \ defined (CONFIG_INITRD_TAG) || \ @@ -80,6 +86,8 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in * Check if there is an initrd image */ if (argc >= 3) { + SHOW_BOOT_PROGRESS (9); + addr = simple_strtoul(argv[2], NULL, 16); printf ("## Loading Ramdisk Image at %08lx ...\n", addr); @@ -89,6 +97,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in if (ntohl(hdr->ih_magic) != IH_MAGIC) { printf ("Bad Magic Number\n"); + SHOW_BOOT_PROGRESS (-10); do_reset (cmdtp, flag, argc, argv); } @@ -100,9 +109,12 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in if (crc32 (0, (char *)data, len) != checksum) { printf ("Bad Header Checksum\n"); + SHOW_BOOT_PROGRESS (-11); do_reset (cmdtp, flag, argc, argv); } + SHOW_BOOT_PROGRESS (10); + print_image_hdr (hdr); data = addr + sizeof(image_header_t); @@ -115,15 +127,19 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in csum = crc32 (0, (char *)data, len); if (csum != ntohl(hdr->ih_dcrc)) { printf ("Bad Data CRC\n"); + SHOW_BOOT_PROGRESS (-12); do_reset (cmdtp, flag, argc, argv); } printf ("OK\n"); } + SHOW_BOOT_PROGRESS (11); + if ((hdr->ih_os != IH_OS_LINUX) || (hdr->ih_arch != IH_CPU_ARM) || (hdr->ih_type != IH_TYPE_RAMDISK) ) { printf ("No Linux ARM Ramdisk Image\n"); + SHOW_BOOT_PROGRESS (-13); do_reset (cmdtp, flag, argc, argv); } @@ -134,6 +150,8 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in ulong tail = ntohl(len_ptr[0]) % 4; int i; + SHOW_BOOT_PROGRESS (13); + /* skip kernel length and terminator */ data = (ulong)(&len_ptr[2]); /* skip any additional image length fields */ @@ -151,6 +169,8 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in /* * no initrd image */ + SHOW_BOOT_PROGRESS (14); + data = 0; } @@ -167,6 +187,8 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in initrd_start = 0; initrd_end = 0; } + + SHOW_BOOT_PROGRESS (15); #ifdef DEBUG printf ("## Transferring control to Linux (at address %08lx) ...\n",