From patchwork Mon Dec 19 12:38:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hui X-Patchwork-Id: 5869 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D56E623E04 for ; Mon, 19 Dec 2011 12:29:15 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id C656FA18062 for ; Mon, 19 Dec 2011 12:29:15 +0000 (UTC) Received: by eaac11 with SMTP id c11so1837105eaa.11 for ; Mon, 19 Dec 2011 04:29:15 -0800 (PST) Received: by 10.204.136.194 with SMTP id s2mr1316778bkt.96.1324297755520; Mon, 19 Dec 2011 04:29:15 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs4611bkc; Mon, 19 Dec 2011 04:29:15 -0800 (PST) Received: by 10.52.31.166 with SMTP id b6mr10884802vdi.70.1324297753327; Mon, 19 Dec 2011 04:29:13 -0800 (PST) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe005.messaging.microsoft.com. [216.32.181.185]) by mx.google.com with ESMTPS id ek4si9035893vdb.131.2011.12.19.04.29.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Dec 2011 04:29:13 -0800 (PST) Received-SPF: neutral (google.com: 216.32.181.185 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) client-ip=216.32.181.185; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.185 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) smtp.mail=jason.hui@linaro.org Received: from mail151-ch1-R.bigfish.com (10.43.68.244) by CH1EHSOBE008.bigfish.com (10.43.70.58) with Microsoft SMTP Server id 14.1.225.23; Mon, 19 Dec 2011 12:29:06 +0000 Received: from mail151-ch1 (localhost [127.0.0.1]) by mail151-ch1-R.bigfish.com (Postfix) with ESMTP id 40F0C4C00FB; Mon, 19 Dec 2011 12:29:29 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail151-ch1 (localhost.localdomain [127.0.0.1]) by mail151-ch1 (MessageSwitch) id 132429776723333_21749; Mon, 19 Dec 2011 12:29:27 +0000 (UTC) Received: from CH1EHSMHS023.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.250]) by mail151-ch1.bigfish.com (Postfix) with ESMTP id 005585C0047; Mon, 19 Dec 2011 12:29:27 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS023.bigfish.com (10.43.70.23) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 19 Dec 2011 12:29:04 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.355.3; Mon, 19 Dec 2011 06:29:09 -0600 Received: from r64343-desktop.ap.freescale.net (r64343-desktop.ap.freescale.net [10.192.242.36]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id pBJCT6iC003689; Mon, 19 Dec 2011 06:29:07 -0600 (CST) From: Jason Liu To: CC: Subject: [PATCH] i.mx6:imx6q: allign MAC address with burned-in ordering Date: Mon, 19 Dec 2011 20:38:13 +0800 Message-ID: <1324298293-14900-1-git-send-email-jason.hui@linaro.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com For the i.mx6q, the burned-in MAC address will be the following odering, fuse: 0x620[7:0] MAC_ADDR[7:0] ---> mac[5] fuse: 0x620[15:8] MAC_ADDR[15:8] ---> mac[4] fuse: 0x620[23:16] MAC_ADDR[23:16] ---> mac[3] fuse: 0x620[31:24] MAC_ADDR[31:24] ---> mac[2] fuse: 0x630[7:0] MAC_ADDR[39:32] ---> mac[1] fuse: 0x630[15:8] MAC_ADDR[47:40] ---> mac[0] This patch also fix the error caculation for the fuse bank[0] address Signed-off-by: Jason Liu Cc: Stefano Babic --- arch/arm/cpu/armv7/mx6/soc.c | 14 ++++++++------ arch/arm/include/asm/arch-mx6/imx-regs.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index dff5e4e..bd59cf5 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -70,13 +70,15 @@ void imx_get_mac_from_fuse(unsigned char *mac) struct fuse_bank4_regs *fuse = (struct fuse_bank4_regs *)bank->fuse_regs; - u32 mac_lo = readl(&fuse->mac_addr_low); - u32 mac_hi = readl(&fuse->mac_addr_high); + u32 value = readl(&fuse->mac_addr_high); + mac[0] = (value >> 8); + mac[1] = value ; - *(u32 *)mac = mac_lo; - - mac[4] = mac_hi & 0xff; - mac[5] = (mac_hi >> 8) & 0xff; + value = readl(&fuse->mac_addr_low); + mac[2] = value >> 24 ; + mac[3] = value >> 16 ; + mac[4] = value >> 8 ; + mac[5] = value ; } #endif diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 85d55b7..5fe9748 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -214,7 +214,7 @@ struct iim_regs { u32 crc_value; u32 rsvd6[3]; u32 version; - u32 rsvd7[0xd8]; + u32 rsvd7[0xdb]; struct fuse_bank { u32 fuse_regs[0x20];