Commit 3a63913f authored by Zhang Le's avatar Zhang Le Committed by Ralf Baechle

MIPS: lemote/lm2e: Added io_map_base to pci controller

Signed-off-by: default avatarZhang Le <r0bertz@gentoo.org>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 97b0511c
/*
* Copyright (c) 2008 Zhang Le <r0bertz@gentoo.org>
*
* 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., 675 Mass Ave, Cambridge, MA
* 02139, USA.
*/
#ifndef _LEMOTE_PCI_H_
#define _LEMOTE_PCI_H_
#define LOONGSON2E_PCI_MEM_START 0x14000000UL
#define LOONGSON2E_PCI_MEM_END 0x1fffffffUL
#define LOONGSON2E_PCI_IO_START 0x00004000UL
#define LOONGSON2E_IO_PORT_BASE 0x1fd00000UL
#endif /* !_LEMOTE_PCI_H_ */
...@@ -30,19 +30,20 @@ ...@@ -30,19 +30,20 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/mips-boards/bonito64.h> #include <asm/mips-boards/bonito64.h>
#include <asm/mach-lemote/pci.h>
extern struct pci_ops bonito64_pci_ops; extern struct pci_ops bonito64_pci_ops;
static struct resource loongson2e_pci_mem_resource = { static struct resource loongson2e_pci_mem_resource = {
.name = "LOONGSON2E PCI MEM", .name = "LOONGSON2E PCI MEM",
.start = 0x14000000UL, .start = LOONGSON2E_PCI_MEM_START,
.end = 0x1fffffffUL, .end = LOONGSON2E_PCI_MEM_END,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}; };
static struct resource loongson2e_pci_io_resource = { static struct resource loongson2e_pci_io_resource = {
.name = "LOONGSON2E PCI IO MEM", .name = "LOONGSON2E PCI IO MEM",
.start = 0x00004000UL, .start = LOONGSON2E_PCI_IO_START,
.end = IO_SPACE_LIMIT, .end = IO_SPACE_LIMIT,
.flags = IORESOURCE_IO, .flags = IORESOURCE_IO,
}; };
...@@ -82,6 +83,12 @@ static void __init ict_pcimap(void) ...@@ -82,6 +83,12 @@ static void __init ict_pcimap(void)
static int __init pcibios_init(void) static int __init pcibios_init(void)
{ {
ict_pcimap(); ict_pcimap();
loongson2e_pci_controller.io_map_base =
(unsigned long) ioremap(LOONGSON2E_IO_PORT_BASE,
loongson2e_pci_io_resource.end -
loongson2e_pci_io_resource.start + 1);
register_pci_controller(&loongson2e_pci_controller); register_pci_controller(&loongson2e_pci_controller);
return 0; return 0;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <asm/mc146818-time.h> #include <asm/mc146818-time.h>
#include <asm/time.h> #include <asm/time.h>
#include <asm/wbflush.h> #include <asm/wbflush.h>
#include <asm/mach-lemote/pci.h>
#ifdef CONFIG_VT #ifdef CONFIG_VT
#include <linux/console.h> #include <linux/console.h>
...@@ -42,12 +43,6 @@ ...@@ -42,12 +43,6 @@
extern void mips_reboot_setup(void); extern void mips_reboot_setup(void);
#ifdef CONFIG_64BIT
#define PTR_PAD(p) ((0xffffffff00000000)|((unsigned long long)(p)))
#else
#define PTR_PAD(p) (p)
#endif
unsigned long cpu_clock_freq; unsigned long cpu_clock_freq;
unsigned long bus_clock; unsigned long bus_clock;
unsigned int memsize; unsigned int memsize;
...@@ -80,8 +75,8 @@ static void wbflush_loongson2e(void) ...@@ -80,8 +75,8 @@ static void wbflush_loongson2e(void)
void __init plat_mem_setup(void) void __init plat_mem_setup(void)
{ {
set_io_port_base(PTR_PAD(0xbfd00000)); set_io_port_base((unsigned long)ioremap(LOONGSON2E_IO_PORT_BASE,
IO_SPACE_LIMIT - LOONGSON2E_PCI_IO_START + 1));
mips_reboot_setup(); mips_reboot_setup();
__wbflush = wbflush_loongson2e; __wbflush = wbflush_loongson2e;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment