From: Wolfgang Denk Date: Thu, 01 Oct 2015 22:50:08 +0200 Subject: [U-Boot] [PATCH] Revert "imx: wdog: correct wcr register settings" In-Reply-To: References: <1443727970-10347-1-git-send-email-festevam@gmail.com> <20151001201143.865D8380905@gemini.denx.de> Message-ID: <20151001205008.732FB3822C0@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 Fabio, In message you wrote: > > > I'm sorry, but I fail to understand how writew() can be better than > > another I/O accessor. Neither of these has the capability to detect > > the endianess of this specific register interface ? > > It's not that writew() is better. The problem is that we cannot use > clrsetbits_le16() for a big endian controller. On ARM (a LE architecture), clrsetbits_le16() maps down into: clrsetbits_le16 -> out_le16 / in_le16 -> out_arch, w,le16 / in_arch, w,le16 -> __raw_writew(cpu_to_le16()) / le16__to_cpu(__raw_readw()) -> __raw_writew() / __raw_readw() while writew() -> __raw_writew(cpu_to_le16(v),__mem_pci(c)) __raw_writew() Both map into __raw_writew() [which then boild down into __arch_putw() which is just a volatile unsigned short write access. So both clrsetbits_le16() and writew() are little endian accessors. In which way would one write other data to the device than the other? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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 The human race has one really effective weapon, and that is laughter. - Mark Twain