aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSundar Raman2013-07-18 17:37:40 -0500
committerSundar Raman2013-07-25 09:22:00 -0500
commit7bd9e88c2642b5aff268046eafc12b2c6f4e20d9 (patch)
tree39f4c0d1fca94e793ead7b71a35bb46e9a4e5810
parentd2ab39a009e3b62db5cf4ae06da110c312ee0e43 (diff)
downloadkernel-video-7bd9e88c2642b5aff268046eafc12b2c6f4e20d9.tar.gz
kernel-video-7bd9e88c2642b5aff268046eafc12b2c6f4e20d9.tar.xz
kernel-video-7bd9e88c2642b5aff268046eafc12b2c6f4e20d9.zip
devices: Initialize GC320 as part of devices init
With K3.8, devices.c is used to initialize platform devices. Added GC320 initialization here so that it is done as part of bootup. Change-Id: I45d3e3b18fb4b419f7a5aabfa7cea54460ffe46a Signed-off-by: Sundar Raman <a0393242@ti.com>
-rw-r--r--arch/arm/mach-omap2/devices.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 2d4f9c02dcc..a8f1557a225 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -22,6 +22,8 @@
22#include <linux/platform_data/omap_ocp2scp.h> 22#include <linux/platform_data/omap_ocp2scp.h>
23#include <linux/usb/omap_control_usb.h> 23#include <linux/usb/omap_control_usb.h>
24#include <linux/platform_data/mailbox-omap.h> 24#include <linux/platform_data/mailbox-omap.h>
25#include <linux/platform_data/omap_gcx.h>
26#include "omap-pm.h"
25 27
26#include <asm/mach-types.h> 28#include <asm/mach-types.h>
27#include <asm/mach/map.h> 29#include <asm/mach/map.h>
@@ -447,6 +449,70 @@ static void __init omap_init_dmic(void)
447static inline void omap_init_dmic(void) {} 449static inline void omap_init_dmic(void) {}
448#endif 450#endif
449 451
452static int gcxxx_scale_dev(struct device *dev, unsigned long val);
453static int gcxxx_set_l3_bw(struct device *dev, unsigned long val);
454
455static struct omap_gcx_platform_data omap_gcxxx = {
456 .get_context_loss_count = omap_pm_get_dev_context_loss_count,
457 .scale_dev = gcxxx_scale_dev,
458 .set_bw = gcxxx_set_l3_bw,
459};
460
461struct omap_device_pm_latency omap_gcxxx_latency[] = {
462 {
463 .deactivate_func = omap_device_idle_hwmods,
464 .activate_func = omap_device_enable_hwmods,
465 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
466 }
467};
468
469static int gcxxx_scale_dev(struct device *dev, unsigned long val)
470{
471 /*omap_device_scale(dev, val) is not supported, returning with no-op
472 * for now. */
473 return 0;
474}
475
476static int gcxxx_set_l3_bw(struct device *dev, unsigned long val)
477{
478 return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, val);
479}
480
481int __init gcxxx_init(void)
482{
483 int retval = 0;
484 struct omap_hwmod *oh;
485 struct platform_device *pdev;
486 /*struct omap_device *od;
487 struct device *dev;*/
488 const char *oh_name = "bb2d";
489 const char *dev_name = "gccore";
490
491 /*
492 * Hwmod lookup will fail in case our platform doesn't support the
493 * hardware spinlock module, so it is safe to run this initcall
494 * on all omaps
495 */
496 oh = omap_hwmod_lookup(oh_name);
497 if (oh == NULL)
498 return -EINVAL;
499
500 omap_gcxxx.regbase = omap_hwmod_get_mpu_rt_va(oh);
501 omap_gcxxx.is_hw_present = (soc_is_omap543x()
502 || soc_is_dra7xx()) ? true : false;
503 pdev = omap_device_build(dev_name, 0, oh, &omap_gcxxx,
504 sizeof(omap_gcxxx), omap_gcxxx_latency,
505 ARRAY_SIZE(omap_gcxxx_latency), false);
506 if (IS_ERR(pdev)) {
507 pr_err("Can't build omap_device for %s:%s\n", dev_name,
508 oh_name);
509 retval = PTR_ERR(pdev);
510 }
511
512 return retval;
513}
514
515
450#if defined(CONFIG_SND_OMAP_SOC_ABE) || \ 516#if defined(CONFIG_SND_OMAP_SOC_ABE) || \
451 defined(CONFIG_SND_OMAP_SOC_ABE_MODULE) 517 defined(CONFIG_SND_OMAP_SOC_ABE_MODULE)
452 518
@@ -683,6 +749,7 @@ static int __init omap2_init_devices(void)
683 omap_init_audio(); 749 omap_init_audio();
684 omap_init_camera(); 750 omap_init_camera();
685 omap_init_mbox(); 751 omap_init_mbox();
752 gcxxx_init();
686 /* If dtb is there, the devices will be created dynamically */ 753 /* If dtb is there, the devices will be created dynamically */
687 if (!of_have_populated_dt()) { 754 if (!of_have_populated_dt()) {
688 omap_init_control_usb(); 755 omap_init_control_usb();