[xtensa-cvscommit] linux/arch/xtensa/platform-xt2000 setup.c,1.1.1.1,1.2
Brought to you by:
zankel
|
From: <joe...@us...> - 2002-10-18 21:57:31
|
Update of /cvsroot/xtensa/linux/arch/xtensa/platform-xt2000
In directory usw-pr-cvs1:/tmp/cvs-serv1903/arch/xtensa/platform-xt2000
Modified Files:
setup.c
Log Message:
Fix three reset functions: machine_restart(), machine_halt(), and machine_power_off(). They no longer call xt_panic() to hang the system, but try to do something meaningful in the context of Xtensa and the XT2000 or ISS platforms, as appropriate.
Index: setup.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/platform-xt2000/setup.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** setup.c 28 Aug 2002 16:10:14 -0000 1.1.1.1
--- setup.c 18 Oct 2002 21:57:28 -0000 1.2
***************
*** 5,9 ****
* ...
*
! * Author: Chris Zankel <za...@te...>
*
* Copyright 2001 Tensilica Inc.
--- 5,10 ----
* ...
*
! * Authors: Chris Zankel <za...@te...>
! * Joe Taylor <jo...@te...>
*
* Copyright 2001 Tensilica Inc.
***************
*** 31,34 ****
--- 32,39 ----
#include <asm/machvec.h>
#include <asm/bootparam.h>
+ #include <asm/xtutil.h>
+
+ #include <xtensa/xt2000.h>
+
/* Initialize vector table if configured */
***************
*** 37,40 ****
--- 42,50 ----
extern void xt2000_setup_pci(void);
+ extern void reset_mmu(void);
+ extern void (*mach_restart)(char *);
+ extern void (*mach_halt)(void);
+ extern void (*mach_power_off)(void);
+
int xt2000_get_cpuinfo(char *buffer)
***************
*** 49,70 ****
}
! void __init xt2000_setup(char** cmdline)
{
- /* Setup PCI bus */
- xt2000_setup_pci();
}
! void __init xt2000_init_IRQ(void)
{
}
! void xt2000_restart(char *cmd)
{
! while(1);
}
! void xt2000_power_off(void)
{
! while(1);
}
--- 59,121 ----
}
! void __init xt2000_init_IRQ(void)
{
}
! /* Assumes s points to an 8-chr string. No checking for NULL. */
! static void led_print (char *s)
{
+ volatile unsigned long * led_addr = (unsigned long *) (XTBOARD_LED_VADDR+0xE0);
+ int i;
+ for (i = 0; i < 8; i++)
+ *led_addr++ = *s++;
}
! static void xt2000_halt(void)
{
! led_print (" HALT ");
! cli();
! while (1);
}
! static void xt2000_power_off(void)
{
! led_print ("POWEROFF");
! cli();
! while (1);
! }
!
! static void xt2000_restart(char *cmd)
! {
! /* Flush and reset the mmu, simulate a processor reset, and
! * jump to the reset vector. */
!
! reset_mmu();
! __asm__ __volatile__ ("movi a2, 15\n\t"
! "wsr a2, " XTSTR(ICOUNTLEVEL) "\n\t"
! "movi a2, 0\n\t"
! "wsr a2, " XTSTR(ICOUNT) "\n\t"
! "wsr a2, " XTSTR(IBREAKENABLE) "\n\t"
! "wsr a2, " XTSTR(LCOUNT) "\n\t"
! "movi a2, 0x1f\n\t"
! "wsr a2, " XTSTR(PS) "\n\t"
! "isync\n\t"
! "jx %0\n\t"
! :
! : "a" (XCHAL_RESET_VECTOR_VADDR)
! : "a2"
! );
!
! /* control never gets here */
! }
!
! void __init xt2000_setup(char** cmdline)
! {
! /* Setup PCI bus */
! xt2000_setup_pci();
!
! mach_restart = xt2000_restart;
! mach_halt = xt2000_halt;
! mach_power_off = xt2000_power_off;
}
|