]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
Merge branch 'mailbox-linux-3.8.y' into ti-linux-3.8.y
authorDan Murphy <dmurphy@ti.com>
Thu, 14 Mar 2013 12:24:00 +0000 (07:24 -0500)
committerDan Murphy <dmurphy@ti.com>
Thu, 14 Mar 2013 12:24:00 +0000 (07:24 -0500)
TI-Feature: mailbox_ipc_base
TI-Tree: git://gitorious.ti.com/rpmsg/mailbox
TI-Branch: mailbox-linux-3.8.y

* mailbox-linux-3.8.y:
  mailbox: omap2+: fix kernel memory corruption in driver remove
  mailbox: mark mailbox structure name fields as const
  mailbox: convert intermediate spaces to tabs

Signed-off-by: Dan Murphy <dmurphy@ti.com>
1  2 
arch/arm/mach-omap2/devices.c

index 37209ae01148105e34e912b77882dea41ee70bc9,127ea595f6be24729fe0ab612d39149610914f85..2d4f9c02dccf29cae8b5e322f046fed2ca252cb4
@@@ -20,7 -20,6 +20,7 @@@
  #include <linux/pinctrl/machine.h>
  #include <linux/platform_data/omap4-keypad.h>
  #include <linux/platform_data/omap_ocp2scp.h>
 +#include <linux/usb/omap_control_usb.h>
  #include <linux/platform_data/mailbox-omap.h>
  
  #include <asm/mach-types.h>
