From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_Bie=DFmann?= Date: Thu, 12 Jun 2014 09:46:27 +0200 Subject: [U-Boot] Refactoring of U-Boot directory structure In-Reply-To: <20140612153214.9642.AA925319@jp.panasonic.com> References: <20140612131050.963A.AA925319@jp.panasonic.com> <20140612044145.B1CF3380601@gemini.denx.de> <20140612153214.9642.AA925319@jp.panasonic.com> Message-ID: <53995AD3.4040708@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi all, On 06/12/2014 08:32 AM, Masahiro Yamada wrote: > On Thu, 12 Jun 2014 06:41:45 +0200 > Wolfgang Denk wrote: >> In message <20140612131050.963A.AA925319@jp.panasonic.com> you wrote: >>> >>> [1] Do not split the similar SoC family to various directories >>> >>> at91 SoC directory exists under arm920t, arm926ejs, armv7 directory. >> >> To me this actually makes sense, as they are using different CPU cores >> (ARMv4t vs. ARMv5te vs. ARMv7). >> >>> ./arch/arm/cpu/arm920t/at91 >>> ./arch/arm/cpu/arm926ejs/at91 >>> ./arch/arm/cpu/armv7/at91 >>> >>> It looks reasonable to collect at91 sources into a single place, >>> arch/arm/mach-at91 I thought about that before when introducing at91-common. >> Did you look at the code? Files like lowlevel_init.S, reset.c or >> timer.c look pretty much specific to the respective architecture. >> What would be the benefit of mixing all this different stuff in a >> single directory? > > No. > I am discussing from the generic view. > > In the current structure, there is no place which at91-common > part should go to. > > Splitting code into various directories loses the motivation of > consolidating the common part even if it exists. That's true. Currently there are some old files which are almost the same in arch/arm/cpu/*/at91 Especially the arm920t and arm926ejs files are mostly the same. For example the clock.c: ---8<--- abiessmann at punisher % diff -Nrupa arch/arm/cpu/arm920t/at91/clock.c arch/arm/cpu/arm926ejs/at91/clock.c | diffstat clock.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) abiessmann at punisher % cat arch/arm/cpu/arm920t/at91/clock.c | wc -l 157 abiessmann@punisher % cat arch/arm/cpu/arm926ejs/at91/clock.c | wc -l 189 --->8--- The differences are just features of the newer IP revision in SoC, so that could be consolidated into one file. lowlevel_init.S is another thing. There should be something done before. We have started to do clock and RAM initialization in C-code for armv7 targets (sama5) and some arm926ejs targets (g45). This could also be done for the ancient (but still available) devices like sam926x, maybe also for the really prehistoric rm9200. So I think it is doable to consolidate the directory structure. It would even be really useful for the generic code. But we need to plan this step before thoroughly. Especially required adoptions like rework of lowlevel_init.S should be done before. Best regards Andreas Bie?mann