diff options
author | andrew <andrew@FreeBSD.org> | 2014-05-25 10:49:07 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2014-05-25 10:49:07 +0000 |
commit | 41475be3f91b47a1b743388c2a791b4ac006ec54 (patch) | |
tree | 066f94e76d48958288b715cdd56f909106f78115 | |
parent | 2adb4b058b904fd6967407593044c701724a5013 (diff) | |
download | FreeBSD-src-41475be3f91b47a1b743388c2a791b4ac006ec54.zip FreeBSD-src-41475be3f91b47a1b743388c2a791b4ac006ec54.tar.gz |
Allow the OMAP4 and AM335x prcm drivers to be compiled in the same kernel
by renaming the structures used.
-rw-r--r-- | sys/arm/ti/am335x/am335x_prcm.c | 2 | ||||
-rw-r--r-- | sys/arm/ti/omap4/omap4_prcm_clks.c | 2 | ||||
-rw-r--r-- | sys/arm/ti/ti_prcm.c | 22 |
3 files changed, 21 insertions, 5 deletions
diff --git a/sys/arm/ti/am335x/am335x_prcm.c b/sys/arm/ti/am335x/am335x_prcm.c index 325a838..7537a33 100644 --- a/sys/arm/ti/am335x/am335x_prcm.c +++ b/sys/arm/ti/am335x/am335x_prcm.c @@ -190,7 +190,7 @@ static int am335x_clk_pruss_activate(struct ti_clock_dev *clkdev); .clk_get_source_freq = am335x_clk_hsmmc_get_source_freq \ } -struct ti_clock_dev ti_clk_devmap[] = { +struct ti_clock_dev ti_am335x_clk_devmap[] = { /* System clocks */ { .id = SYS_CLK, .clk_activate = NULL, diff --git a/sys/arm/ti/omap4/omap4_prcm_clks.c b/sys/arm/ti/omap4/omap4_prcm_clks.c index 7fa59b3..589f156 100644 --- a/sys/arm/ti/omap4/omap4_prcm_clks.c +++ b/sys/arm/ti/omap4/omap4_prcm_clks.c @@ -256,7 +256,7 @@ static int omap4_clk_get_arm_fclk_freq(struct ti_clock_dev *clkdev, unsigned int } -struct ti_clock_dev ti_clk_devmap[] = { +struct ti_clock_dev ti_omap4_clk_devmap[] = { /* System clocks */ { .id = SYS_CLK, diff --git a/sys/arm/ti/ti_prcm.c b/sys/arm/ti/ti_prcm.c index 89a2377..3c073f9 100644 --- a/sys/arm/ti/ti_prcm.c +++ b/sys/arm/ti/ti_prcm.c @@ -57,16 +57,18 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <machine/intr.h> +#include <arm/ti/ti_cpuid.h> #include <arm/ti/ti_prcm.h> /** - * ti_clk_devmap - Array of clock devices, should be defined one per SoC + * ti_*_clk_devmap - Array of clock devices, should be defined one per SoC * * This array is typically defined in one of the targeted *_prcm_clk.c * files and is specific to the given SoC platform. Each entry in the array * corresponds to an individual clock device. */ -extern struct ti_clock_dev ti_clk_devmap[]; +extern struct ti_clock_dev ti_omap4_clk_devmap[]; +extern struct ti_clock_dev ti_am335x_clk_devmap[]; /** * ti_prcm_clk_dev - returns a pointer to the clock device with given id @@ -90,7 +92,21 @@ ti_prcm_clk_dev(clk_ident_t clk) * loop for this, but this function should only called when a driver is * being activated so IMHO not a big issue. */ - clk_dev = &(ti_clk_devmap[0]); + clk_dev = NULL; + switch(ti_chip()) { +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + clk_dev = &(ti_omap4_clk_devmap[0]); + break; +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + clk_dev = &(ti_am335x_clk_devmap[0]); + break; +#endif + } + if (clk_dev == NULL) + panic("No clock devmap found"); while (clk_dev->id != INVALID_CLK_IDENT) { if (clk_dev->id == clk) { return (clk_dev); |