Skip to content

Commit

Permalink
OMAP hwmod: convert header files with static allocations into C files
Browse files Browse the repository at this point in the history
Code should be able to #include any header file without the fear that
the header file will go allocating memory.  This is a coding style
issue, similar to commit 82e9bd5.
Move the existing hwmod data from .h files to .c files.

While here, convert "omap34xx" to "omap3xxx" in the hwmod files, since
most of these structures should be reusable across all OMAP3 chips.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
  • Loading branch information
Paul Walmsley committed Feb 24, 2010
1 parent 50ebdac commit 7359154
Show file tree
Hide file tree
Showing 7 changed files with 226 additions and 207 deletions.
5 changes: 5 additions & 0 deletions arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \
obj-$(CONFIG_ARCH_OMAP2420) += opp2420_data.o
obj-$(CONFIG_ARCH_OMAP2430) += opp2430_data.o

# hwmod data
obj-$(CONFIG_ARCH_OMAP2420) += omap_hwmod_2420_data.o
obj-$(CONFIG_ARCH_OMAP2430) += omap_hwmod_2430_data.o
obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o

# EMU peripherals
obj-$(CONFIG_OMAP3_EMU) += emu.o

Expand Down
21 changes: 7 additions & 14 deletions arch/arm/mach-omap2/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
#include <plat/clockdomain.h>
#include "clockdomains.h"
#include <plat/omap_hwmod.h>
#include "omap_hwmod_2420.h"
#include "omap_hwmod_2430.h"
#include "omap_hwmod_34xx.h"

/*
* The machine specific code may provide the extra mapping besides the
Expand Down Expand Up @@ -322,21 +319,17 @@ static int __init _omap2_init_reprogram_sdrc(void)
void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1)
{
struct omap_hwmod **hwmods = NULL;

if (cpu_is_omap2420())
hwmods = omap2420_hwmods;
else if (cpu_is_omap2430())
hwmods = omap2430_hwmods;
else if (cpu_is_omap34xx())
hwmods = omap34xx_hwmods;

pwrdm_init(powerdomains_omap);
clkdm_init(clockdomains_omap, clkdm_autodeps);
#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
/* The OPP tables have to be registered before a clk init */
omap_hwmod_init(hwmods);
if (cpu_is_omap242x())
omap2420_hwmod_init();
else if (cpu_is_omap243x())
omap2430_hwmod_init();
else if (cpu_is_omap34xx())
omap3xxx_hwmod_init();
omap2_mux_init();
/* The OPP tables have to be registered before a clk init */
omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
#endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
/*
* omap_hwmod_2420.h - hardware modules present on the OMAP2420 chips
* omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips
*
* Copyright (C) 2009 Nokia Corporation
* Copyright (C) 2009-2010 Nokia Corporation
* Paul Walmsley
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* XXX handle crossbar/shared link difference for L3?
*
* XXX these should be marked initdata for multi-OMAP kernels
*/
#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2420_H
#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2420_H

#ifdef CONFIG_ARCH_OMAP2420

#include <plat/omap_hwmod.h>
#include <mach/irqs.h>
#include <plat/cpu.h>
#include <plat/dma.h>

#include "prm-regbits-24xx.h"

/*
* OMAP2420 hardware module integration data
*
* ALl of the data in this section should be autogeneratable from the
* TI hardware database or other technical documentation. Data that
* is driver-specific or driver-kernel integration-specific belongs
* elsewhere.
*/

static struct omap_hwmod omap2420_mpu_hwmod;
static struct omap_hwmod omap2420_l3_hwmod;
static struct omap_hwmod omap2420_l4_core_hwmod;
Expand Down Expand Up @@ -131,10 +135,9 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
NULL,
};

#else
# define omap2420_hwmods 0
#endif

#endif
int __init omap2420_hwmod_init(void)
{
return omap_hwmod_init(omap2420_hwmods);
}


Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
/*
* omap_hwmod_2430.h - hardware modules present on the OMAP2430 chips
* omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 chips
*
* Copyright (C) 2009 Nokia Corporation
* Copyright (C) 2009-2010 Nokia Corporation
* Paul Walmsley
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* XXX handle crossbar/shared link difference for L3?
*
* XXX these should be marked initdata for multi-OMAP kernels
*/
#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2430_H
#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2430_H

#ifdef CONFIG_ARCH_OMAP2430

#include <plat/omap_hwmod.h>
#include <mach/irqs.h>
#include <plat/cpu.h>
#include <plat/dma.h>

#include "prm-regbits-24xx.h"

/*
* OMAP2430 hardware module integration data
*
* ALl of the data in this section should be autogeneratable from the
* TI hardware database or other technical documentation. Data that
* is driver-specific or driver-kernel integration-specific belongs
* elsewhere.
*/

static struct omap_hwmod omap2430_mpu_hwmod;
static struct omap_hwmod omap2430_l3_hwmod;
static struct omap_hwmod omap2430_l4_core_hwmod;
Expand Down Expand Up @@ -133,10 +137,9 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
NULL,
};

#else
# define omap2430_hwmods 0
#endif

#endif
int __init omap2430_hwmod_init(void)
{
return omap_hwmod_init(omap2430_hwmods);
}


167 changes: 0 additions & 167 deletions arch/arm/mach-omap2/omap_hwmod_34xx.h

This file was deleted.

Loading

0 comments on commit 7359154

Please sign in to comment.