From: Wolfgang Denk Date: Mon, 21 Sep 2009 10:48:35 +0200 Subject: [U-Boot] [PATCH 3/6] sbc8548: use I/O accessors In-Reply-To: References: <1253493366-26427-1-git-send-email-paul.gortmaker@windriver.com> <4b92f833dfac8470519a71aee9833c0c67edadbf.1253492532.git.paul.gortmaker@windriver.com> Message-ID: <20090921084835.6F291832E864@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Graeme Russ, In message you wrote: > > > - ecm->eedr = 0xffffffff; /* clear ecm errors */ > > - ecm->eeer = 0xffffffff; /* enable ecm errors */ > > + out_be32(&ecm->eedr, 0xffffffff); /* clear ecm errors */ > > + out_be32(&ecm->eeer, 0xffffffff); /* enable ecm errors */ > > return 0; > > Correct me if I'm wrong, but I thought the general rule was the other > way (i.e. the way it alreay was). See for example: You are wrong. We must use I/O accessors. > http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commit;h=ed7a1b681de1e31d18d5b92e2767ae8df3241687 Ouch. This patch is clearly bloken. Sorry it escaped my attention. Using a C structure to describe the hardware is a good thing, but we still must use I/O accessors to access the registers. This needs to be fixed in your code. > This prevents, for example, accidentally writing words and longs to byte > sized registers. Right. The I/O accessors still allow for strict type checking. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "What is wanted is not the will to believe, but the will to find out, which is the exact opposite." - Bertrand Russell, _Sceptical_Essays_, 1928