diff options
author | Gary King <GKing@nvidia.com> | 2010-02-02 20:23:07 -0800 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-03-04 13:21:45 -0800 |
commit | 7f1eb91b3d4eca6845a290f71199424de1f51ee6 (patch) | |
tree | 608214a90863208ac78d88e990cdac174ad973b5 /arch/arm | |
parent | 7756fa0cf1e033605b23c8cc8501a227634c6eaf (diff) |
tegra init: register iovmm device
register the GART (for harmony & whistler) with IOVMM, to instantiate
the IOVMM device node.
Change-Id: I0d8eba7fd056e2c2db979abbc3ddd0bb650d4312
Reviewed-on: http://git-master/r/446
Reviewed-by: Gary King <gking@nvidia.com>
Tested-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'arch/arm')
-rwxr-xr-x | arch/arm/mach-tegra/init_common.c | 39 | ||||
-rwxr-xr-x | arch/arm/mach-tegra/tegra_sysmap.c | 4 |
2 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/init_common.c b/arch/arm/mach-tegra/init_common.c index 0e1273c1e2fb..50c4dcfdf764 100755 --- a/arch/arm/mach-tegra/init_common.c +++ b/arch/arm/mach-tegra/init_common.c @@ -26,6 +26,7 @@ #include <linux/fsl_devices.h> #include <linux/dma-mapping.h> #include <linux/tegra_devices.h> +#include <mach/iovmm.h> #include "nvcommon.h" #include "nvrm_init.h" #include "nvrm_drf.h" @@ -650,6 +651,43 @@ fail: } #endif +#if !defined(CONFIG_TEGRA_IOVMM) +#define tegra_register_iovmm() do {} while (0) +#elif defined(CONFIG_TEGRA_IOVMM_GART) + +static struct resource tegra_gart_resources[] = { + { + .name = "mc", + .flags = IORESOURCE_MEM + }, + { + .name = "gart", + .flags = IORESOURCE_MEM + } +}; + +static struct platform_device tegra_gart_dev = { + .name = "tegra_gart", + .id = -1, + .num_resources = ARRAY_SIZE(tegra_gart_resources), + .resource = tegra_gart_resources +}; + +static void __init tegra_register_iovmm(void) +{ + unsigned int i; + struct resource *res = tegra_gart_resources; + + for (i=0; i<ARRAY_SIZE(tegra_gart_resources); i++, res++) { + res->start = tegra_get_module_inst_base(res->name, 0); + res->end = res->start + tegra_get_module_inst_size(res->name, 0) - 1; + } + + if (platform_device_register(&tegra_gart_dev)) + pr_err("unable to add %s device\n", tegra_gart_dev.name); +} +#endif + #if !defined(CONFIG_USB_TEGRA_OTG) #define tegra_register_usb_otg() do {} while (0) #else @@ -925,6 +963,7 @@ void __init tegra_common_init(void) NV_ASSERT_SUCCESS(NvRmGpioOpen(s_hRmGlobal, &s_hGpioGlobal)); tegra_init_cpu(); + tegra_register_iovmm(); tegra_dma_init(); tegra_register_i2c(); tegra_register_spi(); diff --git a/arch/arm/mach-tegra/tegra_sysmap.c b/arch/arm/mach-tegra/tegra_sysmap.c index 55154b546b12..9e7d26e98a00 100755 --- a/arch/arm/mach-tegra/tegra_sysmap.c +++ b/arch/arm/mach-tegra/tegra_sysmap.c @@ -38,6 +38,10 @@ static NvRmModuleID tegra_map_name_to_mod(const char *name, int inst) return NVRM_MODULE_ID(NvRmPrivModuleID_Pcie, inst); else if (!strcmp(name, "usbotg")) return NVRM_MODULE_ID(NvRmModuleID_Usb2Otg, inst); + else if (!strcmp(name, "mc")) + return NVRM_MODULE_ID(NvRmPrivModuleID_MemoryController, inst); + else if (!strcmp(name, "gart")) + return NVRM_MODULE_ID(NvRmPrivModuleID_Gart, inst); return (NvRmModuleID) 0; } |