From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Thu, 01 Mar 2012 21:48:10 +0100 Subject: [U-Boot] Do we really need CONFIG_ARCH_CPU_INIT ? In-Reply-To: References: Message-ID: <4F4FE08A.8000709@aribaud.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 01/03/2012 14:23, Fabio Estevam a ?crit : > Hi, > > Currently CONFIG_ARCH_CPU_INIT is used to select arch_cpu_init() function. > > arch_cpu_init() does CPU level initialization, so why do we need to > include CONFIG_ARCH_CPU_INIT in the include/configs/boardXYZ files, > which are board related files ? > > For example: > > Let's say boards X, Y and Z are based on SoC S: > > 1. If processor S has a arch_cpu_init() defined, then it means that > X,Y,Z need the code from arch_cpu_init() and then we need to define > CONFIG_ARCH_CPU_INIT for each of these boards (actually all the boards > based on this processor would need CONFIG_ARCH_CPU_INIT) > > 2. If not all boards need the code inside arch_cpu_init() for > processor S, then it means that this code is not really CPU specific > and then it should be moved to board code. ... or some of these boards have a kind of preloader that does CPU level inits before U-Boot is loaded, but other have not. Plus, if a minority of boards for a given SoC can do without the arch_cpu_init(), then we'll duplicate code that may well be quite identical, won't we? Amicalement, -- Albert.