diff options
author | Ian Lepore <ian@FreeBSD.org> | 2017-03-19 04:03:39 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2017-03-19 04:03:39 +0000 |
commit | 3d9df276014f3f3bfdc2832b40975d4a2ec6a63e (patch) | |
tree | 45663897f67121558e870046f5b3708183ecd15c | |
parent | 08ef4ddb0fa8ee531b6b213a3d041ab7fe89cda7 (diff) |
Notes
-rw-r--r-- | sys/arm/freescale/imx/imx_gpt.c | 31 | ||||
-rw-r--r-- | sys/arm/freescale/imx/imx_gptvar.h | 50 |
2 files changed, 15 insertions, 66 deletions
diff --git a/sys/arm/freescale/imx/imx_gpt.c b/sys/arm/freescale/imx/imx_gpt.c index 117c9298e09b..ea4a37d53dc0 100644 --- a/sys/arm/freescale/imx/imx_gpt.c +++ b/sys/arm/freescale/imx/imx_gpt.c @@ -35,24 +35,18 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/kernel.h> #include <sys/module.h> -#include <sys/malloc.h> #include <sys/rman.h> #include <sys/timeet.h> #include <sys/timetc.h> -#include <sys/watchdog.h> #include <machine/bus.h> -#include <machine/cpu.h> #include <machine/intr.h> #include <dev/ofw/openfirm.h> #include <dev/ofw/ofw_bus.h> #include <dev/ofw/ofw_bus_subr.h> -#include <arm/freescale/imx/imx_gptvar.h> -#include <arm/freescale/imx/imx_gptreg.h> - -#include <sys/kdb.h> #include <arm/freescale/imx/imx_ccmvar.h> +#include <arm/freescale/imx/imx_gptreg.h> #define WRITE4(_sc, _r, _v) \ bus_space_write_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r), (_v)) @@ -80,8 +74,20 @@ static struct timecounter imx_gpt_timecounter = { .tc_quality = 1000, }; +struct imx_gpt_softc { + device_t sc_dev; + struct resource * res[2]; + bus_space_tag_t sc_iot; + bus_space_handle_t sc_ioh; + void * sc_ih; /* interrupt handler */ + uint32_t sc_period; + uint32_t sc_clksrc; + uint32_t clkfreq; + struct eventtimer et; +}; + /* Global softc pointer for use in DELAY(). */ -struct imx_gpt_softc *imx_gpt_sc = NULL; +static struct imx_gpt_softc *imx_gpt_sc; /* * Hand-calibrated delay-loop counter. This was calibrated on an i.MX6 running @@ -106,7 +112,7 @@ static struct resource_spec imx_gpt_spec[] = { }; static struct ofw_compat_data compat_data[] = { - {"fsl,imx6dl-gpt", 1}, + {"fsl,imx6dl-gpt", 1}, {"fsl,imx6q-gpt", 1}, {"fsl,imx53-gpt", 1}, {"fsl,imx51-gpt", 1}, @@ -311,13 +317,6 @@ imx_gpt_timer_stop(struct eventtimer *et) return (0); } -int -imx_gpt_get_timerfreq(struct imx_gpt_softc *sc) -{ - - return (sc->clkfreq); -} - static int imx_gpt_intr(void *arg) { diff --git a/sys/arm/freescale/imx/imx_gptvar.h b/sys/arm/freescale/imx/imx_gptvar.h deleted file mode 100644 index 7a662148ac0f..000000000000 --- a/sys/arm/freescale/imx/imx_gptvar.h +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Oleksandr Rybalko under sponsorship - * from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _IMXGPTVAR_H -#define _IMXGPTVAR_H - -struct imx_gpt_softc { - device_t sc_dev; - struct resource *res[2]; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - void *sc_ih; /* interrupt handler */ - uint32_t sc_period; - uint32_t sc_clksrc; - uint32_t clkfreq; - struct eventtimer et; -}; - -extern struct imx_gpt_softc *imx_gpt_sc; - -int imx_gpt_get_timerfreq(struct imx_gpt_softc *); -#endif /* _IMXGPTVAR_H */ |