aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Gerlach <d-gerlach@ti.com>2018-04-11 17:15:43 -0400
committerTony Lindgren <tony@atomide.com>2018-04-18 13:07:13 -0400
commit5692fceebeb7f11c07e2a990f7711a01ae437de2 (patch)
treea7a49eef9d98f4eda7fb47bde9edeeaefc85be6b
parent60cc43fc888428bb2f18f08997432d426a243338 (diff)
ARM: OMAP2+: Fix build when using split object directories
The sleep33xx and sleep43xx files should not depend on a header file generated in drivers/memory. Remove this dependency and instead allow both drivers/memory and arch/arm/mach-omap2 to generate all macros needed in headers local to their own paths. This fixes an issue where the build fail will when using O= to set a split object directory and arch/arm/mach-omap2 is built before drivers/memory with the following error: .../drivers/memory/emif-asm-offsets.c:1:0: fatal error: can't open drivers/memory/emif-asm-offsets.s for writing: No such file or directory compilation terminated. Fixes: 41d9d44d7258 ("ARM: OMAP2+: pm33xx-core: Add platform code needed for PM") Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.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>
-rw-r--r--arch/arm/mach-omap2/Makefile6
-rw-r--r--arch/arm/mach-omap2/pm-asm-offsets.c3
-rw-r--r--arch/arm/mach-omap2/sleep33xx.S1
-rw-r--r--arch/arm/mach-omap2/sleep43xx.S1
-rw-r--r--drivers/memory/emif-asm-offsets.c72
-rw-r--r--include/linux/ti-emif-sram.h75
6 files changed, 80 insertions, 78 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4603c30fef73..0d9ce58bc464 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -243,8 +243,4 @@ arch/arm/mach-omap2/pm-asm-offsets.s: arch/arm/mach-omap2/pm-asm-offsets.c
243include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE 243include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE
244 $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__) 244 $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__)
245 245
246# For rule to generate ti-emif-asm-offsets.h dependency 246$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-asm-offsets.h
247include drivers/memory/Makefile.asm-offsets
248
249arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h
250arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h
diff --git a/arch/arm/mach-omap2/pm-asm-offsets.c b/arch/arm/mach-omap2/pm-asm-offsets.c
index 6d4392da7c11..b9846b19e5e2 100644
--- a/arch/arm/mach-omap2/pm-asm-offsets.c
+++ b/arch/arm/mach-omap2/pm-asm-offsets.c
@@ -7,9 +7,12 @@
7 7
8#include <linux/kbuild.h> 8#include <linux/kbuild.h>
9#include <linux/platform_data/pm33xx.h> 9#include <linux/platform_data/pm33xx.h>
10#include <linux/ti-emif-sram.h>
10 11
11int main(void) 12int main(void)
12{ 13{
14 ti_emif_asm_offsets();
15
13 DEFINE(AMX3_PM_WFI_FLAGS_OFFSET, 16 DEFINE(AMX3_PM_WFI_FLAGS_OFFSET,
14 offsetof(struct am33xx_pm_sram_data, wfi_flags)); 17 offsetof(struct am33xx_pm_sram_data, wfi_flags));
15 DEFINE(AMX3_PM_L2_AUX_CTRL_VAL_OFFSET, 18 DEFINE(AMX3_PM_L2_AUX_CTRL_VAL_OFFSET,
diff --git a/arch/arm/mach-omap2/sleep33xx.S b/arch/arm/mach-omap2/sleep33xx.S
index 218d79930b04..322b3bb868b4 100644
--- a/arch/arm/mach-omap2/sleep33xx.S
+++ b/arch/arm/mach-omap2/sleep33xx.S
@@ -6,7 +6,6 @@
6 * Dave Gerlach, Vaibhav Bedia 6 * Dave Gerlach, Vaibhav Bedia
7 */ 7 */
8 8
9#include <generated/ti-emif-asm-offsets.h>
10#include <generated/ti-pm-asm-offsets.h> 9#include <generated/ti-pm-asm-offsets.h>
11#include <linux/linkage.h> 10#include <linux/linkage.h>
12#include <linux/ti-emif-sram.h> 11#include <linux/ti-emif-sram.h>
diff --git a/arch/arm/mach-omap2/sleep43xx.S b/arch/arm/mach-omap2/sleep43xx.S
index b24be624e8b9..8903814a6677 100644
--- a/arch/arm/mach-omap2/sleep43xx.S
+++ b/arch/arm/mach-omap2/sleep43xx.S
@@ -6,7 +6,6 @@
6 * Dave Gerlach, Vaibhav Bedia 6 * Dave Gerlach, Vaibhav Bedia
7 */ 7 */
8 8
9#include <generated/ti-emif-asm-offsets.h>
10#include <generated/ti-pm-asm-offsets.h> 9#include <generated/ti-pm-asm-offsets.h>
11#include <linux/linkage.h> 10#include <linux/linkage.h>
12#include <linux/ti-emif-sram.h> 11#include <linux/ti-emif-sram.h>
diff --git a/drivers/memory/emif-asm-offsets.c b/drivers/memory/emif-asm-offsets.c
index 71a89d5d3efd..db8043019ec6 100644
--- a/drivers/memory/emif-asm-offsets.c
+++ b/drivers/memory/emif-asm-offsets.c
@@ -16,77 +16,7 @@
16 16
17int main(void) 17int main(void)
18{ 18{
19 DEFINE(EMIF_SDCFG_VAL_OFFSET, 19 ti_emif_asm_offsets();
20 offsetof(struct emif_regs_amx3, emif_sdcfg_val));
21 DEFINE(EMIF_TIMING1_VAL_OFFSET,
22 offsetof(struct emif_regs_amx3, emif_timing1_val));
23 DEFINE(EMIF_TIMING2_VAL_OFFSET,
24 offsetof(struct emif_regs_amx3, emif_timing2_val));
25 DEFINE(EMIF_TIMING3_VAL_OFFSET,
26 offsetof(struct emif_regs_amx3, emif_timing3_val));
27 DEFINE(EMIF_REF_CTRL_VAL_OFFSET,
28 offsetof(struct emif_regs_amx3, emif_ref_ctrl_val));
29 DEFINE(EMIF_ZQCFG_VAL_OFFSET,
30 offsetof(struct emif_regs_amx3, emif_zqcfg_val));
31 DEFINE(EMIF_PMCR_VAL_OFFSET,
32 offsetof(struct emif_regs_amx3, emif_pmcr_val));
33 DEFINE(EMIF_PMCR_SHDW_VAL_OFFSET,
34 offsetof(struct emif_regs_amx3, emif_pmcr_shdw_val));
35 DEFINE(EMIF_RD_WR_LEVEL_RAMP_CTRL_OFFSET,
36 offsetof(struct emif_regs_amx3, emif_rd_wr_level_ramp_ctrl));
37 DEFINE(EMIF_RD_WR_EXEC_THRESH_OFFSET,
38 offsetof(struct emif_regs_amx3, emif_rd_wr_exec_thresh));
39 DEFINE(EMIF_COS_CONFIG_OFFSET,
40 offsetof(struct emif_regs_amx3, emif_cos_config));
41 DEFINE(EMIF_PRIORITY_TO_COS_MAPPING_OFFSET,
42 offsetof(struct emif_regs_amx3, emif_priority_to_cos_mapping));
43 DEFINE(EMIF_CONNECT_ID_SERV_1_MAP_OFFSET,
44 offsetof(struct emif_regs_amx3, emif_connect_id_serv_1_map));
45 DEFINE(EMIF_CONNECT_ID_SERV_2_MAP_OFFSET,
46 offsetof(struct emif_regs_amx3, emif_connect_id_serv_2_map));
47 DEFINE(EMIF_OCP_CONFIG_VAL_OFFSET,
48 offsetof(struct emif_regs_amx3, emif_ocp_config_val));
49 DEFINE(EMIF_LPDDR2_NVM_TIM_OFFSET,
50 offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim));
51 DEFINE(EMIF_LPDDR2_NVM_TIM_SHDW_OFFSET,
52 offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim_shdw));
53 DEFINE(EMIF_DLL_CALIB_CTRL_VAL_OFFSET,
54 offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val));
55 DEFINE(EMIF_DLL_CALIB_CTRL_VAL_SHDW_OFFSET,
56 offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val_shdw));
57 DEFINE(EMIF_DDR_PHY_CTLR_1_OFFSET,
58 offsetof(struct emif_regs_amx3, emif_ddr_phy_ctlr_1));
59 DEFINE(EMIF_EXT_PHY_CTRL_VALS_OFFSET,
60 offsetof(struct emif_regs_amx3, emif_ext_phy_ctrl_vals));
61 DEFINE(EMIF_REGS_AMX3_SIZE, sizeof(struct emif_regs_amx3));
62
63 BLANK();
64
65 DEFINE(EMIF_PM_BASE_ADDR_VIRT_OFFSET,
66 offsetof(struct ti_emif_pm_data, ti_emif_base_addr_virt));
67 DEFINE(EMIF_PM_BASE_ADDR_PHYS_OFFSET,
68 offsetof(struct ti_emif_pm_data, ti_emif_base_addr_phys));
69 DEFINE(EMIF_PM_CONFIG_OFFSET,
70 offsetof(struct ti_emif_pm_data, ti_emif_sram_config));
71 DEFINE(EMIF_PM_REGS_VIRT_OFFSET,
72 offsetof(struct ti_emif_pm_data, regs_virt));
73 DEFINE(EMIF_PM_REGS_PHYS_OFFSET,
74 offsetof(struct ti_emif_pm_data, regs_phys));
75 DEFINE(EMIF_PM_DATA_SIZE, sizeof(struct ti_emif_pm_data));
76
77 BLANK();
78
79 DEFINE(EMIF_PM_SAVE_CONTEXT_OFFSET,
80 offsetof(struct ti_emif_pm_functions, save_context));
81 DEFINE(EMIF_PM_RESTORE_CONTEXT_OFFSET,
82 offsetof(struct ti_emif_pm_functions, restore_context));
83 DEFINE(EMIF_PM_ENTER_SR_OFFSET,
84 offsetof(struct ti_emif_pm_functions, enter_sr));
85 DEFINE(EMIF_PM_EXIT_SR_OFFSET,
86 offsetof(struct ti_emif_pm_functions, exit_sr));
87 DEFINE(EMIF_PM_ABORT_SR_OFFSET,
88 offsetof(struct ti_emif_pm_functions, abort_sr));
89 DEFINE(EMIF_PM_FUNCTIONS_SIZE, sizeof(struct ti_emif_pm_functions));
90 20
91 return 0; 21 return 0;
92} 22}
diff --git a/include/linux/ti-emif-sram.h b/include/linux/ti-emif-sram.h
index 45bc6b376492..53604b087f2c 100644
--- a/include/linux/ti-emif-sram.h
+++ b/include/linux/ti-emif-sram.h
@@ -60,6 +60,81 @@ struct ti_emif_pm_functions {
60 u32 abort_sr; 60 u32 abort_sr;
61} __packed __aligned(8); 61} __packed __aligned(8);
62 62
63static inline void ti_emif_asm_offsets(void)
64{
65 DEFINE(EMIF_SDCFG_VAL_OFFSET,
66 offsetof(struct emif_regs_amx3, emif_sdcfg_val));
67 DEFINE(EMIF_TIMING1_VAL_OFFSET,
68 offsetof(struct emif_regs_amx3, emif_timing1_val));
69 DEFINE(EMIF_TIMING2_VAL_OFFSET,
70 offsetof(struct emif_regs_amx3, emif_timing2_val));
71 DEFINE(EMIF_TIMING3_VAL_OFFSET,
72 offsetof(struct emif_regs_amx3, emif_timing3_val));
73 DEFINE(EMIF_REF_CTRL_VAL_OFFSET,
74 offsetof(struct emif_regs_amx3, emif_ref_ctrl_val));
75 DEFINE(EMIF_ZQCFG_VAL_OFFSET,
76 offsetof(struct emif_regs_amx3, emif_zqcfg_val));
77 DEFINE(EMIF_PMCR_VAL_OFFSET,
78 offsetof(struct emif_regs_amx3, emif_pmcr_val));
79 DEFINE(EMIF_PMCR_SHDW_VAL_OFFSET,
80 offsetof(struct emif_regs_amx3, emif_pmcr_shdw_val));
81 DEFINE(EMIF_RD_WR_LEVEL_RAMP_CTRL_OFFSET,
82 offsetof(struct emif_regs_amx3, emif_rd_wr_level_ramp_ctrl));
83 DEFINE(EMIF_RD_WR_EXEC_THRESH_OFFSET,
84 offsetof(struct emif_regs_amx3, emif_rd_wr_exec_thresh));
85 DEFINE(EMIF_COS_CONFIG_OFFSET,
86 offsetof(struct emif_regs_amx3, emif_cos_config));
87 DEFINE(EMIF_PRIORITY_TO_COS_MAPPING_OFFSET,
88 offsetof(struct emif_regs_amx3, emif_priority_to_cos_mapping));
89 DEFINE(EMIF_CONNECT_ID_SERV_1_MAP_OFFSET,
90 offsetof(struct emif_regs_amx3, emif_connect_id_serv_1_map));
91 DEFINE(EMIF_CONNECT_ID_SERV_2_MAP_OFFSET,
92 offsetof(struct emif_regs_amx3, emif_connect_id_serv_2_map));
93 DEFINE(EMIF_OCP_CONFIG_VAL_OFFSET,
94 offsetof(struct emif_regs_amx3, emif_ocp_config_val));
95 DEFINE(EMIF_LPDDR2_NVM_TIM_OFFSET,
96 offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim));
97 DEFINE(EMIF_LPDDR2_NVM_TIM_SHDW_OFFSET,
98 offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim_shdw));
99 DEFINE(EMIF_DLL_CALIB_CTRL_VAL_OFFSET,
100 offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val));
101 DEFINE(EMIF_DLL_CALIB_CTRL_VAL_SHDW_OFFSET,
102 offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val_shdw));
103 DEFINE(EMIF_DDR_PHY_CTLR_1_OFFSET,
104 offsetof(struct emif_regs_amx3, emif_ddr_phy_ctlr_1));
105 DEFINE(EMIF_EXT_PHY_CTRL_VALS_OFFSET,
106 offsetof(struct emif_regs_amx3, emif_ext_phy_ctrl_vals));
107 DEFINE(EMIF_REGS_AMX3_SIZE, sizeof(struct emif_regs_amx3));
108
109 BLANK();
110
111 DEFINE(EMIF_PM_BASE_ADDR_VIRT_OFFSET,
112 offsetof(struct ti_emif_pm_data, ti_emif_base_addr_virt));
113 DEFINE(EMIF_PM_BASE_ADDR_PHYS_OFFSET,
114 offsetof(struct ti_emif_pm_data, ti_emif_base_addr_phys));
115 DEFINE(EMIF_PM_CONFIG_OFFSET,
116 offsetof(struct ti_emif_pm_data, ti_emif_sram_config));
117 DEFINE(EMIF_PM_REGS_VIRT_OFFSET,
118 offsetof(struct ti_emif_pm_data, regs_virt));
119 DEFINE(EMIF_PM_REGS_PHYS_OFFSET,
120 offsetof(struct ti_emif_pm_data, regs_phys));
121 DEFINE(EMIF_PM_DATA_SIZE, sizeof(struct ti_emif_pm_data));
122
123 BLANK();
124
125 DEFINE(EMIF_PM_SAVE_CONTEXT_OFFSET,
126 offsetof(struct ti_emif_pm_functions, save_context));
127 DEFINE(EMIF_PM_RESTORE_CONTEXT_OFFSET,
128 offsetof(struct ti_emif_pm_functions, restore_context));
129 DEFINE(EMIF_PM_ENTER_SR_OFFSET,
130 offsetof(struct ti_emif_pm_functions, enter_sr));
131 DEFINE(EMIF_PM_EXIT_SR_OFFSET,
132 offsetof(struct ti_emif_pm_functions, exit_sr));
133 DEFINE(EMIF_PM_ABORT_SR_OFFSET,
134 offsetof(struct ti_emif_pm_functions, abort_sr));
135 DEFINE(EMIF_PM_FUNCTIONS_SIZE, sizeof(struct ti_emif_pm_functions));
136}
137
63struct gen_pool; 138struct gen_pool;
64 139
65int ti_emif_copy_pm_function_table(struct gen_pool *sram_pool, void *dst); 140int ti_emif_copy_pm_function_table(struct gen_pool *sram_pool, void *dst);