Commit bc5cba36 authored by Allen Curtis's avatar Allen Curtis Committed by Paul Mackerras

PPC32: Updates for the 8260 embedded processor and the EST and TQM boards

parent 989ceec2
......@@ -807,7 +807,7 @@ int __init scc_enet_init(void)
/* Install our interrupt handler.
*/
request_8xxirq(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_L to enable Ethernet to MC68160.
......
......@@ -1705,12 +1705,12 @@ init_fcc_startup(fcc_info_t *fip, struct net_device *dev)
/* Install our interrupt handler.
*/
if (request_8xxirq(fip->fc_interrupt, fcc_enet_interrupt, 0,
if (request_irq(fip->fc_interrupt, fcc_enet_interrupt, 0,
"fenet", dev) < 0)
printk("Can't get FCC IRQ %d\n", fip->fc_interrupt);
#ifdef CONFIG_USE_MDIO
if (request_8xxirq(PHY_INTERRUPT, mii_link_interrupt, 0,
if (request_irq(PHY_INTERRUPT, mii_link_interrupt, 0,
"mii", dev) < 0)
printk("Can't get MII IRQ %d\n", fip->fc_interrupt);
#endif /* CONFIG_USE_MDIO */
......
......@@ -3,6 +3,8 @@
* Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
* Copyright (c) 2000 MontaVista Software, Inc. (source@mvista.com)
* 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.
* The original code was written for the EST8260 board. I tried to make
......@@ -28,6 +30,7 @@
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
......@@ -69,9 +72,7 @@
#define TX_WAKEUP ASYNC_SHARE_IRQ
static char *serial_name = "CPM UART driver";
static char *serial_version = "0.01";
static DECLARE_TASK_QUEUE(tq_serial);
static char *serial_version = "0.02";
static struct tty_driver serial_driver, callout_driver;
static int serial_refcount;
......@@ -201,8 +202,8 @@ typedef struct serial_info {
int blocked_open; /* # of blocked opens */
long session; /* Session of opening process */
long pgrp; /* pgrp of opening process */
struct tq_struct tqueue;
struct tq_struct tqueue_hangup;
struct work_struct tqueue;
struct work_struct tqueue_hangup;
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
......@@ -331,8 +332,7 @@ static _INLINE_ void rs_sched_event(ser_info_t *info,
int event)
{
info->event |= 1 << event;
queue_task(&info->tqueue, &tq_serial);
mark_bh(SERIAL_BH);
schedule_work(&info->tqueue);
}
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;
queue_task(&tty->flip.tqueue, &tq_timer);
schedule_delayed_work(&tty->flip.work, 1);
}
static _INLINE_ void transmit_chars(ser_info_t *info)
......@@ -537,7 +537,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
printk("scheduling hangup...");
#endif
MOD_INC_USE_COUNT;
if (schedule_task(&info->tqueue_hangup) == 0)
if (schedule_work(&info->tqueue_hangup) == 0)
MOD_DEC_USE_COUNT;
}
}
......@@ -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
* 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_)
{
ser_info_t *info = (ser_info_t *) private_;
......@@ -651,7 +646,7 @@ static void do_softint(void *private_)
}
/*
* This routine is called from the scheduler tqueue 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
* hangup processing is:
*
......@@ -1308,7 +1303,7 @@ static void begin_break(ser_info_t *info)
{
volatile cpm8260_t *cp;
uint page, sblock;
ushort num;
int num;
cp = cpmp;
......@@ -1352,7 +1347,7 @@ static void end_break(ser_info_t *info)
{
volatile cpm8260_t *cp;
uint page, sblock;
ushort num;
int num;
cp = cpmp;
......@@ -1756,7 +1751,7 @@ static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout)
*/
char_time = 1;
if (timeout)
char_time = min(char_time, timeout);
char_time = min(char_time, (unsigned long)timeout);
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
printk("In rs_wait_until_sent(%d) check=%lu...", timeout, char_time);
printk("jiff=%lu...", jiffies);
......@@ -1980,7 +1975,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
ser_info_t *info;
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))
return -ENODEV;
retval = get_async_struct(line, &info);
......@@ -2455,7 +2450,7 @@ void kgdb_map_scc(void)
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)
volatile immap_t *immap;
volatile iop8260_t *io;
init_bh(SERIAL_BH, do_serial_bh);
show_serial_version();
/* Initialize the tty_driver structure */
......@@ -2680,10 +2673,8 @@ int __init rs_8xx_init(void)
init_waitqueue_head(&info->close_wait);
info->magic = SERIAL_MAGIC;
info->flags = state->flags;
info->tqueue.routine = do_softint;
info->tqueue.data = info;
info->tqueue_hangup.routine = do_serial_hangup;
info->tqueue_hangup.data = info;
INIT_WORK(&info->tqueue, do_softint, info);
INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info);
info->line = i;
info->state = state;
state->info = (struct async_struct *)info;
......@@ -2874,7 +2865,7 @@ int __init rs_8xx_init(void)
/* Install interrupt handler.
*/
request_8xxirq(state->irq, rs_8xx_interrupt, 0, "uart", info);
request_irq(state->irq, rs_8xx_interrupt, 0, "uart", info);
/* Set up the baud rate generator.
*/
......
......@@ -431,7 +431,7 @@ clk_8260(bd_t *bd)
}
#endif
#ifdef CONFIG_EST8260
#if defined(CONFIG_EST8260) || defined(CONFIG_TQM8260)
void
embed_config(bd_t **bdp)
{
......
......@@ -337,7 +337,7 @@ EXPORT_SYMBOL(cpm_free_handler);
#if defined(CONFIG_8xx) || defined(CONFIG_4xx)
EXPORT_SYMBOL(__res);
#endif
#if defined(CONFIG_8xx) || defined(CONFIG_8260)
#if defined(CONFIG_8xx)
EXPORT_SYMBOL(request_8xxirq);
#endif
......
......@@ -28,6 +28,8 @@ obj-$(CONFIG_PMAC_PBOOK) += sleep.o
obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o
obj-$(CONFIG_PREP_RESIDUAL) += residual.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_GEMINI) += gemini_pci.o gemini_setup.o gemini_prom.o
obj-$(CONFIG_K2) += k2_setup.o k2_pci.o
......
......@@ -3,8 +3,12 @@
* will soon be removed. All of the clock values are computed from
* 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
......@@ -25,3 +29,4 @@ typedef struct bd_info {
extern bd_t m8xx_board_info;
#endif /* __EST8260_PLATFORM */
/*
* 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
*
* 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
......@@ -4,8 +4,8 @@
* Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
*/
#ifndef __MACH_TQM8260_H
#define __MACH_TQM8260_H
#ifndef __TQM8260_PLATFORM
#define __TQM8260_PLATFORM
#include <linux/config.h>
......@@ -14,4 +14,6 @@
#define IMAP_ADDR ((uint)0xFFF00000)
#define PHY_INTERRUPT 25
#endif /* __MACH_TQM8260_H */
#define BOOTROM_RESTART_ADDR ((uint)0x40000104)
#endif /* __TQM8260_PLATFORM */
/*
* 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;
......@@ -63,16 +63,6 @@ m8260_setup_arch(void)
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
* divided by four.
*/
......@@ -93,30 +83,27 @@ m8260_calibrate_decr(void)
*/
static uint rtc_time;
static static int
static int
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;
#endif
return(0);
}
static unsigned long
m8260_get_rtc_time(void)
{
#ifdef CONFIG_TQM8260
return ((immap_t *)IMAP_ADDR)->im_sit.sit_tmcnt;
#else
/* Get time from the RTC.
*/
return((unsigned long)rtc_time);
#endif
}
#ifndef BOOTROM_RESTART_ADDR
#warning "Using default BOOTROM_RESTART_ADDR!"
#define BOOTROM_RESTART_ADDR 0xff000104
#endif
static void
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
* or the reboot program to send a proper address.
*/
#ifdef CONFIG_TQM8260
startaddr = 0x40000104;
#else
startaddr = 0xff000104;
#endif
startaddr = BOOTROM_RESTART_ADDR;
if (cmd != NULL) {
if (!strncmp(cmd, "startaddr=", 10))
startaddr = simple_strtoul(&cmd[10], NULL, 0);
}
m8260_gorom((unsigned int)__pa(__res), startaddr);
m8260_gorom((void*)__pa(__res), startaddr);
}
static void
m8260_power_off(void)
m8260_halt(void)
{
m8260_restart(NULL);
local_irq_disable();
while (1);
}
static void
m8260_halt(void)
m8260_power_off(void)
{
m8260_restart(NULL);
m8260_halt();
}
static int
m8260_show_percpuinfo(struct seq_file *m, int i)
{
......@@ -181,9 +164,6 @@ m8260_init_IRQ(void)
int i;
void cpm_interrupt_init(void);
#if 0
ppc8260_pic.irq_offset = 0;
#endif
for ( i = 0 ; i < NR_SIU_INTS ; i++ )
irq_desc[i].handler = &ppc8260_pic;
......@@ -194,7 +174,6 @@ m8260_init_IRQ(void)
immr->im_intctl.ic_siprr = 0x05309770;
immr->im_intctl.ic_scprrh = 0x05309770;
immr->im_intctl.ic_scprrl = 0x05309770;
}
/*
......@@ -219,12 +198,29 @@ m8260_find_end_of_memory(void)
static void __init
m8260_map_io(void)
{
io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
io_block_mapping(0xe0000000, 0xe0000000, 0x10000000, _PAGE_IO);
uint addr;
/* 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
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)
{
parse_bootinfo(find_bootinfo());
......@@ -265,11 +261,3 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
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");
}
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