From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Thu, 02 Jun 2011 21:03:20 +0530 Subject: [U-Boot] [PATCH v2 09/22] omap4: add spl support for OMAP4 SDP In-Reply-To: <4DDE54E5.7080404@ti.com> References: <1298893591-17636-1-git-send-email-aneesh@ti.com> <1305472900-4004-10-git-send-email-aneesh@ti.com> <20110515183343.9D6771491B06@gemini.denx.de> <4DD134DD.6040802@ti.com> <20110516154814.D92D81491B07@gemini.denx.de> <4DD21FB9.6070901@ti.com> <20110517081949.54B731491B09@gemini.denx.de> <4DD26B36.4050102@ti.com> <20110517125309.A50B81491B09@gemini.denx.de> <4DDE54E5.7080404@ti.com> Message-ID: <4DE7AD40.5080504@ti.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 Wolfgang, What's your final view on the Makefile structure of SPL. best regards, Aneesh On Thursday 26 May 2011 06:55 PM, Aneesh V wrote: > Hi Wolfgang, > > On Tuesday 17 May 2011 06:23 PM, Wolfgang Denk wrote: >> Dear Aneesh V, >> >> In message<4DD26B36.4050102@ti.com> you wrote: >>> >>> And how do you distinguish between the two cases at the top level >>> Makefile? Using a CONFIG flag or on a per platform basis? >> >> The decision should not be make in the top level makefile, but in >> spl/Makefile. And this can simply check if a board directory exists >> in the first place. > > 1. How about the case where there is some board dependent code but also > code shared by the boards(SoC based code). Will we have different > 'Makefile's then - one for board and one for SoC. Will we then build > different libraries at each leavel and link them together etc? > > 2. I think one key thing that you are perhaps missing is that in SPL > the board level Makefile is not just meant for board level files. > Instead it is used to pull together files from all the layers and make > a custom image. IMHO, we will get into un-necessary complexities if we > lose this property of SPL. We may rather spend efforts on making the > regular U-Boot more configurable. > >> >>> Why not just invoke the board level Makefile from the top-level >>> Makefile and let it decide about the code-reuse by doing something like >>> I did? >> >> Because then we need board specific directories and board specific >> Makefiles even for those boards where no board specific code exists, >> and all these Makefiles will be semi-identical copies of each other. >> > > Considering point 2 above I think this is logical. > > The board level Makefile needs to have all the files. For the SoC level > selection of files and the SoC level rules, include the respective *.mk > files. Because in this case there are no board specific files there is > nothing more in the Makefile. Please note that this may not be the case > in general. Most boards, I suspect, may have some board specific files > too. > > I wouldn't really consider the include statements as duplication of > code. Instead, that was a way of avoiding duplication of code "given > the constraints of the SPL model". > > best regards, > Aneesh > >>>> Then we should adapt the directory and Makefile structure and allow >>>> for such common code without need for separate spl/board/ >>>> directories. >>> >>> Do you have any specific proposals? I have a feeling that this may get >>> un-necessarily complicated. >> >> Having to maintain multiple copies of identical Makefiles is more >> complicated and error prone in the long run. Let's rather spoend a few >> thoughts initially and solve this problem before it spreads. >> >> Best regards, >> >> Wolfgang Denk >>