From patchwork Sun Oct 7 15:56:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Herrmann X-Patchwork-Id: 189852 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5E87E2C0313 for ; Mon, 8 Oct 2012 02:58:07 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 585B3280AD; Sun, 7 Oct 2012 17:57:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R2+uskt4ls7H; Sun, 7 Oct 2012 17:57:47 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0CB1A280CD; Sun, 7 Oct 2012 17:57:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F25B02809D for ; Sun, 7 Oct 2012 17:57:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0IG75LT-ojlY for ; Sun, 7 Oct 2012 17:57:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by theia.denx.de (Postfix) with ESMTPS id 0A0DE280B4 for ; Sun, 7 Oct 2012 17:56:48 +0200 (CEST) Received: by mail-wi0-f174.google.com with SMTP id hq7so2172296wib.9 for ; Sun, 07 Oct 2012 08:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Z07nbrWECus1EYMTcGr3SqYD7FzesMUIuLtuvY9oQfw=; b=lBuXd0GJfl5mqtUnYFOVXyV/+S94rrIMbSo8YMhvzFcQw/LldP+rkMPKcQPByfABGv 8GRbDRYvG1MISvdy5H63DNRRj+SqLe7ybgQukTkDO/UTN6NQR/7RrCGdl4x+Nz4ZYq7k 0DCbQL1kgDAGI1b9ursTb8htK/G+8gDe4XPO1X6rCMv7+tqehqG96wV6BOEHdfvsRO+W thl4BHXWIUPfK37x43yvHch8+o2tXx5hzEMH2F815pN7cY12+Mvd+O7hkRowRGuQvWBA b0aGhRVno+pB0naJSYFK3yhh66it33laHpMzTyx/s7iuP0NNcUwX7cUaTK3rdUnWztFu YUew== Received: by 10.180.8.40 with SMTP id o8mr15104934wia.9.1349625408000; Sun, 07 Oct 2012 08:56:48 -0700 (PDT) Received: from Bloomfield.kolej.mff.cuni.cz (pavelherrmann.kolej.mff.cuni.cz. [78.128.197.20]) by mx.google.com with ESMTPS id ay10sm16450042wib.2.2012.10.07.08.56.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Oct 2012 08:56:47 -0700 (PDT) From: Pavel Herrmann To: u-boot@lists.denx.de Date: Sun, 7 Oct 2012 17:56:12 +0200 Message-Id: <1349625374-12391-9-git-send-email-morpheus.ibis@gmail.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1349625374-12391-1-git-send-email-morpheus.ibis@gmail.com> References: <1349625374-12391-1-git-send-email-morpheus.ibis@gmail.com> Cc: marex@denx.de Subject: [U-Boot] [PATCH 08/10] split AU1X00 specific code from cmd_ide.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Move special case of ide_swap_read() for AU1X00 SoC into SoC-specific directory. Signed-off-by: Pavel Herrmann --- arch/mips/cpu/mips32/au1x00/Makefile | 2 +- arch/mips/cpu/mips32/au1x00/au1x00_ide.c | 33 ++++++++++++++++++++++++++++++++ common/cmd_ide.c | 6 ++---- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 arch/mips/cpu/mips32/au1x00/au1x00_ide.c diff --git a/arch/mips/cpu/mips32/au1x00/Makefile b/arch/mips/cpu/mips32/au1x00/Makefile index dc58475..b9f895d 100644 --- a/arch/mips/cpu/mips32/au1x00/Makefile +++ b/arch/mips/cpu/mips32/au1x00/Makefile @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).o -COBJS = au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o +COBJS = au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o au1x00_ide.o SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_ide.c b/arch/mips/cpu/mips32/au1x00/au1x00_ide.c new file mode 100644 index 0000000..337dd45 --- /dev/null +++ b/arch/mips/cpu/mips32/au1x00/au1x00_ide.c @@ -0,0 +1,33 @@ +/* + * (C) Copyright 2000-2011 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + */ + +#include + +/* AU1X00 swaps data in big-endian mode, enforce little-endian function */ +#ifndef CONFIG_GTH2 /* GTH2 board behaves as it should */ +void ide_input_swap_data(int dev, ulong *sect_buf, int words) +{ + ide_input_data(dev, sect_buf, words); +} + diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 2f3b077..7c8f866 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -503,9 +503,7 @@ void ide_output_data(int dev, const ulong *sect_buf, int words) __attribute__ ((weak, alias("__ide_output_data"))); /* We only need to swap data if we are running on a big endian cpu. */ -/* But Au1x00 cpu:s already swaps data in big endian mode! */ -#if defined(__LITTLE_ENDIAN) || \ - (defined(CONFIG_SOC_AU1X00) && !defined(CONFIG_GTH2)) +#if defined(__LITTLE_ENDIAN) void __ide_input_swap_data(int dev, ulong *sect_buf, int words) { ide_input_data(dev, sect_buf, words); @@ -533,7 +531,7 @@ void __ide_input_swap_data(int dev, ulong *sect_buf, int words) #endif /* !MIPS */ } } -#endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */ +#endif /* __LITTLE_ENDIAN */ #if defined(CONFIG_IDE_SWAP_IO)