From patchwork Tue Oct 27 10:47:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 56073 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9RAqubH031219 for ; Tue, 27 Oct 2009 10:52:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753739AbZJ0Kw3 (ORCPT ); Tue, 27 Oct 2009 06:52:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753738AbZJ0Kw2 (ORCPT ); Tue, 27 Oct 2009 06:52:28 -0400 Received: from mail-pz0-f188.google.com ([209.85.222.188]:57451 "EHLO mail-pz0-f188.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753706AbZJ0Kw0 (ORCPT ); Tue, 27 Oct 2009 06:52:26 -0400 Received: by pzk26 with SMTP id 26so9875pzk.4 for ; Tue, 27 Oct 2009 03:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=RSJAmzFnQcMAcIqpMT9ex33X9VugBONKCR7t1gLIHnY=; b=hhZEA0fe81bGXPsHnuvUBjyDFzfY+xrom2shOypVGl1TQIRXgp9+DqqZBJGiY/c1M9 oAkdqqF07lfAOL8jqbqr5jj70VLfHm3ZXpl8K4NbgdTg2WAc3rSBXTKePXO2fuKy+mEk c02YCo6Y7hWsDteYxQ+8W/cDl5Bwd0Idzb3u4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=Un+mH0FdI8pQKggrRdN5wGICMO66AmfWpr5TexF3UH2KhQMEKR8AEvuw4iduugY2Qx jY3OvuGiIzu8nFg3ZGceky0SeIlaaaFcYy4BDB1CsboI4luzguuJtFEjQx3D6bl/jRR3 Rv80I3jLerMOdhZTjhTYt5w7c+DCLBAXzrLBw= Received: by 10.115.100.4 with SMTP id c4mr25246000wam.13.1256640750710; Tue, 27 Oct 2009 03:52:30 -0700 (PDT) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 23sm815550pzk.4.2009.10.27.03.52.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Oct 2009 03:52:29 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Tue, 27 Oct 2009 19:47:34 +0900 Message-Id: <20091027104734.26330.25913.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: mac address through private data for sh_eth on ms7724se Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/arch/sh/boards/mach-se/7724/setup.c +++ work/arch/sh/boards/mach-se/7724/setup.c 2009-10-27 18:07:05.000000000 +0900 @@ -507,7 +507,7 @@ static int __init sh_eth_is_eeprom_ready static void __init sh_eth_init(void) { int i; - u16 mac[3]; + u16 mac; /* check EEPROM status */ if (!sh_eth_is_eeprom_ready()) @@ -521,16 +521,10 @@ static void __init sh_eth_init(void) if (!sh_eth_is_eeprom_ready()) return; - mac[i] = ctrl_inw(EEPROM_DATA); - mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */ + mac = ctrl_inw(EEPROM_DATA); + sh_eth_plat.mac_addr[i << 1] = mac & 0xff; + sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8; } - - /* reset sh-eth */ - ctrl_outl(0x1, SH_ETH_ADDR + 0x0); - - /* set MAC addr */ - ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR); - ctrl_outl((mac[2]), SH_ETH_MALR); } #define SW4140 0xBA201000