[PATCH] BOOKE_WDT Part 1/2 (Re: PPC 44x Watchdog timer)

Kumar Gala kumar.gala at freescale.com
Fri May 13 01:37:38 EST 2005


> diff -Nupr linux-2.6.orig/arch/ppc/kernel/head_4xx.S
>  linux-2.6/arch/ppc/kernel/head_4xx.S
> --- linux-2.6.orig/arch/ppc/kernel/head_4xx.S   2005-05-06
> 05:03:55.000000000 +0900
>  +++ linux-2.6/arch/ppc/kernel/head_4xx.S        2005-05-07 
> 05:03:24.000000000 +0900
>  @@ -430,27 +430,24 @@ label:
>

Any reason you moved this code into DecrementerHandler?

>   /* 0x1000 - Programmable Interval Timer (PIT) Exception */
>          START_EXCEPTION(0x1000, Decrementer)
>  -       NORMAL_EXCEPTION_PROLOG
> -       lis     r0,TSR_PIS at h
> -       mtspr   SPRN_TSR,r0             /* Clear the PIT exception */
>  -       addi    r3,r1,STACK_FRAME_OVERHEAD
> -       EXC_XFER_LITE(0x1000, timer_interrupt)
> +       b    DecrementerHandler
>
>   #if 0
>    /* NOTE:
>  - * FIT and WDT handlers are not implemented yet.
>  + * FIT handler is not implemented yet.
>     */
>
>   /* 0x1010 - Fixed Interval Timer (FIT) Exception
>    */
>          STND_EXCEPTION(0x1010,  FITException,           
> UnknownException)
>
> -/* 0x1020 - Watchdog Timer (WDT) Exception
>  -*/
>  -
>  -       CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException)
>   #endif
>
> +/* 0x1020 - Watchdog Timer (WDT) Exception
>  + */
>  +       START_EXCEPTION(0x1020, WDTException)
> +       b    WatchDogHandler
> +
>    /* 0x1100 - Data TLB Miss Exception
>     * As the name implies, translation is not in the MMU, so search the
>     * page tables and fix it.  The only purpose of this function is to
>  @@ -732,6 +729,13 @@ label:
>                  (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
>                  NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
>
> +DecrementerHandler:
> +       NORMAL_EXCEPTION_PROLOG
> +       lis    r0,TSR_PIS at h
> +       mtspr    SPRN_TSR,r0        /* Clear the PIT exception */
>  +       addi    r3,r1,STACK_FRAME_OVERHEAD
> +       EXC_XFER_LITE(0x1000, timer_interrupt)
> +
>    /*
>     * The other Data TLB exceptions bail out to this point
>     * if they can't resolve the lightweight TLB fault.
>  @@ -804,6 +808,19 @@ finish_tlb_load:
>         PPC405_ERR77_SYNC
>         rfi                     /* Should sync shadow TLBs */
>          b       .               /* prevent prefetch past rfi */
>  +/*
>  + * WatchDog Exception
>  + */
>  +WatchDogHandler:
> +       CRITICAL_EXCEPTION_PROLOG;
> +       addi    r3,r1,STACK_FRAME_OVERHEAD;
> +#if defined(CONFIG_BOOKE_WDT)
> +       EXC_XFER_TEMPLATE(booke_wdt_exception, 0x1022, (MSR_KERNEL &
> ~(MSR_ME|MSR_DE|MSR_CE)),NOCOPY, crit_transfer_to_handler,
>  ret_from_crit_exc)
> +
>  +#else
>  +       EXC_XFER_TEMPLATE(UnknownException, 0x1022, (MSR_KERNEL &
> ~(MSR_ME|MSR_DE|MSR_CE)),NOCOPY, crit_transfer_to_handler,
>  ret_from_crit_exc)
> +#endif  /*  CONFIG_BOOKE_WDT  */
>  +
>
>   /* extern void giveup_fpu(struct task_struct *prev)
>     *





More information about the Linuxppc-embedded mailing list