Skip to content

Commit

Permalink
i.MXC family: Adding timer support
Browse files Browse the repository at this point in the history
This patch adds timer support for the i.MX machine family. This code can
be used on the following machs:

 - i.MX1 (tested)
 - i.MX2 (i.MX21 (to be tested), i.MX27 (tested))
 - i.MX3 (i.MX31 (tested))

TODO: It seems impossible to build a kernel for more than one CPU because the
timer do not follow the platform device rules. So it does only work if
timer 1 can be accessed on all CPUs at the same address.

Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Juergen Beisert authored and Robert Schwebel committed Jul 5, 2008
1 parent 90292ea commit d0f349f
Show file tree
Hide file tree
Showing 9 changed files with 418 additions and 251 deletions.
2 changes: 2 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ config ARCH_NS9XXX

config ARCH_MXC
bool "Freescale MXC/iMX-based"
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
select ARCH_MTD_XIP
select GENERIC_GPIO
select HAVE_GPIO_LIB
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mx3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

# Object file lists.

obj-y := mm.o time.o clock.o devices.o iomux.o
obj-y := mm.o clock.o devices.o iomux.o
obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
13 changes: 12 additions & 1 deletion arch/arm/mach-mx3/mx31ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/memory.h>
#include <asm/mach/map.h>
#include <asm/arch/common.h>
Expand Down Expand Up @@ -127,6 +128,16 @@ static void __init mxc_board_init(void)
mxc_init_extuart();
}

static void __init mx31ads_timer_init(void)
{
mxc_clocks_init(26000000);
mxc_timer_init("ipg_clk.0");
}

struct sys_timer mx31ads_timer = {
.init = mx31ads_timer_init,
};

/*
* The following uses standard kernel macros defined in arch.h in order to
* initialize __mach_desc_MX31ADS data structure.
Expand All @@ -139,5 +150,5 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS")
.map_io = mx31ads_map_io,
.init_irq = mxc_init_irq,
.init_machine = mxc_board_init,
.timer = &mxc_timer,
.timer = &mx31ads_timer,
MACHINE_END
148 changes: 0 additions & 148 deletions arch/arm/mach-mx3/time.c

This file was deleted.

2 changes: 1 addition & 1 deletion arch/arm/plat-mxc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#

# Common support
obj-y := irq.o clock.o gpio.o
obj-y := irq.o clock.o gpio.o time.o
Loading

0 comments on commit d0f349f

Please sign in to comment.