Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a7abc3ce
Commit
a7abc3ce
authored
Feb 17, 2004
by
Tom Rini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: More cleanups of the IBM Spruce code.
From Randy Vinson <rvinson@mvista.com>.
parent
7d202bd0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
159 deletions
+71
-159
arch/ppc/platforms/Makefile
arch/ppc/platforms/Makefile
+1
-1
arch/ppc/platforms/spruce.c
arch/ppc/platforms/spruce.c
+65
-11
arch/ppc/platforms/spruce.h
arch/ppc/platforms/spruce.h
+4
-4
arch/ppc/platforms/spruce_pci.c
arch/ppc/platforms/spruce_pci.c
+0
-87
arch/ppc/platforms/spruce_serial.h
arch/ppc/platforms/spruce_serial.h
+0
-55
include/asm-ppc/serial.h
include/asm-ppc/serial.h
+1
-1
No files found.
arch/ppc/platforms/Makefile
View file @
a7abc3ce
...
@@ -45,7 +45,7 @@ obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o
...
@@ -45,7 +45,7 @@ obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o
obj-$(CONFIG_PRPMC750)
+=
prpmc750_setup.o prpmc750_pci.o
obj-$(CONFIG_PRPMC750)
+=
prpmc750_setup.o prpmc750_pci.o
obj-$(CONFIG_PRPMC800)
+=
prpmc800_setup.o prpmc800_pci.o
obj-$(CONFIG_PRPMC800)
+=
prpmc800_setup.o prpmc800_pci.o
obj-$(CONFIG_SANDPOINT)
+=
sandpoint.o
obj-$(CONFIG_SANDPOINT)
+=
sandpoint.o
obj-$(CONFIG_SPRUCE)
+=
spruce
_setup.o spruce_pci
.o
obj-$(CONFIG_SPRUCE)
+=
spruce.o
ifeq
($(CONFIG_SMP),y)
ifeq
($(CONFIG_SMP),y)
obj-$(CONFIG_PPC_PMAC)
+=
pmac_smp.o
obj-$(CONFIG_PPC_PMAC)
+=
pmac_smp.o
...
...
arch/ppc/platforms/spruce
_setup
.c
→
arch/ppc/platforms/spruce.c
View file @
a7abc3ce
/*
/*
* arch/ppc/platforms/spruce
_setup
.c
* arch/ppc/platforms/spruce.c
*
*
* Board setup routines for IBM Spruce
* Board
and PCI
setup routines for IBM Spruce
*
*
* Authors: Johnnie Peters <jpeters@mvista.com>
* Author: MontaVista Software <source@mvista.com>
* Matt Porter <mporter@mvista.com>
*
*
* 200
1-2002
(c) MontaVista, Software, Inc. This file is licensed under
* 200
0-2004
(c) MontaVista, Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
* or implied.
...
@@ -39,18 +38,73 @@
...
@@ -39,18 +38,73 @@
#include <asm/io.h>
#include <asm/io.h>
#include <asm/machdep.h>
#include <asm/machdep.h>
#include <asm/time.h>
#include <asm/time.h>
#include <platforms/spruce.h>
#include <asm/todc.h>
#include <asm/todc.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo.h>
#include <asm/kgdb.h>
#include <asm/kgdb.h>
#include <syslib/cpc700.h>
#include <syslib/cpc700.h>
extern
void
spruce_init_IRQ
(
void
);
#include "spruce.h"
extern
int
spruce_get_irq
(
struct
pt_regs
*
);
extern
void
spruce_setup_hose
(
void
);
extern
char
cmd_line
[];
static
inline
int
spruce_map_irq
(
struct
pci_dev
*
dev
,
unsigned
char
idsel
,
unsigned
char
pin
)
{
static
char
pci_irq_table
[][
4
]
=
/*
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{
23
,
24
,
25
,
26
},
/* IDSEL 1 - PCI slot 3 */
{
24
,
25
,
26
,
23
},
/* IDSEL 2 - PCI slot 2 */
{
25
,
26
,
23
,
24
},
/* IDSEL 3 - PCI slot 1 */
{
26
,
23
,
24
,
25
},
/* IDSEL 4 - PCI slot 0 */
};
const
long
min_idsel
=
1
,
max_idsel
=
4
,
irqs_per_slot
=
4
;
return
PCI_IRQ_TABLE_LOOKUP
;
}
static
void
__init
spruce_setup_hose
(
void
)
{
struct
pci_controller
*
hose
;
/* Setup hose */
hose
=
pcibios_alloc_controller
();
if
(
!
hose
)
return
;
hose
->
first_busno
=
0
;
hose
->
last_busno
=
0xff
;
pci_init_resource
(
&
hose
->
io_resource
,
SPRUCE_PCI_LOWER_IO
,
SPRUCE_PCI_UPPER_IO
,
IORESOURCE_IO
,
"PCI host bridge"
);
pci_init_resource
(
&
hose
->
mem_resources
[
0
],
SPRUCE_PCI_LOWER_MEM
,
SPRUCE_PCI_UPPER_MEM
,
IORESOURCE_MEM
,
"PCI host bridge"
);
hose
->
io_space
.
start
=
SPRUCE_PCI_LOWER_IO
;
hose
->
io_space
.
end
=
SPRUCE_PCI_UPPER_IO
;
hose
->
mem_space
.
start
=
SPRUCE_PCI_LOWER_MEM
;
hose
->
mem_space
.
end
=
SPRUCE_PCI_UPPER_MEM
;
hose
->
io_base_virt
=
(
void
*
)
SPRUCE_ISA_IO_BASE
;
setup_indirect_pci
(
hose
,
SPRUCE_PCI_CONFIG_ADDR
,
SPRUCE_PCI_CONFIG_DATA
);
hose
->
last_busno
=
pciauto_bus_scan
(
hose
,
hose
->
first_busno
);
ppc_md
.
pci_swizzle
=
common_swizzle
;
ppc_md
.
pci_map_irq
=
spruce_map_irq
;
}
/*
/*
* CPC700 PIC interrupt programming table
* CPC700 PIC interrupt programming table
...
@@ -122,7 +176,7 @@ spruce_early_serial_map(void)
...
@@ -122,7 +176,7 @@ spruce_early_serial_map(void)
memset
(
&
serial_req
,
0
,
sizeof
(
serial_req
));
memset
(
&
serial_req
,
0
,
sizeof
(
serial_req
));
serial_req
.
uartclk
=
uart_clk
;
serial_req
.
uartclk
=
uart_clk
;
serial_req
.
irq
=
UART0_INT
;
serial_req
.
irq
=
UART0_INT
;
serial_req
.
flags
=
ASYNC_BOOT_AUTOCONF
|
ASYNC_SKIP_TEST
;
serial_req
.
flags
=
ASYNC_BOOT_AUTOCONF
;
serial_req
.
iotype
=
SERIAL_IO_MEM
;
serial_req
.
iotype
=
SERIAL_IO_MEM
;
serial_req
.
membase
=
(
u_char
*
)
UART0_IO_BASE
;
serial_req
.
membase
=
(
u_char
*
)
UART0_IO_BASE
;
serial_req
.
regshift
=
0
;
serial_req
.
regshift
=
0
;
...
...
arch/ppc/platforms/spruce.h
View file @
a7abc3ce
...
@@ -57,10 +57,10 @@
...
@@ -57,10 +57,10 @@
#define UART0_INT 3
#define UART0_INT 3
#define UART1_INT 4
#define UART1_INT 4
#define STD_UART_OP(num) \
#define STD_UART_OP(num)
\
{ 0, BASE_BAUD, 0, UART##num##_INT, \
{ 0, BASE_BAUD, 0, UART##num##_INT,
\
ASYNC_BOOT_AUTOCONF, \
ASYNC_BOOT_AUTOCONF,
\
iomem_base: UART##num##_IO_BASE, \
iomem_base:
(unsigned char *)
UART##num##_IO_BASE, \
io_type: SERIAL_IO_MEM},
io_type: SERIAL_IO_MEM},
#define SERIAL_PORT_DFNS \
#define SERIAL_PORT_DFNS \
...
...
arch/ppc/platforms/spruce_pci.c
deleted
100644 → 0
View file @
7d202bd0
/*
* arch/ppc/platforms/spruce_pci.c
*
* PCI support for IBM Spruce
*
* Author: Johnnie Peters
* jpeters@mvista.com
*
* 2000 (c) MontaVista, Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <asm/byteorder.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include <platforms/spruce.h>
#include <syslib/cpc700.h>
static
inline
int
spruce_map_irq
(
struct
pci_dev
*
dev
,
unsigned
char
idsel
,
unsigned
char
pin
)
{
static
char
pci_irq_table
[][
4
]
=
/*
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{
23
,
24
,
25
,
26
},
/* IDSEL 1 - PCI slot 3 */
{
24
,
25
,
26
,
23
},
/* IDSEL 2 - PCI slot 2 */
{
25
,
26
,
23
,
24
},
/* IDSEL 3 - PCI slot 1 */
{
26
,
23
,
24
,
25
},
/* IDSEL 4 - PCI slot 0 */
};
const
long
min_idsel
=
1
,
max_idsel
=
4
,
irqs_per_slot
=
4
;
return
PCI_IRQ_TABLE_LOOKUP
;
}
void
__init
spruce_setup_hose
(
void
)
{
struct
pci_controller
*
hose
;
/* Setup hose */
hose
=
pcibios_alloc_controller
();
if
(
!
hose
)
return
;
hose
->
first_busno
=
0
;
hose
->
last_busno
=
0xff
;
pci_init_resource
(
&
hose
->
io_resource
,
SPRUCE_PCI_LOWER_IO
,
SPRUCE_PCI_UPPER_IO
,
IORESOURCE_IO
,
"PCI host bridge"
);
pci_init_resource
(
&
hose
->
mem_resources
[
0
],
SPRUCE_PCI_LOWER_MEM
,
SPRUCE_PCI_UPPER_MEM
,
IORESOURCE_MEM
,
"PCI host bridge"
);
hose
->
io_space
.
start
=
SPRUCE_PCI_LOWER_IO
;
hose
->
io_space
.
end
=
SPRUCE_PCI_UPPER_IO
;
hose
->
mem_space
.
start
=
SPRUCE_PCI_LOWER_MEM
;
hose
->
mem_space
.
end
=
SPRUCE_PCI_UPPER_MEM
;
hose
->
io_base_virt
=
(
void
*
)
SPRUCE_ISA_IO_BASE
;
setup_indirect_pci
(
hose
,
SPRUCE_PCI_CONFIG_ADDR
,
SPRUCE_PCI_CONFIG_DATA
);
hose
->
last_busno
=
pciauto_bus_scan
(
hose
,
hose
->
first_busno
);
ppc_md
.
pci_swizzle
=
common_swizzle
;
ppc_md
.
pci_map_irq
=
spruce_map_irq
;
}
arch/ppc/platforms/spruce_serial.h
deleted
100644 → 0
View file @
7d202bd0
/*
* include/asm-ppc/spruce_serial.h
*
* Definitions for IBM Spruce reference board support
*
* Authors: Matt Porter and Johnnie Peters
* mporter@mvista.com
* jpeters@mvista.com
*
* 2000 (c) MontaVista, Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#ifndef __ASMPPC_SPRUCE_SERIAL_H
#define __ASMPPC_SPRUCE_SERIAL_H
#include <linux/config.h>
/* This is where the serial ports exist */
#define SPRUCE_SERIAL_1_ADDR 0xff600300
#define SPRUCE_SERIAL_2_ADDR 0xff600400
#define RS_TABLE_SIZE 4
/* Rate for the baud clock for the onboard serial chip */
#ifndef CONFIG_SPRUCE_BAUD_33M
#define BASE_BAUD (30000000 / 4 / 16)
#else
#define BASE_BAUD (33000000 / 4 / 16)
#endif
#ifndef SERIAL_MAGIC_KEY
#define kernel_debugger ppc_kernel_debug
#endif
#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
#endif
#define STD_SERIAL_PORT_DFNS \
{ 0, BASE_BAUD, SPRUCE_SERIAL_1_ADDR, 3, STD_COM_FLAGS,
/* ttyS0 */
\
iomem_base: (u8 *)SPRUCE_SERIAL_1_ADDR, \
io_type: SERIAL_IO_MEM }, \
{ 0, BASE_BAUD, SPRUCE_SERIAL_2_ADDR, 4, STD_COM_FLAGS,
/* ttyS1 */
\
iomem_base: (u8 *)SPRUCE_SERIAL_2_ADDR, \
io_type: SERIAL_IO_MEM },
#define SERIAL_PORT_DFNS \
STD_SERIAL_PORT_DFNS
#endif
/* __ASMPPC_SPRUCE_SERIAL_H */
include/asm-ppc/serial.h
View file @
a7abc3ce
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#elif defined(CONFIG_SANDPOINT)
#elif defined(CONFIG_SANDPOINT)
#include <platforms/sandpoint.h>
#include <platforms/sandpoint.h>
#elif defined(CONFIG_SPRUCE)
#elif defined(CONFIG_SPRUCE)
#include <platforms/spruce
_serial
.h>
#include <platforms/spruce.h>
#elif defined(CONFIG_4xx)
#elif defined(CONFIG_4xx)
#include <asm/ibm4xx.h>
#include <asm/ibm4xx.h>
#else
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment