|
@@ -16,6 +16,7 @@
|
|
* You should have received a copy of the GNU General Public License
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
*/
|
|
|
|
+#include <linux/delay.h>
|
|
#include <linux/dw_apb_timer.h>
|
|
#include <linux/dw_apb_timer.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/of_address.h>
|
|
@@ -130,6 +131,17 @@ static void __init init_sched_clock(void)
|
|
sched_clock_register(read_sched_clock, 32, sched_rate);
|
|
sched_clock_register(read_sched_clock, 32, sched_rate);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifdef CONFIG_ARM
|
|
|
|
+static unsigned long dw_apb_delay_timer_read(void)
|
|
|
|
+{
|
|
|
|
+ return ~readl_relaxed(sched_io_base);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static struct delay_timer dw_apb_delay_timer = {
|
|
|
|
+ .read_current_timer = dw_apb_delay_timer_read,
|
|
|
|
+};
|
|
|
|
+#endif
|
|
|
|
+
|
|
static int num_called;
|
|
static int num_called;
|
|
static void __init dw_apb_timer_init(struct device_node *timer)
|
|
static void __init dw_apb_timer_init(struct device_node *timer)
|
|
{
|
|
{
|
|
@@ -142,6 +154,10 @@ static void __init dw_apb_timer_init(struct device_node *timer)
|
|
pr_debug("%s: found clocksource timer\n", __func__);
|
|
pr_debug("%s: found clocksource timer\n", __func__);
|
|
add_clocksource(timer);
|
|
add_clocksource(timer);
|
|
init_sched_clock();
|
|
init_sched_clock();
|
|
|
|
+#ifdef CONFIG_ARM
|
|
|
|
+ dw_apb_delay_timer.freq = sched_rate;
|
|
|
|
+ register_current_timer_delay(&dw_apb_delay_timer);
|
|
|
|
+#endif
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|