From patchwork Fri Feb 8 23:17:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 2119021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 0328F3FD56 for ; Fri, 8 Feb 2013 23:24:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U3xGR-0003rC-67; Fri, 08 Feb 2013 23:21:51 +0000 Received: from ducie-dc1.codethink.co.uk ([37.128.190.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U3xCr-0001CS-2N for linux-arm-kernel@lists.infradead.org; Fri, 08 Feb 2013 23:18:15 +0000 Received: by ducie-dc1.codethink.co.uk (Postfix, from userid 1002) id 9016746C611; Fri, 8 Feb 2013 23:18:02 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ducie-dc1.codethink.co.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=6.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [192.168.24.216]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 7905246C62B; Fri, 8 Feb 2013 23:18:00 +0000 (GMT) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.80) (envelope-from ) id 1U3xCj-0006Xn-FR; Fri, 08 Feb 2013 23:18:01 +0000 From: Ben Dooks To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/17] ARM: update atag-to-fdt code to be endian agnostic Date: Fri, 8 Feb 2013 23:17:40 +0000 Message-Id: <1360365467-25056-11-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360365467-25056-1-git-send-email-ben.dooks@codethink.co.uk> References: <1360365467-25056-1-git-send-email-ben.dooks@codethink.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130208_181809_365088_D244DFC9 X-CRM114-Status: GOOD ( 13.34 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Ben Dooks X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The atag-to-fdt code can now use the conversion function we introduced previously to avoid it having to know about the endian-ness of the environment which booted the processor. Signed-off-by: Ben Dooks Acked-by: Nicolas Pitre --- arch/arm/boot/compressed/atags_to_fdt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/compressed/atags_to_fdt.c b/arch/arm/boot/compressed/atags_to_fdt.c index aabc02a..a64ec71 100644 --- a/arch/arm/boot/compressed/atags_to_fdt.c +++ b/arch/arm/boot/compressed/atags_to_fdt.c @@ -108,9 +108,9 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) return 0; /* validate the ATAG */ - if (atag->hdr.tag != ATAG_CORE || - (atag->hdr.size != tag_size(tag_core) && - atag->hdr.size != 2)) + if (atag->hdr.tag != atag32_to_cpu(ATAG_CORE) || + (atag->hdr.size != atag32_to_cpu(tag_size(tag_core)) && + atag->hdr.size != atag32_to_cpu(2))) return 1; /* let's give it all the room it could need */ @@ -132,17 +132,17 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) else setprop_string(fdt, "/chosen", "bootargs", atag->u.cmdline.cmdline); - } else if (atag->hdr.tag == ATAG_MEM) { + } else if (atag->hdr.tag == atag32_to_cpu(ATAG_MEM)) { if (memcount >= sizeof(mem_reg_property)/4) continue; - if (!atag->u.mem.size) + if (!atag32_to_cpu(atag->u.mem.size)) continue; - mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.start); - mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.size); - } else if (atag->hdr.tag == ATAG_INITRD2) { + mem_reg_property[memcount++] = cpu_to_fdt32(atag32_to_cpu(atag->u.mem.start)); + mem_reg_property[memcount++] = cpu_to_fdt32(atag32_to_cpu(atag->u.mem.size)); + } else if (atag->hdr.tag == atag32_to_cpu(ATAG_INITRD2)) { uint32_t initrd_start, initrd_size; - initrd_start = atag->u.initrd.start; - initrd_size = atag->u.initrd.size; + initrd_start = atag32_to_cpu(atag->u.initrd.start); + initrd_size = atag32_to_cpu(____atag->u.initrd.size); setprop_cell(fdt, "/chosen", "linux,initrd-start", initrd_start); setprop_cell(fdt, "/chosen", "linux,initrd-end",