From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 27 Oct 2014 10:41:41 +0100 Subject: [U-Boot] [PATCH 2/4] ARM: HYP/non-sec: Make armv7_init_nonsec() usable before relocation In-Reply-To: <4adda4d321cc4de6859477b23d3b2578@DM2PR03MB574.namprd03.prod.outlook.com> References: <1412842298-3257-1-git-send-email-Yuantian.Tang@freescale.com> <1412842298-3257-3-git-send-email-Yuantian.Tang@freescale.com> <543E9647.6070503@freescale.com> <1eb5f7a41b4e47ab9dd04509ab5fb3d3@DM2PR03MB574.namprd03.prod.outlook.com> <4adda4d321cc4de6859477b23d3b2578@DM2PR03MB574.namprd03.prod.outlook.com> Message-ID: <20141027104141.1d02374c@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Yuantian, On Thu, 16 Oct 2014 04:42:06 +0000, Yuantian Tang wrote: > > >> Wouldn't it be better to declare gic_dist_base as a local variable? > > >>It is only used once outside function armv7_switch_nonsec(). It could > > >>be replaced with > > >> get_gicd_base_address() call. > > >> > > >I am with you. That's what I did in the first version of this patch. > > >Patch links is at: http://patchwork.ozlabs.org/patch/391065/ > > >But Albert seems have some concerns. The attached is what we discussed. FTR, I only had concerns with the patch subject / commit summary. Regarding the patch itself, I just asked whether the global was not used as some means of coordination which would have been broken by turning it into a local, but you had checked, so that was fine. > > >Now on the second thought, I prefer the way this patch proposed because > > >if we define gic_dist_base as local variable, That means function > > >get_gicd_base_address() should be usable at any time in any mode. Can > > >we make sure of that in the future? > > > > I don't strongly object introducing a new local variable. But I don't see how the > > global variable is useful. Function get_gicd_base_address() should be available all > > the time. It reads PERIPHBASE register, or return a macro. It hasn't changed > > since the first patch added it in 2013. Not sure if the original author Andre > > Przywara is available to comments. > > > Thanks for your comments. > If no one objects the original patch, I like to resubmit it. > > Hi Albert, what's your opinion on this? Which 'original patch' do you mean? If it is http://patchwork.ozlabs.org/patch/391065/ then I'm fine with it and will apply it. > Regards, > Yuantian > > > York > > Amicalement, -- Albert.