
Hi Mans,
On Monday 16 May 2011 02:12 AM, Måns Rullgård wrote:
Wolfgang Denkwd@denx.de writes:
Dear Aneesh V,
In message1305472900-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