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
Kirill Smelkov
linux
Commits
bc5cba36
Commit
bc5cba36
authored
Mar 24, 2003
by
Allen Curtis
Committed by
Paul Mackerras
Mar 24, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Updates for the 8260 embedded processor and the EST and TQM boards
parent
989ceec2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
256 additions
and
82 deletions
+256
-82
arch/ppc/8260_io/enet.c
arch/ppc/8260_io/enet.c
+1
-1
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8260_io/fcc_enet.c
+2
-2
arch/ppc/8260_io/uart.c
arch/ppc/8260_io/uart.c
+18
-27
arch/ppc/boot/simple/embed_config.c
arch/ppc/boot/simple/embed_config.c
+1
-1
arch/ppc/kernel/ppc_ksyms.c
arch/ppc/kernel/ppc_ksyms.c
+1
-1
arch/ppc/platforms/Makefile
arch/ppc/platforms/Makefile
+2
-0
arch/ppc/platforms/est8260.h
arch/ppc/platforms/est8260.h
+6
-1
arch/ppc/platforms/est8260_setup.c
arch/ppc/platforms/est8260_setup.c
+65
-0
arch/ppc/platforms/mpc82xx.h
arch/ppc/platforms/mpc82xx.h
+42
-0
arch/ppc/platforms/tqm8260.h
arch/ppc/platforms/tqm8260.h
+5
-3
arch/ppc/platforms/tqm8260_setup.c
arch/ppc/platforms/tqm8260_setup.c
+79
-0
arch/ppc/syslib/m8260_setup.c
arch/ppc/syslib/m8260_setup.c
+34
-46
No files found.
arch/ppc/8260_io/enet.c
View file @
bc5cba36
...
@@ -807,7 +807,7 @@ int __init scc_enet_init(void)
...
@@ -807,7 +807,7 @@ int __init scc_enet_init(void)
/* Install our interrupt handler.
/* Install our interrupt handler.
*/
*/
request_
8xx
irq
(
SIU_INT_ENET
,
scc_enet_interrupt
,
0
,
"enet"
,
dev
);
request_irq
(
SIU_INT_ENET
,
scc_enet_interrupt
,
0
,
"enet"
,
dev
);
/* Set GSMR_H to enable all normal operating modes.
/* Set GSMR_H to enable all normal operating modes.
* Set GSMR_L to enable Ethernet to MC68160.
* Set GSMR_L to enable Ethernet to MC68160.
...
...
arch/ppc/8260_io/fcc_enet.c
View file @
bc5cba36
...
@@ -1705,12 +1705,12 @@ init_fcc_startup(fcc_info_t *fip, struct net_device *dev)
...
@@ -1705,12 +1705,12 @@ init_fcc_startup(fcc_info_t *fip, struct net_device *dev)
/* Install our interrupt handler.
/* Install our interrupt handler.
*/
*/
if
(
request_
8xx
irq
(
fip
->
fc_interrupt
,
fcc_enet_interrupt
,
0
,
if
(
request_irq
(
fip
->
fc_interrupt
,
fcc_enet_interrupt
,
0
,
"fenet"
,
dev
)
<
0
)
"fenet"
,
dev
)
<
0
)
printk
(
"Can't get FCC IRQ %d
\n
"
,
fip
->
fc_interrupt
);
printk
(
"Can't get FCC IRQ %d
\n
"
,
fip
->
fc_interrupt
);
#ifdef CONFIG_USE_MDIO
#ifdef CONFIG_USE_MDIO
if
(
request_
8xx
irq
(
PHY_INTERRUPT
,
mii_link_interrupt
,
0
,
if
(
request_irq
(
PHY_INTERRUPT
,
mii_link_interrupt
,
0
,
"mii"
,
dev
)
<
0
)
"mii"
,
dev
)
<
0
)
printk
(
"Can't get MII IRQ %d
\n
"
,
fip
->
fc_interrupt
);
printk
(
"Can't get MII IRQ %d
\n
"
,
fip
->
fc_interrupt
);
#endif
/* CONFIG_USE_MDIO */
#endif
/* CONFIG_USE_MDIO */
...
...
arch/ppc/8260_io/uart.c
View file @
bc5cba36
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
* Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
* Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
* Copyright (c) 2000 MontaVista Software, Inc. (source@mvista.com)
* Copyright (c) 2000 MontaVista Software, Inc. (source@mvista.com)
* 2.3.99 updates
* 2.3.99 updates
* Copyright (c) 2002 Allen Curtis, Ones and Zeros, Inc. (acurtis@onz.com)
* 2.5.50 updates
*
*
* I used the 8xx uart.c driver as the framework for this driver.
* I used the 8xx uart.c driver as the framework for this driver.
* The original code was written for the EST8260 board. I tried to make
* The original code was written for the EST8260 board. I tried to make
...
@@ -28,6 +30,7 @@
...
@@ -28,6 +30,7 @@
#include <linux/signal.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/tty.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/tty_flip.h>
...
@@ -69,9 +72,7 @@
...
@@ -69,9 +72,7 @@
#define TX_WAKEUP ASYNC_SHARE_IRQ
#define TX_WAKEUP ASYNC_SHARE_IRQ
static
char
*
serial_name
=
"CPM UART driver"
;
static
char
*
serial_name
=
"CPM UART driver"
;
static
char
*
serial_version
=
"0.01"
;
static
char
*
serial_version
=
"0.02"
;
static
DECLARE_TASK_QUEUE
(
tq_serial
);
static
struct
tty_driver
serial_driver
,
callout_driver
;
static
struct
tty_driver
serial_driver
,
callout_driver
;
static
int
serial_refcount
;
static
int
serial_refcount
;
...
@@ -201,8 +202,8 @@ typedef struct serial_info {
...
@@ -201,8 +202,8 @@ typedef struct serial_info {
int
blocked_open
;
/* # of blocked opens */
int
blocked_open
;
/* # of blocked opens */
long
session
;
/* Session of opening process */
long
session
;
/* Session of opening process */
long
pgrp
;
/* pgrp of opening process */
long
pgrp
;
/* pgrp of opening process */
struct
tq
_struct
tqueue
;
struct
work
_struct
tqueue
;
struct
tq
_struct
tqueue_hangup
;
struct
work
_struct
tqueue_hangup
;
wait_queue_head_t
open_wait
;
wait_queue_head_t
open_wait
;
wait_queue_head_t
close_wait
;
wait_queue_head_t
close_wait
;
...
@@ -331,8 +332,7 @@ static _INLINE_ void rs_sched_event(ser_info_t *info,
...
@@ -331,8 +332,7 @@ static _INLINE_ void rs_sched_event(ser_info_t *info,
int
event
)
int
event
)
{
{
info
->
event
|=
1
<<
event
;
info
->
event
|=
1
<<
event
;
queue_task
(
&
info
->
tqueue
,
&
tq_serial
);
schedule_work
(
&
info
->
tqueue
);
mark_bh
(
SERIAL_BH
);
}
}
static
_INLINE_
void
receive_chars
(
ser_info_t
*
info
)
static
_INLINE_
void
receive_chars
(
ser_info_t
*
info
)
...
@@ -479,7 +479,7 @@ static _INLINE_ void receive_chars(ser_info_t *info)
...
@@ -479,7 +479,7 @@ static _INLINE_ void receive_chars(ser_info_t *info)
info
->
rx_cur
=
(
cbd_t
*
)
bdp
;
info
->
rx_cur
=
(
cbd_t
*
)
bdp
;
queue_task
(
&
tty
->
flip
.
tqueue
,
&
tq_timer
);
schedule_delayed_work
(
&
tty
->
flip
.
work
,
1
);
}
}
static
_INLINE_
void
transmit_chars
(
ser_info_t
*
info
)
static
_INLINE_
void
transmit_chars
(
ser_info_t
*
info
)
...
@@ -537,7 +537,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
...
@@ -537,7 +537,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
printk
(
"scheduling hangup..."
);
printk
(
"scheduling hangup..."
);
#endif
#endif
MOD_INC_USE_COUNT
;
MOD_INC_USE_COUNT
;
if
(
schedule_
tas
k
(
&
info
->
tqueue_hangup
)
==
0
)
if
(
schedule_
wor
k
(
&
info
->
tqueue_hangup
)
==
0
)
MOD_DEC_USE_COUNT
;
MOD_DEC_USE_COUNT
;
}
}
}
}
...
@@ -628,11 +628,6 @@ static void rs_8xx_interrupt(int irq, void * dev_id, struct pt_regs * regs)
...
@@ -628,11 +628,6 @@ static void rs_8xx_interrupt(int irq, void * dev_id, struct pt_regs * regs)
* interrupt driver proper are done; the interrupt driver schedules
* interrupt driver proper are done; the interrupt driver schedules
* them using rs_sched_event(), and they get done here.
* them using rs_sched_event(), and they get done here.
*/
*/
static
void
do_serial_bh
(
void
)
{
run_task_queue
(
&
tq_serial
);
}
static
void
do_softint
(
void
*
private_
)
static
void
do_softint
(
void
*
private_
)
{
{
ser_info_t
*
info
=
(
ser_info_t
*
)
private_
;
ser_info_t
*
info
=
(
ser_info_t
*
)
private_
;
...
@@ -651,7 +646,7 @@ static void do_softint(void *private_)
...
@@ -651,7 +646,7 @@ static void do_softint(void *private_)
}
}
/*
/*
* This routine is called from the scheduler
t
queue when the interrupt
* This routine is called from the scheduler
work
queue when the interrupt
* routine has signalled that a hangup has occurred. The path of
* routine has signalled that a hangup has occurred. The path of
* hangup processing is:
* hangup processing is:
*
*
...
@@ -1308,7 +1303,7 @@ static void begin_break(ser_info_t *info)
...
@@ -1308,7 +1303,7 @@ static void begin_break(ser_info_t *info)
{
{
volatile
cpm8260_t
*
cp
;
volatile
cpm8260_t
*
cp
;
uint
page
,
sblock
;
uint
page
,
sblock
;
ushor
t
num
;
in
t
num
;
cp
=
cpmp
;
cp
=
cpmp
;
...
@@ -1352,7 +1347,7 @@ static void end_break(ser_info_t *info)
...
@@ -1352,7 +1347,7 @@ static void end_break(ser_info_t *info)
{
{
volatile
cpm8260_t
*
cp
;
volatile
cpm8260_t
*
cp
;
uint
page
,
sblock
;
uint
page
,
sblock
;
ushor
t
num
;
in
t
num
;
cp
=
cpmp
;
cp
=
cpmp
;
...
@@ -1756,7 +1751,7 @@ static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout)
...
@@ -1756,7 +1751,7 @@ static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout)
*/
*/
char_time
=
1
;
char_time
=
1
;
if
(
timeout
)
if
(
timeout
)
char_time
=
min
(
char_time
,
timeout
);
char_time
=
min
(
char_time
,
(
unsigned
long
)
timeout
);
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
printk
(
"In rs_wait_until_sent(%d) check=%lu..."
,
timeout
,
char_time
);
printk
(
"In rs_wait_until_sent(%d) check=%lu..."
,
timeout
,
char_time
);
printk
(
"jiff=%lu..."
,
jiffies
);
printk
(
"jiff=%lu..."
,
jiffies
);
...
@@ -1980,7 +1975,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
...
@@ -1980,7 +1975,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
ser_info_t
*
info
;
ser_info_t
*
info
;
int
retval
,
line
;
int
retval
,
line
;
line
=
MINOR
(
tty
->
device
)
-
tty
->
driver
.
minor_start
;
line
=
minor
(
tty
->
device
)
-
tty
->
driver
.
minor_start
;
if
((
line
<
0
)
||
(
line
>=
NR_PORTS
))
if
((
line
<
0
)
||
(
line
>=
NR_PORTS
))
return
-
ENODEV
;
return
-
ENODEV
;
retval
=
get_async_struct
(
line
,
&
info
);
retval
=
get_async_struct
(
line
,
&
info
);
...
@@ -2455,7 +2450,7 @@ void kgdb_map_scc(void)
...
@@ -2455,7 +2450,7 @@ void kgdb_map_scc(void)
static
kdev_t
serial_console_device
(
struct
console
*
c
)
static
kdev_t
serial_console_device
(
struct
console
*
c
)
{
{
return
MKDEV
(
TTY_MAJOR
,
64
+
c
->
index
);
return
mk_kdev
(
TTY_MAJOR
,
64
+
c
->
index
);
}
}
...
@@ -2503,8 +2498,6 @@ int __init rs_8xx_init(void)
...
@@ -2503,8 +2498,6 @@ int __init rs_8xx_init(void)
volatile
immap_t
*
immap
;
volatile
immap_t
*
immap
;
volatile
iop8260_t
*
io
;
volatile
iop8260_t
*
io
;
init_bh
(
SERIAL_BH
,
do_serial_bh
);
show_serial_version
();
show_serial_version
();
/* Initialize the tty_driver structure */
/* Initialize the tty_driver structure */
...
@@ -2680,10 +2673,8 @@ int __init rs_8xx_init(void)
...
@@ -2680,10 +2673,8 @@ int __init rs_8xx_init(void)
init_waitqueue_head
(
&
info
->
close_wait
);
init_waitqueue_head
(
&
info
->
close_wait
);
info
->
magic
=
SERIAL_MAGIC
;
info
->
magic
=
SERIAL_MAGIC
;
info
->
flags
=
state
->
flags
;
info
->
flags
=
state
->
flags
;
info
->
tqueue
.
routine
=
do_softint
;
INIT_WORK
(
&
info
->
tqueue
,
do_softint
,
info
);
info
->
tqueue
.
data
=
info
;
INIT_WORK
(
&
info
->
tqueue_hangup
,
do_serial_hangup
,
info
);
info
->
tqueue_hangup
.
routine
=
do_serial_hangup
;
info
->
tqueue_hangup
.
data
=
info
;
info
->
line
=
i
;
info
->
line
=
i
;
info
->
state
=
state
;
info
->
state
=
state
;
state
->
info
=
(
struct
async_struct
*
)
info
;
state
->
info
=
(
struct
async_struct
*
)
info
;
...
@@ -2874,7 +2865,7 @@ int __init rs_8xx_init(void)
...
@@ -2874,7 +2865,7 @@ int __init rs_8xx_init(void)
/* Install interrupt handler.
/* Install interrupt handler.
*/
*/
request_
8xx
irq
(
state
->
irq
,
rs_8xx_interrupt
,
0
,
"uart"
,
info
);
request_irq
(
state
->
irq
,
rs_8xx_interrupt
,
0
,
"uart"
,
info
);
/* Set up the baud rate generator.
/* Set up the baud rate generator.
*/
*/
...
...
arch/ppc/boot/simple/embed_config.c
View file @
bc5cba36
...
@@ -431,7 +431,7 @@ clk_8260(bd_t *bd)
...
@@ -431,7 +431,7 @@ clk_8260(bd_t *bd)
}
}
#endif
#endif
#if
def CONFIG_EST8260
#if
defined(CONFIG_EST8260) || defined(CONFIG_TQM8260)
void
void
embed_config
(
bd_t
**
bdp
)
embed_config
(
bd_t
**
bdp
)
{
{
...
...
arch/ppc/kernel/ppc_ksyms.c
View file @
bc5cba36
...
@@ -337,7 +337,7 @@ EXPORT_SYMBOL(cpm_free_handler);
...
@@ -337,7 +337,7 @@ EXPORT_SYMBOL(cpm_free_handler);
#if defined(CONFIG_8xx) || defined(CONFIG_4xx)
#if defined(CONFIG_8xx) || defined(CONFIG_4xx)
EXPORT_SYMBOL
(
__res
);
EXPORT_SYMBOL
(
__res
);
#endif
#endif
#if defined(CONFIG_8xx)
|| defined(CONFIG_8260)
#if defined(CONFIG_8xx)
EXPORT_SYMBOL
(
request_8xxirq
);
EXPORT_SYMBOL
(
request_8xxirq
);
#endif
#endif
...
...
arch/ppc/platforms/Makefile
View file @
bc5cba36
...
@@ -28,6 +28,8 @@ obj-$(CONFIG_PMAC_PBOOK) += sleep.o
...
@@ -28,6 +28,8 @@ obj-$(CONFIG_PMAC_PBOOK) += sleep.o
obj-$(CONFIG_PPC_RTAS)
+=
error_log.o proc_rtas.o
obj-$(CONFIG_PPC_RTAS)
+=
error_log.o proc_rtas.o
obj-$(CONFIG_PREP_RESIDUAL)
+=
residual.o
obj-$(CONFIG_PREP_RESIDUAL)
+=
residual.o
obj-$(CONFIG_ADIR)
+=
adir_setup.o adir_pic.o adir_pci.o
obj-$(CONFIG_ADIR)
+=
adir_setup.o adir_pic.o adir_pci.o
obj-$(CONFIG_EST8260)
+=
est8260_setup.o
obj-$(CONFIG_TQM8260)
+=
tqm8260_setup.o
obj-$(CONFIG_EV64260)
+=
ev64260_setup.o
obj-$(CONFIG_EV64260)
+=
ev64260_setup.o
obj-$(CONFIG_GEMINI)
+=
gemini_pci.o gemini_setup.o gemini_prom.o
obj-$(CONFIG_GEMINI)
+=
gemini_pci.o gemini_setup.o gemini_prom.o
obj-$(CONFIG_K2)
+=
k2_setup.o k2_pci.o
obj-$(CONFIG_K2)
+=
k2_setup.o k2_pci.o
...
...
arch/ppc/platforms/est8260.h
View file @
bc5cba36
...
@@ -3,8 +3,12 @@
...
@@ -3,8 +3,12 @@
* will soon be removed. All of the clock values are computed from
* will soon be removed. All of the clock values are computed from
* the configuration SCMR and the Power-On-Reset word.
* the configuration SCMR and the Power-On-Reset word.
*/
*/
#ifndef __EST8260_PLATFORM
#define __EST8260_PLATFORM
#define IMAP_ADDR ((uint)0xf0000000)
#define IMAP_ADDR ((uint)0xf0000000)
#define BOOTROM_RESTART_ADDR ((uint)0xff000104)
/* A Board Information structure that is given to a program when
/* A Board Information structure that is given to a program when
...
@@ -25,3 +29,4 @@ typedef struct bd_info {
...
@@ -25,3 +29,4 @@ typedef struct bd_info {
extern
bd_t
m8xx_board_info
;
extern
bd_t
m8xx_board_info
;
#endif
/* __EST8260_PLATFORM */
arch/ppc/platforms/est8260_setup.c
0 → 100644
View file @
bc5cba36
/*
* arch/ppc/platforms/est8260_setup.c
*
* EST8260 platform support
*
* Author: Allen Curtis <acurtis@onz.com>
* Derived from: m8260_setup.c by Dan Malek, MVista
*
* Copyright 2002 Ones and Zeros, Inc.
*
* 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.
*/
#include <linux/config.h>
#include <linux/seq_file.h>
#include <asm/mpc8260.h>
#include <asm/machdep.h>
static
void
(
*
callback_setup_arch
)(
void
);
extern
unsigned
char
__res
[
sizeof
(
bd_t
)];
extern
void
m8260_init
(
unsigned
long
r3
,
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
);
static
int
est8260_show_cpuinfo
(
struct
seq_file
*
m
)
{
bd_t
*
binfo
=
(
bd_t
*
)
__res
;
seq_printf
(
m
,
"vendor
\t\t
: EST Corporation
\n
"
"machine
\t\t
: SBC8260 PowerPC
\n
"
"
\n
"
"mem size
\t\t
: 0x%08x
\n
"
"console baud
\t\t
: %d
\n
"
"
\n
"
,
binfo
->
bi_memsize
,
binfo
->
bi_baudrate
);
return
0
;
}
static
void
__init
est8260_setup_arch
(
void
)
{
printk
(
"EST SBC8260 Port
\n
"
);
callback_setup_arch
();
}
void
__init
platform_init
(
unsigned
long
r3
,
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
)
{
/* Generic 8260 platform initialization */
m8260_init
(
r3
,
r4
,
r5
,
r6
,
r7
);
/* Anything special for this platform */
ppc_md
.
show_cpuinfo
=
est8260_show_cpuinfo
;
callback_setup_arch
=
ppc_md
.
setup_arch
;
ppc_md
.
setup_arch
=
est8260_setup_arch
;
}
arch/ppc/platforms/mpc82xx.h
0 → 100644
View file @
bc5cba36
/*
* arch/ppc/platforms/mpc82xx.h
*
* Board specific support for various 82xx platforms.
*
* Author: Allen Curtis <acurtis@onz.com>
*
* Copyright 2002 Ones and Zeros, Inc.
*
* 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.
*/
#ifndef __CONFIG_82XX_PLATFORMS
#define __CONFIG_82XX_PLATFORMS
#ifdef CONFIG_8260
#ifdef CONFIG_EST8260
#include <platforms/est8260.h>
#endif
#ifdef CONFIG_SBS8260
#include <platforms/sbs8260.h>
#endif
#ifdef CONFIG_RPX6
#include <platforms/rpxsuper.h>
#endif
#ifdef CONFIG_WILLOW
#include <platforms/willow.h>
#endif
#ifdef CONFIG_TQM8260
#include <platforms/tqm8260.h>
#endif
#endif
/* CONFIG_8260 */
#endif
arch/ppc/platforms/tqm8260.h
View file @
bc5cba36
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
* Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
* Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
*/
*/
#ifndef __
MACH_TQM8260_H
#ifndef __
TQM8260_PLATFORM
#define __
MACH_TQM8260_H
#define __
TQM8260_PLATFORM
#include <linux/config.h>
#include <linux/config.h>
...
@@ -14,4 +14,6 @@
...
@@ -14,4 +14,6 @@
#define IMAP_ADDR ((uint)0xFFF00000)
#define IMAP_ADDR ((uint)0xFFF00000)
#define PHY_INTERRUPT 25
#define PHY_INTERRUPT 25
#endif
/* __MACH_TQM8260_H */
#define BOOTROM_RESTART_ADDR ((uint)0x40000104)
#endif
/* __TQM8260_PLATFORM */
arch/ppc/platforms/tqm8260_setup.c
0 → 100644
View file @
bc5cba36
/*
* arch/ppc/platforms/tqm8260_setup.c
*
* TQM8260 platform support
*
* Author: Allen Curtis <acurtis@onz.com>
* Derived from: m8260_setup.c by Dan Malek, MVista
*
* Copyright 2002 Ones and Zeros, Inc.
*
* 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.
*/
#include <linux/config.h>
#include <linux/seq_file.h>
#include <asm/immap_8260.h>
#include <asm/mpc8260.h>
#include <asm/machdep.h>
static
void
(
*
callback_setup_arch
)(
void
);
extern
unsigned
char
__res
[
sizeof
(
bd_t
)];
extern
void
m8260_init
(
unsigned
long
r3
,
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
);
static
int
tqm8260_show_cpuinfo
(
struct
seq_file
*
m
)
{
bd_t
*
binfo
=
(
bd_t
*
)
__res
;
seq_printf
(
m
,
"vendor
\t\t
: IN2 Systems
\n
"
"machine
\t\t
: TQM8260 PowerPC
\n
"
"mem size
\t\t
: 0x%08x
\n
"
"
\n
"
,
binfo
->
bi_memsize
);
return
0
;
}
static
int
tqm8260_set_rtc_time
(
unsigned
long
time
)
{
((
immap_t
*
)
IMAP_ADDR
)
->
im_sit
.
sit_tmcnt
=
time
;
((
immap_t
*
)
IMAP_ADDR
)
->
im_sit
.
sit_tmcntsc
=
0x3
;
return
(
0
);
}
static
unsigned
long
tqm8260_get_rtc_time
(
void
)
{
return
((
immap_t
*
)
IMAP_ADDR
)
->
im_sit
.
sit_tmcnt
;
}
static
void
__init
tqm8260_setup_arch
(
void
)
{
printk
(
"IN2 Systems TQM8260 port
\n
"
);
callback_setup_arch
();
}
void
__init
platform_init
(
unsigned
long
r3
,
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
)
{
/* Generic 8260 platform initialization */
m8260_init
(
r3
,
r4
,
r5
,
r6
,
r7
);
/* Anything special for this platform */
ppc_md
.
show_cpuinfo
=
tqm8260_show_cpuinfo
;
ppc_md
.
set_rtc_time
=
tqm8260_set_rtc_time
;
ppc_md
.
get_rtc_time
=
tqm8260_get_rtc_time
;
callback_setup_arch
=
ppc_md
.
setup_arch
;
ppc_md
.
setup_arch
=
tqm8260_setup_arch
;
arch/ppc/syslib/m8260_setup.c
View file @
bc5cba36
...
@@ -63,16 +63,6 @@ m8260_setup_arch(void)
...
@@ -63,16 +63,6 @@ m8260_setup_arch(void)
m8260_cpm_reset
();
m8260_cpm_reset
();
}
}
static
void
abort
(
void
)
{
#ifdef CONFIG_XMON
extern
void
xmon
(
void
*
);
xmon
(
0
);
#endif
machine_restart
(
NULL
);
}
/* The decrementer counts at the system (internal) clock frequency
/* The decrementer counts at the system (internal) clock frequency
* divided by four.
* divided by four.
*/
*/
...
@@ -93,30 +83,27 @@ m8260_calibrate_decr(void)
...
@@ -93,30 +83,27 @@ m8260_calibrate_decr(void)
*/
*/
static
uint
rtc_time
;
static
uint
rtc_time
;
static
static
int
static
int
m8260_set_rtc_time
(
unsigned
long
time
)
m8260_set_rtc_time
(
unsigned
long
time
)
{
{
#ifdef CONFIG_TQM8260
((
immap_t
*
)
IMAP_ADDR
)
->
im_sit
.
sit_tmcnt
=
time
;
((
immap_t
*
)
IMAP_ADDR
)
->
im_sit
.
sit_tmcntsc
=
0x3
;
#else
rtc_time
=
time
;
rtc_time
=
time
;
#endif
return
(
0
);
return
(
0
);
}
}
static
unsigned
long
static
unsigned
long
m8260_get_rtc_time
(
void
)
m8260_get_rtc_time
(
void
)
{
{
#ifdef CONFIG_TQM8260
return
((
immap_t
*
)
IMAP_ADDR
)
->
im_sit
.
sit_tmcnt
;
#else
/* Get time from the RTC.
/* Get time from the RTC.
*/
*/
return
((
unsigned
long
)
rtc_time
);
return
((
unsigned
long
)
rtc_time
);
#endif
}
}
#ifndef BOOTROM_RESTART_ADDR
#warning "Using default BOOTROM_RESTART_ADDR!"
#define BOOTROM_RESTART_ADDR 0xff000104
#endif
static
void
static
void
m8260_restart
(
char
*
cmd
)
m8260_restart
(
char
*
cmd
)
{
{
...
@@ -127,32 +114,28 @@ m8260_restart(char *cmd)
...
@@ -127,32 +114,28 @@ m8260_restart(char *cmd)
* of the reset vector. If that doesn't work for you, change this
* of the reset vector. If that doesn't work for you, change this
* or the reboot program to send a proper address.
* or the reboot program to send a proper address.
*/
*/
#ifdef CONFIG_TQM8260
startaddr
=
BOOTROM_RESTART_ADDR
;
startaddr
=
0x40000104
;
#else
startaddr
=
0xff000104
;
#endif
if
(
cmd
!=
NULL
)
{
if
(
cmd
!=
NULL
)
{
if
(
!
strncmp
(
cmd
,
"startaddr="
,
10
))
if
(
!
strncmp
(
cmd
,
"startaddr="
,
10
))
startaddr
=
simple_strtoul
(
&
cmd
[
10
],
NULL
,
0
);
startaddr
=
simple_strtoul
(
&
cmd
[
10
],
NULL
,
0
);
}
}
m8260_gorom
((
unsigned
int
)
__pa
(
__res
),
startaddr
);
m8260_gorom
((
void
*
)
__pa
(
__res
),
startaddr
);
}
}
static
void
static
void
m8260_
power_off
(
void
)
m8260_
halt
(
void
)
{
{
m8260_restart
(
NULL
);
local_irq_disable
();
while
(
1
);
}
}
static
void
static
void
m8260_
halt
(
void
)
m8260_
power_off
(
void
)
{
{
m8260_restart
(
NULL
);
m8260_halt
(
);
}
}
static
int
static
int
m8260_show_percpuinfo
(
struct
seq_file
*
m
,
int
i
)
m8260_show_percpuinfo
(
struct
seq_file
*
m
,
int
i
)
{
{
...
@@ -181,9 +164,6 @@ m8260_init_IRQ(void)
...
@@ -181,9 +164,6 @@ m8260_init_IRQ(void)
int
i
;
int
i
;
void
cpm_interrupt_init
(
void
);
void
cpm_interrupt_init
(
void
);
#if 0
ppc8260_pic.irq_offset = 0;
#endif
for
(
i
=
0
;
i
<
NR_SIU_INTS
;
i
++
)
for
(
i
=
0
;
i
<
NR_SIU_INTS
;
i
++
)
irq_desc
[
i
].
handler
=
&
ppc8260_pic
;
irq_desc
[
i
].
handler
=
&
ppc8260_pic
;
...
@@ -194,7 +174,6 @@ m8260_init_IRQ(void)
...
@@ -194,7 +174,6 @@ m8260_init_IRQ(void)
immr
->
im_intctl
.
ic_siprr
=
0x05309770
;
immr
->
im_intctl
.
ic_siprr
=
0x05309770
;
immr
->
im_intctl
.
ic_scprrh
=
0x05309770
;
immr
->
im_intctl
.
ic_scprrh
=
0x05309770
;
immr
->
im_intctl
.
ic_scprrl
=
0x05309770
;
immr
->
im_intctl
.
ic_scprrl
=
0x05309770
;
}
}
/*
/*
...
@@ -219,12 +198,29 @@ m8260_find_end_of_memory(void)
...
@@ -219,12 +198,29 @@ m8260_find_end_of_memory(void)
static
void
__init
static
void
__init
m8260_map_io
(
void
)
m8260_map_io
(
void
)
{
{
io_block_mapping
(
0xf0000000
,
0xf0000000
,
0x10000000
,
_PAGE_IO
);
uint
addr
;
io_block_mapping
(
0xe0000000
,
0xe0000000
,
0x10000000
,
_PAGE_IO
);
/* Map IMMR region to a 256MB BAT */
addr
=
(
immr
!=
NULL
)
?
(
uint
)
immr
:
IMAP_ADDR
;
io_block_mapping
(
addr
,
addr
,
0x10000000
,
_PAGE_IO
);
/* Map I/O region to a 256MB BAT */
io_block_mapping
(
IO_VIRT_ADDR
,
IO_PHYS_ADDR
,
0x10000000
,
_PAGE_IO
);
}
}
/* Inputs:
* r3 - Optional pointer to a board information structure.
* r4 - Optional pointer to the physical starting address of the init RAM
* disk.
* r5 - Optional pointer to the physical ending address of the init RAM
* disk.
* r6 - Optional pointer to the physical starting address of any kernel
* command-line parameters.
* r7 - Optional pointer to the physical ending address of any kernel
* command-line parameters.
*/
void
__init
void
__init
platform
_init
(
unsigned
long
r3
,
unsigned
long
r4
,
unsigned
long
r5
,
m8260
_init
(
unsigned
long
r3
,
unsigned
long
r4
,
unsigned
long
r5
,
unsigned
long
r6
,
unsigned
long
r7
)
unsigned
long
r6
,
unsigned
long
r7
)
{
{
parse_bootinfo
(
find_bootinfo
());
parse_bootinfo
(
find_bootinfo
());
...
@@ -265,11 +261,3 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
...
@@ -265,11 +261,3 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md
.
setup_io_mappings
=
m8260_map_io
;
ppc_md
.
setup_io_mappings
=
m8260_map_io
;
}
}
/* Mainly for ksyms.
*/
int
request_irq
(
unsigned
int
irq
,
void
(
*
handler
)(
int
,
void
*
,
struct
pt_regs
*
),
unsigned
long
flag
,
const
char
*
naem
,
void
*
dev
)
{
panic
(
"request IRQ
\n
"
);
}
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