From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Subject: Re: [PATCH v2 3/3] ARM: tegra: set CPU reset handler with firmware op Date: Thu, 13 Jun 2013 13:23:41 -0600 Message-ID: <51BA1C3D.1010608@wwwdotorg.org> References: <1371114745-24710-1-git-send-email-acourbot@nvidia.com> <1371114745-24710-4-git-send-email-acourbot@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1371114745-24710-4-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Alexandre Courbot Cc: gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Jassi Brar , Russell King - ARM Linux , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Chris Johnson , Tomasz Figa , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Karan Jhavar , Matthew Longnecker , Joseph Lo , linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-tegra@vger.kernel.org On 06/13/2013 03:12 AM, Alexandre Courbot wrote: > Use a firmware operation to set the CPU reset handler and only resort to > doing it ourselves if there is none defined. > > This supports the booting of secondary CPUs on devices using a TrustZone > secure monitor. > diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c > + err = call_firmware_op(set_cpu_boot_addr, 0, reset_address); > + switch (err) { > + case -ENOSYS: > + tegra_cpu_reset_handler_set(reset_address); > + /* pass-through */ Rather than detecting -ENOSYS and falling back to the custom tegra_cpu_reset_handler_set(), does it make sense to plug in tegra_cpu_reset_handler_set as the firmware op when there is no secure firmware detected? That way, this code wouldn't need the special case; that would be isolated to firmware.c. From mboxrd@z Thu Jan 1 00:00:00 1970 From: swarren@wwwdotorg.org (Stephen Warren) Date: Thu, 13 Jun 2013 13:23:41 -0600 Subject: [PATCH v2 3/3] ARM: tegra: set CPU reset handler with firmware op In-Reply-To: <1371114745-24710-4-git-send-email-acourbot@nvidia.com> References: <1371114745-24710-1-git-send-email-acourbot@nvidia.com> <1371114745-24710-4-git-send-email-acourbot@nvidia.com> Message-ID: <51BA1C3D.1010608@wwwdotorg.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 06/13/2013 03:12 AM, Alexandre Courbot wrote: > Use a firmware operation to set the CPU reset handler and only resort to > doing it ourselves if there is none defined. > > This supports the booting of secondary CPUs on devices using a TrustZone > secure monitor. > diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c > + err = call_firmware_op(set_cpu_boot_addr, 0, reset_address); > + switch (err) { > + case -ENOSYS: > + tegra_cpu_reset_handler_set(reset_address); > + /* pass-through */ Rather than detecting -ENOSYS and falling back to the custom tegra_cpu_reset_handler_set(), does it make sense to plug in tegra_cpu_reset_handler_set as the firmware op when there is no secure firmware detected? That way, this code wouldn't need the special case; that would be isolated to firmware.c. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758962Ab3FMTXs (ORCPT ); Thu, 13 Jun 2013 15:23:48 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:41084 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758355Ab3FMTXp (ORCPT ); Thu, 13 Jun 2013 15:23:45 -0400 Message-ID: <51BA1C3D.1010608@wwwdotorg.org> Date: Thu, 13 Jun 2013 13:23:41 -0600 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Alexandre Courbot CC: Joseph Lo , Karan Jhavar , Varun Wadekar , Chris Johnson , Matthew Longnecker , Russell King - ARM Linux , Tomasz Figa , Dave Martin , Jassi Brar , gnurou@gmail.com, devicetree-discuss@lists.ozlabs.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 3/3] ARM: tegra: set CPU reset handler with firmware op References: <1371114745-24710-1-git-send-email-acourbot@nvidia.com> <1371114745-24710-4-git-send-email-acourbot@nvidia.com> In-Reply-To: <1371114745-24710-4-git-send-email-acourbot@nvidia.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/13/2013 03:12 AM, Alexandre Courbot wrote: > Use a firmware operation to set the CPU reset handler and only resort to > doing it ourselves if there is none defined. > > This supports the booting of secondary CPUs on devices using a TrustZone > secure monitor. > diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c > + err = call_firmware_op(set_cpu_boot_addr, 0, reset_address); > + switch (err) { > + case -ENOSYS: > + tegra_cpu_reset_handler_set(reset_address); > + /* pass-through */ Rather than detecting -ENOSYS and falling back to the custom tegra_cpu_reset_handler_set(), does it make sense to plug in tegra_cpu_reset_handler_set as the firmware op when there is no secure firmware detected? That way, this code wouldn't need the special case; that would be isolated to firmware.c.