From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric =?UTF-8?B?QsOpbmFyZA==?= Date: Thu, 27 Mar 2014 08:40:05 +0100 Subject: [U-Boot] [PATCH v2 2/2] MarSBoard: add new board In-Reply-To: <5333CDA6.2090306@denx.de> References: <20140326190257.CFD5A380370@gemini.denx.de> <1395869509-14263-1-git-send-email-eric@eukrea.com> <1395869509-14263-2-git-send-email-eric@eukrea.com> <5333CDA6.2090306@denx.de> Message-ID: <20140327084005.0370479b@e6520eb> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefan, Le Thu, 27 Mar 2014 08:05:10 +0100, Stefan Roese a ?crit : > Yes, I agree. #ifdef's are ugly. But code duplication is also a problem > as Wolfgang has mentioned. > > Isn't there a way to detect the board type at runtime somehow (via CPU > type or GPIO input, ...)? And then dynamically configure the board > either for "RiOT" or "MarS"? This would make the code a bit more complex > of course. But there would be no #ifdef's and no code duplication. And > you would only have to maintain one U-Boot binary / version for both boards. > > So, what do you think? Is this possible? > Thanks for the idea, that's possible by detecting i.MX6Solo vs i.MX6Dual. I'll try to implement that. Eric