]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
arch: arm64: mach-tegra: Add carveout for ADSP OS
authorAjay Nandakumar <anandakumarm@nvidia.com>
Tue, 18 Mar 2014 06:06:54 +0000 (11:36 +0530)
committerBo Yan <byan@nvidia.com>
Tue, 22 Apr 2014 21:25:44 +0000 (14:25 -0700)
The ADSP OS requires carveouts where SMMU is not avialable or
is not being used by ADSP OS.

Bug 1351881

Change-Id: I46bfa682fd727059f3874e9deca75ffd607c0ae0
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/375878
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bo Yan <byan@nvidia.com>
Tested-by: Bo Yan <byan@nvidia.com>
arch/arm/mach-tegra/board.h
arch/arm/mach-tegra/common.c
arch/arm64/mach-tegra/board-dt-t210.c
include/linux/tegra_nvadsp.h

index 18b5e5ff4f709059aca051db77849d26d8d43531..84794570367d63ae6b739545642597a37ea43d15 100644 (file)
@@ -103,6 +103,7 @@ void __init tegra12x_init_early(void);
 void __init tegra14x_init_early(void);
 void __init tegra21x_init_early(void);
 void __init tegra_map_common_io(void);
+phys_addr_t __init tegra_reserve_adsp(unsigned long size);
 void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
        unsigned long fb2_size);
 void __init tegra_reserve4(ulong carveout_size, ulong fb_size,
index c969e38d8475cec944c9e005c7782dbe7437767b..e5247a5af5fe2144855fc15627f78f2d6be4acba 100644 (file)
@@ -1857,6 +1857,18 @@ static void __init tegra_reserve_bpmp(void)
 static inline void __init tegra_reserve_bpmp(void) {}
 #endif
 
+phys_addr_t __init tegra_reserve_adsp(unsigned long size)
+{
+       phys_addr_t reserve = memblock_end_of_4G() - size;
+       if (memblock_remove(reserve, size)) {
+               pr_err("%s failed for %llx:%lx\n",
+                               __func__, (u64)reserve, size);
+       }
+       pr_info("%s: reserved %llx:%lx\n",
+                               __func__, (u64)reserve, size);
+       return reserve;
+}
+
 void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
        unsigned long fb2_size)
 {
index 667d2ed38c32af3d613b744eeb9d4fc721f70be3..6fdc33ad31b7b5c622a0f55631907da019ee6fe6 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/tegra_nvadsp.h>
 
 
 #include <asm/mach/arch.h>
@@ -66,8 +67,17 @@ static struct platform_device *t210_gfx_devices[] __initdata = {
        &t210_nvmap_device,
 };
 
+#if defined(CONFIG_TEGRA_NVADSP)
+static struct nvadsp_platform_data nvadsp_plat_data;
+#endif
+
 static void __init tegra_t210_reserve(void)
 {
+#if defined(CONFIG_TEGRA_NVADSP)
+       nvadsp_plat_data.co_pa = tegra_reserve_adsp(SZ_128M);
+       nvadsp_plat_data.co_size = SZ_32M;
+#endif
+
 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
        tegra_reserve(0, SZ_16M + SZ_2M, SZ_4M);
 #else
@@ -132,6 +142,10 @@ struct of_dev_auxdata t210_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
                                NULL),
+#ifdef CONFIG_TEGRA_NVADSP
+       OF_DEV_AUXDATA("nvidia,tegra210-adsp", TEGRA_APE_AMC_BASE,
+                               "tegra210-adsp", &nvadsp_plat_data),
+#endif
        {}
 };
 
index 585c05b3fb9327952541fce824dd004f77b6b0ee..f0300afdd816aa65b57de55f0a2d3f57a0c20897 100644 (file)
 #include <linux/completion.h>
 #include <linux/dma-mapping.h>
 
+struct nvadsp_platform_data {
+       phys_addr_t co_pa;
+       unsigned long co_size;
+};
+
 typedef int status_t;
 
 /*