From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v2 05/18] reset: Add reset_controller_of_init() function Date: Tue, 10 Mar 2015 21:19:55 +0100 Message-ID: <6773745.i9mx5zmPP4@wuerfel> References: <1424455277-29983-1-git-send-email-mcoquelin.stm32@gmail.com> <8729383.kvUZDm4dQz@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Maxime Coquelin Cc: Mark Rutland , "linux-doc@vger.kernel.org" , Linus Walleij , Will Deacon , Nikolay Borisov , "linux-api@vger.kernel.org" , Jiri Slaby , Mauro Carvalho Chehab , Linux-Arch , Russell King , Jonathan Corbet , Daniel Lezcano , Antti Palosaari , Geert Uytterhoeven , "linux-serial@vger.kernel.org" , Uwe =?ISO-8859-1?Q?Kleine=2DK=F6nig?= , "devicetree@vger.kernel.org" , Kees Cook , Pawel Moll , Ian Campbell List-Id: linux-api@vger.kernel.org On Tuesday 10 March 2015 16:28:44 Maxime Coquelin wrote: > 2015-03-10 16:00 GMT+01:00 Arnd Bergmann : > > On Friday 20 February 2015 19:01:04 Maxime Coquelin wrote: > >> Some platforms need to initialize the reset controller before the timers. > >> > >> This patch introduces a reset_controller_of_init() function that can be > >> called before the timers intialization. > >> > >> Signed-off-by: Maxime Coquelin > >> > > > > Not sure about this. It seems like the cleanest approach if we get > > a lot of these, but then again it is probably very rare, and I'd > > like to avoid adding such infrastructure if it's just for one > > SoC. Could we add a hack in the machine initialization instead? > > Sun6i also need to initialize the reset controller early. Today, they > hack the machine initialization. > With two SoCs having the same need, what should we do? Good question, I'd like to hear some other opinions on this first. > > I think ideally this would be done in the boot loader before we > > even start Linux, but I don't know if that's possible for you. > > From what I understand, the only constraint is to perform it after the > clock is enabled. > So this should be possible to do it in the bootloader, but it means > also adding timers clocks ungating in the bootloader. Ungating the timer clock input seems like a reasonable thing to do for the bootloader, I think a lot of platforms rely on this elsewhere (but enough of them don't, which is why we have the early clk init). Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de ([212.227.17.10]:51464 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbbCJUWM (ORCPT ); Tue, 10 Mar 2015 16:22:12 -0400 From: Arnd Bergmann Subject: Re: [PATCH v2 05/18] reset: Add reset_controller_of_init() function Date: Tue, 10 Mar 2015 21:19:55 +0100 Message-ID: <6773745.i9mx5zmPP4@wuerfel> In-Reply-To: References: <1424455277-29983-1-git-send-email-mcoquelin.stm32@gmail.com> <8729383.kvUZDm4dQz@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Maxime Coquelin Cc: maxime.ripard@free-electrons.com, Uwe =?ISO-8859-1?Q?Kleine=2DK=F6nig?= , Andreas =?ISO-8859-1?Q?F=E4rber?= , Geert Uytterhoeven , Rob Herring , Philipp Zabel , Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Daniel Lezcano , Thomas Gleixner , Linus Walleij , Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , "David S. Miller" , Mauro Carvalho Chehab , Joe Perches , Antti Palosaari , Tejun Heo , Will Deacon , Nikolay Borisov , Rusty Russell , Kees Cook , Michal Marek , "linux-doc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-serial@vger.kernel.org" , Linux-Arch , "linux-api@vger.kernel.org" Message-ID: <20150310201955.jft22WbyUFPxnpt4of89RzS71hdtwUpNQ7I3KFmUOrg@z> On Tuesday 10 March 2015 16:28:44 Maxime Coquelin wrote: > 2015-03-10 16:00 GMT+01:00 Arnd Bergmann : > > On Friday 20 February 2015 19:01:04 Maxime Coquelin wrote: > >> Some platforms need to initialize the reset controller before the timers. > >> > >> This patch introduces a reset_controller_of_init() function that can be > >> called before the timers intialization. > >> > >> Signed-off-by: Maxime Coquelin > >> > > > > Not sure about this. It seems like the cleanest approach if we get > > a lot of these, but then again it is probably very rare, and I'd > > like to avoid adding such infrastructure if it's just for one > > SoC. Could we add a hack in the machine initialization instead? > > Sun6i also need to initialize the reset controller early. Today, they > hack the machine initialization. > With two SoCs having the same need, what should we do? Good question, I'd like to hear some other opinions on this first. > > I think ideally this would be done in the boot loader before we > > even start Linux, but I don't know if that's possible for you. > > From what I understand, the only constraint is to perform it after the > clock is enabled. > So this should be possible to do it in the bootloader, but it means > also adding timers clocks ungating in the bootloader. Ungating the timer clock input seems like a reasonable thing to do for the bootloader, I think a lot of platforms rely on this elsewhere (but enough of them don't, which is why we have the early clk init). Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Tue, 10 Mar 2015 21:19:55 +0100 Subject: [PATCH v2 05/18] reset: Add reset_controller_of_init() function In-Reply-To: References: <1424455277-29983-1-git-send-email-mcoquelin.stm32@gmail.com> <8729383.kvUZDm4dQz@wuerfel> Message-ID: <6773745.i9mx5zmPP4@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tuesday 10 March 2015 16:28:44 Maxime Coquelin wrote: > 2015-03-10 16:00 GMT+01:00 Arnd Bergmann : > > On Friday 20 February 2015 19:01:04 Maxime Coquelin wrote: > >> Some platforms need to initialize the reset controller before the timers. > >> > >> This patch introduces a reset_controller_of_init() function that can be > >> called before the timers intialization. > >> > >> Signed-off-by: Maxime Coquelin > >> > > > > Not sure about this. It seems like the cleanest approach if we get > > a lot of these, but then again it is probably very rare, and I'd > > like to avoid adding such infrastructure if it's just for one > > SoC. Could we add a hack in the machine initialization instead? > > Sun6i also need to initialize the reset controller early. Today, they > hack the machine initialization. > With two SoCs having the same need, what should we do? Good question, I'd like to hear some other opinions on this first. > > I think ideally this would be done in the boot loader before we > > even start Linux, but I don't know if that's possible for you. > > From what I understand, the only constraint is to perform it after the > clock is enabled. > So this should be possible to do it in the bootloader, but it means > also adding timers clocks ungating in the bootloader. Ungating the timer clock input seems like a reasonable thing to do for the bootloader, I think a lot of platforms rely on this elsewhere (but enough of them don't, which is why we have the early clk init). Arnd