diff options
author | Zhang Le <r0bertz@gentoo.org> | 2008-10-27 19:33:24 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-10-27 12:18:31 -0400 |
commit | 3a63913f607832a2629545467e715a40ec930c32 (patch) | |
tree | e47bfd5e31dc66144244028d5e77e817a68218f0 | |
parent | 97b0511ce125b0cb95d73b198c1bdbb3cebc4de2 (diff) |
MIPS: lemote/lm2e: Added io_map_base to pci controller
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/mach-lemote/pci.h | 30 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/pci.c | 13 | ||||
-rw-r--r-- | arch/mips/lemote/lm2e/setup.c | 11 |
3 files changed, 43 insertions, 11 deletions
diff --git a/arch/mips/include/asm/mach-lemote/pci.h b/arch/mips/include/asm/mach-lemote/pci.h new file mode 100644 index 000000000000..ea6aa143b78e --- /dev/null +++ b/arch/mips/include/asm/mach-lemote/pci.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008 Zhang Le <r0bertz@gentoo.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it | ||
5 | * and/or modify it under the terms of the GNU General | ||
6 | * Public License as published by the Free Software | ||
7 | * Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be | ||
11 | * useful, but WITHOUT ANY WARRANTY; without even the implied | ||
12 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
13 | * PURPOSE. See the GNU General Public License for more | ||
14 | * details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public | ||
17 | * License along with this program; if not, write to the Free | ||
18 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA | ||
19 | * 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef _LEMOTE_PCI_H_ | ||
23 | #define _LEMOTE_PCI_H_ | ||
24 | |||
25 | #define LOONGSON2E_PCI_MEM_START 0x14000000UL | ||
26 | #define LOONGSON2E_PCI_MEM_END 0x1fffffffUL | ||
27 | #define LOONGSON2E_PCI_IO_START 0x00004000UL | ||
28 | #define LOONGSON2E_IO_PORT_BASE 0x1fd00000UL | ||
29 | |||
30 | #endif /* !_LEMOTE_PCI_H_ */ | ||
diff --git a/arch/mips/lemote/lm2e/pci.c b/arch/mips/lemote/lm2e/pci.c index c1e41f15cc7e..8be03a8e1ad4 100644 --- a/arch/mips/lemote/lm2e/pci.c +++ b/arch/mips/lemote/lm2e/pci.c | |||
@@ -30,19 +30,20 @@ | |||
30 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
32 | #include <asm/mips-boards/bonito64.h> | 32 | #include <asm/mips-boards/bonito64.h> |
33 | #include <asm/mach-lemote/pci.h> | ||
33 | 34 | ||
34 | extern struct pci_ops bonito64_pci_ops; | 35 | extern struct pci_ops bonito64_pci_ops; |
35 | 36 | ||
36 | static struct resource loongson2e_pci_mem_resource = { | 37 | static struct resource loongson2e_pci_mem_resource = { |
37 | .name = "LOONGSON2E PCI MEM", | 38 | .name = "LOONGSON2E PCI MEM", |
38 | .start = 0x14000000UL, | 39 | .start = LOONGSON2E_PCI_MEM_START, |
39 | .end = 0x1fffffffUL, | 40 | .end = LOONGSON2E_PCI_MEM_END, |
40 | .flags = IORESOURCE_MEM, | 41 | .flags = IORESOURCE_MEM, |
41 | }; | 42 | }; |
42 | 43 | ||
43 | static struct resource loongson2e_pci_io_resource = { | 44 | static struct resource loongson2e_pci_io_resource = { |
44 | .name = "LOONGSON2E PCI IO MEM", | 45 | .name = "LOONGSON2E PCI IO MEM", |
45 | .start = 0x00004000UL, | 46 | .start = LOONGSON2E_PCI_IO_START, |
46 | .end = IO_SPACE_LIMIT, | 47 | .end = IO_SPACE_LIMIT, |
47 | .flags = IORESOURCE_IO, | 48 | .flags = IORESOURCE_IO, |
48 | }; | 49 | }; |
@@ -82,6 +83,12 @@ static void __init ict_pcimap(void) | |||
82 | static int __init pcibios_init(void) | 83 | static int __init pcibios_init(void) |
83 | { | 84 | { |
84 | ict_pcimap(); | 85 | ict_pcimap(); |
86 | |||
87 | loongson2e_pci_controller.io_map_base = | ||
88 | (unsigned long) ioremap(LOONGSON2E_IO_PORT_BASE, | ||
89 | loongson2e_pci_io_resource.end - | ||
90 | loongson2e_pci_io_resource.start + 1); | ||
91 | |||
85 | register_pci_controller(&loongson2e_pci_controller); | 92 | register_pci_controller(&loongson2e_pci_controller); |
86 | 93 | ||
87 | return 0; | 94 | return 0; |
diff --git a/arch/mips/lemote/lm2e/setup.c b/arch/mips/lemote/lm2e/setup.c index 2cc6745991ab..ebd6ceaef2fd 100644 --- a/arch/mips/lemote/lm2e/setup.c +++ b/arch/mips/lemote/lm2e/setup.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/mc146818-time.h> | 34 | #include <asm/mc146818-time.h> |
35 | #include <asm/time.h> | 35 | #include <asm/time.h> |
36 | #include <asm/wbflush.h> | 36 | #include <asm/wbflush.h> |
37 | #include <asm/mach-lemote/pci.h> | ||
37 | 38 | ||
38 | #ifdef CONFIG_VT | 39 | #ifdef CONFIG_VT |
39 | #include <linux/console.h> | 40 | #include <linux/console.h> |
@@ -42,12 +43,6 @@ | |||
42 | 43 | ||
43 | extern void mips_reboot_setup(void); | 44 | extern void mips_reboot_setup(void); |
44 | 45 | ||
45 | #ifdef CONFIG_64BIT | ||
46 | #define PTR_PAD(p) ((0xffffffff00000000)|((unsigned long long)(p))) | ||
47 | #else | ||
48 | #define PTR_PAD(p) (p) | ||
49 | #endif | ||
50 | |||
51 | unsigned long cpu_clock_freq; | 46 | unsigned long cpu_clock_freq; |
52 | unsigned long bus_clock; | 47 | unsigned long bus_clock; |
53 | unsigned int memsize; | 48 | unsigned int memsize; |
@@ -80,8 +75,8 @@ static void wbflush_loongson2e(void) | |||
80 | 75 | ||
81 | void __init plat_mem_setup(void) | 76 | void __init plat_mem_setup(void) |
82 | { | 77 | { |
83 | set_io_port_base(PTR_PAD(0xbfd00000)); | 78 | set_io_port_base((unsigned long)ioremap(LOONGSON2E_IO_PORT_BASE, |
84 | 79 | IO_SPACE_LIMIT - LOONGSON2E_PCI_IO_START + 1)); | |
85 | mips_reboot_setup(); | 80 | mips_reboot_setup(); |
86 | 81 | ||
87 | __wbflush = wbflush_loongson2e; | 82 | __wbflush = wbflush_loongson2e; |