From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Tue, 17 May 2011 12:10:03 +0530 Subject: [U-Boot] [PATCH v2 02/22] omap4: add OMAP4430 revision check In-Reply-To: <20110516153551.2E2141491B07@gemini.denx.de> References: <1298893591-17636-1-git-send-email-aneesh@ti.com> <1305472900-4004-3-git-send-email-aneesh@ti.com> <20110515190911.787031491B06@gemini.denx.de> <4DD11511.1060208@ti.com> <20110516153551.2E2141491B07@gemini.denx.de> Message-ID: <4DD21843.4060000@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, On Monday 16 May 2011 09:05 PM, Wolfgang Denk wrote: > Dear Aneesh V, > ... >> >> 1. Please note that the above function is just for getting the string >> not for the revision itself. To get the revision we have >> omap4_revision(). > > Well, when you already have such a funxction, then why cannot it be > made to return useful values that are well-suited for formatting? > > Instead of > > #define OMAP4430_ES1_0 1 > #define OMAP4430_ES2_0 2 > #define OMAP4430_ES2_1 3 > #define OMAP4430_ES2_2 4 > > you could use > > #define OMAP4430_ES1_0 10 > #define OMAP4430_ES2_0 20 > #define OMAP4430_ES2_1 21 > #define OMAP4430_ES2_2 22 > > And then use a plain > > sprintf(omap4_rev, "OMAP4430 ES%d.%d", rev/10, rev%10); > > or similar. This is a good idea. The only minor hitch is that OMAP4460 will come into picture in near future, again having at least ES1_0. But I think that can be worked out. best regards, Aneesh