@@@ -256,49 -255,6 +256,49 @@@ static inline void omap_init_camera(voi
  #endif
  }
  
 +#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
 +static struct omap_control_usb_platform_data omap4_control_usb_pdata = {
 +      .type = 1,
 +};
 +
 +struct resource omap4_control_usb_res[] = {
 +      {
 +              .name   = "control_dev_conf",
 +              .start  = 0x4a002300,
 +              .end    = 0x4a002303,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      {
 +              .name   = "otghs_control",
 +              .start  = 0x4a00233c,
 +              .end    = 0x4a00233f,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device omap4_control_usb = {
 +      .name = "omap-control-usb",
 +      .id = -1,
 +      .dev = {
 +              .platform_data = &omap4_control_usb_pdata,
 +      },
 +      .num_resources = 2,
 +      .resource = omap4_control_usb_res,
 +};
 +
 +static inline void __init omap_init_control_usb(void)
 +{
 +      if (!cpu_is_omap44xx())
 +              return;
 +
 +      if (platform_device_register(&omap4_control_usb))
 +              pr_err("Error registering omap_control_usb device\n");
 +}
 +
 +#else
 +static inline void omap_init_control_usb(void) { }
 +#endif /* CONFIG_OMAP_CONTROL_USB */
 +
  int __init omap4_keyboard_init(struct omap4_keypad_platform_data
                        *sdp4430_keypad_data, struct omap_board_data *bdata)
  {
@@@ -336,7 -292,6 +336,6 @@@ static inline void __init omap_init_mbo
        struct omap_hwmod *oh;
        struct platform_device *pdev;
        struct omap_mbox_pdata *pdata;
-       u32 pdata_len;
  
        oh = omap_hwmod_lookup("mailbox");
        if (!oh) {
        }
  
        pdata = (struct omap_mbox_pdata *)oh->dev_attr;
-       pdata_len = (pdata->info_cnt * (sizeof(struct omap_mbox_dev_info))) +
-                       (2 * sizeof(u32));
-       pdev = omap_device_build("omap-mailbox", -1, oh, pdata, pdata_len,
+       pdev = omap_device_build("omap-mailbox", -1, oh, pdata, sizeof(*pdata),
                                                                NULL, 0, 0);
        WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
                                                __func__, PTR_ERR(pdev));
@@@ -378,36 -331,6 +375,36 @@@ static void omap_init_audio(void
  static inline void omap_init_audio(void) {}
  #endif
  
 +#if defined(CONFIG_SND_OMAP_SOC_MCASP) || \
 +      defined(CONFIG_SND_OMAP_SOC_MCASP_MODULE)
 +static struct omap_device_pm_latency omap_mcasp_latency[] = {
 +      {
 +              .deactivate_func = omap_device_idle_hwmods,
 +              .activate_func = omap_device_enable_hwmods,
 +              .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
 +      },
 +};
 +
 +static void omap_init_mcasp(void)
 +{
 +      struct omap_hwmod *oh;
 +      struct platform_device *pdev;
 +
 +      oh = omap_hwmod_lookup("mcasp");
 +      if (!oh) {
 +              pr_err("could not look up mcasp hw_mod\n");
 +              return;
 +      }
 +
 +      pdev = omap_device_build("omap-mcasp", -1, oh, NULL, 0,
 +                              omap_mcasp_latency,
 +                              ARRAY_SIZE(omap_mcasp_latency), 0);
 +      WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcasp-audio.\n");
 +}
 +#else
 +static inline void omap_init_mcasp(void) {}
 +#endif
 +
  #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
                defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
  
@@@ -450,26 -373,34 +447,26 @@@ static void __init omap_init_dmic(void
  static inline void omap_init_dmic(void) {}
  #endif
  
 -#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
 -              defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
 +#if defined(CONFIG_SND_OMAP_SOC_ABE) || \
 +      defined(CONFIG_SND_OMAP_SOC_ABE_MODULE)
  
 -static struct platform_device omap_hdmi_audio = {
 -      .name   = "omap-hdmi-audio",
 -      .id     = -1,
 -};
 -
 -static void __init omap_init_hdmi_audio(void)
 +static void omap_init_aess(void)
  {
        struct omap_hwmod *oh;
        struct platform_device *pdev;
  
 -      oh = omap_hwmod_lookup("dss_hdmi");
 +      oh = omap_hwmod_lookup("aess");
        if (!oh) {
 -              printk(KERN_ERR "Could not look up dss_hdmi hw_mod\n");
 +              pr_err("Could not look up aess hw_mod\n");
                return;
        }
  
 -      pdev = omap_device_build("omap-hdmi-audio-dai",
 -              -1, oh, NULL, 0, NULL, 0, 0);
 +      pdev = omap_device_build("aess", -1, oh, NULL, 0, NULL, 0, 0);
        WARN(IS_ERR(pdev),
 -           "Can't build omap_device for omap-hdmi-audio-dai.\n");
 -
 -      platform_device_register(&omap_hdmi_audio);
 +           "Could not build omap_device for omap-aess-audio\n");
  }
  #else
 -static inline void omap_init_hdmi_audio(void) {}
 +static inline void omap_init_aess(void) {}
  #endif
  
  #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
@@@ -541,31 -472,140 +538,31 @@@ static void omap_init_rng(void
        WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
  }
  
 -#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)
 -
 -#ifdef CONFIG_ARCH_OMAP2
 -static struct resource omap2_sham_resources[] = {
 -      {
 -              .start  = OMAP24XX_SEC_SHA1MD5_BASE,
 -              .end    = OMAP24XX_SEC_SHA1MD5_BASE + 0x64,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      {
 -              .start  = 51 + OMAP_INTC_START,
 -              .flags  = IORESOURCE_IRQ,
 -      }
 -};
 -static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources);
 -#else
 -#define omap2_sham_resources          NULL
 -#define omap2_sham_resources_sz               0
 -#endif
 -
 -#ifdef CONFIG_ARCH_OMAP3
 -static struct resource omap3_sham_resources[] = {
 -      {
 -              .start  = OMAP34XX_SEC_SHA1MD5_BASE,
 -              .end    = OMAP34XX_SEC_SHA1MD5_BASE + 0x64,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      {
 -              .start  = 49 + OMAP_INTC_START,
 -              .flags  = IORESOURCE_IRQ,
 -      },
 -      {
 -              .start  = OMAP34XX_DMA_SHA1MD5_RX,
 -              .flags  = IORESOURCE_DMA,
 -      }
 -};
 -static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources);
 -#else
 -#define omap3_sham_resources          NULL
 -#define omap3_sham_resources_sz               0
 -#endif
 -
 -static struct platform_device sham_device = {
 -      .name           = "omap-sham",
 -      .id             = -1,
 -};
 -
 -static void omap_init_sham(void)
 +static void __init omap_init_sham(void)
  {
 -      if (cpu_is_omap24xx()) {
 -              sham_device.resource = omap2_sham_resources;
 -              sham_device.num_resources = omap2_sham_resources_sz;
 -      } else if (cpu_is_omap34xx()) {
 -              sham_device.resource = omap3_sham_resources;
 -              sham_device.num_resources = omap3_sham_resources_sz;
 -      } else {
 -              pr_err("%s: platform not supported\n", __func__);
 -              return;
 -      }
 -      platform_device_register(&sham_device);
 -}
 -#else
 -static inline void omap_init_sham(void) { }
 -#endif
 -
 -#if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE)
 -
 -#ifdef CONFIG_ARCH_OMAP2
 -static struct resource omap2_aes_resources[] = {
 -      {
 -              .start  = OMAP24XX_SEC_AES_BASE,
 -              .end    = OMAP24XX_SEC_AES_BASE + 0x4C,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      {
 -              .start  = OMAP24XX_DMA_AES_TX,
 -              .flags  = IORESOURCE_DMA,
 -      },
 -      {
 -              .start  = OMAP24XX_DMA_AES_RX,
 -              .flags  = IORESOURCE_DMA,
 -      }
 -};
 -static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources);
 -#else
 -#define omap2_aes_resources           NULL
 -#define omap2_aes_resources_sz                0
 -#endif
 +      struct omap_hwmod *oh;
 +      struct platform_device *pdev;
  
 -#ifdef CONFIG_ARCH_OMAP3
 -static struct resource omap3_aes_resources[] = {
 -      {
 -              .start  = OMAP34XX_SEC_AES_BASE,
 -              .end    = OMAP34XX_SEC_AES_BASE + 0x4C,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      {
 -              .start  = OMAP34XX_DMA_AES2_TX,
 -              .flags  = IORESOURCE_DMA,
 -      },
 -      {
 -              .start  = OMAP34XX_DMA_AES2_RX,
 -              .flags  = IORESOURCE_DMA,
 -      }
 -};
 -static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources);
 -#else
 -#define omap3_aes_resources           NULL
 -#define omap3_aes_resources_sz                0
 -#endif
 +      oh = omap_hwmod_lookup("sham");
 +      if (!oh)
 +              return;
  
 -static struct platform_device aes_device = {
 -      .name           = "omap-aes",
 -      .id             = -1,
 -};
 +      pdev = omap_device_build("omap-sham", -1, oh, NULL, 0, NULL, 0, 0);
 +      WARN(IS_ERR(pdev), "Can't build omap_device for omap-sham\n");
 +}
  
 -static void omap_init_aes(void)
 +static void __init omap_init_aes(void)
  {
 -      if (cpu_is_omap24xx()) {
 -              aes_device.resource = omap2_aes_resources;
 -              aes_device.num_resources = omap2_aes_resources_sz;
 -      } else if (cpu_is_omap34xx()) {
 -              aes_device.resource = omap3_aes_resources;
 -              aes_device.num_resources = omap3_aes_resources_sz;
 -      } else {
 -              pr_err("%s: platform not supported\n", __func__);
 +      struct omap_hwmod *oh;
 +      struct platform_device *pdev;
 +
 +      oh = omap_hwmod_lookup("aes");
 +      if (!oh)
                return;
 -      }
 -      platform_device_register(&aes_device);
 -}
  
 -#else
 -static inline void omap_init_aes(void) { }
 -#endif
 +      pdev = omap_device_build("omap-aes", -1, oh, NULL, 0, NULL, 0, 0);
 +      WARN(IS_ERR(pdev), "Can't build omap_device for omap-aes\n");
 +}
  
  /*-------------------------------------------------------------------------*/
  
@@@ -685,20 -725,18 +682,20 @@@ static int __init omap2_init_devices(vo
         */
        omap_init_audio();
        omap_init_camera();
 -      omap_init_hdmi_audio();
        omap_init_mbox();
        /* If dtb is there, the devices will be created dynamically */
        if (!of_have_populated_dt()) {
 +              omap_init_control_usb();
 +              omap_init_aess();
                omap_init_dmic();
                omap_init_mcpdm();
                omap_init_mcspi();
 +              omap_init_mcasp();
 +              omap_init_sham();
 +              omap_init_aes();
        }
        omap_init_sti();
        omap_init_rng();
 -      omap_init_sham();
 -      omap_init_aes();
        omap_init_vout();
        omap_init_ocp2scp();