From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Tue, 17 May 2011 20:00:09 +0530 Subject: [U-Boot] [PATCH v2 16/22] omap4: calculate EMIF register values In-Reply-To: References: <1298893591-17636-1-git-send-email-aneesh@ti.com> <1305472900-4004-17-git-send-email-aneesh@ti.com> <20110515200523.A1A4C1491B06@gemini.denx.de> Message-ID: <4DD28671.9040001@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 Mans, On Monday 16 May 2011 02:12 AM, M?ns Rullg?rd wrote: > Wolfgang Denk writes: > >> Dear Aneesh V, >> >> In message<1305472900-4004-17-git-send-email-aneesh@ti.com> you wrote: >>> Calculate EMIF register values based on AC timing parameters >>> from the SDRAM datasheet and the DDR frequency rather than >>> using the hard-coded values. >>> >>> For a new board the user doen't have to go through the tedious >>> process of calculating the register values. Instead, just >>> provide the AC timings from the device data sheet as input >>> and the driver will automatically calculate the register values. >> >> Does it make sense to do this in the driver code? These parameters >> will never change, so why can we not rather perform the computation >> only once, at build time, and feed in the respective parameters to the >> driver? > > I agree, there should be no reason for doing this at runtime. I would > think it possible to do with some C macros. > I had a C macro version earlier. But as I have mentioned in my reply to Wolfgang some of the inputs vary between different revisions of our silicon. I am doing a run-time identification of the revision and doing the settings accordingly. Besides, the forest of MACROs was really ugly. best regards, Aneesh