From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Wed, 28 Nov 2007 16:16:42 -0600 Subject: [U-Boot-Users] [PATCH][FDT][UPDATE] Add common memory fixup function In-Reply-To: References: Message-ID: <474DE8CA.7020707@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Kumar Gala wrote: > + addrcell = fdt_getprop(blob, 0, "#address-cells", NULL); > + /* use shifts and mask to ensure endianness */ > + if ((addrcell) && (*addrcell == 2)) { > + tmp[0] = (start >> 56) & 0xff; > + tmp[1] = (start >> 48) & 0xff; > + tmp[2] = (start >> 40) & 0xff; > + tmp[3] = (start >> 32) & 0xff; > + tmp[4] = (start >> 24) & 0xff; > + tmp[5] = (start >> 16) & 0xff; > + tmp[6] = (start >> 8) & 0xff; > + tmp[7] = (start ) & 0xff; > + len = 8; > + } else { > + tmp[0] = (start >> 24) & 0xff; > + tmp[1] = (start >> 16) & 0xff; > + tmp[2] = (start >> 8) & 0xff; > + tmp[3] = (start ) & 0xff; > + len = 4; > + } Could we please use the existing byteswapping functions? -Scott