summaryrefslogtreecommitdiffstats
path: root/drivers/memory/ti-emif-pm.c
Commit message (Collapse)AuthorAgeFilesLines
* memory: ti-emif-pm: Use device_get_match_data() to simplify the codeye xingchen2023-01-231-6/+1
| | | | | | | | Directly get the match data with device_get_match_data(). Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202211171939327684154@zte.com.cn Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
* memory: ti-emif-pm: simplify platform_get_resource()Krzysztof Kozlowski2022-04-261-3/+3
| | | | | | | | Use devm_platform_get_and_ioremap_resource() instead of platform_get_resource() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220419142859.380566-4-krzysztof.kozlowski@linaro.org
* memory: ti-emif-pm: Drop of_match_ptr from of_device_id tableKrzysztof Kozlowski2021-02-081-1/+1
| | | | | | | | | | | | | | | The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might be not relevant here). This fixes compile warning (!CONFIG_OF with clang): drivers/memory/ti-emif-pm.c:238:34: warning: unused variable 'ti_emif_of_match' [-Wunused-const-variable] Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20210206111343.19273-1-krzk@kernel.org
* memory: ti-emif-pm: Fix cast to iomem pointerKrzysztof Kozlowski2020-07-241-1/+1
| | | | | | | | | | Cast pointer to iomem memory properly to fix sparse warning: drivers/memory/ti-emif-pm.c:251:38: warning: incorrect type in argument 1 (different address spaces) drivers/memory/ti-emif-pm.c:251:38: expected void const volatile [noderef] __iomem *addr drivers/memory/ti-emif-pm.c:251:38: got void * Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174Thomas Gleixner2019-05-301-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* memory: ti-emif-sram: Add ti_emif_run_hw_leveling for DDR3 hardware levelingDave Gerlach2019-04-091-0/+3
| | | | | | | | | | | | | | In certain situations, such as when returning from low power modes, the EMIF must re-run hardware leveling to properly restore DDR3 access. This is accomplished by introducing a new ti-emif-sram-pm call, ti_emif_run_hw_leveling, to check if DDR3 is in use and if so, trigger the full write and read leveling processes. Suggested-by: Brad Griffis <bgriffis@ti.com> Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Acked-by: Santosh Shilimkar <ssantosh@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
* memory: ti-emif-sram: Add resume function to recopy sram codeDave Gerlach2018-06-261-0/+33
| | | | | | | | | | | | After an RTC+DDR cycle we lose sram context so emif pm functions present in sram are lost. We can check if the first byte of the original code in DDR contains the same first byte as the code in sram, and if they do not match we know we have lost context and must recopy the functions to the previous address to maintain PM functionality. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
* memory: ti-emif-sram: remove redundant dev_err call in ti_emif_probe()Wei Yongjun2018-03-051-1/+0
| | | | | | | | | There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
* memory: ti-emif-sram: remove unused variableArnd Bergmann2017-12-061-1/+0
| | | | | | | | | | | | The newly introduced driver causes a harmless warning for a variable that was evidently never used: drivers/memory/ti-emif-pm.c: In function 'ti_emif_remove': drivers/memory/ti-emif-pm.c:303:17: error: unused variable 'dev' [-Werror=unused-variable] Fixes: 8428e5ad750d ("memory: ti-emif-sram: introduce relocatable suspend/resume handlers") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
* memory: ti-emif-sram: introduce relocatable suspend/resume handlersDave Gerlach2017-12-021-0/+325
Certain SoCs like Texas Instruments AM335x and AM437x require parts of the EMIF PM code to run late in the suspend sequence from SRAM, such as saving and restoring the EMIF context and placing the memory into self-refresh. One requirement for these SoCs to suspend and enter its lowest power mode, called DeepSleep0, is that the PER power domain must be shut off. Because the EMIF (DDR Controller) resides within this power domain, it will lose context during a suspend operation, so we must save it so we can restore once we resume. However, we cannot execute this code from external memory, as it is not available at this point, so the code must be executed late in the suspend path from SRAM. This patch introduces a ti-emif-sram driver that includes several functions written in ARM ASM that are relocatable so the PM SRAM code can use them. It also allocates a region of writable SRAM to be used by the code running in the executable region of SRAM to save and restore the EMIF context. It can export a table containing the absolute addresses of the available PM functions so that other SRAM code can branch to them. This code is required for suspend/resume on AM335x and AM437x to work. In addition to this, to be able to share data structures between C and the ti-emif-sram-pm assembly code, we can automatically generate all of the C struct member offsets and sizes as macros by processing emif-asm-offsets.c into assembly code and then extracting the relevant data as is done for the generated platform asm-offsets.h files. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>