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 --- include/ide.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/ide.h b/include/ide.h index 59ea975..0269d51 100644 --- a/include/ide.h +++ b/include/ide.h @@ -76,7 +76,7 @@ int ide_device_present(int dev); unsigned char ide_read_register(int dev, unsigned int port); void ide_write_register(int dev, unsigned int port, unsigned char val); void ide_read_data(int dev, ulong *sect_buf, int words); -void ide_write_data(int dev, ulong *sect_buf, int words); +void ide_write_data(int dev, const ulong *sect_buf, int words); #endif /* -- 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 --- include/faraday/ftpci100.h | 96 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 include/faraday/ftpci100.h (limited to 'include') diff --git a/include/faraday/ftpci100.h b/include/faraday/ftpci100.h new file mode 100644 index 0000000..7a4945a --- /dev/null +++ b/include/faraday/ftpci100.h @@ -0,0 +1,96 @@ +/* + * 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 From 3c016704d9c5418479e68e4690759cb2be6f90d3 Mon Sep 17 00:00:00 2001 From: ken kuo Date: Sat, 8 Jun 2013 11:14:09 +0800 Subject: nds32: Enable two banks of SDRAM on Andes board The original adp-ag101/adp-ag101p initialize only one bank(64MB) by default at boot time, but it is not enough for some application, so increasing to two banks(128M). Signed-off-by: Kuan-Yu Kuo Cc: Macpaul Lin --- include/configs/adp-ag101.h | 10 +++++++++- include/configs/adp-ag101p.h | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/adp-ag101.h b/include/configs/adp-ag101.h index b6e3844..1b84b04 100644 --- a/include/configs/adp-ag101.h +++ b/include/configs/adp-ag101.h @@ -235,6 +235,11 @@ #define CONFIG_SYS_FTSDMC021_BANK0_BSR (FTSDMC021_BANK_ENABLE | \ CONFIG_SYS_FTSDMC021_BANK0_BASE) +#define CONFIG_SYS_FTSDMC021_BANK1_BASE \ + (CONFIG_SYS_FTAHBC020S_SLAVE_BSR_BASE + (PHYS_SDRAM_0_SIZE >> 20)) +#define CONFIG_SYS_FTSDMC021_BANK1_BSR (FTSDMC021_BANK_ENABLE | \ + CONFIG_SYS_FTSDMC021_BANK1_BASE) + #endif /* @@ -248,9 +253,12 @@ #else /* !CONFIG_SKIP_LOWLEVEL_INIT && !CONFIG_MEM_REMAP */ #define PHYS_SDRAM_0 0x10000000 /* SDRAM Bank #1 */ #endif +#define PHYS_SDRAM_1 \ + (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE) /* SDRAM Bank #2 */ -#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ +#define CONFIG_NR_DRAM_BANKS 2 /* we have 2 bank of DRAM */ #define PHYS_SDRAM_0_SIZE 0x04000000 /* 64 MB */ +#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */ #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_0 diff --git a/include/configs/adp-ag101p.h b/include/configs/adp-ag101p.h index ef55e35..cec89f6 100644 --- a/include/configs/adp-ag101p.h +++ b/include/configs/adp-ag101p.h @@ -236,6 +236,10 @@ #define CONFIG_SYS_FTSDMC021_BANK0_BSR (FTSDMC021_BANK_ENABLE | \ CONFIG_SYS_FTSDMC021_BANK0_BASE) +#define CONFIG_SYS_FTSDMC021_BANK1_BASE \ + (CONFIG_SYS_FTAHBC020S_SLAVE_BSR_BASE + (PHYS_SDRAM_0_SIZE >> 20)) +#define CONFIG_SYS_FTSDMC021_BANK1_BSR (FTSDMC021_BANK_ENABLE | \ + CONFIG_SYS_FTSDMC021_BANK1_BASE) #endif /* @@ -249,9 +253,12 @@ #else /* !CONFIG_SKIP_LOWLEVEL_INIT && !CONFIG_MEM_REMAP */ #define PHYS_SDRAM_0 0x10000000 /* SDRAM Bank #1 */ #endif +#define PHYS_SDRAM_1 \ + (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE) /* SDRAM Bank #2 */ -#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ +#define CONFIG_NR_DRAM_BANKS 2 /* we have 2 bank of DRAM */ #define PHYS_SDRAM_0_SIZE 0x04000000 /* 64 MB */ +#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */ #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_0 -- cgit v1.1 From 61ccf082e7ca2e6bb20b4004fd629883a3f8a2c1 Mon Sep 17 00:00:00 2001 From: ken kuo Date: Sat, 8 Jun 2013 11:14:11 +0800 Subject: nds32: Enable SDIO and EXT2 command support for Andes board Signed-off-by: Kuan-Yu Kuo Cc: Macpaul Lin --- include/configs/adp-ag101.h | 2 ++ include/configs/adp-ag101p.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/configs/adp-ag101.h b/include/configs/adp-ag101.h index 1b84b04..85dbad2 100644 --- a/include/configs/adp-ag101.h +++ b/include/configs/adp-ag101.h @@ -116,7 +116,9 @@ #define CONFIG_DOS_PARTITION #define CONFIG_FTSDC010 #define CONFIG_FTSDC010_NUMBER 1 +#define CONFIG_FTSDC010_SDIO #define CONFIG_CMD_FAT +#define CONFIG_CMD_EXT2 /* * Command line configuration. diff --git a/include/configs/adp-ag101p.h b/include/configs/adp-ag101p.h index cec89f6..6085208 100644 --- a/include/configs/adp-ag101p.h +++ b/include/configs/adp-ag101p.h @@ -116,7 +116,9 @@ #define CONFIG_DOS_PARTITION #define CONFIG_FTSDC010 #define CONFIG_FTSDC010_NUMBER 1 +#define CONFIG_FTSDC010_SDIO #define CONFIG_CMD_FAT +#define CONFIG_CMD_EXT2 /* * Command line configuration. -- cgit v1.1 From e3c58b029255f5acf5471e5992efd7f84b77ebad Mon Sep 17 00:00:00 2001 From: ken kuo Date: Sat, 8 Jun 2013 11:14:12 +0800 Subject: nds32: Enable the function of passing parameters to Linux Add a header file, setup.h, which copy from Linux source code, this file contain structures are used to pass initialisation parameters to Linux. Enable this function on adp-ag101/adp-ag101p target Signed-off-by: Kuan-Yu Kuo Cc: Macpaul Lin --- include/common.h | 1 + include/configs/adp-ag101.h | 7 +++++++ include/configs/adp-ag101p.h | 7 +++++++ 3 files changed, 15 insertions(+) (limited to 'include') diff --git a/include/common.h b/include/common.h index e5220cf..e254c52 100644 --- a/include/common.h +++ b/include/common.h @@ -421,6 +421,7 @@ static inline int setenv_addr(const char *varname, const void *addr) #endif #ifdef CONFIG_NDS32 # include +# include # include #endif /* CONFIG_NDS32 */ #ifdef CONFIG_MIPS diff --git a/include/configs/adp-ag101.h b/include/configs/adp-ag101.h index 85dbad2..1c380ea 100644 --- a/include/configs/adp-ag101.h +++ b/include/configs/adp-ag101.h @@ -35,6 +35,13 @@ #define CONFIG_SKIP_LOWLEVEL_INIT +/* + * Definitions related to passing arguments to kernel. + */ +#define CONFIG_CMDLINE_TAG /* send commandline to Kernel */ +#define CONFIG_SETUP_MEMORY_TAGS /* send memory definition to kernel */ +#define CONFIG_INITRD_TAG /* send initrd params */ + #ifndef CONFIG_SKIP_LOWLEVEL_INIT #define CONFIG_MEM_REMAP #endif diff --git a/include/configs/adp-ag101p.h b/include/configs/adp-ag101p.h index 6085208..8748134 100644 --- a/include/configs/adp-ag101p.h +++ b/include/configs/adp-ag101p.h @@ -35,6 +35,13 @@ #define CONFIG_SKIP_LOWLEVEL_INIT +/* + * Definitions related to passing arguments to kernel. + */ +#define CONFIG_CMDLINE_TAG /* send commandline to Kernel */ +#define CONFIG_SETUP_MEMORY_TAGS /* send memory definition to kernel */ +#define CONFIG_INITRD_TAG /* send initrd params */ + #ifndef CONFIG_SKIP_LOWLEVEL_INIT #define CONFIG_MEM_REMAP #endif -- cgit v1.1