Received: by 10.192.165.156 with SMTP id m28csp1702727imm; Thu, 12 Apr 2018 01:54:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ShLlErg07ONu458d7e8lPruvFFtl1rC/YfZQdLHc8zeHnnlBz1RhGJloG8/z9HsN8E1oj X-Received: by 2002:a17:902:102c:: with SMTP id b41-v6mr59013pla.39.1523523253778; Thu, 12 Apr 2018 01:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523523253; cv=none; d=google.com; s=arc-20160816; b=0NbIFgFxDHpY2pr0kAOiWIGwfJ1wTceW4mNmAE9yWVIRzH4zpqVIq+569NuSoBx6px 9zJOqfhY7Qo9IBLP2MmZthYkBWilpdXlPkr+apB1it8QUjp11bgOV9zlxPhjP+r5Bo3R IC+OqnIknIHSdaS6N1o4+eOj4L6gP8yh5QBZhi0PWPTBhFC+Wjc0zrNVkzNlGMjjRrux KIbaT/a3YWTrIHqsyhoGtaGrbvvPFkrjrVcCYT7DBLXEKCKE8YVrBLIM1l6okFCq+HeL Kwhwom7GhJZysmNJg1xmT/Pi4IBL+OXJstNUEJxW8aBHWb+D4fnV2oMMrZZiejOHpTRn tkzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=hMCY8rSxngBcRWH4JRccGDugnD8CX1du7WYCl6sm6rk=; b=zf+gu2WwT5fTerbGmXW4i22L4Bczw0SHRplzeCJuWS+SEem4/HR28KmMg8tat2yFTz 1x/M6ul4qbleNmSX1qh1SpEpBNDIQXBsSuJaCZw0nDQveLVmG9LkcnGVhaz1Uoro/DcQ 1znKMA0oixc+irCr1NDKYNkQK29t3FRxvjtZFnnMUOD3ddETOc2lMOPtoVIgQqZjjbKP 9oqzmUcyi4pMs5dmPn5zzISKlzH+m1iFMF46vRjiC8LOBcCmUDjUpjbljHJbnWiTsse2 EVWgwEy8mo4qfXZzmFD0ngUVZqMcu3dDcjhpMv6o9FHXB6HTIkYnSbTKD3Lahqhox89b OtiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CgtQcqzK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si2856973plb.285.2018.04.12.01.53.35; Thu, 12 Apr 2018 01:54:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CgtQcqzK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819AbeDLIuv (ORCPT + 99 others); Thu, 12 Apr 2018 04:50:51 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:37911 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbeDLIut (ORCPT ); Thu, 12 Apr 2018 04:50:49 -0400 Received: by mail-lf0-f66.google.com with SMTP id u3-v6so6549606lff.5 for ; Thu, 12 Apr 2018 01:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hMCY8rSxngBcRWH4JRccGDugnD8CX1du7WYCl6sm6rk=; b=CgtQcqzKEjvzYyIelN8qDAYf2Q0sKr0ghq53ow4+x3WkgIt3U7AszUL8Y3TkqeBN+S 2VcZ9V85Z6+mrmOGFZrgztXN6KfUk5LYq0ef0sJHgLRNUQiiKmYk0nDdZ/k4Se0gHpfF b7Rt5o2fvBDCGYKGbeYwFkFqNw/LYOOEAcVuQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hMCY8rSxngBcRWH4JRccGDugnD8CX1du7WYCl6sm6rk=; b=rIVDc92dztqHlo0+7cMb4oumL+XGg4zHdb9fNBaxOFiUjlz45tsBz5DZfN5gGVZ4Ki 7UXm6oYoYHMXFpT1NTe7uom26w9LADmaBk3KylnYir6QlEgG1/Eln/L53hJS56Y6SA05 sPArSdz2KweCu2dTSMs6DOZt0PQ4dc7lLbSj5iC7N2KRnL8280Q8IiRm/rwHE7fBScSV u0bIJr/TW+l9bz66moD5tpNAOEQXlupTANq2rMpc0WCIHgEh+9uQ2+mfw5bH4A+duC6G JpzDFLqfAbz03hV+fP2uizVgQ0MD1cKgYQ1jW0Yv04TI3JQIjgJCCtTmQmmztINYb+73 JKZw== X-Gm-Message-State: ALQs6tDB2wDlWQkq8zzhhKCkY348999X5DnzIFW5SbRpQCEp9pvEKQxI Fqe9LZNBASowY0Fwvcz1tpbdsg== X-Received: by 10.46.25.134 with SMTP id 6mr63757ljz.14.1523523048057; Thu, 12 Apr 2018 01:50:48 -0700 (PDT) Received: from localhost.localdomain (c-2c3d70d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.61.44]) by smtp.gmail.com with ESMTPSA id n131-v6sm616040lfn.55.2018.04.12.01.50.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Apr 2018 01:50:47 -0700 (PDT) Date: Thu, 12 Apr 2018 10:21:57 +0200 From: Anders Roxell To: Dave Gerlach Cc: linux-kernel@vger.kernel.org, Tony Lindgren , Russell King - ARM Linux , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kbuild@vger.kernel.org, Masahiro Yamada , Michal Marek Subject: Re: [PATCH] ARM: omap2: Fix build when using split object directories Message-ID: <20180412082157.GB4002@localhost.localdomain> References: <20180411211543.7923-1-d-gerlach@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180411211543.7923-1-d-gerlach@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-04-11 16:15, Dave Gerlach wrote: > 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") > Acked-by: Tony Lindgren > Reviewed-by: Masahiro Yamada > Signed-off-by: Dave Gerlach Tested-by: Anders Roxell Maybe we can remove drivers/memory/Makefile.asm-offsets and move those changes into drivers/memory/Makefile ? Cheers, Anders > --- > arch/arm/mach-omap2/Makefile | 6 +-- > arch/arm/mach-omap2/pm-asm-offsets.c | 3 ++ > arch/arm/mach-omap2/sleep33xx.S | 1 - > arch/arm/mach-omap2/sleep43xx.S | 1 - > drivers/memory/emif-asm-offsets.c | 72 +--------------------------------- > include/linux/ti-emif-sram.h | 75 ++++++++++++++++++++++++++++++++++++ > 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 > include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE > $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__) > > -# For rule to generate ti-emif-asm-offsets.h dependency > -include drivers/memory/Makefile.asm-offsets > - > -arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h > -arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h > +$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-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 @@ > > #include > #include > +#include > > int main(void) > { > + ti_emif_asm_offsets(); > + > DEFINE(AMX3_PM_WFI_FLAGS_OFFSET, > offsetof(struct am33xx_pm_sram_data, wfi_flags)); > 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 @@ > * Dave Gerlach, Vaibhav Bedia > */ > > -#include > #include > #include > #include > 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 @@ > * Dave Gerlach, Vaibhav Bedia > */ > > -#include > #include > #include > #include > 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 @@ > > int main(void) > { > - DEFINE(EMIF_SDCFG_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_sdcfg_val)); > - DEFINE(EMIF_TIMING1_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_timing1_val)); > - DEFINE(EMIF_TIMING2_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_timing2_val)); > - DEFINE(EMIF_TIMING3_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_timing3_val)); > - DEFINE(EMIF_REF_CTRL_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_ref_ctrl_val)); > - DEFINE(EMIF_ZQCFG_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_zqcfg_val)); > - DEFINE(EMIF_PMCR_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_pmcr_val)); > - DEFINE(EMIF_PMCR_SHDW_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_pmcr_shdw_val)); > - DEFINE(EMIF_RD_WR_LEVEL_RAMP_CTRL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_rd_wr_level_ramp_ctrl)); > - DEFINE(EMIF_RD_WR_EXEC_THRESH_OFFSET, > - offsetof(struct emif_regs_amx3, emif_rd_wr_exec_thresh)); > - DEFINE(EMIF_COS_CONFIG_OFFSET, > - offsetof(struct emif_regs_amx3, emif_cos_config)); > - DEFINE(EMIF_PRIORITY_TO_COS_MAPPING_OFFSET, > - offsetof(struct emif_regs_amx3, emif_priority_to_cos_mapping)); > - DEFINE(EMIF_CONNECT_ID_SERV_1_MAP_OFFSET, > - offsetof(struct emif_regs_amx3, emif_connect_id_serv_1_map)); > - DEFINE(EMIF_CONNECT_ID_SERV_2_MAP_OFFSET, > - offsetof(struct emif_regs_amx3, emif_connect_id_serv_2_map)); > - DEFINE(EMIF_OCP_CONFIG_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_ocp_config_val)); > - DEFINE(EMIF_LPDDR2_NVM_TIM_OFFSET, > - offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim)); > - DEFINE(EMIF_LPDDR2_NVM_TIM_SHDW_OFFSET, > - offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim_shdw)); > - DEFINE(EMIF_DLL_CALIB_CTRL_VAL_OFFSET, > - offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val)); > - DEFINE(EMIF_DLL_CALIB_CTRL_VAL_SHDW_OFFSET, > - offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val_shdw)); > - DEFINE(EMIF_DDR_PHY_CTLR_1_OFFSET, > - offsetof(struct emif_regs_amx3, emif_ddr_phy_ctlr_1)); > - DEFINE(EMIF_EXT_PHY_CTRL_VALS_OFFSET, > - offsetof(struct emif_regs_amx3, emif_ext_phy_ctrl_vals)); > - DEFINE(EMIF_REGS_AMX3_SIZE, sizeof(struct emif_regs_amx3)); > - > - BLANK(); > - > - DEFINE(EMIF_PM_BASE_ADDR_VIRT_OFFSET, > - offsetof(struct ti_emif_pm_data, ti_emif_base_addr_virt)); > - DEFINE(EMIF_PM_BASE_ADDR_PHYS_OFFSET, > - offsetof(struct ti_emif_pm_data, ti_emif_base_addr_phys)); > - DEFINE(EMIF_PM_CONFIG_OFFSET, > - offsetof(struct ti_emif_pm_data, ti_emif_sram_config)); > - DEFINE(EMIF_PM_REGS_VIRT_OFFSET, > - offsetof(struct ti_emif_pm_data, regs_virt)); > - DEFINE(EMIF_PM_REGS_PHYS_OFFSET, > - offsetof(struct ti_emif_pm_data, regs_phys)); > - DEFINE(EMIF_PM_DATA_SIZE, sizeof(struct ti_emif_pm_data)); > - > - BLANK(); > - > - DEFINE(EMIF_PM_SAVE_CONTEXT_OFFSET, > - offsetof(struct ti_emif_pm_functions, save_context)); > - DEFINE(EMIF_PM_RESTORE_CONTEXT_OFFSET, > - offsetof(struct ti_emif_pm_functions, restore_context)); > - DEFINE(EMIF_PM_ENTER_SR_OFFSET, > - offsetof(struct ti_emif_pm_functions, enter_sr)); > - DEFINE(EMIF_PM_EXIT_SR_OFFSET, > - offsetof(struct ti_emif_pm_functions, exit_sr)); > - DEFINE(EMIF_PM_ABORT_SR_OFFSET, > - offsetof(struct ti_emif_pm_functions, abort_sr)); > - DEFINE(EMIF_PM_FUNCTIONS_SIZE, sizeof(struct ti_emif_pm_functions)); > + ti_emif_asm_offsets(); > > return 0; > } > 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 { > u32 abort_sr; > } __packed __aligned(8); > > +static inline void ti_emif_asm_offsets(void) > +{ > + DEFINE(EMIF_SDCFG_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_sdcfg_val)); > + DEFINE(EMIF_TIMING1_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_timing1_val)); > + DEFINE(EMIF_TIMING2_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_timing2_val)); > + DEFINE(EMIF_TIMING3_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_timing3_val)); > + DEFINE(EMIF_REF_CTRL_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_ref_ctrl_val)); > + DEFINE(EMIF_ZQCFG_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_zqcfg_val)); > + DEFINE(EMIF_PMCR_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_pmcr_val)); > + DEFINE(EMIF_PMCR_SHDW_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_pmcr_shdw_val)); > + DEFINE(EMIF_RD_WR_LEVEL_RAMP_CTRL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_rd_wr_level_ramp_ctrl)); > + DEFINE(EMIF_RD_WR_EXEC_THRESH_OFFSET, > + offsetof(struct emif_regs_amx3, emif_rd_wr_exec_thresh)); > + DEFINE(EMIF_COS_CONFIG_OFFSET, > + offsetof(struct emif_regs_amx3, emif_cos_config)); > + DEFINE(EMIF_PRIORITY_TO_COS_MAPPING_OFFSET, > + offsetof(struct emif_regs_amx3, emif_priority_to_cos_mapping)); > + DEFINE(EMIF_CONNECT_ID_SERV_1_MAP_OFFSET, > + offsetof(struct emif_regs_amx3, emif_connect_id_serv_1_map)); > + DEFINE(EMIF_CONNECT_ID_SERV_2_MAP_OFFSET, > + offsetof(struct emif_regs_amx3, emif_connect_id_serv_2_map)); > + DEFINE(EMIF_OCP_CONFIG_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_ocp_config_val)); > + DEFINE(EMIF_LPDDR2_NVM_TIM_OFFSET, > + offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim)); > + DEFINE(EMIF_LPDDR2_NVM_TIM_SHDW_OFFSET, > + offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim_shdw)); > + DEFINE(EMIF_DLL_CALIB_CTRL_VAL_OFFSET, > + offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val)); > + DEFINE(EMIF_DLL_CALIB_CTRL_VAL_SHDW_OFFSET, > + offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val_shdw)); > + DEFINE(EMIF_DDR_PHY_CTLR_1_OFFSET, > + offsetof(struct emif_regs_amx3, emif_ddr_phy_ctlr_1)); > + DEFINE(EMIF_EXT_PHY_CTRL_VALS_OFFSET, > + offsetof(struct emif_regs_amx3, emif_ext_phy_ctrl_vals)); > + DEFINE(EMIF_REGS_AMX3_SIZE, sizeof(struct emif_regs_amx3)); > + > + BLANK(); > + > + DEFINE(EMIF_PM_BASE_ADDR_VIRT_OFFSET, > + offsetof(struct ti_emif_pm_data, ti_emif_base_addr_virt)); > + DEFINE(EMIF_PM_BASE_ADDR_PHYS_OFFSET, > + offsetof(struct ti_emif_pm_data, ti_emif_base_addr_phys)); > + DEFINE(EMIF_PM_CONFIG_OFFSET, > + offsetof(struct ti_emif_pm_data, ti_emif_sram_config)); > + DEFINE(EMIF_PM_REGS_VIRT_OFFSET, > + offsetof(struct ti_emif_pm_data, regs_virt)); > + DEFINE(EMIF_PM_REGS_PHYS_OFFSET, > + offsetof(struct ti_emif_pm_data, regs_phys)); > + DEFINE(EMIF_PM_DATA_SIZE, sizeof(struct ti_emif_pm_data)); > + > + BLANK(); > + > + DEFINE(EMIF_PM_SAVE_CONTEXT_OFFSET, > + offsetof(struct ti_emif_pm_functions, save_context)); > + DEFINE(EMIF_PM_RESTORE_CONTEXT_OFFSET, > + offsetof(struct ti_emif_pm_functions, restore_context)); > + DEFINE(EMIF_PM_ENTER_SR_OFFSET, > + offsetof(struct ti_emif_pm_functions, enter_sr)); > + DEFINE(EMIF_PM_EXIT_SR_OFFSET, > + offsetof(struct ti_emif_pm_functions, exit_sr)); > + DEFINE(EMIF_PM_ABORT_SR_OFFSET, > + offsetof(struct ti_emif_pm_functions, abort_sr)); > + DEFINE(EMIF_PM_FUNCTIONS_SIZE, sizeof(struct ti_emif_pm_functions)); > +} > + > struct gen_pool; > > int ti_emif_copy_pm_function_table(struct gen_pool *sram_pool, void *dst); > -- > 2.16.1 > -- Anders Roxell anders.roxell@linaro.org M: +46 709 71 42 85 | IRC: roxell