From dbb713baa608d3397e56bc32b26d2efe07c756ee Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sun, 26 May 2013 12:11:27 +0200 Subject: mmc: ftsdc010_mci: fix build error if CONFIG_FTSDC010_SDIO is not defined The FTSDC010_DCR_FIFO_RST symbol is conditionally defined in and it is available available when CONFIG_FTSDC010_SDIO is enabled. However the actual driver code unconditionally uses the FTSDC010_DCR_FIFO_RST constant and this causes build error if CONFIG_FTSDC010_SDIO is not enabled. The following error happens when compiling for the adp-ag101 board: ftsdc010_mci.c: In function 'ftsdc010_request': ftsdc010_mci.c:178: error: 'FTSDC010_DCR_FIFO_RST' undeclared (first use in this function) ftsdc010_mci.c:178: error: (Each undeclared identifier is reported only once ftsdc010_mci.c:178: error: for each function it appears in.) The patch ensures that the FTSDC010_DCR_FIFO_RST symbol gets used only if CONFIG_FTSDC010_SDIO is defined. Compile tested only. Cc: Kuo-Jung Su Cc: Macpaul Lin Signed-off-by: Gabor Juhos Reviewed-by: Kuo-Jung Su --- drivers/mmc/ftsdc010_mci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/ftsdc010_mci.c b/drivers/mmc/ftsdc010_mci.c index 562b14a..1fcb97c 100644 --- a/drivers/mmc/ftsdc010_mci.c +++ b/drivers/mmc/ftsdc010_mci.c @@ -175,7 +175,11 @@ static int ftsdc010_request(struct mmc *mmc, struct mmc_cmd *cmd, len = data->blocksize * data->blocks; /* 1. data disable + fifo reset */ - writel(FTSDC010_DCR_FIFO_RST, ®s->dcr); + dcr = 0; +#ifdef CONFIG_FTSDC010_SDIO + dcr |= FTSDC010_DCR_FIFO_RST; +#endif + writel(dcr, ®s->dcr); /* 2. clear status register */ writel(FTSDC010_STATUS_DATA_MASK | FTSDC010_STATUS_FIFO_URUN -- cgit v1.1 From c575180bae9b6baa8aa06e832f81ff41264f5707 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sun, 26 May 2013 12:11:28 +0200 Subject: block: constify sect_buf argument of ide_write_data Add a const keyword to the sect_buf argument of ide_write_data to fix the following warning: cmd_ide.c: In function '__ide_output_data': cmd_ide.c:548: warning: passing argument 2 of 'ide_write_data' discards qualifiers from pointer target type /devel/u-boot.git/include/ide.h:76: note: expected 'ulong *' but argument is of type 'const ulong *' Also modify the driver-model documentation to match with the new prototype. Compile tested only. Cc: Macpaul Lin Signed-off-by: Gabor Juhos --- drivers/block/ftide020.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/block/ftide020.c b/drivers/block/ftide020.c index ad8fdad..61900ba 100644 --- a/drivers/block/ftide020.c +++ b/drivers/block/ftide020.c @@ -81,7 +81,7 @@ void ide_write_register(int dev, unsigned int port, unsigned char val) IDE_REG_DA_WRITE(port) | val); } -void ide_write_data(int dev, ulong *sect_buf, int words) +void ide_write_data(int dev, const ulong *sect_buf, int words) { static struct ftide020_s *ftide020 = (struct ftide020_s *) FTIDE_BASE; -- cgit v1.1 From b979cba9da8aa859f4dcec9b9036eb9ca0f13210 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sun, 26 May 2013 12:11:29 +0200 Subject: pci: add prototype for pci_ftpci_init() function The pci_ftpci_init() function is implemented in 'drivers/pci/pci_ftpci100.c' however it is always called by external code. Add function declaration into ftpci100.h to make it visible for external code. Compile tested only. Cc: Macpaul Lin Signed-off-by: Gabor Juhos --- drivers/pci/pci_ftpci100.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/pci/pci_ftpci100.h b/drivers/pci/pci_ftpci100.h index 19c81a8..7a4945a 100644 --- a/drivers/pci/pci_ftpci100.h +++ b/drivers/pci/pci_ftpci100.h @@ -76,6 +76,8 @@ struct ftpci100_ahbc { #define FTPCI100_BRIDGE_VENDORID 0x159b #define FTPCI100_BRIDGE_DEVICEID 0x4321 +void pci_ftpci_init(void); + struct pcibar { unsigned int size; unsigned int addr; -- cgit v1.1 From 8599515f42cd51009bb3b0bf8f48e1181b058537 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sun, 26 May 2013 12:11:30 +0200 Subject: pci: move pci_ftpci100.h to include/faraday/ftpci100.h Even though the header files is used only by the pci_ftpci100 driver, it contains declaration for a function which is used by external code. Move the header file to a common location which lets external code use it. Compile tested only. Cc: Macpaul Lin Signed-off-by: Gabor Juhos --- drivers/pci/pci_ftpci100.c | 4 +- drivers/pci/pci_ftpci100.h | 96 ---------------------------------------------- 2 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 drivers/pci/pci_ftpci100.h (limited to 'drivers') diff --git a/drivers/pci/pci_ftpci100.c b/drivers/pci/pci_ftpci100.c index a795a97..df7f615 100644 --- a/drivers/pci/pci_ftpci100.c +++ b/drivers/pci/pci_ftpci100.c @@ -23,11 +23,11 @@ #include #include +#include + #include #include /* u32, u16.... used by pci.h */ -#include "pci_ftpci100.h" - struct ftpci100_data { unsigned int reg_base; unsigned int io_base; diff --git a/drivers/pci/pci_ftpci100.h b/drivers/pci/pci_ftpci100.h deleted file mode 100644 index 7a4945a..0000000 --- a/drivers/pci/pci_ftpci100.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Faraday FTPCI100 PCI Bridge Controller Device Driver Implementation - * - * Copyright (C) 2010 Andes Technology Corporation - * Gavin Guo, Andes Technology Corporation - * Macpaul Lin, Andes Technology Corporation - * - * 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 - */ - -#ifndef __FTPCI100_H -#define __FTPCI100_H - -/* AHB Control Registers */ -struct ftpci100_ahbc { - unsigned int iosize; /* 0x00 - I/O Space Size Signal */ - unsigned int prot; /* 0x04 - AHB Protection */ - unsigned int rsved[8]; /* 0x08-0x24 - Reserved */ - unsigned int conf; /* 0x28 - PCI Configuration */ - unsigned int data; /* 0x2c - PCI Configuration DATA */ -}; - -/* - * FTPCI100_IOSIZE_REG's constant definitions - */ -#define FTPCI100_BASE_IO_SIZE(x) (ffs(x) - 1) /* 1M - 2048M */ - -/* - * PCI Configuration Register - */ -#define PCI_INT_MASK 0x4c -#define PCI_MEM_BASE_SIZE1 0x50 -#define PCI_MEM_BASE_SIZE2 0x54 -#define PCI_MEM_BASE_SIZE3 0x58 - -/* - * PCI_INT_MASK's bit definitions - */ -#define PCI_INTA_ENABLE (1 << 22) -#define PCI_INTB_ENABLE (1 << 23) -#define PCI_INTC_ENABLE (1 << 24) -#define PCI_INTD_ENABLE (1 << 25) - -/* - * PCI_MEM_BASE_SIZE1's constant definitions - */ -#define FTPCI100_BASE_ADR_SIZE(x) ((ffs(x) - 1) << 16) /* 1M - 2048M */ - -#define FTPCI100_MAX_FUNCTIONS 20 -#define PCI_IRQ_LINES 4 - -#define MAX_BUS_NUM 256 -#define MAX_DEV_NUM 32 -#define MAX_FUN_NUM 8 - -#define PCI_MAX_BAR_PER_FUNC 6 - -/* - * PCI_MEM_SIZE - */ -#define FTPCI100_MEM_SIZE(x) (ffs(x) << 24) - -/* This definition is used by pci_ftpci_init() */ -#define FTPCI100_BRIDGE_VENDORID 0x159b -#define FTPCI100_BRIDGE_DEVICEID 0x4321 - -void pci_ftpci_init(void); - -struct pcibar { - unsigned int size; - unsigned int addr; -}; - -struct pci_config { - unsigned int bus; - unsigned int dev; /* device */ - unsigned int func; - unsigned int pin; - unsigned short v_id; /* vendor id */ - unsigned short d_id; /* device id */ - struct pcibar bar[PCI_MAX_BAR_PER_FUNC + 1]; -}; - -#endif -- cgit v1.1