From: Reinhard Meyer Date: Mon, 05 Jul 2010 17:37:57 +0200 Subject: [U-Boot] cmd_date.c error or itention? In-Reply-To: <20100705144410.392FDFA8F0@gemini.denx.de> References: <4C31C596.5020905@emk-elektronik.de> <20100705125553.A9367FA8F0@gemini.denx.de> <4C31ED2B.1020707@emk-elektronik.de> <20100705144410.392FDFA8F0@gemini.denx.de> Message-ID: <4C31FC55.8070104@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk schrieb: > Dear Reinhard Meyer, > > In message <4C31ED2B.1020707@emk-elektronik.de> you wrote: >> As well as there is a difference between read error and file not found, >> there well might be a difference in clock nonfunctional and time invalid... > > Indeed. > >> But alas, I will make rtc_get not return an error and zero out the tm >> structure instead when the driver KNOWS the date is not correct. > > Why would you do that? This prevents anybody trying to track down > problems from seeing what is really going on. When you retrun the > real (incorrect) data, I can see if the attempt to set the date shows > any affect at all - with your method I don't see anything at all. > So far no AT91SAM9xxx board has a date command in u-boot. The kernel as it is will not set the system time when the offset register is zero. If the register is non-zero the time will be used. I'm just trying to have the same behaviour in u-boot. Besides your argumentation is flawed: why try to READ the clock when I am going to set it anyway? This reading and the following if just increase the code size :) Now setting the clock still gives the warning (puts() in the driver) that the time is invalid (because the time is read before overwritten). I think that is more irritating. So your suggestions is then to have the driver not say anything at all, just return OK and a bogus value... Reinhard -------------- next part -------------- A non-text attachment was scrubbed... Name: reinhard_meyer.vcf Type: text/x-vcard Size: 370 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20100705/613c82f4/attachment.vcf