# HG changeset patch # User gthomas # Date 1038861777 0 # Node ID b8b99761a77b1e6d937ba95d1407b6fe0848c61d # Parent cb9bc921600ab0384abef47918da3a7a222be395 Add proper MPC8xx RESET support. diff --git a/packages/hal/powerpc/adder/current/ChangeLog b/packages/hal/powerpc/adder/current/ChangeLog --- a/packages/hal/powerpc/adder/current/ChangeLog +++ b/packages/hal/powerpc/adder/current/ChangeLog @@ -1,3 +1,7 @@ +2002-12-02 Gary Thomas + + * include/plf_intr.h: Use MPC8xx variant RESET support. + 2002-11-26 Gary Thomas * misc/redboot_ROMRAM.ecm: Export. diff --git a/packages/hal/powerpc/adder/current/include/plf_intr.h b/packages/hal/powerpc/adder/current/include/plf_intr.h --- a/packages/hal/powerpc/adder/current/include/plf_intr.h +++ b/packages/hal/powerpc/adder/current/include/plf_intr.h @@ -45,7 +45,7 @@ //#####DESCRIPTIONBEGIN#### // // Author(s): jskov -// Contributors: jskov +// Contributors: jskov, gthomas // Date: 2000-06-13 // Purpose: Define platform specific interrupt support // @@ -72,9 +72,8 @@ //---------------------------------------------------------------------------- // Reset. -// The ADDER does not have a watchdog (not one we can easily use for this -// purpose anyway). -#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT +externC void _mpc8xx_reset(void); +#define HAL_PLATFORM_RESET() _mpc8xx_reset() #define HAL_PLATFORM_RESET_ENTRY 0xfe000100 diff --git a/packages/hal/powerpc/mbx/current/ChangeLog b/packages/hal/powerpc/mbx/current/ChangeLog --- a/packages/hal/powerpc/mbx/current/ChangeLog +++ b/packages/hal/powerpc/mbx/current/ChangeLog @@ -1,3 +1,7 @@ +2002-12-02 Gary Thomas + + * include/plf_intr.h: Use MPC8xx variant RESET support. + 2002-11-26 Gary Thomas * cdl/hal_powerpc_mbx.cdl: Move platform defines to platform package. diff --git a/packages/hal/powerpc/mbx/current/include/plf_intr.h b/packages/hal/powerpc/mbx/current/include/plf_intr.h --- a/packages/hal/powerpc/mbx/current/include/plf_intr.h +++ b/packages/hal/powerpc/mbx/current/include/plf_intr.h @@ -12,6 +12,7 @@ // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2002 Gary Thomas // // eCos is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -44,7 +45,7 @@ //#####DESCRIPTIONBEGIN#### // // Author(s): jskov -// Contributors: jskov +// Contributors: jskov, gthomas // Date: 2000-06-13 // Purpose: Define platform specific interrupt support // @@ -71,9 +72,8 @@ //---------------------------------------------------------------------------- // Reset. -// The MBX does not have a watchdog (not one we can easily use for this -// purpose anyway). -#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT +externC void _mpc8xx_reset(void); +#define HAL_PLATFORM_RESET() _mpc8xx_reset() #define HAL_PLATFORM_RESET_ENTRY 0xfe000100 diff --git a/packages/hal/powerpc/mpc8xx/current/ChangeLog b/packages/hal/powerpc/mpc8xx/current/ChangeLog --- a/packages/hal/powerpc/mpc8xx/current/ChangeLog +++ b/packages/hal/powerpc/mpc8xx/current/ChangeLog @@ -1,3 +1,8 @@ +2002-12-02 Gary Thomas + + * src/variant.S (_mpc8xx_reset): New function, used to cause a + hardware reset of the platform. + 2002-11-25 Gary Thomas * include/var_regs.h: Add CICR definitions. diff --git a/packages/hal/powerpc/mpc8xx/current/src/variant.S b/packages/hal/powerpc/mpc8xx/current/src/variant.S --- a/packages/hal/powerpc/mpc8xx/current/src/variant.S +++ b/packages/hal/powerpc/mpc8xx/current/src/variant.S @@ -9,6 +9,7 @@ ## ------------------------------------------- ## This file is part of eCos, the Embedded Configurable Operating System. ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +## Copyright (C) 2002 Gary Thomas ## ## eCos is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free @@ -41,7 +42,7 @@ #######DESCRIPTIONBEGIN#### ## ## Author(s): jskov -## Contributors:jskov +## Contributors:jskov, gthomas ## Date: 2000-02-04 ## Purpose: PowerPC MPC8xx variant code ## Description: Variant specific code for PowerPC MPC8xx CPUs. @@ -51,6 +52,9 @@ ##============================================================================= #include +#include /* on-chip resource layout, special */ + /* registers, IMM layout... */ +#include /* more of the same */ #--------------------------------------------------------------------------- # Interrupt vector tables. @@ -81,5 +85,34 @@ hal_interrupt_objects: .long 0 .endr + +#--------------------------------------------------------------------------- +# Hard reset support +# + + .text + .globl _mpc8xx_reset +_mpc8xx_reset: + lwi r4,CYGARC_REG_IMM_BASE # base address of control registers + + // Enable checkstop reset + lwz r3,PLPRCR(r4) + ori r3,r3,0x0080 // Bit 24 + stw r3,PLPRCR(r4) + mfmsr r3 + lwi r5,~MSR_ME + and r3,r3,r5 + mtmsr r3 + + // Pull the plug by disabling CS0 & CS1. This will cause a checkstop. + li r0,0 + stw r0,BR0(r4) + stw r0,BR1(r4) + lwi r3,_end +10: nop + lwzu r3,4(r2) // Force a memory access + b 10b + + ##----------------------------------------------------------------------------- ## end of variant.S diff --git a/packages/hal/powerpc/ts1000/current/ChangeLog b/packages/hal/powerpc/ts1000/current/ChangeLog --- a/packages/hal/powerpc/ts1000/current/ChangeLog +++ b/packages/hal/powerpc/ts1000/current/ChangeLog @@ -1,3 +1,7 @@ +2002-12-02 Gary Thomas + + * include/plf_intr.h: Use MPC8xx variant RESET support. + 2002-11-26 Gary Thomas * cdl/hal_powerpc_ts1000.cdl: Move platform define to platform package. diff --git a/packages/hal/powerpc/ts1000/current/include/plf_intr.h b/packages/hal/powerpc/ts1000/current/include/plf_intr.h --- a/packages/hal/powerpc/ts1000/current/include/plf_intr.h +++ b/packages/hal/powerpc/ts1000/current/include/plf_intr.h @@ -45,7 +45,7 @@ //#####DESCRIPTIONBEGIN#### // // Author(s): jskov -// Contributors: jskov +// Contributors: jskov, gthomas // Date: 2000-06-13 // Purpose: Define platform specific interrupt support // @@ -72,9 +72,8 @@ //---------------------------------------------------------------------------- // Reset. -// The TS1000 does not have a watchdog (not one we can easily use for this -// purpose anyway). -#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT +externC void _mpc8xx_reset(void); +#define HAL_PLATFORM_RESET() _mpc8xx_reset() #define HAL_PLATFORM_RESET_ENTRY 0xfe000100 diff --git a/packages/hal/powerpc/viper/current/ChangeLog b/packages/hal/powerpc/viper/current/ChangeLog --- a/packages/hal/powerpc/viper/current/ChangeLog +++ b/packages/hal/powerpc/viper/current/ChangeLog @@ -1,3 +1,7 @@ +2002-12-02 Gary Thomas + + * include/plf_intr.h: Use MPC8xx variant RESET support. + 2002-11-26 Gary Thomas * cdl/hal_powerpc_viper.cdl: Move platform define to platform package. diff --git a/packages/hal/powerpc/viper/current/include/plf_intr.h b/packages/hal/powerpc/viper/current/include/plf_intr.h --- a/packages/hal/powerpc/viper/current/include/plf_intr.h +++ b/packages/hal/powerpc/viper/current/include/plf_intr.h @@ -45,7 +45,7 @@ //#####DESCRIPTIONBEGIN#### // // Author(s): jskov -// Contributors: jskov +// Contributors: jskov, gthomas // Date: 2000-06-13 // Purpose: Define platform specific interrupt support // @@ -72,9 +72,8 @@ //---------------------------------------------------------------------------- // Reset. -// The VIPER does not have a watchdog (not one we can easily use for this -// purpose anyway). -#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT +externC void _mpc8xx_reset(void); +#define HAL_PLATFORM_RESET() _mpc8xx_reset() #define HAL_PLATFORM_RESET_ENTRY 0xfe000100