Lines Matching refs:emif_data

40 static u32 sram_suspend_address(struct ti_emif_data *emif_data,  in sram_suspend_address()  argument
43 return (emif_data->ti_emif_sram_virt + in sram_suspend_address()
47 static phys_addr_t sram_resume_address(struct ti_emif_data *emif_data, in sram_resume_address() argument
50 return ((unsigned long)emif_data->ti_emif_sram_phys + in sram_resume_address()
54 static void ti_emif_free_sram(struct ti_emif_data *emif_data) in ti_emif_free_sram() argument
56 gen_pool_free(emif_data->sram_pool_code, emif_data->ti_emif_sram_virt, in ti_emif_free_sram()
58 gen_pool_free(emif_data->sram_pool_data, in ti_emif_free_sram()
59 emif_data->ti_emif_sram_data_virt, in ti_emif_free_sram()
64 struct ti_emif_data *emif_data) in ti_emif_alloc_sram() argument
69 emif_data->sram_pool_code = of_gen_pool_get(np, "sram", 0); in ti_emif_alloc_sram()
70 if (!emif_data->sram_pool_code) { in ti_emif_alloc_sram()
75 emif_data->ti_emif_sram_virt = in ti_emif_alloc_sram()
76 gen_pool_alloc(emif_data->sram_pool_code, in ti_emif_alloc_sram()
78 if (!emif_data->ti_emif_sram_virt) { in ti_emif_alloc_sram()
84 emif_data->ti_emif_sram_phys = in ti_emif_alloc_sram()
85 gen_pool_virt_to_phys(emif_data->sram_pool_code, in ti_emif_alloc_sram()
86 emif_data->ti_emif_sram_virt); in ti_emif_alloc_sram()
89 emif_data->sram_pool_data = of_gen_pool_get(np, "sram", 1); in ti_emif_alloc_sram()
90 if (!emif_data->sram_pool_data) { in ti_emif_alloc_sram()
96 emif_data->ti_emif_sram_data_virt = in ti_emif_alloc_sram()
97 gen_pool_alloc(emif_data->sram_pool_data, in ti_emif_alloc_sram()
99 if (!emif_data->ti_emif_sram_data_virt) { in ti_emif_alloc_sram()
106 emif_data->ti_emif_sram_data_phys = in ti_emif_alloc_sram()
107 gen_pool_virt_to_phys(emif_data->sram_pool_data, in ti_emif_alloc_sram()
108 emif_data->ti_emif_sram_data_virt); in ti_emif_alloc_sram()
113 emif_data->pm_functions.save_context = in ti_emif_alloc_sram()
114 sram_suspend_address(emif_data, in ti_emif_alloc_sram()
116 emif_data->pm_functions.enter_sr = in ti_emif_alloc_sram()
117 sram_suspend_address(emif_data, in ti_emif_alloc_sram()
119 emif_data->pm_functions.abort_sr = in ti_emif_alloc_sram()
120 sram_suspend_address(emif_data, in ti_emif_alloc_sram()
127 emif_data->pm_functions.restore_context = in ti_emif_alloc_sram()
128 sram_resume_address(emif_data, in ti_emif_alloc_sram()
130 emif_data->pm_functions.exit_sr = in ti_emif_alloc_sram()
131 sram_resume_address(emif_data, in ti_emif_alloc_sram()
133 emif_data->pm_functions.run_hw_leveling = in ti_emif_alloc_sram()
134 sram_resume_address(emif_data, in ti_emif_alloc_sram()
137 emif_data->pm_data.regs_virt = in ti_emif_alloc_sram()
138 (struct emif_regs_amx3 *)emif_data->ti_emif_sram_data_virt; in ti_emif_alloc_sram()
139 emif_data->pm_data.regs_phys = emif_data->ti_emif_sram_data_phys; in ti_emif_alloc_sram()
144 gen_pool_free(emif_data->sram_pool_code, emif_data->ti_emif_sram_virt, in ti_emif_alloc_sram()
149 static int ti_emif_push_sram(struct device *dev, struct ti_emif_data *emif_data) in ti_emif_push_sram() argument
154 copy_addr = sram_exec_copy(emif_data->sram_pool_code, in ti_emif_push_sram()
155 (void *)emif_data->ti_emif_sram_virt, in ti_emif_push_sram()
162 data_addr = sram_suspend_address(emif_data, in ti_emif_push_sram()
164 copy_addr = sram_exec_copy(emif_data->sram_pool_code, in ti_emif_push_sram()
166 &emif_data->pm_data, in ti_emif_push_sram()
167 sizeof(emif_data->pm_data)); in ti_emif_push_sram()
183 static void ti_emif_configure_sr_delay(struct ti_emif_data *emif_data) in ti_emif_configure_sr_delay() argument
186 (emif_data->pm_data.ti_emif_base_addr_virt + in ti_emif_configure_sr_delay()
190 (emif_data->pm_data.ti_emif_base_addr_virt + in ti_emif_configure_sr_delay()
280 struct ti_emif_data *emif_data; in ti_emif_probe() local
282 emif_data = devm_kzalloc(dev, sizeof(*emif_data), GFP_KERNEL); in ti_emif_probe()
283 if (!emif_data) in ti_emif_probe()
286 emif_data->pm_data.ti_emif_sram_config = (unsigned long) device_get_match_data(&pdev->dev); in ti_emif_probe()
288 emif_data->pm_data.ti_emif_base_addr_virt = devm_platform_get_and_ioremap_resource(pdev, in ti_emif_probe()
291 if (IS_ERR(emif_data->pm_data.ti_emif_base_addr_virt)) { in ti_emif_probe()
292 ret = PTR_ERR(emif_data->pm_data.ti_emif_base_addr_virt); in ti_emif_probe()
296 emif_data->pm_data.ti_emif_base_addr_phys = res->start; in ti_emif_probe()
298 ti_emif_configure_sr_delay(emif_data); in ti_emif_probe()
300 ret = ti_emif_alloc_sram(dev, emif_data); in ti_emif_probe()
304 ret = ti_emif_push_sram(dev, emif_data); in ti_emif_probe()
308 emif_instance = emif_data; in ti_emif_probe()
313 ti_emif_free_sram(emif_data); in ti_emif_probe()
320 struct ti_emif_data *emif_data = emif_instance; in ti_emif_remove() local
324 ti_emif_free_sram(emif_data); in ti_emif_remove()