* [PATCH 1/5] OMAP2/3 omapdev: add basic omapdev structure
2008-10-18 21:59 [PATCH 0/5] PM: add omapdev code Paul Walmsley
@ 2008-10-18 21:59 ` Paul Walmsley
2008-10-23 7:26 ` David Brownell
2008-10-18 21:59 ` [PATCH 2/5] OMAP242x omapdev: add OMAP242x omapdev records Paul Walmsley
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Paul Walmsley @ 2008-10-18 21:59 UTC (permalink / raw)
To: linux-omap; +Cc: Paul Walmsley
Add a structure 'omapdev' to represent on-chip hardware peripherals.
Currently the only additional information stored are the powerdomains for
each on-chip peripheral, although the long-term intention is to use this
to handle device reset at boot time and to clean up device registration.
Use platform_device name and id fields to link this structure back to the
corresponding platform_device. In the medium- to long-term, it may be best
to use a generic device pointer so system devices can be linked also; but
for now, most cases can be handled via platform_device.
struct omapdev differs in purpose from struct platform_device in that
platform_device is currently used to represent "logical" devices in
the Linux driver model, whereas this struct omapdev is used to
represent physical on-chip devices in the OMAP memory map. An example
is the OMAP2xxx camera driver. It uses only one platform_device,
"omap24xxcam.-1", but on the hardware, that platform_device covers
several independent on-chip devices with their own address space and
control parameters. Other examples of multiple omapdevs per platform_device
include the display subsystem and UARTs.
struct omapdev entries are only for on-chip devices. Off-chip
peripherals are not included in omapdev. So, smc91x and onenand, for example,
will not be included. What belongs in those two cases would be some sort
of GPMC platform_device.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/omapdev-common.h | 27 +++++++++++++++
arch/arm/plat-omap/include/mach/omapdev.h | 51 +++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/omapdev-common.h
create mode 100644 arch/arm/plat-omap/include/mach/omapdev.h
diff --git a/arch/arm/mach-omap2/omapdev-common.h b/arch/arm/mach-omap2/omapdev-common.h
new file mode 100644
index 0000000..ce03f3d
--- /dev/null
+++ b/arch/arm/mach-omap2/omapdev-common.h
@@ -0,0 +1,27 @@
+/*
+ * OMAP on-chip devices present on OMAP2/3
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 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.
+ *
+ */
+
+#ifndef ARCH_ARM_MACH_OMAP2_OMAPDEV_COMMON_H
+#define ARCH_ARM_MACH_OMAP2_OMAPDEV_COMMON_H
+
+#include <mach/omapdev.h>
+
+#include "omapdev242x.h"
+#include "omapdev243x.h"
+#include "omapdev3xxx.h"
+
+static struct omapdev *omapdevs[] = {
+ NULL,
+};
+
+#endif
diff --git a/arch/arm/plat-omap/include/mach/omapdev.h b/arch/arm/plat-omap/include/mach/omapdev.h
new file mode 100644
index 0000000..ef91f00
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/omapdev.h
@@ -0,0 +1,51 @@
+/*
+ * OMAP on-chip device: structure and function call definitions
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 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.
+ *
+ */
+#ifndef ARCH_ARM_PLAT_OMAP_OMAPDEV_H
+#define ARCH_ARM_PLAT_OMAP_OMAPDEV_H
+
+#include <linux/types.h>
+#include <linux/list.h>
+
+#include <mach/cpu.h>
+#include <mach/powerdomain.h>
+
+/**
+ * struct omapdev - OMAP on-chip hardware devices
+ * @name: name of the device - should match TRM
+ * @pwrdm: powerdomain that the device resides in
+ * @omap_chip: OMAP chips this omapdev is valid for
+ * @pdev_name: platform_device name associated with this omapdev (if any)
+ * @pdev_id: platform_device id associated with this omapdev (if any)
+ *
+ */
+struct omapdev {
+
+ const char *name;
+
+ union {
+ const char *name;
+ struct powerdomain *ptr;
+ } pwrdm;
+
+ const struct omap_chip_id omap_chip;
+
+ const char *pdev_name;
+
+ const int pdev_id;
+
+ struct list_head node;
+};
+
+
+
+#endif
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 2/5] OMAP242x omapdev: add OMAP242x omapdev records
2008-10-18 21:59 [PATCH 0/5] PM: add omapdev code Paul Walmsley
2008-10-18 21:59 ` [PATCH 1/5] OMAP2/3 omapdev: add basic omapdev structure Paul Walmsley
@ 2008-10-18 21:59 ` Paul Walmsley
2008-10-23 7:34 ` David Brownell
2008-10-18 21:59 ` [PATCH 3/5] OMAP243x omapdev: add OMAP243x " Paul Walmsley
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Paul Walmsley @ 2008-10-18 21:59 UTC (permalink / raw)
To: linux-omap; +Cc: Paul Walmsley
Add records for most of the OMAP242x physical on-chip devices. Include
platform_device name and id fields for most of the devices currently in use
by the codebase.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/omapdev-common.h | 81 +++++
arch/arm/mach-omap2/omapdev242x.h | 581 ++++++++++++++++++++++++++++++++++
2 files changed, 662 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/omapdev242x.h
diff --git a/arch/arm/mach-omap2/omapdev-common.h b/arch/arm/mach-omap2/omapdev-common.h
index ce03f3d..ce2852d 100644
--- a/arch/arm/mach-omap2/omapdev-common.h
+++ b/arch/arm/mach-omap2/omapdev-common.h
@@ -21,6 +21,87 @@
#include "omapdev3xxx.h"
static struct omapdev *omapdevs[] = {
+
+#ifdef CONFIG_ARCH_OMAP2420
+ &mpu_242x_omapdev,
+ &iva_242x_omapdev,
+ &gfx_242x_omapdev,
+ &prcm_242x_omapdev,
+ &l3_242x_omapdev,
+ &l4_core_242x_omapdev,
+ &dsp_242x_omapdev,
+ &dsp_mmu_242x_omapdev,
+ &control_242x_omapdev,
+ &tap_242x_omapdev,
+ &gpio2_242x_omapdev,
+ &gpio3_242x_omapdev,
+ &gpio4_242x_omapdev,
+ &gptimer12_242x_omapdev,
+ &uart3_242x_omapdev,
+ &mcbsp2_242x_omapdev,
+ &wdtimer4_242x_omapdev,
+ &gptimer2_242x_omapdev,
+ &gptimer3_242x_omapdev,
+ &gptimer4_242x_omapdev,
+ &gptimer5_242x_omapdev,
+ &gptimer6_242x_omapdev,
+ &gptimer7_242x_omapdev,
+ &gptimer8_242x_omapdev,
+ &gptimer9_242x_omapdev,
+ &etb_242x_omapdev,
+ &cwt_242x_omapdev,
+ &xti_242x_omapdev,
+ &dap_242x_omapdev,
+ &dsi_242x_omapdev,
+ &dsi_pll_242x_omapdev,
+ &dss_242x_omapdev,
+ &dispc_242x_omapdev,
+ &rfbi_242x_omapdev,
+ &venc_242x_omapdev,
+ &fac_242x_omapdev,
+ &cam_242x_omapdev,
+ &cam_core_242x_omapdev,
+ &cam_dma_242x_omapdev,
+ &cam_mmu_242x_omapdev,
+ &mpu_intc_242x_omapdev,
+ &sms_242x_omapdev,
+ &gpmc_242x_omapdev,
+ &sdrc_242x_omapdev,
+ &ocm_ram_242x_omapdev,
+ &ocm_rom_242x_omapdev,
+ &ssi_242x_omapdev,
+ &ohci_242x_omapdev,
+ &otg_242x_omapdev,
+ &sdma_242x_omapdev,
+ &i2c1_242x_omapdev,
+ &i2c2_242x_omapdev,
+ &uart1_242x_omapdev,
+ &uart2_242x_omapdev,
+ &mcbsp1_242x_omapdev,
+ &gptimer10_242x_omapdev,
+ &gptimer11_242x_omapdev,
+ &mailbox_242x_omapdev,
+ &mcspi1_242x_omapdev,
+ &mcspi2_242x_omapdev,
+ &mg_242x_omapdev,
+ &hdq_242x_omapdev,
+ &mspro_242x_omapdev,
+ &wdtimer3_242x_omapdev,
+ &vlynq_242x_omapdev,
+ &eac_242x_omapdev,
+ &mmc_242x_omapdev,
+ &gptimer1_242x_omapdev,
+ &omap_32ksynct_242x_omapdev,
+ &gpio1_242x_omapdev,
+ &wdtimer2_242x_omapdev,
+ &wdtimer1_242x_omapdev,
+ &rng_242x_omapdev,
+ &sha1md5_242x_omapdev,
+ &des_242x_omapdev,
+ &aes_242x_omapdev,
+ &pka_242x_omapdev,
+#endif
+
NULL,
};
diff --git a/arch/arm/mach-omap2/omapdev242x.h b/arch/arm/mach-omap2/omapdev242x.h
new file mode 100644
index 0000000..3898958
--- /dev/null
+++ b/arch/arm/mach-omap2/omapdev242x.h
@@ -0,0 +1,581 @@
+/*
+ * TI OCP devices present on OMAP242x
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 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.
+ *
+ */
+
+#ifndef ARCH_ARM_MACH_OMAP2_OMAPDEV_242X_H
+#define ARCH_ARM_MACH_OMAP2_OMAPDEV_242X_H
+
+#include <linux/serial_8250.h>
+
+#include <mach/cpu.h>
+#include <mach/omapdev.h>
+
+#ifdef CONFIG_ARCH_OMAP2420
+
+/* 242x data from 2420 TRM ES2.1.1 ES2.2 Rev Q */
+
+/* MPU */
+
+static struct omapdev mpu_242x_omapdev = {
+ .name = "mpu_omapdev",
+ .pwrdm = { .name = "mpu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+
+/* DSP/IVA pwrdm */
+
+/* This is IVA1, the ARM7 core on 2420 */
+static struct omapdev iva_242x_omapdev = {
+ .name = "iva_omapdev",
+ .pwrdm = { .name = "dsp_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* GFX */
+
+/* XXX VGP/MBX split ? */
+static struct omapdev gfx_242x_omapdev = {
+ .name = "gfx_omapdev",
+ .pwrdm = { .name = "gfx_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* WKUP */
+
+static struct omapdev prcm_242x_omapdev = {
+ .name = "prcm_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* CORE */
+
+/* L3 bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l3_242x_omapdev = {
+ .name = "l3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* L4_CORE bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l4_core_242x_omapdev = {
+ .name = "l4_core_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev dsp_242x_omapdev = {
+ .name = "dsp_omapdev",
+ .pwrdm = { .name = "dsp_pwrdm" },
+ .pdev_name = "dsp",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev dsp_mmu_242x_omapdev = {
+ .name = "dsp_mmu_omapdev",
+ .pwrdm = { .name = "dsp_pwrdm" },
+ .pdev_name = "dsp",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* Wakeup */
+
+/* on CORE pwrdm in OMAP3 */
+static struct omapdev control_242x_omapdev = {
+ .name = "control_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev tap_242x_omapdev = {
+ .name = "tap_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* GPIO2-4 is on PER_PWRDM on OMAP3 */
+static struct omapdev gpio2_242x_omapdev = {
+ .name = "gpio2_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gpio3_242x_omapdev = {
+ .name = "gpio3_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gpio4_242x_omapdev = {
+ .name = "gpio4_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer12_242x_omapdev = {
+ .name = "gptimer12_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev uart3_242x_omapdev = {
+ .name = "uart3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mcbsp2_242x_omapdev = {
+ .name = "mcbsp2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* aka the "IVA2 wdtimer" */
+static struct omapdev wdtimer4_242x_omapdev = {
+ .name = "wdtimer4_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer2_242x_omapdev = {
+ .name = "gptimer2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer3_242x_omapdev = {
+ .name = "gptimer3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer4_242x_omapdev = {
+ .name = "gptimer4_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer5_242x_omapdev = {
+ .name = "gptimer5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer6_242x_omapdev = {
+ .name = "gptimer6_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer7_242x_omapdev = {
+ .name = "gptimer7_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer8_242x_omapdev = {
+ .name = "gptimer8_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer9_242x_omapdev = {
+ .name = "gptimer9_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev etb_242x_omapdev = {
+ .name = "etb_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev cwt_242x_omapdev = {
+ .name = "cwt_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev xti_242x_omapdev = {
+ .name = "xti_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "sti",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev dap_242x_omapdev = {
+ .name = "dap_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev dsi_242x_omapdev = {
+ .name = "dsi_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev dsi_pll_242x_omapdev = {
+ .name = "dsi_pll_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev dss_242x_omapdev = {
+ .name = "dss_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev dispc_242x_omapdev = {
+ .name = "dispc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev rfbi_242x_omapdev = {
+ .name = "rfbi_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev venc_242x_omapdev = {
+ .name = "venc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev fac_242x_omapdev = {
+ .name = "fac_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev cam_242x_omapdev = {
+ .name = "cam_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev cam_core_242x_omapdev = {
+ .name = "cam_core_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev cam_dma_242x_omapdev = {
+ .name = "cam_dma_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev cam_mmu_242x_omapdev = {
+ .name = "cam_mmu_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* Connected to the ARM1136 peripheral port, not an L3/L4 interconnect */
+static struct omapdev mpu_intc_242x_omapdev = {
+ .name = "mpu_intc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev sms_242x_omapdev = {
+ .name = "sms_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gpmc_242x_omapdev = {
+ .name = "gpmc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev sdrc_242x_omapdev = {
+ .name = "sdrc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev ocm_ram_242x_omapdev = {
+ .name = "ocm_ram_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev ocm_rom_242x_omapdev = {
+ .name = "ocm_rom_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev ssi_242x_omapdev = {
+ .name = "ssi_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev ohci_242x_omapdev = {
+ .name = "ohci_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "ohci",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev otg_242x_omapdev = {
+ .name = "otg_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_otg",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev sdma_242x_omapdev = {
+ .name = "sdma_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev i2c1_242x_omapdev = {
+ .name = "i2c1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "i2c_omap",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev i2c2_242x_omapdev = {
+ .name = "i2c2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "i2c_omap",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev uart1_242x_omapdev = {
+ .name = "uart1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev uart2_242x_omapdev = {
+ .name = "uart2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mcbsp1_242x_omapdev = {
+ .name = "mcbsp1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer10_242x_omapdev = {
+ .name = "gptimer10_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer11_242x_omapdev = {
+ .name = "gptimer11_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mailbox_242x_omapdev = {
+ .name = "mailbox_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mailbox",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mcspi1_242x_omapdev = {
+ .name = "mcspi1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mcspi2_242x_omapdev = {
+ .name = "mcspi2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mg_242x_omapdev = {
+ .name = "mg_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev hdq_242x_omapdev = {
+ .name = "hdq_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_hdq",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mspro_242x_omapdev = {
+ .name = "mspro_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* Not present on 2430 - present on 3430 in PER pwrdm */
+static struct omapdev wdtimer3_242x_omapdev = {
+ .name = "wdtimer3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev vlynq_242x_omapdev = {
+ .name = "vlynq_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev eac_242x_omapdev = {
+ .name = "eac_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xx-eac",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev mmc_242x_omapdev = {
+ .name = "mmc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mmci-omap",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gptimer1_242x_omapdev = {
+ .name = "gptimer1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev omap_32ksynct_242x_omapdev = {
+ .name = "32ksynct_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev gpio1_242x_omapdev = {
+ .name = "gpio1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* aka the "omap wdtimer" on 2430 or the "mpu wdtimer" on 3430 */
+static struct omapdev wdtimer2_242x_omapdev = {
+ .name = "wdtimer2_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .pdev_name = "omap_wdt",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* Secure-mode devices */
+
+/* aka the "secure wdtimer" */
+static struct omapdev wdtimer1_242x_omapdev = {
+ .name = "wdtimer1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev rng_242x_omapdev = {
+ .name = "rng_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_rng",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+/* XXX is the slash in this pdev_name going to wreck sysfs? */
+static struct omapdev sha1md5_242x_omapdev = {
+ .name = "sha1md5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "OMAP SHA1/MD5",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev des_242x_omapdev = {
+ .name = "des_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev aes_242x_omapdev = {
+ .name = "aes_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct omapdev pka_242x_omapdev = {
+ .name = "pka_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+#endif /* CONFIG_ARCH_OMAP2420 */
+
+
+#endif
+
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 2/5] OMAP242x omapdev: add OMAP242x omapdev records
2008-10-18 21:59 ` [PATCH 2/5] OMAP242x omapdev: add OMAP242x omapdev records Paul Walmsley
@ 2008-10-23 7:34 ` David Brownell
2008-12-11 3:55 ` Paul Walmsley
0 siblings, 1 reply; 10+ messages in thread
From: David Brownell @ 2008-10-23 7:34 UTC (permalink / raw)
To: Paul Walmsley; +Cc: linux-omap
On Saturday 18 October 2008, Paul Walmsley wrote:
> --- a/arch/arm/mach-omap2/omapdev-common.h
> +++ b/arch/arm/mach-omap2/omapdev-common.h
> @@ -21,6 +21,87 @@
> #include "omapdev3xxx.h"
>
> static struct omapdev *omapdevs[] = {
> +
> +#ifdef CONFIG_ARCH_OMAP2420
> + &mpu_242x_omapdev,
> + &iva_242x_omapdev,
> + &gfx_242x_omapdev,
> ...
Urgh, this is unpleasant style: declaration of a large
static data structure in a header file.
Cleaner: just have some omap2420-specific C file declare
the struct, and hand it off to whatever code uses it.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 2/5] OMAP242x omapdev: add OMAP242x omapdev records
2008-10-23 7:34 ` David Brownell
@ 2008-12-11 3:55 ` Paul Walmsley
2008-12-11 8:10 ` Felipe Balbi
0 siblings, 1 reply; 10+ messages in thread
From: Paul Walmsley @ 2008-12-11 3:55 UTC (permalink / raw)
To: David Brownell; +Cc: linux-omap
[-- Attachment #1: Type: TEXT/PLAIN, Size: 891 bytes --]
Hi David,
On Thu, 23 Oct 2008, David Brownell wrote:
> On Saturday 18 October 2008, Paul Walmsley wrote:
> > --- a/arch/arm/mach-omap2/omapdev-common.h
> > +++ b/arch/arm/mach-omap2/omapdev-common.h
> > @@ -21,6 +21,87 @@
> > #include "omapdev3xxx.h"
> >
> > static struct omapdev *omapdevs[] = {
> > +
> > +#ifdef CONFIG_ARCH_OMAP2420
> > + &mpu_242x_omapdev,
> > + &iva_242x_omapdev,
> > + &gfx_242x_omapdev,
> > ...
>
> Urgh, this is unpleasant style: declaration of a large
> static data structure in a header file.
>
> Cleaner: just have some omap2420-specific C file declare
> the struct, and hand it off to whatever code uses it.
Not sure I understand what you'd like to see. Could you send a short code
snippet as an example? One caveat is that whatever we go with here will
need to work for a multi-OMAP kernel.
- Paul
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 2/5] OMAP242x omapdev: add OMAP242x omapdev records
2008-12-11 3:55 ` Paul Walmsley
@ 2008-12-11 8:10 ` Felipe Balbi
0 siblings, 0 replies; 10+ messages in thread
From: Felipe Balbi @ 2008-12-11 8:10 UTC (permalink / raw)
To: ext Paul Walmsley; +Cc: David Brownell, linux-omap
On Wed, Dec 10, 2008 at 08:55:00PM -0700, Paul Walmsley wrote:
> Hi David,
>
> On Thu, 23 Oct 2008, David Brownell wrote:
>
> > On Saturday 18 October 2008, Paul Walmsley wrote:
> > > --- a/arch/arm/mach-omap2/omapdev-common.h
> > > +++ b/arch/arm/mach-omap2/omapdev-common.h
> > > @@ -21,6 +21,87 @@
> > > #include "omapdev3xxx.h"
> > >
> > > static struct omapdev *omapdevs[] = {
> > > +
> > > +#ifdef CONFIG_ARCH_OMAP2420
> > > + &mpu_242x_omapdev,
> > > + &iva_242x_omapdev,
> > > + &gfx_242x_omapdev,
> > > ...
> >
> > Urgh, this is unpleasant style: declaration of a large
> > static data structure in a header file.
> >
> > Cleaner: just have some omap2420-specific C file declare
> > the struct, and hand it off to whatever code uses it.
>
> Not sure I understand what you'd like to see. Could you send a short code
> snippet as an example? One caveat is that whatever we go with here will
> need to work for a multi-OMAP kernel.
I think dave is saying that you could move static struct omapdev to a
C-file and probably have separate tables for each omap version, then you
can pass a reference to it to a function which would do all the magic.
Something like platform_add_devices(), then you pass the reference to
the table and the table size.
--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/5] OMAP243x omapdev: add OMAP243x omapdev records
2008-10-18 21:59 [PATCH 0/5] PM: add omapdev code Paul Walmsley
2008-10-18 21:59 ` [PATCH 1/5] OMAP2/3 omapdev: add basic omapdev structure Paul Walmsley
2008-10-18 21:59 ` [PATCH 2/5] OMAP242x omapdev: add OMAP242x omapdev records Paul Walmsley
@ 2008-10-18 21:59 ` Paul Walmsley
2008-10-18 21:59 ` [PATCH 4/5] OMAP3xxx omapdev: add OMAP3xxx " Paul Walmsley
2008-10-18 21:59 ` [PATCH 5/5] OMAP2/3 omapdev: add code to walk the " Paul Walmsley
4 siblings, 0 replies; 10+ messages in thread
From: Paul Walmsley @ 2008-10-18 21:59 UTC (permalink / raw)
To: linux-omap; +Cc: Paul Walmsley
Add records for most of the OMAP243x/OMAP253x physical on-chip
devices. Include platform_device name and id fields for most of the
devices currently in use by the codebase.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/omapdev-common.h | 90 +++++
arch/arm/mach-omap2/omapdev243x.h | 661 ++++++++++++++++++++++++++++++++++
2 files changed, 751 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/omapdev243x.h
diff --git a/arch/arm/mach-omap2/omapdev-common.h b/arch/arm/mach-omap2/omapdev-common.h
index ce2852d..964efd6 100644
--- a/arch/arm/mach-omap2/omapdev-common.h
+++ b/arch/arm/mach-omap2/omapdev-common.h
@@ -102,6 +102,96 @@ static struct omapdev *omapdevs[] = {
&pka_242x_omapdev,
#endif
+#ifdef CONFIG_ARCH_OMAP2430
+ &mpu_243x_omapdev,
+ &iva2_243x_omapdev,
+ &iva2_mmu_243x_omapdev,
+ &gfx_243x_omapdev,
+ &l3_243x_omapdev,
+ &l4_core_243x_omapdev,
+ &l4_wkup_243x_omapdev,
+ &dsp_243x_omapdev,
+ &control_243x_omapdev,
+ &tap_243x_omapdev,
+ &gpio2_243x_omapdev,
+ &gpio3_243x_omapdev,
+ &gpio4_243x_omapdev,
+ &gptimer12_243x_omapdev,
+ &uart3_243x_omapdev,
+ &mcbsp2_243x_omapdev,
+ &wdtimer4_243x_omapdev,
+ &gptimer2_243x_omapdev,
+ &gptimer3_243x_omapdev,
+ &gptimer4_243x_omapdev,
+ &gptimer5_243x_omapdev,
+ &gptimer6_243x_omapdev,
+ &gptimer7_243x_omapdev,
+ &gptimer8_243x_omapdev,
+ &gptimer9_243x_omapdev,
+ &etb_243x_omapdev,
+ &cwt_243x_omapdev,
+ &xti_243x_omapdev,
+ &dap_243x_omapdev,
+ &dsi_243x_omapdev,
+ &dsi_pll_243x_omapdev,
+ &dss_243x_omapdev,
+ &dispc_243x_omapdev,
+ &rfbi_243x_omapdev,
+ &venc_243x_omapdev,
+ &fac_243x_omapdev,
+ &cam_243x_omapdev,
+ &cam_core_243x_omapdev,
+ &cam_dma_243x_omapdev,
+ &cam_mmu_243x_omapdev,
+ &mpu_intc_243x_omapdev,
+ &modem_intc_243x_omapdev,
+ &sms_243x_omapdev,
+ &gpmc_243x_omapdev,
+ &sdrc_243x_omapdev,
+ &ocm_ram_243x_omapdev,
+ &ocm_rom_243x_omapdev,
+ &sad2d_243x_omapdev,
+ &ssi_243x_omapdev,
+ &ohci_243x_omapdev,
+ &fsotg_243x_omapdev,
+ &hsotg_243x_omapdev,
+ &sdma_243x_omapdev,
+ &i2c1_243x_omapdev,
+ &i2c2_243x_omapdev,
+ &uart1_243x_omapdev,
+ &uart2_243x_omapdev,
+ &mcbsp1_243x_omapdev,
+ &gptimer10_243x_omapdev,
+ &gptimer11_243x_omapdev,
+ &mailbox_243x_omapdev,
+ &mcspi1_243x_omapdev,
+ &mcspi2_243x_omapdev,
+ &mg_243x_omapdev,
+ &hdq_243x_omapdev,
+ &mspro_243x_omapdev,
+ &mcbsp5_243x_omapdev,
+ &hsmmc1_243x_omapdev,
+ &hsmmc2_243x_omapdev,
+ &mcspi3_243x_omapdev,
+ &gptimer1_243x_omapdev,
+ &prm_243x_omapdev,
+ &cm_243x_omapdev,
+ &omap_32ksynct_243x_omapdev,
+ &gpio1_243x_omapdev,
+ &wdtimer2_243x_omapdev,
+ &wdtimer1_243x_omapdev,
+ &rng_243x_omapdev,
+ &sha1md5_243x_omapdev,
+ &des_243x_omapdev,
+ &aes_243x_omapdev,
+ &pka_243x_omapdev,
+ &modem_243x_omapdev,
+ &icr_243x_omapdev,
+ &mcbsp3_243x_omapdev,
+ &mcbsp4_243x_omapdev,
+ &gpio5_243x_omapdev,
+#endif
+
NULL,
};
diff --git a/arch/arm/mach-omap2/omapdev243x.h b/arch/arm/mach-omap2/omapdev243x.h
new file mode 100644
index 0000000..6a51cb3
--- /dev/null
+++ b/arch/arm/mach-omap2/omapdev243x.h
@@ -0,0 +1,661 @@
+/*
+ * TI OCP devices present on OMAP243x
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 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.
+ *
+ */
+
+#ifndef ARCH_ARM_MACH_OMAP2_OMAPDEV_243X_H
+#define ARCH_ARM_MACH_OMAP2_OMAPDEV_243X_H
+
+#include <linux/serial_8250.h>
+
+#include <mach/cpu.h>
+#include <mach/omapdev.h>
+
+#ifdef CONFIG_ARCH_OMAP2430
+
+/* 2430 data from 2430 TRM ES2.1 Rev G */
+
+/* XXX add IVA2.1 WUGEN for 2430/3430 ? */
+
+
+/* MPU */
+
+static struct omapdev mpu_243x_omapdev = {
+ .name = "mpu_omapdev",
+ .pwrdm = { .name = "mpu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* IVA2/DSP */
+
+/* dsp_omapdev is what is used on OMAP243x */
+static struct omapdev iva2_243x_omapdev = {
+ .name = "iva2_omapdev",
+ .pwrdm = { .name = "iva2_pwrdm" },
+ .pdev_name = "dsp",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev iva2_mmu_243x_omapdev = {
+ .name = "iva2_mmu_omapdev",
+ .pwrdm = { .name = "iva2_pwrdm" },
+ .pdev_name = "dsp",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+
+/* GFX */
+
+/* XXX VGP/MBX split ? */
+static struct omapdev gfx_243x_omapdev = {
+ .name = "gfx_omapdev",
+ .pwrdm = { .name = "gfx_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+
+/* CORE pwrdm */
+
+/* L3 bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l3_243x_omapdev = {
+ .name = "l3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* L4_CORE bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l4_core_243x_omapdev = {
+ .name = "l4_core_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* L4_WKUP bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l4_wkup_243x_omapdev = {
+ .name = "l4_wkup_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev dsp_243x_omapdev = {
+ .name = "dsp_omapdev",
+ .pwrdm = { .name = "dsp_pwrdm" },
+ .pdev_name = "dsp",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* Wakeup */
+
+/* on CORE pwrdm in OMAP3 */
+static struct omapdev control_243x_omapdev = {
+ .name = "control_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev tap_243x_omapdev = {
+ .name = "tap_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* GPIO2-4 is on PER_PWRDM on OMAP3 */
+static struct omapdev gpio2_243x_omapdev = {
+ .name = "gpio2_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gpio3_243x_omapdev = {
+ .name = "gpio3_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gpio4_243x_omapdev = {
+ .name = "gpio4_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer12_243x_omapdev = {
+ .name = "gptimer12_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev uart3_243x_omapdev = {
+ .name = "uart3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mcbsp2_243x_omapdev = {
+ .name = "mcbsp2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* aka the "IVA2 wdtimer" */
+static struct omapdev wdtimer4_243x_omapdev = {
+ .name = "wdtimer4_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "wdt",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer2_243x_omapdev = {
+ .name = "gptimer2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer3_243x_omapdev = {
+ .name = "gptimer3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer4_243x_omapdev = {
+ .name = "gptimer4_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer5_243x_omapdev = {
+ .name = "gptimer5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer6_243x_omapdev = {
+ .name = "gptimer6_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer7_243x_omapdev = {
+ .name = "gptimer7_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer8_243x_omapdev = {
+ .name = "gptimer8_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer9_243x_omapdev = {
+ .name = "gptimer9_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev etb_243x_omapdev = {
+ .name = "etb_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev cwt_243x_omapdev = {
+ .name = "cwt_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev xti_243x_omapdev = {
+ .name = "xti_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "sti",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev dap_243x_omapdev = {
+ .name = "dap_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev dsi_243x_omapdev = {
+ .name = "dsi_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev dsi_pll_243x_omapdev = {
+ .name = "dsi_pll_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev dss_243x_omapdev = {
+ .name = "dss_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev dispc_243x_omapdev = {
+ .name = "dispc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev rfbi_243x_omapdev = {
+ .name = "rfbi_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev venc_243x_omapdev = {
+ .name = "venc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev fac_243x_omapdev = {
+ .name = "fac_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev cam_243x_omapdev = {
+ .name = "cam_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev cam_core_243x_omapdev = {
+ .name = "cam_core_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev cam_dma_243x_omapdev = {
+ .name = "cam_dma_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev cam_mmu_243x_omapdev = {
+ .name = "cam_mmu_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap24xxcam",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* Connected to the ARM1136 peripheral port, not an L3/L4 interconnect */
+static struct omapdev mpu_intc_243x_omapdev = {
+ .name = "mpu_intc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* XXX guessing on this one; TRM does not cover it well */
+static struct omapdev modem_intc_243x_omapdev = {
+ .name = "modem_intc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev sms_243x_omapdev = {
+ .name = "sms_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gpmc_243x_omapdev = {
+ .name = "gpmc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev sdrc_243x_omapdev = {
+ .name = "sdrc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev ocm_ram_243x_omapdev = {
+ .name = "ocm_ram_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev ocm_rom_243x_omapdev = {
+ .name = "ocm_rom_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev sad2d_243x_omapdev = {
+ .name = "sad2d_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev ssi_243x_omapdev = {
+ .name = "ssi_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev ohci_243x_omapdev = {
+ .name = "ohci_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "ohci",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev fsotg_243x_omapdev = {
+ .name = "fsotg_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_otg",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev hsotg_243x_omapdev = {
+ .name = "hsotg_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_otg",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev sdma_243x_omapdev = {
+ .name = "sdma_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev i2c1_243x_omapdev = {
+ .name = "i2c1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "i2c_omap",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev i2c2_243x_omapdev = {
+ .name = "i2c2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "i2c_omap",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev uart1_243x_omapdev = {
+ .name = "uart1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev uart2_243x_omapdev = {
+ .name = "uart2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mcbsp1_243x_omapdev = {
+ .name = "mcbsp1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer10_243x_omapdev = {
+ .name = "gptimer10_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gptimer11_243x_omapdev = {
+ .name = "gptimer11_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mailbox_243x_omapdev = {
+ .name = "mailbox_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mailbox",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mcspi1_243x_omapdev = {
+ .name = "mcspi1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mcspi2_243x_omapdev = {
+ .name = "mcspi2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mg_243x_omapdev = {
+ .name = "mg_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev hdq_243x_omapdev = {
+ .name = "hdq_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_hdq",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mspro_243x_omapdev = {
+ .name = "mspro_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mcbsp5_243x_omapdev = {
+ .name = "mcbsp5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 5,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev hsmmc1_243x_omapdev = {
+ .name = "hsmmc1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mmci-omap",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev hsmmc2_243x_omapdev = {
+ .name = "hsmmc2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mmci-omap",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mcspi3_243x_omapdev = {
+ .name = "mcspi3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 3,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+
+
+/* WKUP */
+
+static struct omapdev gptimer1_243x_omapdev = {
+ .name = "gptimer1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev prm_243x_omapdev = {
+ .name = "prm_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev cm_243x_omapdev = {
+ .name = "cm_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev omap_32ksynct_243x_omapdev = {
+ .name = "32ksynct_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gpio1_243x_omapdev = {
+ .name = "gpio1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* aka the "omap wdtimer" on 2430 or the "mpu wdtimer" on 3430 */
+static struct omapdev wdtimer2_243x_omapdev = {
+ .name = "wdtimer2_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .pdev_name = "omap_wdt",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* Secure-mode devices */
+
+/* aka the "secure wdtimer" */
+static struct omapdev wdtimer1_243x_omapdev = {
+ .name = "wdtimer1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev rng_243x_omapdev = {
+ .name = "rng_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_rng",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev sha1md5_243x_omapdev = {
+ .name = "sha1md5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "OMAP SHA1/MD5",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev des_243x_omapdev = {
+ .name = "des_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev aes_243x_omapdev = {
+ .name = "aes_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev pka_243x_omapdev = {
+ .name = "pka_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+
+static struct omapdev modem_243x_omapdev = {
+ .name = "modem_omapdev",
+ .pwrdm = { .name = "mdm_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev icr_243x_omapdev = {
+ .name = "icr_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* These two McBSP instances are in PER on 3430 */
+static struct omapdev mcbsp3_243x_omapdev = {
+ .name = "mcbsp3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 3,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev mcbsp4_243x_omapdev = {
+ .name = "mcbsp4_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 4,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct omapdev gpio5_243x_omapdev = {
+ .name = "gpio5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+#endif /* CONFIG_ARCH_OMAP2430 */
+
+#endif
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 4/5] OMAP3xxx omapdev: add OMAP3xxx omapdev records
2008-10-18 21:59 [PATCH 0/5] PM: add omapdev code Paul Walmsley
` (2 preceding siblings ...)
2008-10-18 21:59 ` [PATCH 3/5] OMAP243x omapdev: add OMAP243x " Paul Walmsley
@ 2008-10-18 21:59 ` Paul Walmsley
2008-10-18 21:59 ` [PATCH 5/5] OMAP2/3 omapdev: add code to walk the " Paul Walmsley
4 siblings, 0 replies; 10+ messages in thread
From: Paul Walmsley @ 2008-10-18 21:59 UTC (permalink / raw)
To: linux-omap; +Cc: Paul Walmsley
Add records for most of the OMAP3xxx physical on-chip devices.
OMAP3430 is used as the reference here. Include platform_device name
and id fields for most of the devices currently in use by the
codebase.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/omapdev-common.h | 111 +++++
arch/arm/mach-omap2/omapdev3xxx.h | 802 ++++++++++++++++++++++++++++++++++
2 files changed, 913 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/omapdev3xxx.h
diff --git a/arch/arm/mach-omap2/omapdev-common.h b/arch/arm/mach-omap2/omapdev-common.h
index 964efd6..a2d4855 100644
--- a/arch/arm/mach-omap2/omapdev-common.h
+++ b/arch/arm/mach-omap2/omapdev-common.h
@@ -192,6 +192,117 @@ static struct omapdev *omapdevs[] = {
&gpio5_243x_omapdev,
#endif
+#ifdef CONFIG_ARCH_OMAP3
+ &mpu_3xxx_omapdev,
+ &iva2_3xxx_omapdev,
+ &iva2_mmu_3xxx_omapdev,
+ &gfx_3xxx_omapdev,
+ &l3_3xxx_omapdev,
+ &l4_core_3xxx_omapdev,
+ &l4_wkup_3xxx_omapdev,
+ &mpu_intc_3xxx_omapdev,
+ &modem_intc_3xxx_omapdev,
+ &sms_3xxx_omapdev,
+ &gpmc_3xxx_omapdev,
+ &sdrc_3xxx_omapdev,
+ &ocm_ram_3xxx_omapdev,
+ &ocm_rom_3xxx_omapdev,
+ &sad2d_3xxx_omapdev,
+ &ssi_3xxx_omapdev,
+ &sdma_3xxx_omapdev,
+ &i2c1_3xxx_omapdev,
+ &i2c2_3xxx_omapdev,
+ &uart1_3xxx_omapdev,
+ &uart2_3xxx_omapdev,
+ &mcbsp1_3xxx_omapdev,
+ &gptimer10_3xxx_omapdev,
+ &gptimer11_3xxx_omapdev,
+ &mailbox_3xxx_omapdev,
+ &mcspi1_3xxx_omapdev,
+ &mcspi2_3xxx_omapdev,
+ &mg_3xxx_omapdev,
+ &hdq_3xxx_omapdev,
+ &mspro_3xxx_omapdev,
+ &mcbsp5_3xxx_omapdev,
+ &hsmmc1_3xxx_omapdev,
+ &hsmmc2_3xxx_omapdev,
+ &mcspi3_3xxx_omapdev,
+ &gptimer1_3xxx_omapdev,
+ &prm_3xxx_omapdev,
+ &cm_3xxx_omapdev,
+ &omap_32ksynct_3xxx_omapdev,
+ &gpio1_3xxx_omapdev,
+ &wdtimer2_3xxx_omapdev,
+ &wdtimer1_3xxx_omapdev,
+ &rng_3xxx_omapdev,
+ &sha1md5_3xxx_omapdev,
+ &des_3xxx_omapdev,
+ &aes_3xxx_omapdev,
+ &pka_3xxx_omapdev,
+ &neon_3xxx_omapdev,
+ &sgx_3xxx_omapdev,
+ &l4_per_3xxx_omapdev,
+ &l4_emu_3xxx_omapdev,
+ &icr_3xxx_omapdev,
+ &wugen_3xxx_omapdev,
+ &mad2d_3xxx_omapdev,
+ &control_3xxx_omapdev,
+ &i2c3_3xxx_omapdev,
+ &hsmmc3_3xxx_omapdev,
+ &mcspi4_3xxx_omapdev,
+ &sr1_3xxx_omapdev,
+ &sr2_3xxx_omapdev,
+ &usbhost_es1_3xxx_omapdev,
+ &usbotg_es1_3xxx_omapdev,
+ &uart3_3xxx_omapdev,
+ &mcbsp2_3xxx_omapdev,
+ &mcbsp3_3xxx_omapdev,
+ &mcbsp4_3xxx_omapdev,
+ &mcbsp2_sidetone_3xxx_omapdev,
+ &mcbsp3_sidetone_3xxx_omapdev,
+ &wdtimer3_3xxx_omapdev,
+ &gptimer2_3xxx_omapdev,
+ &gptimer3_3xxx_omapdev,
+ &gptimer4_3xxx_omapdev,
+ &gptimer5_3xxx_omapdev,
+ &gptimer6_3xxx_omapdev,
+ &gptimer7_3xxx_omapdev,
+ &gptimer8_3xxx_omapdev,
+ &gptimer9_3xxx_omapdev,
+ &gpio2_3xxx_omapdev,
+ &gpio3_3xxx_omapdev,
+ &gpio4_3xxx_omapdev,
+ &gpio5_3xxx_omapdev,
+ &gpio6_3xxx_omapdev,
+ &tap_3xxx_omapdev,
+ &mpuemu_3xxx_omapdev,
+ &tpiu_3xxx_omapdev,
+ &etb_3xxx_omapdev,
+ &dapctl_3xxx_omapdev,
+ &sdti_3xxx_omapdev,
+ &dap_3xxx_omapdev,
+ &usbhost_3xxx_omapdev,
+ &usbotg_3xxx_omapdev,
+ &usbtll_3xxx_omapdev,
+ &dsi_3xxx_omapdev,
+ &dsi_phy_3xxx_omapdev,
+ &dsi_pll_3xxx_omapdev,
+ &dss_3xxx_omapdev,
+ &dispc_3xxx_omapdev,
+ &rfbi_3xxx_omapdev,
+ &venc_3xxx_omapdev,
+ &isp_3xxx_omapdev,
+ &isp_cbuff_3xxx_omapdev,
+ &ccp2_3xxx_omapdev,
+ &ccdc_3xxx_omapdev,
+ &hist_3xxx_omapdev,
+ &h3a_3xxx_omapdev,
+ &prv_3xxx_omapdev,
+ &rsz_3xxx_omapdev,
+ &sbl_3xxx_omapdev,
+ &csi2_3xxx_omapdev,
+#endif
+
NULL,
};
diff --git a/arch/arm/mach-omap2/omapdev3xxx.h b/arch/arm/mach-omap2/omapdev3xxx.h
new file mode 100644
index 0000000..199282f
--- /dev/null
+++ b/arch/arm/mach-omap2/omapdev3xxx.h
@@ -0,0 +1,802 @@
+/*
+ * TI OCP devices present on OMAP3xxx
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 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.
+ *
+ */
+
+#ifndef ARCH_ARM_MACH_OMAP2_OMAPDEV_3XXX_H
+#define ARCH_ARM_MACH_OMAP2_OMAPDEV_3XXX_H
+
+#include <linux/serial_8250.h>
+
+#include <mach/cpu.h>
+#include <mach/omapdev.h>
+
+#ifdef CONFIG_ARCH_OMAP3
+
+/* 3xxx data from the 34xx ES2 TRM Rev F */
+
+/* MPU */
+
+static struct omapdev mpu_3xxx_omapdev = {
+ .name = "mpu_3xxx_omapdev",
+ .pwrdm = { .name = "mpu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* IVA2/DSP */
+
+/* dsp_omapdev is what is used on OMAP242x */
+static struct omapdev iva2_3xxx_omapdev = {
+ .name = "iva2_3xxx_omapdev",
+ .pwrdm = { .name = "iva2_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev iva2_mmu_3xxx_omapdev = {
+ .name = "iva2_mmu_3xxx_omapdev",
+ .pwrdm = { .name = "iva2_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+
+/* GFX */
+
+/* XXX VGP/MBX split ? */
+static struct omapdev gfx_3xxx_omapdev = {
+ .name = "gfx_omapdev",
+ .pwrdm = { .name = "gfx_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
+};
+
+
+/* CORE pwrdm */
+
+/* L3 bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l3_3xxx_omapdev = {
+ .name = "l3_3xxx_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* L4_CORE bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l4_core_3xxx_omapdev = {
+ .name = "l4_core_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* L4_WKUP bus configuration: RT, AP, LA, PM blocks */
+static struct omapdev l4_wkup_3xxx_omapdev = {
+ .name = "l4_wkup_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mpu_intc_3xxx_omapdev = {
+ .name = "mpu_intc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* XXX guessing on this one; TRM does not cover it well */
+static struct omapdev modem_intc_3xxx_omapdev = {
+ .name = "modem_intc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sms_3xxx_omapdev = {
+ .name = "sms_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gpmc_3xxx_omapdev = {
+ .name = "gpmc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sdrc_3xxx_omapdev = {
+ .name = "sdrc_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev ocm_ram_3xxx_omapdev = {
+ .name = "ocm_ram_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev ocm_rom_3xxx_omapdev = {
+ .name = "ocm_rom_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sad2d_3xxx_omapdev = {
+ .name = "sad2d_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev ssi_3xxx_omapdev = {
+ .name = "ssi_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sdma_3xxx_omapdev = {
+ .name = "sdma_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev i2c1_3xxx_omapdev = {
+ .name = "i2c1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "i2c_omap",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev i2c2_3xxx_omapdev = {
+ .name = "i2c2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "i2c_omap",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev uart1_3xxx_omapdev = {
+ .name = "uart1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev uart2_3xxx_omapdev = {
+ .name = "uart2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcbsp1_3xxx_omapdev = {
+ .name = "mcbsp1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer10_3xxx_omapdev = {
+ .name = "gptimer10_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer11_3xxx_omapdev = {
+ .name = "gptimer11_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mailbox_3xxx_omapdev = {
+ .name = "mailbox_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mailbox",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcspi1_3xxx_omapdev = {
+ .name = "mcspi1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcspi2_3xxx_omapdev = {
+ .name = "mcspi2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mg_3xxx_omapdev = {
+ .name = "mg_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev hdq_3xxx_omapdev = {
+ .name = "hdq_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap_hdq",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mspro_3xxx_omapdev = {
+ .name = "mspro_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcbsp5_3xxx_omapdev = {
+ .name = "mcbsp5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 5,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev hsmmc1_3xxx_omapdev = {
+ .name = "hsmmc1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mmci-omap",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev hsmmc2_3xxx_omapdev = {
+ .name = "hsmmc2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mmci-omap",
+ .pdev_id = 1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcspi3_3xxx_omapdev = {
+ .name = "mcspi3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 3,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+
+
+/* WKUP */
+
+static struct omapdev gptimer1_3xxx_omapdev = {
+ .name = "gptimer1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev prm_3xxx_omapdev = {
+ .name = "prm_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev cm_3xxx_omapdev = {
+ .name = "cm_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev omap_32ksynct_3xxx_omapdev = {
+ .name = "32ksynct_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gpio1_3xxx_omapdev = {
+ .name = "gpio1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* aka the "omap wdtimer" on 2430 or the "mpu wdtimer" on 3430 */
+static struct omapdev wdtimer2_3xxx_omapdev = {
+ .name = "wdtimer2_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .pdev_name = "omap_wdt",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* Secure-mode devices */
+
+/* aka the "secure wdtimer" */
+static struct omapdev wdtimer1_3xxx_omapdev = {
+ .name = "wdtimer1_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev rng_3xxx_omapdev = {
+ .name = "rng_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+ .pdev_name = "omap_rng",
+ .pdev_id = -1,
+};
+
+static struct omapdev sha1md5_3xxx_omapdev = {
+ .name = "sha1md5_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+ .pdev_name = "OMAP SHA1/MD5",
+ .pdev_id = -1,
+};
+
+static struct omapdev des_3xxx_omapdev = {
+ .name = "des_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev aes_3xxx_omapdev = {
+ .name = "aes_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev pka_3xxx_omapdev = {
+ .name = "pka_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* NEON */
+
+static struct omapdev neon_3xxx_omapdev = {
+ .name = "neon_omapdev",
+ .pwrdm = { .name = "neon_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* IVA2 */
+
+/* XXX include IVA2 async bridges ? */
+
+/* SGX/GFX */
+
+static struct omapdev sgx_3xxx_omapdev = {
+ .name = "sgx_omapdev",
+ .pwrdm = { .name = "sgx_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
+};
+
+/* CORE */
+
+static struct omapdev l4_per_3xxx_omapdev = {
+ .name = "l4_per_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev l4_emu_3xxx_omapdev = {
+ .name = "l4_emu_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* XXX ICR is present on 2430 & 3430, but is in WKUP on 2430 */
+static struct omapdev icr_3xxx_omapdev = {
+ .name = "icr_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* IVA2 interrupt controller - XXX 2430 also ? */
+static struct omapdev wugen_3xxx_omapdev = {
+ .name = "wugen_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* XXX temperature sensor (what is the second one for ?) */
+
+/* XXX CWT is on 2430 at least, what about 2420? */
+
+static struct omapdev mad2d_3xxx_omapdev = {
+ .name = "mad2d_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* CONTROL/SCM moved into CORE pwrdm on 3430 */
+static struct omapdev control_3xxx_omapdev = {
+ .name = "control_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev i2c3_3xxx_omapdev = {
+ .name = "i2c3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "i2c_omap",
+ .pdev_id = 3,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev hsmmc3_3xxx_omapdev = {
+ .name = "hsmmc3_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "mmci-omap",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
+};
+
+static struct omapdev mcspi4_3xxx_omapdev = {
+ .name = "mcspi4_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .pdev_name = "omap2_mcspi",
+ .pdev_id = 4,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sr1_3xxx_omapdev = {
+ .name = "sr1_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sr2_3xxx_omapdev = {
+ .name = "sr2_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev usbhost_es1_3xxx_omapdev = {
+ .name = "usbhost_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
+};
+
+static struct omapdev usbotg_es1_3xxx_omapdev = {
+ .name = "usbotg_omapdev",
+ .pwrdm = { .name = "core_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
+};
+
+/* L4-PER */
+
+static struct omapdev uart3_3xxx_omapdev = {
+ .name = "uart3_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .pdev_name = "serial8250",
+ .pdev_id = PLAT8250_DEV_PLATFORM,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcbsp2_3xxx_omapdev = {
+ .name = "mcbsp2_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 2,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcbsp3_3xxx_omapdev = {
+ .name = "mcbsp3_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 3,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcbsp4_3xxx_omapdev = {
+ .name = "mcbsp4_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .pdev_name = "omap-mcbsp",
+ .pdev_id = 3,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcbsp2_sidetone_3xxx_omapdev = {
+ .name = "mcbsp2_sidetone_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev mcbsp3_sidetone_3xxx_omapdev = {
+ .name = "mcbsp3_sidetone_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* On 2420 also, but in CORE pwrdm */
+/* aka the "iva2" wdtimer */
+static struct omapdev wdtimer3_3xxx_omapdev = {
+ .name = "wdtimer3_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer2_3xxx_omapdev = {
+ .name = "gptimer2_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer3_3xxx_omapdev = {
+ .name = "gptimer3_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer4_3xxx_omapdev = {
+ .name = "gptimer4_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer5_3xxx_omapdev = {
+ .name = "gptimer5_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer6_3xxx_omapdev = {
+ .name = "gptimer6_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer7_3xxx_omapdev = {
+ .name = "gptimer7_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer8_3xxx_omapdev = {
+ .name = "gptimer8_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gptimer9_3xxx_omapdev = {
+ .name = "gptimer9_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gpio2_3xxx_omapdev = {
+ .name = "gpio2_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gpio3_3xxx_omapdev = {
+ .name = "gpio3_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gpio4_3xxx_omapdev = {
+ .name = "gpio4_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gpio5_3xxx_omapdev = {
+ .name = "gpio5_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev gpio6_3xxx_omapdev = {
+ .name = "gpio6_omapdev",
+ .pwrdm = { .name = "per_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* L4-WAKEUP */
+
+static struct omapdev tap_3xxx_omapdev = {
+ .name = "tap_omapdev",
+ .pwrdm = { .name = "wkup_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+
+/* L4-EMU */
+
+static struct omapdev mpuemu_3xxx_omapdev = {
+ .name = "mpuemu_omapdev",
+ .pwrdm = { .name = "emu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev tpiu_3xxx_omapdev = {
+ .name = "tpiu_omapdev",
+ .pwrdm = { .name = "emu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev etb_3xxx_omapdev = {
+ .name = "etb_omapdev",
+ .pwrdm = { .name = "emu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev dapctl_3xxx_omapdev = {
+ .name = "dapctl_omapdev",
+ .pwrdm = { .name = "emu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sdti_3xxx_omapdev = {
+ .name = "sdti_omapdev",
+ .pwrdm = { .name = "emu_pwrdm" },
+ .pdev_name = "sti",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev dap_3xxx_omapdev = {
+ .name = "dap_omapdev",
+ .pwrdm = { .name = "emu_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* USBHOST */
+
+static struct omapdev usbhost_3xxx_omapdev = {
+ .name = "usbhost_omapdev",
+ .pwrdm = { .name = "usbhost_pwrdm" },
+ .pdev_name = "ehci-omap",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
+};
+
+static struct omapdev usbotg_3xxx_omapdev = {
+ .name = "usbotg_omapdev",
+ .pwrdm = { .name = "usbhost_pwrdm" },
+ .pdev_name = "musb_hdrc",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
+};
+
+static struct omapdev usbtll_3xxx_omapdev = {
+ .name = "usbtll_omapdev",
+ .pwrdm = { .name = "usbhost_pwrdm" },
+ .pdev_name = "ehci-omap",
+ .pdev_id = 0,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* DSS */
+
+static struct omapdev dsi_3xxx_omapdev = {
+ .name = "dsi_omapdev",
+ .pwrdm = { .name = "dss_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev dsi_phy_3xxx_omapdev = {
+ .name = "dsi_phy_omapdev",
+ .pwrdm = { .name = "dss_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev dsi_pll_3xxx_omapdev = {
+ .name = "dsi_pll_omapdev",
+ .pwrdm = { .name = "dss_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev dss_3xxx_omapdev = {
+ .name = "dss_omapdev",
+ .pwrdm = { .name = "dss_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev dispc_3xxx_omapdev = {
+ .name = "dispc_omapdev",
+ .pwrdm = { .name = "dss_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev rfbi_3xxx_omapdev = {
+ .name = "rfbi_omapdev",
+ .pwrdm = { .name = "dss_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev venc_3xxx_omapdev = {
+ .name = "venc_omapdev",
+ .pwrdm = { .name = "dss_pwrdm" },
+ .pdev_name = "omapfb",
+ .pdev_id = -1,
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+
+/* CAM */
+
+
+static struct omapdev isp_3xxx_omapdev = {
+ .name = "isp_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev isp_cbuff_3xxx_omapdev = {
+ .name = "isp_cbuff_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev ccp2_3xxx_omapdev = {
+ .name = "ccp2_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev ccdc_3xxx_omapdev = {
+ .name = "ccdc_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev hist_3xxx_omapdev = {
+ .name = "hist_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev h3a_3xxx_omapdev = {
+ .name = "h3a_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev prv_3xxx_omapdev = {
+ .name = "prv_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev rsz_3xxx_omapdev = {
+ .name = "rsz_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev sbl_3xxx_omapdev = {
+ .name = "sbl_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct omapdev csi2_3xxx_omapdev = {
+ .name = "csi2_omapdev",
+ .pwrdm = { .name = "cam_pwrdm" },
+ .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+#endif /* CONFIG_ARCH_OMAP3 */
+
+#endif
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 5/5] OMAP2/3 omapdev: add code to walk the omapdev records
2008-10-18 21:59 [PATCH 0/5] PM: add omapdev code Paul Walmsley
` (3 preceding siblings ...)
2008-10-18 21:59 ` [PATCH 4/5] OMAP3xxx omapdev: add OMAP3xxx " Paul Walmsley
@ 2008-10-18 21:59 ` Paul Walmsley
4 siblings, 0 replies; 10+ messages in thread
From: Paul Walmsley @ 2008-10-18 21:59 UTC (permalink / raw)
To: linux-omap; +Cc: Paul Walmsley
Register the omapdevs early in the boot process. Also provide
functions for other code (primarily the OMAP PM layer at the moment)
to look up an omapdev given a platform_device name and id.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/Makefile | 2
arch/arm/mach-omap2/io.c | 3
arch/arm/mach-omap2/omapdev.c | 177 +++++++++++++++++++++++++++++
arch/arm/plat-omap/include/mach/omapdev.h | 7 +
4 files changed, 188 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/mach-omap2/omapdev.c
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 33de217..25a4791 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -5,7 +5,7 @@
# Common support
obj-y := irq.o id.o io.o sdrc.o control.o prcm.o clock.o mux.o \
devices.o serial.o gpmc.o timer-gp.o powerdomain.o \
- clockdomain.o
+ clockdomain.o omapdev.o
obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 05d4f2d..1829c1b 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -29,6 +29,8 @@
#include <mach/sdrc.h>
#include <mach/gpmc.h>
+#include "omapdev-common.h"
+
#include "clock.h"
#include <mach/powerdomain.h>
@@ -202,6 +204,7 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sp)
omap_pm_if_early_init();
pwrdm_init(powerdomains_omap);
clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
+ omapdev_init(omapdevs);
omap2_clk_init();
omap_pm_if_init(NULL, NULL);
omap2_sdrc_init(sp);
diff --git a/arch/arm/mach-omap2/omapdev.c b/arch/arm/mach-omap2/omapdev.c
new file mode 100644
index 0000000..1488681
--- /dev/null
+++ b/arch/arm/mach-omap2/omapdev.c
@@ -0,0 +1,177 @@
+/*
+ * omapdev device registration and handling code
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 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.
+ *
+ */
+#undef DEBUG
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+
+#include <mach/cpu.h>
+#include <mach/powerdomain.h>
+#include <mach/omapdev.h>
+
+/* odev_list contains all registered struct omapdevs */
+static LIST_HEAD(odev_list);
+
+
+/* Private functions */
+
+/*
+ * _omapdev_lookup - look up an OMAP module pointer by its name
+ * @name: name of the OMAP module to look up
+ *
+ * Finds a registered OMAP module by its name, returning a pointer to
+ * it. Returns a pointer to the struct omapdev if found, or NULL
+ * otherwise.
+ */
+static struct omapdev *_omapdev_lookup(const char *name)
+{
+ struct omapdev *odev, *temp_odev;
+
+ if (!name)
+ return NULL;
+
+ odev = NULL;
+
+ list_for_each_entry(temp_odev, &odev_list, node) {
+ if (!strcmp(name, temp_odev->name)) {
+ odev = temp_odev;
+ break;
+ }
+ }
+
+ return odev;
+}
+
+/*
+ * _omapdev_register - register an OMAP module
+ * @odev: struct omapdev * to register
+ *
+ * Adds a OMAP module to the internal OMAP module list. Returns
+ * -EINVAL if given a null pointer, -EEXIST if a OMAP module is
+ * already registered by the provided name, or 0 upon success.
+ */
+static int _omapdev_register(struct omapdev *odev)
+{
+ struct powerdomain *pwrdm;
+
+ if (!odev)
+ return -EINVAL;
+
+ if (!omap_chip_is(odev->omap_chip))
+ return -EINVAL;
+
+ if (_omapdev_lookup(odev->name))
+ return -EEXIST;
+
+ pwrdm = pwrdm_lookup(odev->pwrdm.name);
+ if (!pwrdm) {
+ pr_debug("omapdev: cannot register %s: bad powerdomain\n",
+ odev->name);
+ return -EINVAL;
+ }
+ odev->pwrdm.ptr = pwrdm;
+
+ list_add(&odev->node, &odev_list);
+
+ pr_debug("omapdev: registered %s\n", odev->name);
+
+ return 0;
+}
+
+
+
+/* Public functions */
+
+
+/**
+ * omapdev_init - set up the OMAP module layer
+ * @odevs: ptr to a array of omapdev ptrs to register
+ *
+ * Loop through the list of OMAP modules, registering them all. No
+ * return value.
+ */
+void omapdev_init(struct omapdev **odevs)
+{
+ struct omapdev **d = NULL;
+
+ if (!list_empty(&odev_list)) {
+ pr_debug("omapdev: init already called\n");
+ return;
+ }
+
+ for (d = odevs; *d; d++) {
+ int v;
+
+ if (!omap_chip_is((*d)->omap_chip))
+ continue;
+
+ v = _omapdev_register(*d);
+ if (ERR_PTR(v))
+ pr_err("omapdev: could not register %s\n",
+ (*d)->name);
+ }
+}
+
+
+/**
+ * omapdev_get_pwrdm - return pwrdm pointer associated with the device
+ * @omapdev: omapdev *
+ *
+ */
+struct powerdomain *omapdev_get_pwrdm(struct omapdev *odev)
+{
+ if (!odev)
+ return NULL;
+
+ return odev->pwrdm.ptr;
+}
+
+
+/**
+ * omapdev_find_pdev - look up an OMAP module by platform_device
+ * @pdev_name: platform_device name to find
+ * @pdev_id: platform_device id to find
+ *
+ * Finds a registered OMAP module by the platform_device name and ID
+ * that is associated with it in the omapdev structure. If multiple
+ * records exist, simply returns the 'first' record that it finds -
+ * this is probably not optimal behavior, but should work for current
+ * purposes. Returns a pointer to the struct omapdev if found, or
+ * NULL otherwise.
+ */
+struct omapdev *omapdev_find_pdev(struct platform_device *pdev)
+{
+ struct omapdev *odev, *temp_odev;
+
+ if (!pdev)
+ return NULL;
+
+ odev = NULL;
+
+ list_for_each_entry(temp_odev, &odev_list, node) {
+ if (temp_odev->pdev_name &&
+ !strcmp(pdev->name, temp_odev->pdev_name) &&
+ pdev->id == temp_odev->pdev_id) {
+ odev = temp_odev;
+ break;
+ }
+ }
+
+ return odev;
+}
+
diff --git a/arch/arm/plat-omap/include/mach/omapdev.h b/arch/arm/plat-omap/include/mach/omapdev.h
index ef91f00..4b379bc 100644
--- a/arch/arm/plat-omap/include/mach/omapdev.h
+++ b/arch/arm/plat-omap/include/mach/omapdev.h
@@ -15,6 +15,7 @@
#include <linux/types.h>
#include <linux/list.h>
+#include <linux/platform_device.h>
#include <mach/cpu.h>
#include <mach/powerdomain.h>
@@ -47,5 +48,11 @@ struct omapdev {
};
+void omapdev_init(struct omapdev **odev_list);
+
+struct powerdomain *omapdev_get_pwrdm(struct omapdev *odev);
+
+struct omapdev *omapdev_find_pdev(struct platform_device *pdev);
+
#endif
^ permalink raw reply related [flat|nested] 10+ messages in thread