• Home
  • Raw
  • Download

Lines Matching +full:sram +full:- +full:section

2  * TI AM33XX SRAM EMIF Driver
4 * Copyright (C) 2016-2017 Texas Instruments Inc.
25 #include <linux/sram.h>
26 #include <linux/ti-emif-sram.h>
30 #define TI_EMIF_SRAM_SYMBOL_OFFSET(sym) ((unsigned long)(sym) - \
51 return (emif_data->ti_emif_sram_virt + in sram_suspend_address()
58 return ((unsigned long)emif_data->ti_emif_sram_phys + in sram_resume_address()
64 gen_pool_free(emif_data->sram_pool_code, emif_data->ti_emif_sram_virt, in ti_emif_free_sram()
66 gen_pool_free(emif_data->sram_pool_data, in ti_emif_free_sram()
67 emif_data->ti_emif_sram_data_virt, in ti_emif_free_sram()
74 struct device_node *np = dev->of_node; in ti_emif_alloc_sram()
77 emif_data->sram_pool_code = of_gen_pool_get(np, "sram", 0); in ti_emif_alloc_sram()
78 if (!emif_data->sram_pool_code) { in ti_emif_alloc_sram()
79 dev_err(dev, "Unable to get sram pool for ocmcram code\n"); in ti_emif_alloc_sram()
80 return -ENODEV; in ti_emif_alloc_sram()
83 emif_data->ti_emif_sram_virt = in ti_emif_alloc_sram()
84 gen_pool_alloc(emif_data->sram_pool_code, in ti_emif_alloc_sram()
86 if (!emif_data->ti_emif_sram_virt) { in ti_emif_alloc_sram()
88 return -ENOMEM; in ti_emif_alloc_sram()
92 emif_data->ti_emif_sram_phys = in ti_emif_alloc_sram()
93 gen_pool_virt_to_phys(emif_data->sram_pool_code, in ti_emif_alloc_sram()
94 emif_data->ti_emif_sram_virt); in ti_emif_alloc_sram()
96 /* Get sram pool for data section and allocate space */ in ti_emif_alloc_sram()
97 emif_data->sram_pool_data = of_gen_pool_get(np, "sram", 1); in ti_emif_alloc_sram()
98 if (!emif_data->sram_pool_data) { in ti_emif_alloc_sram()
99 dev_err(dev, "Unable to get sram pool for ocmcram data\n"); in ti_emif_alloc_sram()
100 ret = -ENODEV; in ti_emif_alloc_sram()
104 emif_data->ti_emif_sram_data_virt = in ti_emif_alloc_sram()
105 gen_pool_alloc(emif_data->sram_pool_data, in ti_emif_alloc_sram()
107 if (!emif_data->ti_emif_sram_data_virt) { in ti_emif_alloc_sram()
109 ret = -ENOMEM; in ti_emif_alloc_sram()
114 emif_data->ti_emif_sram_data_phys = in ti_emif_alloc_sram()
115 gen_pool_virt_to_phys(emif_data->sram_pool_data, in ti_emif_alloc_sram()
116 emif_data->ti_emif_sram_data_virt); in ti_emif_alloc_sram()
121 emif_data->pm_functions.save_context = in ti_emif_alloc_sram()
124 emif_data->pm_functions.enter_sr = in ti_emif_alloc_sram()
127 emif_data->pm_functions.abort_sr = in ti_emif_alloc_sram()
135 emif_data->pm_functions.restore_context = in ti_emif_alloc_sram()
138 emif_data->pm_functions.exit_sr = in ti_emif_alloc_sram()
142 emif_data->pm_data.regs_virt = in ti_emif_alloc_sram()
143 (struct emif_regs_amx3 *)emif_data->ti_emif_sram_data_virt; in ti_emif_alloc_sram()
144 emif_data->pm_data.regs_phys = emif_data->ti_emif_sram_data_phys; in ti_emif_alloc_sram()
149 gen_pool_free(emif_data->sram_pool_code, emif_data->ti_emif_sram_virt, in ti_emif_alloc_sram()
159 copy_addr = sram_exec_copy(emif_data->sram_pool_code, in ti_emif_push_sram()
160 (void *)emif_data->ti_emif_sram_virt, in ti_emif_push_sram()
163 dev_err(dev, "Cannot copy emif code to sram\n"); in ti_emif_push_sram()
164 return -ENODEV; in ti_emif_push_sram()
169 copy_addr = sram_exec_copy(emif_data->sram_pool_code, in ti_emif_push_sram()
171 &emif_data->pm_data, in ti_emif_push_sram()
172 sizeof(emif_data->pm_data)); in ti_emif_push_sram()
174 dev_err(dev, "Cannot copy emif data to code sram\n"); in ti_emif_push_sram()
175 return -ENODEV; in ti_emif_push_sram()
183 * Self-Refresh Command Limit" found in AM335x Silicon Errata
191 (emif_data->pm_data.ti_emif_base_addr_virt + in ti_emif_configure_sr_delay()
195 (emif_data->pm_data.ti_emif_base_addr_virt + in ti_emif_configure_sr_delay()
200 * ti_emif_copy_pm_function_table - copy mapping of pm funcs in sram
211 return -ENODEV; in ti_emif_copy_pm_function_table()
214 &emif_instance->pm_functions, in ti_emif_copy_pm_function_table()
215 sizeof(emif_instance->pm_functions)); in ti_emif_copy_pm_function_table()
217 return -ENODEV; in ti_emif_copy_pm_function_table()
224 * ti_emif_get_mem_type - return type for memory type in use
233 return -ENODEV; in ti_emif_get_mem_type()
235 temp = readl(emif_instance->pm_data.ti_emif_base_addr_virt + in ti_emif_get_mem_type()
244 { .compatible = "ti,emif-am3352", .data =
246 { .compatible = "ti,emif-am4372", .data =
256 __raw_readl((void *)emif_instance->ti_emif_sram_virt); in ti_emif_resume()
261 * indicates we have lost context and sram no longer contains in ti_emif_resume()
284 struct device *dev = &pdev->dev; in ti_emif_probe()
290 return -ENOMEM; in ti_emif_probe()
292 match = of_match_device(ti_emif_of_match, &pdev->dev); in ti_emif_probe()
294 return -ENODEV; in ti_emif_probe()
296 emif_data->pm_data.ti_emif_sram_config = (unsigned long)match->data; in ti_emif_probe()
299 emif_data->pm_data.ti_emif_base_addr_virt = devm_ioremap_resource(dev, in ti_emif_probe()
301 if (IS_ERR(emif_data->pm_data.ti_emif_base_addr_virt)) { in ti_emif_probe()
302 ret = PTR_ERR(emif_data->pm_data.ti_emif_base_addr_virt); in ti_emif_probe()
306 emif_data->pm_data.ti_emif_base_addr_phys = res->start; in ti_emif_probe()
354 MODULE_AUTHOR("Dave Gerlach <d-gerlach@ti.com>");
355 MODULE_DESCRIPTION("Texas Instruments SRAM EMIF driver");