You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
powerpc/mpic: add global timer support
The MPIC global timer is a hardware timer inside the Freescale PIC complying with OpenPIC standard. When the specified interval times out, the hardware timer generates an interrupt. The driver currently is only tested on fsl chip, but it can potentially support other global timers complying to OpenPIC standard. The two independent groups of global timer on fsl chip, group A and group B, are identical in their functionality, except that they appear at different locations within the PIC register map. The hardware timer can be cascaded to create timers larger than the default 31-bit global timers. Timer cascade fields allow configuration of up to two 63-bit timers. But These two groups of timers cannot be cascaded together. It can be used as a wakeup source for low power modes. It also could be used as periodical timer for protocols, drivers and etc. Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
committed by
Scott Wood
parent
5ff04b7287
commit
36ca09be6f
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* arch/powerpc/include/asm/mpic_timer.h
|
||||
*
|
||||
* Header file for Mpic Global Timer
|
||||
*
|
||||
* Copyright 2013 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* Author: Wang Dongsheng <Dongsheng.Wang@freescale.com>
|
||||
* Li Yang <leoli@freescale.com>
|
||||
*
|
||||
* This program 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 Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef __MPIC_TIMER__
|
||||
#define __MPIC_TIMER__
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/time.h>
|
||||
|
||||
struct mpic_timer {
|
||||
void *dev;
|
||||
struct cascade_priv *cascade_handle;
|
||||
unsigned int num;
|
||||
unsigned int irq;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MPIC_TIMER
|
||||
struct mpic_timer *mpic_request_timer(irq_handler_t fn, void *dev,
|
||||
const struct timeval *time);
|
||||
void mpic_start_timer(struct mpic_timer *handle);
|
||||
void mpic_stop_timer(struct mpic_timer *handle);
|
||||
void mpic_get_remain_time(struct mpic_timer *handle, struct timeval *time);
|
||||
void mpic_free_timer(struct mpic_timer *handle);
|
||||
#else
|
||||
struct mpic_timer *mpic_request_timer(irq_handler_t fn, void *dev,
|
||||
const struct timeval *time) { return NULL; }
|
||||
void mpic_start_timer(struct mpic_timer *handle) { }
|
||||
void mpic_stop_timer(struct mpic_timer *handle) { }
|
||||
void mpic_get_remain_time(struct mpic_timer *handle, struct timeval *time) { }
|
||||
void mpic_free_timer(struct mpic_timer *handle) { }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -86,6 +86,18 @@ config MPIC
|
||||
bool
|
||||
default n
|
||||
|
||||
config MPIC_TIMER
|
||||
bool "MPIC Global Timer"
|
||||
depends on MPIC && FSL_SOC
|
||||
default n
|
||||
help
|
||||
The MPIC global timer is a hardware timer inside the
|
||||
Freescale PIC complying with OpenPIC standard. When the
|
||||
specified interval times out, the hardware timer generates
|
||||
an interrupt. The driver currently is only tested on fsl
|
||||
chip, but it can potentially support other global timers
|
||||
complying with the OpenPIC standard.
|
||||
|
||||
config PPC_EPAPR_HV_PIC
|
||||
bool
|
||||
default n
|
||||
|
||||
@@ -4,6 +4,7 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
|
||||
|
||||
mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o
|
||||
obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y)
|
||||
obj-$(CONFIG_MPIC_TIMER) += mpic_timer.o
|
||||
mpic-msgr-obj-$(CONFIG_MPIC_MSGR) += mpic_msgr.o
|
||||
obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y) $(mpic-msgr-obj-y)
|
||||
obj-$(CONFIG_PPC_EPAPR_HV_PIC) += ehv_pic.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user