Commit 603ba04d authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.6-serial

into ppc970.osdl.org:/home/torvalds/v2.5/linux
parents 427502ff 45cf898b
......@@ -154,29 +154,6 @@ config ROMKERNEL
endchoice
config DEFAULT_CMDLINE
bool "Use buildin commandline"
default n
help
buildin kernel commandline enabled.
config KERNEL_COMMAND
string "Buildin commmand string"
depends on DEFAULT_CMDLINE
help
buildin kernel commandline strings.
config BLKDEV_RESERVE
bool "BLKDEV Reserved Memory"
default n
help
Reserved BLKDEV area.
config CONFIG_BLKDEV_RESERVE_ADDRESS
hex 'start address'
depends on BLKDEV_RESERVE
help
BLKDEV start address.
endmenu
menu "Executable file formats"
......@@ -193,26 +170,19 @@ source "drivers/block/Kconfig"
source "drivers/ide/Kconfig"
source "net/Kconfig"
source "drivers/isdn/Kconfig"
source "arch/h8300/Kconfig.ide"
source "drivers/telephony/Kconfig"
source "net/Kconfig"
#
# input before char - char/joystick depends on it. As does USB.
# input - input/joystick depends on it. As does USB.
#
source "drivers/input/Kconfig"
#
# Character device configuration
#
menu "Character devices"
config VT
bool "Virtual terminal"
requires INPUT=y
---help---
If you say Y here, you will get support for terminal devices with
display and keyboard devices. These are called "virtual" because you
......@@ -266,8 +236,37 @@ config HW_CONSOLE
depends on VT && !S390 && !UM
default y
config SERIAL
tristate "Serial (8250, 16450, 16550 or compatible) support"
---help---
This selects whether you want to include the driver for the standard
serial ports. The standard answer is Y. People who might say N
here are those that are setting up dedicated Ethernet WWW/FTP
servers, or users that have one of the various bus mice instead of a
serial mouse and don't intend to use their machine's standard serial
port for anything. (Note that the Cyclades and Stallion multi
serial port drivers do not need this driver built in for them to
work.)
To compile this driver as a module, choose M here: the
module will be called serial.
[WARNING: Do not compile this driver as a module if you are using
non-standard serial ports, since the configuration information will
be lost when the driver is unloaded. This limitation may be lifted
in the future.]
BTW1: If you have a mouseman serial mouse which is not recognized by
the X window system, try running gpm first.
BTW2: If you intend to use a software modem (also called Winmodem)
under Linux, forget it. These modems are crippled and require
proprietary drivers which are only available under Windows.
Most people will say Y or M here, so that they can use serial mice,
modems and similar devices connecting to the standard serial ports.
config SH_SCI
tristate "Serial (SCI) support"
tristate "Serial (SCI, SCIF) support"
help
Selecting this option will allow the Linux kernel to transfer data
over SCI (Serial Communication Interface) and/or SCIF (Serial
......@@ -301,6 +300,8 @@ config SERIAL_CONSOLE
If unsure, say N.
comment "Unix98 PTY support"
config UNIX98_PTYS
bool "Unix98 PTY support"
---help---
......@@ -343,15 +344,17 @@ config UNIX98_PTY_COUNT
When not in use, each additional set of 256 PTYs occupy
approximately 8 KB of kernel memory on 32-bit architectures.
endmenu
source "drivers/char/pcmcia/Kconfig"
source "drivers/media/Kconfig"
source "sound/Kconfig"
source "drivers/serial/Kconfig"
source "fs/Kconfig"
source "drivers/i2c/Kconfig"
source "drivers/usb/Kconfig"
endmenu
source "fs/Kconfig"
menu "Kernel hacking"
......@@ -400,6 +403,29 @@ config CONFIG_SH_STANDARD_BIOS
serial console output using GDB protocol.
Require eCos/RedBoot
config DEFAULT_CMDLINE
bool "Use buildin commandline"
default n
help
buildin kernel commandline enabled.
config KERNEL_COMMAND
string "Buildin commmand string"
depends on DEFAULT_CMDLINE
help
buildin kernel commandline strings.
config BLKDEV_RESERVE
bool "BLKDEV Reserved Memory"
default n
help
Reserved BLKDEV area.
config CONFIG_BLKDEV_RESERVE_ADDRESS
hex 'start address'
depends on BLKDEV_RESERVE
help
BLKDEV start address.
endmenu
source "security/Kconfig"
......
# uClinux H8/300 Target Board Selection Menu (IDE)
menu "IDE Extra configuration"
config H8300_IDE_BASE
hex "IDE regitser base address"
depends on IDE
help
IDE registers base address
config H8300_IDE_ALT
hex "IDE regitser alternate address"
depends on IDE
help
IDE alternate registers address
config H8300_IDE_IRQNO
int "IDE IRQ no"
depends on IDE
help
IDE I/F using IRQ no
endmenu
#
# Automatically generated make config: don't edit
#
CONFIG_H8300=y
# CONFIG_MMU is not set
# CONFIG_SWAP is not set
# CONFIG_FPU is not set
......@@ -13,6 +14,9 @@ CONFIG_ISA=y
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
CONFIG_BROKEN_ON_SMP=y
#
# General setup
......@@ -21,9 +25,15 @@ CONFIG_EXPERIMENTAL=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_SYSCTL is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_IKCONFIG is not set
CONFIG_EMBEDDED=y
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
#
# Loadable module support
......@@ -37,24 +47,29 @@ CONFIG_EPOLL=y
# CONFIG_H8300H_AKI3068NET is not set
# CONFIG_H8300H_H8MAX is not set
CONFIG_H8300H_SIM=y
# CONFIG_H8S_EDOSK2674 is not set
# CONFIG_H8S_SIM is not set
# CONFIG_H83002 is not set
CONFIG_H83007=y
# CONFIG_H83048 is not set
# CONFIG_H83068 is not set
# CONFIG_H8S2678 is not set
CONFIG_CPU_H8300H=y
CONFIG_CPU_CLOCK=16000
# CONFIG_RAMKERNEL is not set
CONFIG_ROMKERNEL=y
# CONFIG_DEFAULT_CMDLINE is not set
#
# Executable file formats
#
CONFIG_KCORE_AOUT=y
CONFIG_BINFMT_FLAT=y
# CONFIG_BINFMT_ZFLAT is not set
# CONFIG_BINFMT_MISC is not set
#
# Generic Driver Options
#
#
# Memory Technology Devices (MTD)
#
......@@ -72,6 +87,7 @@ CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
#
# RAM/ROM/Flash chip drivers
......@@ -86,6 +102,7 @@ CONFIG_MTD_RAM=y
#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_UCLINUX=y
#
......@@ -98,9 +115,9 @@ CONFIG_MTD_UCLINUX=y
#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
#
# NAND Flash Device Drivers
......@@ -113,18 +130,100 @@ CONFIG_MTD_UCLINUX=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
#
# ATA/IDE/MFM/RLL support
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set
#
# IDE Extra configuration
#
#
# Networking support
#
# CONFIG_NET is not set
CONFIG_NET=y
#
# Networking options
#
# CONFIG_PACKET is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_UNIX is not set
# CONFIG_NET_KEY is not set
# CONFIG_INET is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_FASTROUTE is not set
# CONFIG_NET_HW_FLOWCONTROL is not set
#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NETDEVICES=y
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
#
# Ethernet (10 or 100Mbit)
#
# CONFIG_NET_ETHERNET is not set
#
# Ethernet (1000 Mbit)
#
#
# Ethernet (10000 Mbit)
#
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set
#
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_SHAPER is not set
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# Amateur Radio support
......@@ -132,13 +231,14 @@ CONFIG_MTD_UCLINUX=y
# CONFIG_HAMRADIO is not set
#
# ISDN subsystem
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# Telephony Support
# Bluetooth support
#
# CONFIG_PHONE is not set
# CONFIG_BT is not set
#
# Input device support
......@@ -155,6 +255,7 @@ CONFIG_MTD_UCLINUX=y
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
# CONFIG_SERIO is not set
# CONFIG_SERIO_I8042 is not set
#
# Input Device Drivers
......@@ -163,14 +264,38 @@ CONFIG_SOUND_GAMEPORT=y
#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL is not set
CONFIG_SH_SCI=y
CONFIG_SERIAL_CONSOLE=y
#
# Unix98 PTY support
#
# CONFIG_UNIX98_PTYS is not set
#
# Multimedia devices
# Serial drivers
#
# CONFIG_VIDEO_DEV is not set
# CONFIG_SERIAL_8250 is not set
#
# Non-8250 serial port support
#
#
# I2C support
#
# CONFIG_I2C is not set
#
# USB support
#
#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set
#
# File systems
......@@ -203,8 +328,10 @@ CONFIG_ROMFS_FS=y
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
# CONFIG_DEVFS_FS is not set
# CONFIG_TMPFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
#
......@@ -225,6 +352,11 @@ CONFIG_RAMFS=y
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
#
# Network File Systems
#
# CONFIG_EXPORTFS is not set
#
# Partition Types
#
......@@ -232,8 +364,9 @@ CONFIG_RAMFS=y
CONFIG_MSDOS_PARTITION=y
#
# USB support
# Native Language Support
#
# CONFIG_NLS is not set
#
# Kernel hacking
......@@ -243,7 +376,9 @@ CONFIG_FULLDEBUG=y
# CONFIG_HIGHPROFILE is not set
CONFIG_NO_KERNEL_MSG=y
CONFIG_GDB_MAGICPRINT=y
CONFIG_SYSCALL_PRINT=y
# CONFIG_SYSCALL_PRINT is not set
# CONFIG_DEFAULT_CMDLINE is not set
# CONFIG_BLKDEV_RESERVE is not set
#
# Security options
......
......@@ -27,10 +27,10 @@
void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
{
outb(H8300_TIMER_COUNT_DATA,TCORA2);
outb(0x00,_8TCSR2);
ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2);
ctrl_outb(0x00,_8TCSR2);
request_irq(40,timer_int,0,"timer",0);
outb(0x40|0x08|0x03,_8TCR2);
ctrl_outb(0x40|0x08|0x03,_8TCR2);
}
void platform_timer_eoi(void)
......
......@@ -236,7 +236,7 @@ SYMBOL_NAME_LABEL(system_call)
mov.l @(LER3:16,sp),er2
jsr @er4
mov.l er0,@(LER0:16,sp) /* save the return value */
jsr SYMBOL_NAME(syscall_trace)
jsr @SYMBOL_NAME(syscall_trace)
SYMBOL_NAME_LABEL(ret_from_signal)
......@@ -253,7 +253,7 @@ SYMBOL_NAME_LABEL(ret_from_exception)
1:
mov.l @(TI_FLAGS:16,er2),er1
btst #TIF_NEED_RESCHED,r1l
bne @SYMBOL_NAME(reschedule):16
bne SYMBOL_NAME(reschedule):16
mov.l sp,er1
subs #4,er1 /* adjust retpc */
mov.l er2,er0
......@@ -273,7 +273,7 @@ SYMBOL_NAME_LABEL(reschedule)
SYMBOL_NAME_LABEL(ret_from_fork)
mov.l er2,er0
jsr @SYMBOL_NAME(schedule_tail)
jmp @SYMBOL_NAME_LABEL(ret_from_exception)
jmp @SYMBOL_NAME(ret_from_exception)
SYMBOL_NAME_LABEL(resume)
/*
......
......@@ -105,6 +105,7 @@ gpio_table:
;; PBDDR
.byte 0x00,0x00
.section .rodata
__target_name:
.asciz "generic"
......
......@@ -29,13 +29,14 @@ extern int request_irq_boot(unsigned int,
#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
#include <asm/regs306x.h>
#define CMFA 6
int platform_timer_setup(void (*timer_int)(int, void *, struct pt_regs *))
{
outb(H8300_TIMER_COUNT_DATA,TMR8CMA2);
outb(0x00,TMR8TCSR2);
request_irq_boot(40,timer_int,0,"timer",0);
outb(0x40|0x08|0x03,TMR8TCNT2);
ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2);
ctrl_outb(0x00,_8TCSR2);
request_irq(40,timer_int,0,"timer",0);
ctrl_outb(0x40|0x08|0x03,_8TCR2);
return 0;
}
......@@ -65,19 +66,19 @@ int platform_timer_setup(void (*timer_int)(int, void *, struct pt_regs *))
{
*(unsigned short *)GRA= H8300_TIMER_COUNT_DATA;
*(unsigned short *)TCNT=0;
outb(0x23,TCR);
outb(0x00,TIOR);
ctrl_outb(0x23,TCR);
ctrl_outb(0x00,TIOR);
request_timer_irq(26,timer_int,0,"timer",0);
outb(inb(TIER) | 0x01,TIER);
outb(inb(TSNC) & ~0x01,TSNC);
outb(inb(TMDR) & ~0x01,TMDR);
outb(inb(TSTR) | 0x01,TSTR);
ctrl_outb(inb(TIER) | 0x01,TIER);
ctrl_outb(inb(TSNC) & ~0x01,TSNC);
ctrl_outb(inb(TMDR) & ~0x01,TMDR);
ctrl_outb(inb(TSTR) | 0x01,TSTR);
return 0;
}
void platform_timer_eoi(void)
{
outb(inb(TSR) & ~0x01,TSR);
ctrl_outb(inb(TSR) & ~0x01,TSR);
}
#endif
......
......@@ -27,10 +27,10 @@
void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
{
outb(H8300_TIMER_COUNT_DATA,TCORA2);
outb(0x00,_8TCSR2);
ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2);
ctrl_outb(0x00,_8TCSR2);
request_irq(40,timer_int,0,"timer",0);
outb(0x40|0x08|0x03,_8TCR2);
ctrl_outb(0x40|0x08|0x03,_8TCR2);
}
void platform_timer_eoi(void)
......
......@@ -168,6 +168,7 @@ gpio_table:
;; PHDDR
.byte 0x00,0x00
.section .rodata
__target_name:
.asciz "EDOSK-2674"
......
......@@ -29,13 +29,13 @@
int __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
{
unsigned char mstpcrl;
mstpcrl = inb(MSTPCRL); /* Enable timer */
mstpcrl = ctrl_inb(MSTPCRL); /* Enable timer */
mstpcrl &= ~0x01;
outb(mstpcrl,MSTPCRL);
outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
outb(0x00,_8TCSR1);
ctrl_outb(mstpcrl,MSTPCRL);
ctrl_outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
ctrl_outb(0x00,_8TCSR1);
request_irq(76,timer_int,0,"timer",0);
outb(0x40|0x08|0x03,_8TCR1);
ctrl_outb(0x40|0x08|0x03,_8TCR1);
return 0;
}
......
......@@ -233,7 +233,7 @@ SYMBOL_NAME_LABEL(system_call)
mov.l @(LER3:16,sp),er2
jsr @er4
mov.l er0,@(LER0:16,sp) /* save the return value */
jsr SYMBOL_NAME(syscall_trace)
jsr @SYMBOL_NAME(syscall_trace)
SYMBOL_NAME_LABEL(ret_from_signal)
......@@ -250,7 +250,7 @@ SYMBOL_NAME_LABEL(ret_from_exception)
1:
mov.l @(TI_FLAGS:16,er2),er1
btst #TIF_NEED_RESCHED,r1l
bne @SYMBOL_NAME(reschedule):16
bne SYMBOL_NAME(reschedule):16
mov.l sp,er1
subs #4,er1 /* adjust retpc */
mov.l er2,er0
......@@ -270,7 +270,7 @@ SYMBOL_NAME_LABEL(reschedule)
SYMBOL_NAME_LABEL(ret_from_fork)
mov.l er2,er0
jsr @SYMBOL_NAME(schedule_tail)
jmp @SYMBOL_NAME_LABEL(ret_from_exception)
jmp @SYMBOL_NAME(ret_from_exception)
SYMBOL_NAME_LABEL(resume)
......
......@@ -110,6 +110,7 @@ gpio_table:
;; PHDDR
.byte 0x00,0x00
.section .rodata
__target_name:
.asciz "generic"
......
......@@ -25,10 +25,10 @@
int platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
{
outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
outb(0x00,_8TCSR1);
ctrl_outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
ctrl_outb(0x00,_8TCSR1);
request_irq(76,timer_int,0,"timer",0);
outb(0x40|0x08|0x03,_8TCR1);
ctrl_outb(0x40|0x08|0x03,_8TCR1);
return 0;
}
......
......@@ -130,11 +130,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
mtspr HID0,r4 /* Disable DPM */
sync
/* Flush & disable L1 */
mr r5,r3
bl __flush_disable_L1
mr r3,r5
/* Get the current enable bit of the L2CR into r4 */
mfspr r4,L2CR
......@@ -236,7 +231,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
sync
4:
bl __inval_enable_L1
/* Restore HID0[DPM] to whatever it was before */
sync
......@@ -394,11 +388,10 @@ BEGIN_FTR_SECTION
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
sync
/* Load counter to 0x1000 cache lines (128k) and
/* Load counter to 0x4000 cache lines (512k) and
* load cache with datas
*/
lis r3,0x0002
// li r3,0x1000 /* 128kB / 32B */
li r3,0x4000 /* 512kB / 32B */
mtctr r3
li r3, 0
1:
......@@ -409,8 +402,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
sync
/* Now flush those cache lines */
lis r3,0x0002
// li r3,0x1000 /* 128kB / 32B */
li r3,0x4000 /* 512kB / 32B */
mtctr r3
li r3, 0
1:
......
......@@ -54,6 +54,7 @@ int smp_hw_index[NR_CPUS];
struct thread_info *secondary_ti;
EXPORT_SYMBOL(cpu_online_map);
EXPORT_SYMBOL(cpu_possible_map);
/* SMP operations for this machine */
static struct smp_ops_t *smp_ops;
......
......@@ -319,7 +319,7 @@ static void start_request(struct floppy_state *fs)
#if 0
printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n",
req->rq_disk->disk_name, req->cmd,
req->sector, req->nr_sectors, req->buffer);
(long)req->sector, req->nr_sectors, req->buffer);
printk(" rq_status=%d errors=%d current_nr_sectors=%ld\n",
req->rq_status, req->errors, req->current_nr_sectors);
#endif
......@@ -346,8 +346,13 @@ static void start_request(struct floppy_state *fs)
}
}
fs->req_cyl = req->sector / fs->secpercyl;
x = req->sector % fs->secpercyl;
/* Do not remove the cast. req->sector is now a sector_t and
* can be 64 bits, but it will never go past 32 bits for this
* driver anyway, so we can safely cast it down and not have
* to do a 64/32 division
*/
fs->req_cyl = ((long)req->sector) / fs->secpercyl;
x = ((long)req->sector) % fs->secpercyl;
fs->head = x / fs->secpertrack;
fs->req_sector = x % fs->secpertrack + 1;
fd_req = req;
......@@ -614,7 +619,7 @@ static void xfer_timeout(unsigned long data)
fd_req->sector += s;
fd_req->current_nr_sectors -= s;
printk(KERN_ERR "swim3: timeout %sing sector %ld\n",
(rq_data_dir(fd_req)==WRITE? "writ": "read"), fd_req->sector);
(rq_data_dir(fd_req)==WRITE? "writ": "read"), (long)fd_req->sector);
end_request(fd_req, 0);
fs->state = idle;
start_request(fs);
......@@ -730,7 +735,7 @@ static irqreturn_t swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} else {
printk("swim3: error %sing block %ld (err=%x)\n",
rq_data_dir(fd_req) == WRITE? "writ": "read",
fd_req->sector, err);
(long)fd_req->sector, err);
end_request(fd_req, 0);
fs->state = idle;
}
......
......@@ -440,7 +440,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
char * p = buf;
char charging = 0;
long charge = -1;
long current = 0;
long amperage = 0;
unsigned long btype = 0;
ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0);
......@@ -453,7 +453,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
percentage += (pmu_batteries[i].charge * 100) /
pmu_batteries[i].max_charge;
charge += pmu_batteries[i].charge;
current += pmu_batteries[i].current;
amperage += pmu_batteries[i].amperage;
if (btype == 0)
btype = (pmu_batteries[i].flags & PMU_BATT_TYPE_MASK);
real_count++;
......@@ -462,11 +462,11 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
}
}
if (real_count) {
if (current < 0) {
if (amperage < 0) {
if (btype == PMU_BATT_TYPE_SMART)
time_units = (charge * 59) / (current * -1);
time_units = (charge * 59) / (amperage * -1);
else
time_units = (charge * 16440) / (current * -60);
time_units = (charge * 16440) / (amperage * -60);
}
percentage /= real_count;
if (charging > 0) {
......
......@@ -649,7 +649,7 @@ done_battery_state_ohare(struct adb_request* req)
unsigned int bat_flags = PMU_BATT_TYPE_HOOPER;
long pcharge, charge, vb, vmax, lmax;
long vmax_charging, vmax_charged;
long current, voltage, time, max;
long amperage, voltage, time, max;
int mb = pmac_call_feature(PMAC_FTR_GET_MB_INFO,
NULL, PMAC_MB_INFO_MODEL, 0);
......@@ -676,10 +676,10 @@ done_battery_state_ohare(struct adb_request* req)
bat_flags |= PMU_BATT_CHARGING;
vb = (req->reply[1] << 8) | req->reply[2];
voltage = (vb * 265 + 72665) / 10;
current = req->reply[5];
amperage = req->reply[5];
if ((req->reply[0] & 0x01) == 0) {
if (current > 200)
vb += ((current - 200) * 15)/100;
if (amperage > 200)
vb += ((amperage - 200) * 15)/100;
} else if (req->reply[0] & 0x02) {
vb = (vb * 97) / 100;
vmax = vmax_charging;
......@@ -694,19 +694,19 @@ done_battery_state_ohare(struct adb_request* req)
if (pcharge < charge)
charge = pcharge;
}
if (current > 0)
time = (charge * 16440) / current;
if (amperage > 0)
time = (charge * 16440) / amperage;
else
time = 0;
max = 100;
current = -current;
amperage = -amperage;
} else
charge = max = current = voltage = time = 0;
charge = max = amperage = voltage = time = 0;
pmu_batteries[pmu_cur_battery].flags = bat_flags;
pmu_batteries[pmu_cur_battery].charge = charge;
pmu_batteries[pmu_cur_battery].max_charge = max;
pmu_batteries[pmu_cur_battery].current = current;
pmu_batteries[pmu_cur_battery].amperage = amperage;
pmu_batteries[pmu_cur_battery].voltage = voltage;
pmu_batteries[pmu_cur_battery].time_remaining = time;
}
......@@ -734,7 +734,7 @@ done_battery_state_smart(struct adb_request* req)
*/
unsigned int bat_flags = PMU_BATT_TYPE_SMART;
int current;
int amperage;
unsigned int capa, max, voltage;
if (req->reply[1] & 0x01)
......@@ -749,12 +749,12 @@ done_battery_state_smart(struct adb_request* req)
case 3:
case 4: capa = req->reply[2];
max = req->reply[3];
current = *((signed char *)&req->reply[4]);
amperage = *((signed char *)&req->reply[4]);
voltage = req->reply[5];
break;
case 5: capa = (req->reply[2] << 8) | req->reply[3];
max = (req->reply[4] << 8) | req->reply[5];
current = *((signed short *)&req->reply[6]);
amperage = *((signed short *)&req->reply[6]);
voltage = (req->reply[8] << 8) | req->reply[9];
break;
default:
......@@ -763,23 +763,23 @@ done_battery_state_smart(struct adb_request* req)
break;
}
} else
capa = max = current = voltage = 0;
capa = max = amperage = voltage = 0;
if ((req->reply[1] & 0x01) && (current > 0))
if ((req->reply[1] & 0x01) && (amperage > 0))
bat_flags |= PMU_BATT_CHARGING;
pmu_batteries[pmu_cur_battery].flags = bat_flags;
pmu_batteries[pmu_cur_battery].charge = capa;
pmu_batteries[pmu_cur_battery].max_charge = max;
pmu_batteries[pmu_cur_battery].current = current;
pmu_batteries[pmu_cur_battery].amperage = amperage;
pmu_batteries[pmu_cur_battery].voltage = voltage;
if (current) {
if ((req->reply[1] & 0x01) && (current > 0))
if (amperage) {
if ((req->reply[1] & 0x01) && (amperage > 0))
pmu_batteries[pmu_cur_battery].time_remaining
= ((max-capa) * 3600) / current;
= ((max-capa) * 3600) / amperage;
else
pmu_batteries[pmu_cur_battery].time_remaining
= (capa * 3600) / (-current);
= (capa * 3600) / (-amperage);
} else
pmu_batteries[pmu_cur_battery].time_remaining = 0;
......@@ -861,7 +861,7 @@ proc_get_batt(char *page, char **start, off_t off,
p += sprintf(p, "max_charge : %d\n",
pmu_batteries[batnum].max_charge);
p += sprintf(p, "current : %d\n",
pmu_batteries[batnum].current);
pmu_batteries[batnum].amperage);
p += sprintf(p, "voltage : %d\n",
pmu_batteries[batnum].voltage);
p += sprintf(p, "time rem. : %d\n",
......
......@@ -680,6 +680,7 @@ static __inline__ void gem_post_rxds(struct gem *gp, int limit)
static void gem_rx(struct gem *gp)
{
int entry, drops;
u32 done;
if (netif_msg_intr(gp))
printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
......@@ -687,6 +688,7 @@ static void gem_rx(struct gem *gp)
entry = gp->rx_new;
drops = 0;
done = readl(gp->regs + RXDMA_DONE);
for (;;) {
struct gem_rxd *rxd = &gp->init_block->rxd[entry];
struct sk_buff *skb;
......@@ -697,6 +699,19 @@ static void gem_rx(struct gem *gp)
if ((status & RXDCTRL_OWN) != 0)
break;
/* When writing back RX descriptor, GEM writes status
* then buffer address, possibly in seperate transactions.
* If we don't wait for the chip to write both, we could
* post a new buffer to this descriptor then have GEM spam
* on the buffer address. We sync on the RX completion
* register to prevent this from happening.
*/
if (entry == done) {
done = readl(gp->regs + RXDMA_DONE);
if (entry == done)
break;
}
skb = gp->rx_skbs[entry];
len = (status & RXDCTRL_BUFSZ) >> 16;
......
......@@ -2,7 +2,6 @@
/* TIMER rate define */
#ifdef H8300_TIMER_DEFINE
#include <linux/config.h>
#define H8300_TIMER_COUNT_DATA 20000*10/8192
#define H8300_TIMER_FREQ 20000*1000/8192
#endif
......@@ -12,13 +11,8 @@
#define NE2000_ADDR 0x200000
#define NE2000_IRQ 5
#define NE2000_IRQ_VECTOR (12 + NE2000_IRQ)
#define NE2000_BYTE volatile unsigned short
#define IER 0xfee015
#define ISR 0xfee016
#define IRQ_MASK (1 << NE2000_IRQ)
#define WCRL 0xfee023
#define MAR0A 0xffff20
#define ETCR0A 0xffff24
......
......@@ -13,6 +13,7 @@
#define H8300_NE_DEFINE
#include <asm/machine-depend.h>
#define NE2000_IRQ_VECTOR (12 + NE2000_IRQ)
#undef H8300_NE_DEFINE
/****************************************************************************/
......
......@@ -14,9 +14,6 @@
#define NE2000_IRQ_VECTOR (12 + NE2000_IRQ)
#define NE2000_BYTE volatile unsigned short
#define IER 0xfee015
#define ISR 0xfee016
#define IRQ_MASK (1 << NE2000_IRQ)
/* sorry quick hack */
#if defined(outb)
# undef outb
......
......@@ -17,8 +17,8 @@
/****************************************************************************/
void h8300_ide_print_resource(char *name, hw_regs_t *hw);
static inline int ide_default_irq(unsigned long base) { return 0; };
static inline ide_ioreg_t ide_default_io_base(int index) { return 0; };
static __inline__ int ide_default_irq(unsigned long base) { return 0; };
static __inline__ unsigned long ide_default_io_base(int index) { return 0; };
static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
unsigned long ctrl_port, int *irq)
......
......@@ -6,6 +6,15 @@
#include <linux/config.h>
#include <asm/virtconvert.h>
#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
#include <asm/regs306x.h>
#elif defined(CONFIG_H8S2678)
#include <asm/regs2678.h>
#else
#error UNKNOWN CPU TYPE
#endif
/*
* These are for ISA/PCI shared memory _only_ and should never be used
* on any other type of memory, including Zorro memory. They are meant to
......@@ -30,6 +39,7 @@
* 020325 Added some #define's for the COBRA5272 board
* (hede)
*/
static inline unsigned short _swapw(volatile unsigned short v)
{
return ((v << 8) | (v >> 8));
......@@ -41,20 +51,19 @@ static inline unsigned int _swapl(volatile unsigned long v)
}
#define readb(addr) \
({ unsigned char __v = (*(volatile unsigned char *) (addr & 0x00ffffff)); __v; })
({ unsigned char __v = (*(volatile unsigned char *) ((addr) & 0x00ffffff)); __v; })
#define readw(addr) \
({ unsigned short __v = (*(volatile unsigned short *) (addr & 0x00ffffff)); __v; })
({ unsigned short __v = (*(volatile unsigned short *) ((addr) & 0x00ffffff)); __v; })
#define readl(addr) \
({ unsigned int __v = (*(volatile unsigned int *) (addr & 0x00ffffff)); __v; })
({ unsigned int __v = (*(volatile unsigned int *) ((addr) & 0x00ffffff)); __v; })
#define writeb(b,addr) (void)((*(volatile unsigned char *) ((addr) & 0x00ffffff)) = (b))
#define writew(b,addr) (void)((*(volatile unsigned short *) ((addr) & 0x00ffffff)) = (b))
#define writel(b,addr) (void)((*(volatile unsigned int *) ((addr) & 0x00ffffff)) = (b))
#define readb_relaxed(addr) readb(addr)
#define readw_relaxed(addr) readw(addr)
#define readl_relaxed(addr) readl(addr)
#define writeb(b,addr) (void)((*(volatile unsigned char *) (addr & 0x00ffffff)) = (b))
#define writew(b,addr) (void)((*(volatile unsigned short *) (addr & 0x00ffffff)) = (b))
#define writel(b,addr) (void)((*(volatile unsigned int *) (addr & 0x00ffffff)) = (b))
#define __raw_readb readb
#define __raw_readw readw
#define __raw_readl readl
......@@ -62,12 +71,24 @@ static inline unsigned int _swapl(volatile unsigned long v)
#define __raw_writew writew
#define __raw_writel writel
static inline int h8300_buswidth(unsigned int addr)
{
return (*(volatile unsigned char *)ABWCR & (1 << (addr >> 21) & 7)) == 0;
}
static inline void io_outsb(unsigned int addr, void *buf, int len)
{
volatile unsigned char *ap = (volatile unsigned char *) addr;
volatile unsigned char *ap_b = (volatile unsigned char *) addr;
volatile unsigned short *ap_w = (volatile unsigned short *) addr;
unsigned char *bp = (unsigned char *) buf;
if(h8300_buswidth(addr) && (addr & 1)) {
while (len--)
*ap = *bp++;
*ap_w = *bp++;
} else {
while (len--)
*ap_b = *bp++;
}
}
static inline void io_outsw(unsigned int addr, void *buf, int len)
......@@ -75,7 +96,7 @@ static inline void io_outsw(unsigned int addr, void *buf, int len)
volatile unsigned short *ap = (volatile unsigned short *) addr;
unsigned short *bp = (unsigned short *) buf;
while (len--)
*ap = _swapw(*bp++);
*ap = *bp++;
}
static inline void io_outsl(unsigned int addr, void *buf, int len)
......@@ -83,13 +104,18 @@ static inline void io_outsl(unsigned int addr, void *buf, int len)
volatile unsigned int *ap = (volatile unsigned int *) addr;
unsigned int *bp = (unsigned int *) buf;
while (len--)
*ap = _swapl(*bp++);
*ap = *bp++;
}
static inline void io_insb(unsigned int addr, void *buf, int len)
{
volatile unsigned char *ap = (volatile unsigned char *) addr;
volatile unsigned char *ap;
unsigned char *bp = (unsigned char *) buf;
if(h8300_buswidth(addr))
ap = (volatile unsigned char *)(addr ^ 1);
else
ap = (volatile unsigned char *)addr;
while (len--)
*bp++ = *ap;
}
......@@ -99,7 +125,7 @@ static inline void io_insw(unsigned int addr, void *buf, int len)
volatile unsigned short *ap = (volatile unsigned short *) addr;
unsigned short *bp = (unsigned short *) buf;
while (len--)
*bp++ = _swapw(*ap);
*bp++ = *ap;
}
static inline void io_insl(unsigned int addr, void *buf, int len)
......@@ -107,7 +133,7 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
volatile unsigned int *ap = (volatile unsigned int *) addr;
unsigned int *bp = (unsigned int *) buf;
while (len--)
*bp++ = _swapl(*ap);
*bp++ = *ap;
}
/*
......@@ -119,12 +145,12 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
#define inb(addr) readb(addr)
#define inw(addr) readw(addr)
#define inl(addr) readl(addr)
#define outb(x,addr) ((void) writeb(x,addr))
#define outw(x,addr) ((void) writew(x,addr))
#define outl(x,addr) ((void) writel(x,addr))
#define inb(addr) ((h8300_buswidth(addr))?readb(addr ^ 1) & 0xff:readb(addr))
#define inw(addr) _swapw(readw(addr))
#define inl(addr) _swapl(readl(addr))
#define outb(x,addr) ((void)((h8300_buswidth(addr) && (addr & 1))?writew(x,addr):writeb(x,addr)))
#define outw(x,addr) ((void) writew(_swapw(x),addr))
#define outl(x,addr) ((void) writel(_swapl(x),addr))
#define inb_p(addr) inb(addr)
#define inw_p(addr) inw(addr)
......@@ -153,19 +179,19 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
extern void __iounmap(void *addr, unsigned long size);
extern inline void *ioremap(unsigned long physaddr, unsigned long size)
static inline void *ioremap(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
}
extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
}
extern inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
static inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
}
extern inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size)
static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
}
......
#ifndef _H8300NOMMU_PAGE_H
#define _H8300NOMMU_PAGE_H
#ifndef _H8300_PAGE_H
#define _H8300_PAGE_H
#include <linux/config.h>
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT (12)
#define PAGE_SIZE (4096)
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#ifdef __KERNEL__
......@@ -98,4 +98,4 @@ extern unsigned long memory_end;
#endif /* __KERNEL__ */
#endif /* _H8300NOMMU_PAGE_H */
#endif /* _H8300_PAGE_H */
......@@ -75,6 +75,7 @@ do { \
set_fs(USER_DS); /* reads from user space */ \
(_regs)->pc = (_pc); \
(_regs)->ccr &= 0x00; /* clear kernel flag */ \
wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \
} while(0)
#endif
#if defined(__H8300S__)
......
......@@ -57,14 +57,14 @@ asmlinkage void resume(void);
#define __cli() asm volatile ("orc #0x80,ccr")
#define __save_flags(x) \
asm volatile ("stc ccr,r0l\n\tmov.l er0,%0":"=r" (x) : : "er0")
asm volatile ("stc ccr,%w0":"=r" (x))
#define __restore_flags(x) \
asm volatile ("mov.l %0,er0\n\tldc r0l,ccr": :"r" (x) : "er0")
asm volatile ("ldc %w0,ccr": :"r" (x))
#define irqs_disabled() \
({ \
unsigned long flags; \
unsigned char flags; \
__save_flags(flags); \
((flags & 0x80) == 0x80); \
})
......
......@@ -226,7 +226,7 @@ struct pmu_battery_info
unsigned int flags;
unsigned int charge; /* current charge */
unsigned int max_charge; /* maximum charge */
signed int current; /* current, positive if charging */
signed int amperage; /* current, positive if charging */
unsigned int voltage; /* voltage */
unsigned int time_remaining; /* remaining time */
};
......
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