You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dave A. <ai...@us...> - 2003-06-10 03:08:11
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/macintosh In directory sc8-pr-cvs1:/tmp/cvs-serv14646/drivers/macintosh Added Files: ans-lcd.c apm_emu.c Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- /* * /dev/lcd driver for Apple Network Servers. */ #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/miscdevice.h> #include <linux/fcntl.h> #include <linux/init.h> #include <linux/delay.h> #include <asm/uaccess.h> #include <asm/sections.h> #include <asm/prom.h> #include <asm/ans-lcd.h> #include <asm/io.h> #define ANSLCD_ADDR 0xf301c000 #define ANSLCD_CTRL_IX 0x00 #define ANSLCD_DATA_IX 0x10 static unsigned long anslcd_short_delay = 80; static unsigned long anslcd_long_delay = 3280; static volatile unsigned char* anslcd_ptr; #undef DEBUG static void __pmac anslcd_write_byte_ctrl ( unsigned char c ) { #ifdef DEBUG printk(KERN_DEBUG "LCD: CTRL byte: %02x\n",c); #endif out_8(anslcd_ptr + ANSLCD_CTRL_IX, c); switch(c) { case 1: case 2: case 3: udelay(anslcd_long_delay); break; default: udelay(anslcd_short_delay); } } static void __pmac anslcd_write_byte_data ( unsigned char c ) { out_8(anslcd_ptr + ANSLCD_DATA_IX, c); udelay(anslcd_short_delay); } static ssize_t __pmac anslcd_write( struct file * file, const char * buf, size_t count, loff_t *ppos ) { const char * p = buf; int i; #ifdef DEBUG printk(KERN_DEBUG "LCD: write\n"); #endif if ( verify_area(VERIFY_READ, buf, count) ) return -EFAULT; for ( i = *ppos; count > 0; ++i, ++p, --count ) { char c; __get_user(c, p); anslcd_write_byte_data( c ); } *ppos = i; return p - buf; } static int __pmac anslcd_ioctl( struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg ) { char ch, *temp; #ifdef DEBUG printk(KERN_DEBUG "LCD: ioctl(%d,%d)\n",cmd,arg); #endif switch ( cmd ) { case ANSLCD_CLEAR: anslcd_write_byte_ctrl ( 0x38 ); anslcd_write_byte_ctrl ( 0x0f ); anslcd_write_byte_ctrl ( 0x06 ); anslcd_write_byte_ctrl ( 0x01 ); anslcd_write_byte_ctrl ( 0x02 ); return 0; case ANSLCD_SENDCTRL: temp = (char *) arg; __get_user(ch, temp); for (; ch; temp++) { /* FIXME: This is ugly, but should work, as a \0 byte is not a valid command code */ anslcd_write_byte_ctrl ( ch ); __get_user(ch, temp); } return 0; case ANSLCD_SETSHORTDELAY: if (!capable(CAP_SYS_ADMIN)) return -EACCES; anslcd_short_delay=arg; return 0; case ANSLCD_SETLONGDELAY: if (!capable(CAP_SYS_ADMIN)) return -EACCES; anslcd_long_delay=arg; return 0; default: return -EINVAL; } } static int __pmac anslcd_open( struct inode * inode, struct file * file ) { return 0; } struct file_operations anslcd_fops = { write: anslcd_write, ioctl: anslcd_ioctl, open: anslcd_open, }; static struct miscdevice anslcd_dev = { ANSLCD_MINOR, "anslcd", &anslcd_fops }; const char anslcd_logo[] = "********************" /* Line #1 */ "* LINUX! *" /* Line #3 */ "* Welcome to *" /* Line #2 */ "********************"; /* Line #4 */ int __init anslcd_init(void) { int a; struct device_node* node; node = find_devices("lcd"); if (!node || !node->parent) return -ENODEV; if (strcmp(node->parent->name, "gc")) return -ENODEV; anslcd_ptr = (volatile unsigned char*)ioremap(ANSLCD_ADDR, 0x20); misc_register(&anslcd_dev); #ifdef DEBUG printk(KERN_DEBUG "LCD: init\n"); #endif anslcd_write_byte_ctrl ( 0x38 ); anslcd_write_byte_ctrl ( 0x0c ); anslcd_write_byte_ctrl ( 0x06 ); anslcd_write_byte_ctrl ( 0x01 ); anslcd_write_byte_ctrl ( 0x02 ); for(a=0;a<80;a++) { anslcd_write_byte_data(anslcd_logo[a]); } return 0; } __initcall(anslcd_init); --- NEW FILE --- /* APM emulation layer for PowerMac * * Copyright 2001 Benjamin Herrenschmidt (be...@ke...) * * Lots of code inherited from apm.c, see appropriate notice in * arch/i386/kernel/apm.c * * 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, 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. * * */ #include <linux/config.h> #include <linux/module.h> #include <linux/poll.h> #include <linux/types.h> #include <linux/stddef.h> #include <linux/timer.h> #include <linux/fcntl.h> #include <linux/slab.h> #include <linux/stat.h> #include <linux/proc_fs.h> #include <linux/miscdevice.h> #include <linux/apm_bios.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/pm.h> #include <linux/kernel.h> #include <linux/smp_lock.h> #include <linux/adb.h> #include <linux/pmu.h> #include <asm/system.h> #include <asm/uaccess.h> #include <asm/machdep.h> #undef DEBUG #ifdef DEBUG #define DBG(args...) printk(KERN_DEBUG args) //#define DBG(args...) xmon_printf(args) #else #define DBG(args...) do { } while (0) #endif /* * The apm_bios device is one of the misc char devices. * This is its minor number. */ #define APM_MINOR_DEV 134 /* * Maximum number of events stored */ #define APM_MAX_EVENTS 20 #define FAKE_APM_BIOS_VERSION 0x0101 #define APM_USER_NOTIFY_TIMEOUT (5*HZ) /* * The per-file APM data */ struct apm_user { int magic; struct apm_user * next; int suser: 1; int suspend_waiting: 1; int suspends_pending; int suspends_read; int event_head; int event_tail; apm_event_t events[APM_MAX_EVENTS]; }; /* * The magic number in apm_user */ #define APM_BIOS_MAGIC 0x4101 /* * Local variables */ static int suspends_pending; static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue); static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); static struct apm_user * user_list; static int apm_notify_sleep(struct pmu_sleep_notifier *self, int when); static struct pmu_sleep_notifier apm_sleep_notifier = { apm_notify_sleep, SLEEP_LEVEL_USERLAND, }; static char driver_version[] = "0.5"; /* no spaces */ #ifdef DEBUG static char * apm_event_name[] = { "system standby", "system suspend", "normal resume", "critical resume", "low battery", "power status change", "update time", "critical suspend", "user standby", "user suspend", "system standby resume", "capabilities change" }; #define NR_APM_EVENT_NAME \ (sizeof(apm_event_name) / sizeof(apm_event_name[0])) #endif static int queue_empty(struct apm_user *as) { return as->event_head == as->event_tail; } static apm_event_t get_queued_event(struct apm_user *as) { as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS; return as->events[as->event_tail]; } static void queue_event(apm_event_t event, struct apm_user *sender) { struct apm_user * as; DBG("apm_emu: queue_event(%s)\n", apm_event_name[event-1]); if (user_list == NULL) return; for (as = user_list; as != NULL; as = as->next) { if (as == sender) continue; as->event_head = (as->event_head + 1) % APM_MAX_EVENTS; if (as->event_head == as->event_tail) { static int notified; if (notified++ == 0) printk(KERN_ERR "apm_emu: an event queue overflowed\n"); as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS; } as->events[as->event_head] = event; if (!as->suser) continue; switch (event) { case APM_SYS_SUSPEND: case APM_USER_SUSPEND: as->suspends_pending++; suspends_pending++; break; case APM_NORMAL_RESUME: as->suspend_waiting = 0; break; } } wake_up_interruptible(&apm_waitqueue); } static int check_apm_user(struct apm_user *as, const char *func) { if ((as == NULL) || (as->magic != APM_BIOS_MAGIC)) { printk(KERN_ERR "apm_emu: %s passed bad filp\n", func); return 1; } return 0; } static ssize_t do_read(struct file *fp, char *buf, size_t count, loff_t *ppos) { struct apm_user * as; int i; apm_event_t event; DECLARE_WAITQUEUE(wait, current); as = fp->private_data; if (check_apm_user(as, "read")) return -EIO; if (count < sizeof(apm_event_t)) return -EINVAL; if (queue_empty(as)) { if (fp->f_flags & O_NONBLOCK) return -EAGAIN; add_wait_queue(&apm_waitqueue, &wait); repeat: set_current_state(TASK_INTERRUPTIBLE); if (queue_empty(as) && !signal_pending(current)) { schedule(); goto repeat; } set_current_state(TASK_RUNNING); remove_wait_queue(&apm_waitqueue, &wait); } i = count; while ((i >= sizeof(event)) && !queue_empty(as)) { event = get_queued_event(as); DBG("apm_emu: do_read, returning: %s\n", apm_event_name[event-1]); if (copy_to_user(buf, &event, sizeof(event))) { if (i < count) break; return -EFAULT; } switch (event) { case APM_SYS_SUSPEND: case APM_USER_SUSPEND: as->suspends_read++; break; } buf += sizeof(event); i -= sizeof(event); } if (i < count) return count - i; if (signal_pending(current)) return -ERESTARTSYS; return 0; } static unsigned int do_poll(struct file *fp, poll_table * wait) { struct apm_user * as; as = fp->private_data; if (check_apm_user(as, "poll")) return 0; poll_wait(fp, &apm_waitqueue, wait); if (!queue_empty(as)) return POLLIN | POLLRDNORM; return 0; } static int do_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) { struct apm_user * as; DECLARE_WAITQUEUE(wait, current); as = filp->private_data; if (check_apm_user(as, "ioctl")) return -EIO; if (!as->suser) return -EPERM; switch (cmd) { case APM_IOC_SUSPEND: /* If a suspend message was sent to userland, we * consider this as a confirmation message */ if (as->suspends_read > 0) { as->suspends_read--; as->suspends_pending--; suspends_pending--; } else { // Route to PMU suspend ? break; } as->suspend_waiting = 1; add_wait_queue(&apm_waitqueue, &wait); DBG("apm_emu: ioctl waking up sleep waiter !\n"); wake_up(&apm_suspend_waitqueue); mb(); while(as->suspend_waiting && !signal_pending(current)) { set_current_state(TASK_INTERRUPTIBLE); schedule(); } set_current_state(TASK_RUNNING); remove_wait_queue(&apm_waitqueue, &wait); break; default: return -EINVAL; } return 0; } static int do_release(struct inode * inode, struct file * filp) { struct apm_user * as; as = filp->private_data; if (check_apm_user(as, "release")) return 0; filp->private_data = NULL; lock_kernel(); if (as->suspends_pending > 0) { suspends_pending -= as->suspends_pending; if (suspends_pending <= 0) wake_up(&apm_suspend_waitqueue); } if (user_list == as) user_list = as->next; else { struct apm_user * as1; for (as1 = user_list; (as1 != NULL) && (as1->next != as); as1 = as1->next) ; if (as1 == NULL) printk(KERN_ERR "apm: filp not in user list\n"); else as1->next = as->next; } unlock_kernel(); kfree(as); return 0; } static int do_open(struct inode * inode, struct file * filp) { struct apm_user * as; as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL); if (as == NULL) { printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", sizeof(*as)); return -ENOMEM; } as->magic = APM_BIOS_MAGIC; as->event_tail = as->event_head = 0; as->suspends_pending = 0; as->suspends_read = 0; /* * XXX - this is a tiny bit broken, when we consider BSD * process accounting. If the device is opened by root, we * instantly flag that we used superuser privs. Who knows, * we might close the device immediately without doing a * privileged operation -- cevans */ as->suser = capable(CAP_SYS_ADMIN); as->next = user_list; user_list = as; filp->private_data = as; DBG("apm_emu: opened by %s, suser: %d\n", current->comm, (int)as->suser); return 0; } /* Wait for all clients to ack the suspend request. APM API * doesn't provide a way to NAK, but this could be added * here. */ static int wait_all_suspend(void) { DECLARE_WAITQUEUE(wait, current); add_wait_queue(&apm_suspend_waitqueue, &wait); DBG("apm_emu: wait_all_suspend(), suspends_pending: %d\n", suspends_pending); while(suspends_pending > 0) { set_current_state(TASK_UNINTERRUPTIBLE); schedule(); } set_current_state(TASK_RUNNING); remove_wait_queue(&apm_suspend_waitqueue, &wait); DBG("apm_emu: wait_all_suspend() - complete !\n"); return 1; } static int apm_notify_sleep(struct pmu_sleep_notifier *self, int when) { switch(when) { case PBOOK_SLEEP_REQUEST: queue_event(APM_SYS_SUSPEND, NULL); if (!wait_all_suspend()) return PBOOK_SLEEP_REFUSE; break; case PBOOK_SLEEP_REJECT: case PBOOK_WAKE: queue_event(APM_NORMAL_RESUME, NULL); break; } return PBOOK_SLEEP_OK; } #define APM_CRITICAL 10 #define APM_LOW 30 static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length) { /* Arguments, with symbols from linux/apm_bios.h. Information is from the Get Power Status (0x0a) call unless otherwise noted. 0) Linux driver version (this will change if format changes) 1) APM BIOS Version. Usually 1.0, 1.1 or 1.2. 2) APM flags from APM Installation Check (0x00): bit 0: APM_16_BIT_SUPPORT bit 1: APM_32_BIT_SUPPORT bit 2: APM_IDLE_SLOWS_CLOCK bit 3: APM_BIOS_DISABLED bit 4: APM_BIOS_DISENGAGED 3) AC line status 0x00: Off-line 0x01: On-line 0x02: On backup power (BIOS >= 1.1 only) 0xff: Unknown 4) Battery status 0x00: High 0x01: Low 0x02: Critical 0x03: Charging 0x04: Selected battery not present (BIOS >= 1.2 only) 0xff: Unknown 5) Battery flag bit 0: High bit 1: Low bit 2: Critical bit 3: Charging bit 7: No system battery 0xff: Unknown 6) Remaining battery life (percentage of charge): 0-100: valid -1: Unknown 7) Remaining battery life (time units): Number of remaining minutes or seconds -1: Unknown 8) min = minutes; sec = seconds */ unsigned short ac_line_status = 0xff; unsigned short battery_status = 0xff; unsigned short battery_flag = 0xff; int percentage = -1; int time_units = -1; int real_count = 0; int i; char * p = buf; ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0); for (i=0; i<pmu_battery_count; i++) { if (percentage < 0) percentage = 0; if (time_units < 0) time_units = 0; if (pmu_batteries[i].flags & PMU_BATT_PRESENT) { percentage += (pmu_batteries[i].charge * 100) / pmu_batteries[i].max_charge; /* hrm... should we provide the remaining charge * time when AC is plugged ? If yes, just remove * that test --BenH */ if (!ac_line_status) time_units += pmu_batteries[i].time_remaining / 60; real_count++; if (!(pmu_batteries[i].flags & PMU_BATT_CHARGING)) battery_flag &= ~0x08; } } if (real_count) { percentage /= real_count; if (battery_flag & 0x08) { battery_status = 0x03; battery_flag = 0x08; } else if (percentage <= APM_CRITICAL) { battery_status = 0x02; battery_flag = 0x04; } else if (percentage <= APM_LOW) { battery_status = 0x01; battery_flag = 0x02; } else { battery_status = 0x00; battery_flag = 0x01; } } p += sprintf(p, "%s %d.%d 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n", driver_version, (FAKE_APM_BIOS_VERSION >> 8) & 0xff, FAKE_APM_BIOS_VERSION & 0xff, 0, ac_line_status, battery_status, battery_flag, percentage, time_units, "min"); return p - buf; } static struct file_operations apm_bios_fops = { owner: THIS_MODULE, read: do_read, poll: do_poll, ioctl: do_ioctl, open: do_open, release: do_release, }; static struct miscdevice apm_device = { APM_MINOR_DEV, "apm_bios", &apm_bios_fops }; static int __init apm_emu_init(void) { struct proc_dir_entry *apm_proc; if (sys_ctrler != SYS_CTRLER_PMU) { printk(KERN_INFO "apm_emu: Requires a machine with a PMU.\n"); return -ENODEV; } apm_proc = create_proc_info_entry("apm", 0, NULL, apm_emu_get_info); if (apm_proc) SET_MODULE_OWNER(apm_proc); misc_register(&apm_device); pmu_register_sleep_notifier(&apm_sleep_notifier); printk(KERN_INFO "apm_emu: APM Emulation %s initialized.\n", driver_version); return 0; } static void __exit apm_emu_exit(void) { pmu_unregister_sleep_notifier(&apm_sleep_notifier); misc_deregister(&apm_device); remove_proc_entry("apm", NULL); printk(KERN_INFO "apm_emu: APM Emulation removed.\n"); } module_init(apm_emu_init); module_exit(apm_emu_exit); MODULE_AUTHOR("Benjamin Herrenschmidt"); MODULE_DESCRIPTION("APM emulation layer for PowerMac"); MODULE_LICENSE("GPL"); EXPORT_NO_SYMBOLS; |
From: Dave A. <ai...@us...> - 2003-06-10 03:08:10
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/i2c In directory sc8-pr-cvs1:/tmp/cvs-serv14646/drivers/i2c Added Files: i2c-keywest.c i2c-keywest.h Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- /* i2c Support for Apple Keywest I2C Bus Controller Copyright (c) 2001 Benjamin Herrenschmidt <be...@ke...> Original work by Copyright (c) 2000 Philip Edelbrock <ph...@st...> 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. Changes: 2001/12/13 BenH New implementation 2001/12/15 BenH Add support for "byte" and "quick" transfers. Add i2c_xfer routine. My understanding of the various modes supported by keywest are: - Dumb mode : not implemented, probably direct tweaking of lines - Standard mode : simple i2c transaction of type S Addr R/W A Data A Data ... T - Standard sub mode : combined 8 bit subaddr write with data read S Addr R/W A SubAddr A Data A Data ... T - Combined mode : Subaddress and Data sequences appended with no stop S Addr R/W A SubAddr S Addr R/W A Data A Data ... T Currently, this driver uses only Standard mode for i2c xfer, and smbus byte & quick transfers ; and uses StandardSub mode for other smbus transfers instead of combined as we need that for the sound driver to be happy */ #include <linux/module.h> #include <linux/config.h> #include <linux/version.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/pci.h> #include <linux/types.h> #include <linux/delay.h> #include <linux/i2c.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/timer.h> #include <linux/spinlock.h> #include <linux/completion.h> #include <asm/io.h> #include <asm/prom.h> #include <asm/machdep.h> #include <asm/pmac_feature.h> #include "i2c-keywest.h" #undef POLLED_MODE #define DBG(x...) do {\ if (debug > 0) \ printk(KERN_DEBUG "KW:" x); \ } while(0) MODULE_AUTHOR("Benjamin Herrenschmidt <be...@ke...>"); MODULE_DESCRIPTION("I2C driver for Apple's Keywest"); MODULE_LICENSE("GPL"); MODULE_PARM(probe, "i"); MODULE_PARM(debug, "i"); EXPORT_NO_SYMBOLS; int probe = 0; int debug = 0; static struct keywest_iface *ifaces = NULL; #ifdef POLLED_MODE /* This isn't fast, but will go once I implement interrupt with * proper timeout */ static u8 wait_interrupt(struct keywest_iface* iface) { int i; u8 isr; for (i = 0; i < POLL_TIMEOUT; i++) { isr = read_reg(reg_isr) & KW_I2C_IRQ_MASK; if (isr != 0) return isr; current->state = TASK_UNINTERRUPTIBLE; schedule_timeout(1); } return isr; } #endif /* POLLED_MODE */ static void do_stop(struct keywest_iface* iface, int result) { write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_STOP); iface->state = state_stop; iface->result = result; } /* Main state machine for standard & standard sub mode */ static void handle_interrupt(struct keywest_iface *iface, u8 isr) { int ack; DBG("handle_interrupt(), got: %x, status: %x, state: %d\n", isr, read_reg(reg_status), iface->state); if (isr == 0 && iface->state != state_stop) { do_stop(iface, -1); return; } if (isr & KW_I2C_IRQ_STOP && iface->state != state_stop) { iface->result = -1; iface->state = state_stop; } switch(iface->state) { case state_addr: if (!(isr & KW_I2C_IRQ_ADDR)) { do_stop(iface, -1); break; } ack = read_reg(reg_status); DBG("ack on set address: %x\n", ack); if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { do_stop(iface, -1); break; } /* Handle rw "quick" mode */ if (iface->datalen == 0) do_stop(iface, 0); else if (iface->read_write == I2C_SMBUS_READ) { iface->state = state_read; if (iface->datalen > 1) write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_AAK); } else { iface->state = state_write; DBG("write byte: %x\n", *(iface->data)); write_reg(reg_data, *(iface->data++)); iface->datalen--; } break; case state_read: if (!(isr & KW_I2C_IRQ_DATA)) { do_stop(iface, -1); break; } *(iface->data++) = read_reg(reg_data); DBG("read byte: %x\n", *(iface->data-1)); iface->datalen--; if (iface->datalen == 0) iface->state = state_stop; else write_reg(reg_control, 0); break; case state_write: if (!(isr & KW_I2C_IRQ_DATA)) { do_stop(iface, -1); break; } /* Check ack status */ ack = read_reg(reg_status); DBG("ack on data write: %x\n", ack); if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { do_stop(iface, -1); break; } if (iface->datalen) { DBG("write byte: %x\n", *(iface->data)); write_reg(reg_data, *(iface->data++)); iface->datalen--; } else do_stop(iface, 0); break; case state_stop: if (!(isr & KW_I2C_IRQ_STOP) && (++iface->stopretry) < 10) do_stop(iface, -1); else { iface->state = state_idle; write_reg(reg_control, 0x00); write_reg(reg_ier, 0x00); #ifndef POLLED_MODE complete(&iface->complete); #endif /* POLLED_MODE */ } break; } write_reg(reg_isr, isr); } #ifndef POLLED_MODE /* Interrupt handler */ static void keywest_irq(int irq, void *dev_id, struct pt_regs *regs) { struct keywest_iface *iface = (struct keywest_iface *)dev_id; spin_lock(&iface->lock); del_timer(&iface->timeout_timer); handle_interrupt(iface, read_reg(reg_isr)); if (iface->state != state_idle) { iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; add_timer(&iface->timeout_timer); } spin_unlock(&iface->lock); } static void keywest_timeout(unsigned long data) { struct keywest_iface *iface = (struct keywest_iface *)data; DBG("timeout !\n"); spin_lock_irq(&iface->lock); handle_interrupt(iface, read_reg(reg_isr)); if (iface->state != state_idle) { iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; add_timer(&iface->timeout_timer); } spin_unlock(&iface->lock); } #endif /* POLLED_MODE */ /* * SMBUS-type transfer entrypoint */ static s32 keywest_smbus_xfer( struct i2c_adapter* adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data* data) { struct keywest_chan* chan = (struct keywest_chan*)adap->data; struct keywest_iface* iface = chan->iface; int len; u8* buffer; u16 cur_word; int rc = 0; if (iface->state == state_dead) return -1; /* Prepare datas & select mode */ iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK; switch (size) { case I2C_SMBUS_QUICK: len = 0; buffer = NULL; iface->cur_mode |= KW_I2C_MODE_STANDARD; break; case I2C_SMBUS_BYTE: len = 1; buffer = &data->byte; iface->cur_mode |= KW_I2C_MODE_STANDARD; break; case I2C_SMBUS_BYTE_DATA: len = 1; buffer = &data->byte; iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; break; case I2C_SMBUS_WORD_DATA: len = 2; cur_word = cpu_to_le16(data->word); buffer = (u8 *)&cur_word; iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; break; case I2C_SMBUS_BLOCK_DATA: len = data->block[0]; buffer = &data->block[1]; iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; break; default: return -1; } /* Original driver had this limitation */ if (len > 32) len = 32; down(&iface->sem); DBG("chan: %d, addr: 0x%x, transfer len: %d, read: %d\n", chan->chan_no, addr, len, read_write == I2C_SMBUS_READ); iface->data = buffer; iface->datalen = len; iface->state = state_addr; iface->result = 0; iface->stopretry = 0; iface->read_write = read_write; /* Setup channel & clear pending irqs */ write_reg(reg_mode, iface->cur_mode | (chan->chan_no << 4)); write_reg(reg_isr, read_reg(reg_isr)); write_reg(reg_status, 0); /* Set up address and r/w bit */ write_reg(reg_addr, (addr << 1) | ((read_write == I2C_SMBUS_READ) ? 0x01 : 0x00)); /* Set up the sub address */ if ((iface->cur_mode & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_STANDARDSUB || (iface->cur_mode & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_COMBINED) write_reg(reg_subaddr, command); /* Arm timeout */ iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; add_timer(&iface->timeout_timer); /* Start sending address & enable interrupt*/ write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_XADDR); write_reg(reg_ier, KW_I2C_IRQ_MASK); #ifdef POLLED_MODE DBG("using polled mode...\n"); /* State machine, to turn into an interrupt handler */ while(iface->state != state_idle) { u8 isr = wait_interrupt(iface); handle_interrupt(iface, isr); } #else /* POLLED_MODE */ DBG("using interrupt mode...\n"); wait_for_completion(&iface->complete); #endif /* POLLED_MODE */ rc = iface->result; DBG("transfer done, result: %d\n", rc); if (rc == 0 && size == I2C_SMBUS_WORD_DATA && read_write == I2C_SMBUS_READ) data->word = le16_to_cpu(cur_word); /* Release sem */ up(&iface->sem); return rc; } /* * Generic i2c master transfer entrypoint */ static int keywest_xfer( struct i2c_adapter *adap, struct i2c_msg msgs[], int num) { struct keywest_chan* chan = (struct keywest_chan*)adap->data; struct keywest_iface* iface = chan->iface; struct i2c_msg *pmsg; int i, completed; int rc = 0; down(&iface->sem); /* Set adapter to standard mode */ iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK; iface->cur_mode |= KW_I2C_MODE_STANDARD; completed = 0; for (i = 0; rc >= 0 && i < num;) { u8 addr; pmsg = &msgs[i++]; addr = pmsg->addr; if (pmsg->flags & I2C_M_TEN) { printk(KERN_ERR "i2c-keywest: 10 bits addr not supported !\n"); rc = -EINVAL; break; } DBG("xfer: chan: %d, doing %s %d bytes to 0x%02x - %d of %d messages\n", chan->chan_no, pmsg->flags & I2C_M_RD ? "read" : "write", pmsg->len, addr, i, num); /* Setup channel & clear pending irqs */ write_reg(reg_mode, iface->cur_mode | (chan->chan_no << 4)); write_reg(reg_isr, read_reg(reg_isr)); write_reg(reg_status, 0); iface->data = pmsg->buf; iface->datalen = pmsg->len; iface->state = state_addr; iface->result = 0; iface->stopretry = 0; if (pmsg->flags & I2C_M_RD) iface->read_write = I2C_SMBUS_READ; else iface->read_write = I2C_SMBUS_WRITE; /* Set up address and r/w bit */ if (pmsg->flags & I2C_M_REV_DIR_ADDR) addr ^= 1; write_reg(reg_addr, (addr << 1) | ((iface->read_write == I2C_SMBUS_READ) ? 0x01 : 0x00)); /* Arm timeout */ iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; add_timer(&iface->timeout_timer); /* Start sending address & enable interrupt*/ write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_XADDR); write_reg(reg_ier, KW_I2C_IRQ_MASK); #ifdef POLLED_MODE DBG("using polled mode...\n"); /* State machine, to turn into an interrupt handler */ while(iface->state != state_idle) { u8 isr = wait_interrupt(iface); handle_interrupt(iface, isr); } #else /* POLLED_MODE */88 DBG("using interrupt mode...\n"); wait_for_completion(&iface->complete); #endif /* POLLED_MODE */ rc = iface->result; if (rc == 0) completed++; DBG("transfer done, result: %d\n", rc); } /* Release sem */ up(&iface->sem); return completed; } static u32 keywest_func(struct i2c_adapter * adapter) { return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA; } static void keywest_inc(struct i2c_adapter *adapter) { MOD_INC_USE_COUNT; } static void keywest_dec(struct i2c_adapter *adapter) { MOD_DEC_USE_COUNT; } /* For now, we only handle combined mode (smbus) */ static struct i2c_algorithm keywest_algorithm = { name: "Keywest i2c", id: I2C_ALGO_SMBUS, smbus_xfer: keywest_smbus_xfer, master_xfer: keywest_xfer, functionality: keywest_func, }; static int create_iface(struct device_node* np) { unsigned long steps, *psteps, *prate; unsigned bsteps, tsize, i, nchan, addroffset; struct keywest_iface* iface; int rc; psteps = (unsigned long *)get_property(np, "AAPL,address-step", NULL); steps = psteps ? (*psteps) : 0x10; /* Hrm... maybe we can be smarter here */ for (bsteps = 0; (steps & 0x01) == 0; bsteps++) steps >>= 1; if (!strcmp(np->parent->name, "uni-n")) { nchan = 2; addroffset = 3; } else { addroffset = 0; nchan = 1; } tsize = sizeof(struct keywest_iface) + (sizeof(struct keywest_chan) + 4) * nchan; iface = (struct keywest_iface *) kmalloc(tsize, GFP_KERNEL); if (iface == NULL) { printk(KERN_ERR "i2c-keywest: can't allocate inteface !\n"); return -ENOMEM; } memset(iface, 0, tsize); init_MUTEX(&iface->sem); spin_lock_init(&iface->lock); init_completion(&iface->complete); iface->bsteps = bsteps; iface->chan_count = nchan; iface->state = state_idle; iface->irq = np->intrs[0].line; iface->channels = (struct keywest_chan *) (((unsigned long)(iface + 1) + 3UL) & ~3UL); iface->base = (unsigned long)ioremap(np->addrs[0].address + addroffset, np->addrs[0].size); if (iface->base == 0) { printk(KERN_ERR "i2c-keywest: can't map inteface !\n"); kfree(iface); return -ENOMEM; } init_timer(&iface->timeout_timer); iface->timeout_timer.function = keywest_timeout; iface->timeout_timer.data = (unsigned long)iface; /* Select interface rate */ iface->cur_mode = KW_I2C_MODE_100KHZ; prate = (unsigned long *)get_property(np, "AAPL,i2c-rate", NULL); if (prate) switch(*prate) { case 100: iface->cur_mode = KW_I2C_MODE_100KHZ; break; case 50: iface->cur_mode = KW_I2C_MODE_50KHZ; break; case 25: iface->cur_mode = KW_I2C_MODE_25KHZ; break; default: printk(KERN_WARNING "i2c-keywest: unknown rate %ldKhz, using 100KHz\n", *prate); } /* Select standard sub mode */ iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; /* Write mode */ write_reg(reg_mode, iface->cur_mode); /* Switch interrupts off & clear them*/ write_reg(reg_ier, 0x00); write_reg(reg_isr, KW_I2C_IRQ_MASK); #ifndef POLLED_MODE /* Request chip interrupt */ rc = request_irq(iface->irq, keywest_irq, 0, "keywest i2c", iface); if (rc) { printk(KERN_ERR "i2c-keywest: can't get IRQ %d !\n", iface->irq); iounmap((void *)iface->base); kfree(iface); return -ENODEV; } #endif /* POLLED_MODE */ for (i=0; i<nchan; i++) { struct keywest_chan* chan = &iface->channels[i]; u8 addr; sprintf(chan->adapter.name, "%s %d", np->parent->name, i); chan->iface = iface; chan->chan_no = i; chan->adapter.id = I2C_ALGO_SMBUS; chan->adapter.algo = &keywest_algorithm; chan->adapter.algo_data = NULL; chan->adapter.inc_use = keywest_inc; chan->adapter.dec_use = keywest_dec; chan->adapter.client_register = NULL; chan->adapter.client_unregister = NULL; chan->adapter.data = chan; rc = i2c_add_adapter(&chan->adapter); if (rc) { printk("i2c-keywest.c: Adapter %s registration failed\n", chan->adapter.name); chan->adapter.data = NULL; } if (probe) { printk("Probe: "); for (addr = 0x00; addr <= 0x7f; addr++) { if (i2c_smbus_xfer(&chan->adapter,addr, 0,0,0,I2C_SMBUS_QUICK,NULL) >= 0) printk("%02x ", addr); } printk("\n"); } } printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n", np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps); iface->next = ifaces; ifaces = iface; return 0; } static void dispose_iface(struct keywest_iface *iface) { int i, rc; ifaces = iface->next; /* Make sure we stop all activity */ down(&iface->sem); #ifndef POLLED_MODE spin_lock_irq(&iface->lock); while (iface->state != state_idle) { spin_unlock_irq(&iface->lock); schedule(); spin_lock_irq(&iface->lock); } #endif /* POLLED_MODE */ iface->state = state_dead; #ifndef POLLED_MODE spin_unlock_irq(&iface->lock); free_irq(iface->irq, iface); #endif /* POLLED_MODE */ up(&iface->sem); /* Release all channels */ for (i=0; i<iface->chan_count; i++) { struct keywest_chan* chan = &iface->channels[i]; if (!chan->adapter.data) continue; rc = i2c_del_adapter(&chan->adapter); chan->adapter.data = NULL; /* We aren't that prepared to deal with this... */ if (rc) printk("i2c-keywest.c: i2c_del_adapter failed, that's bad !\n"); } iounmap((void *)iface->base); kfree(iface); } static int __init i2c_keywest_init(void) { struct device_node *np; int rc = -ENODEV; np = find_compatible_devices("i2c", "keywest"); while (np != 0) { if (np->n_addrs >= 1 && np->n_intrs >= 1) rc = create_iface(np); np = np->next; } if (ifaces) rc = 0; return rc; } static void __exit i2c_keywest_cleanup(void) { while(ifaces) dispose_iface(ifaces); } module_init(i2c_keywest_init); module_exit(i2c_keywest_cleanup); --- NEW FILE --- #ifndef __I2C_KEYWEST_H__ #define __I2C_KEYWEST_H__ /* The Tumbler audio equalizer can be really slow sometimes */ #define POLL_TIMEOUT (2*HZ) /* Register indices */ typedef enum { reg_mode = 0, reg_control, reg_status, reg_isr, reg_ier, reg_addr, reg_subaddr, reg_data } reg_t; /* Mode register */ #define KW_I2C_MODE_100KHZ 0x00 #define KW_I2C_MODE_50KHZ 0x01 #define KW_I2C_MODE_25KHZ 0x02 #define KW_I2C_MODE_DUMB 0x00 #define KW_I2C_MODE_STANDARD 0x04 #define KW_I2C_MODE_STANDARDSUB 0x08 #define KW_I2C_MODE_COMBINED 0x0C #define KW_I2C_MODE_MODE_MASK 0x0C #define KW_I2C_MODE_CHAN_MASK 0xF0 /* Control register */ #define KW_I2C_CTL_AAK 0x01 #define KW_I2C_CTL_XADDR 0x02 #define KW_I2C_CTL_STOP 0x04 #define KW_I2C_CTL_START 0x08 /* Status register */ #define KW_I2C_STAT_BUSY 0x01 #define KW_I2C_STAT_LAST_AAK 0x02 #define KW_I2C_STAT_LAST_RW 0x04 #define KW_I2C_STAT_SDA 0x08 #define KW_I2C_STAT_SCL 0x10 /* IER & ISR registers */ #define KW_I2C_IRQ_DATA 0x01 #define KW_I2C_IRQ_ADDR 0x02 #define KW_I2C_IRQ_STOP 0x04 #define KW_I2C_IRQ_START 0x08 #define KW_I2C_IRQ_MASK 0x0F /* Physical interface */ struct keywest_iface { unsigned long base; unsigned bsteps; int irq; struct semaphore sem; spinlock_t lock; struct keywest_chan* channels; unsigned chan_count; u8 cur_mode; char read_write; u8* data; unsigned datalen; int state; int result; int stopretry; struct timer_list timeout_timer; struct completion complete; struct keywest_iface* next; }; enum { state_idle, state_addr, state_read, state_write, state_stop, state_dead }; /* Channel on an interface */ struct keywest_chan { struct i2c_adapter adapter; struct keywest_iface* iface; unsigned chan_no; }; /* Register access */ static inline u8 __read_reg(struct keywest_iface *iface, reg_t reg) { return in_8(((volatile u8 *)iface->base) + (((unsigned)reg) << iface->bsteps)); } static inline void __write_reg(struct keywest_iface *iface, reg_t reg, u8 val) { out_8(((volatile u8 *)iface->base) + (((unsigned)reg) << iface->bsteps), val); (void)__read_reg(iface, reg); udelay(10); } #define write_reg(reg, val) __write_reg(iface, reg, val) #define read_reg(reg) __read_reg(iface, reg) #endif /* __I2C_KEYWEST_H__ */ |
From: Dave A. <ai...@us...> - 2003-06-10 03:08:07
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/drm In directory sc8-pr-cvs1:/tmp/cvs-serv14646/drivers/char/drm Added Files: sis.h sis_drm.h sis_drv.c sis_drv.h sis_ds.c sis_ds.h sis_mm.c Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- /* sis_drv.h -- Private header for sis driver -*- linux-c -*- * * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h,v 1.1 2001/05/19 18:29:22 dawes Exp $ */ #ifndef __SIS_H__ #define __SIS_H__ /* This remains constant for all DRM template files. * Name it sisdrv_##x as there's a conflict with sis_free/malloc in the kernel * that's used for fb devices */ #define DRM(x) sisdrv_##x /* General customization: */ #define __HAVE_AGP 1 #define __MUST_HAVE_AGP 0 #define __HAVE_MTRR 1 #define __HAVE_CTX_BITMAP 1 /* Buffer customization: */ #define DRIVER_AGP_BUFFERS_MAP( dev ) \ ((drm_sis_private_t *)((dev)->dev_private))->buffers extern int sis_init_context(int context); extern int sis_final_context(int context); #define DRIVER_CTX_CTOR sis_init_context #define DRIVER_CTX_DTOR sis_final_context #endif --- NEW FILE --- #ifndef _sis_drm_public_h_ #define _sis_drm_public_h_ typedef struct { int context; unsigned int offset; unsigned int size; unsigned int free; } drm_sis_mem_t; typedef struct { unsigned int offset, size; } drm_sis_agp_t; typedef struct { unsigned int left, right; } drm_sis_flip_t; #ifdef __KERNEL__ int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); int sisp_agp_init(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); int sisp_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); int sisp_agp_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); #endif #endif --- NEW FILE --- /* sis.c -- sis driver -*- linux-c -*- * * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ #include <linux/config.h> #include "sis.h" #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" #define DRIVER_AUTHOR "SIS" #define DRIVER_NAME "sis" #define DRIVER_DESC "SIS 300/630/540" #define DRIVER_DATE "20010503" #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 #define DRIVER_PATCHLEVEL 0 #define DRIVER_IOCTLS \ [DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 0 }, \ [DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 0 }, \ /* AGP Memory Management */ \ [DRM_IOCTL_NR(SIS_IOCTL_AGP_INIT)] = { sisp_agp_init, 1, 0 }, \ [DRM_IOCTL_NR(SIS_IOCTL_AGP_ALLOC)] = { sisp_agp_alloc, 1, 0 }, \ [DRM_IOCTL_NR(SIS_IOCTL_AGP_FREE)] = { sisp_agp_free, 1, 0 } #if 0 /* these don't appear to be defined */ /* SIS Stereo */ [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { sis_control, 1, 1 }, [DRM_IOCTL_NR(SIS_IOCTL_FLIP)] = { sis_flip, 1, 1 }, [DRM_IOCTL_NR(SIS_IOCTL_FLIP_INIT)] = { sis_flip_init, 1, 1 }, [DRM_IOCTL_NR(SIS_IOCTL_FLIP_FINAL)] = { sis_flip_final, 1, 1 } #endif #define __HAVE_COUNTERS 5 #include "drm_auth.h" #include "drm_agpsupport.h" #include "drm_bufs.h" #include "drm_context.h" #include "drm_dma.h" #include "drm_drawable.h" #include "drm_drv.h" #include "drm_fops.h" #include "drm_init.h" #include "drm_ioctl.h" #include "drm_lists.h" #include "drm_lock.h" #include "drm_memory.h" #include "drm_proc.h" #include "drm_vm.h" #include "drm_stub.h" --- NEW FILE --- /* sis_drv.h -- Private header for sis driver -*- linux-c -*- * * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ #ifndef _SIS_DRV_H_ #define _SIS_DRV_H_ typedef struct drm_sis_private { drm_map_t *buffers; } drm_sis_private_t; /* Stereo ? - this was never committed */ int sis_flip(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); int sis_flip_init(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); int sis_flip_final(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); void flip_final(void); #endif --- NEW FILE --- /* sis_ds.c -- Private header for Direct Rendering Manager -*- linux-c -*- * Created: Mon Jan 4 10:05:05 1999 by sc...@si... * * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Sung-Ching Lin <sc...@si...> * */ #define __NO_VERSION__ #include <linux/module.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/malloc.h> #include <linux/poll.h> #include <asm/io.h> #include <linux/pci.h> #include "sis_ds.h" /* Set Data Structure, not check repeated value * temporarily used */ set_t *setInit(void) { int i; set_t *set; set = (set_t *)MALLOC(sizeof(set_t)); for(i = 0; i < SET_SIZE; i++){ set->list[i].free_next = i+1; set->list[i].alloc_next = -1; } set->list[SET_SIZE-1].free_next = -1; set->free = 0; set->alloc = -1; set->trace = -1; return set; } int setAdd(set_t *set, ITEM_TYPE item) { int free = set->free; if(free != -1){ set->list[free].val = item; set->free = set->list[free].free_next; } else{ return 0; } set->list[free].alloc_next = set->alloc; set->alloc = free; set->list[free].free_next = -1; return 1; } int setDel(set_t *set, ITEM_TYPE item) { int alloc = set->alloc; int prev = -1; while(alloc != -1){ if(set->list[alloc].val == item){ if(prev != -1) set->list[prev].alloc_next = set->list[alloc].alloc_next; else set->alloc = set->list[alloc].alloc_next; break; } prev = alloc; alloc = set->list[alloc].alloc_next; } if(alloc == -1) return 0; set->list[alloc].free_next = set->free; set->free = alloc; set->list[alloc].alloc_next = -1; return 1; } /* setFirst -> setAdd -> setNext is wrong */ int setFirst(set_t *set, ITEM_TYPE *item) { if(set->alloc == -1) return 0; *item = set->list[set->alloc].val; set->trace = set->list[set->alloc].alloc_next; return 1; } int setNext(set_t *set, ITEM_TYPE *item) { if(set->trace == -1) return 0; *item = set->list[set->trace].val; set->trace = set->list[set->trace].alloc_next; return 1; } int setDestroy(set_t *set) { FREE(set); return 1; } /* * GLX Hardware Device Driver common code * Copyright (C) 1999 Keith Whitwell * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #define ISFREE(bptr) ((bptr)->free) #define PRINTF(fmt, arg...) do{}while(0) #define fprintf(fmt, arg...) do{}while(0) static void *calloc(size_t nmemb, size_t size) { void *addr; addr = kmalloc(nmemb*size, GFP_KERNEL); memset(addr, 0, nmemb*size); return addr; } #define free(n) kfree(n) void mmDumpMemInfo( memHeap_t *heap ) { TMemBlock *p; PRINTF ("Memory heap %p:\n", heap); if (heap == 0) { PRINTF (" heap == 0\n"); } else { p = (TMemBlock *)heap; while (p) { PRINTF (" Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size, p->free ? '.':'U', p->reserved ? 'R':'.'); p = p->next; } } PRINTF ("End of memory blocks\n"); } memHeap_t *mmInit(int ofs, int size) { PMemBlock blocks; if (size <= 0) { return 0; } blocks = (TMemBlock *) calloc(1,sizeof(TMemBlock)); if (blocks) { blocks->ofs = ofs; blocks->size = size; blocks->free = 1; return (memHeap_t *)blocks; } else return 0; } /* Kludgey workaround for existing i810 server. Remove soon. */ memHeap_t *mmAddRange( memHeap_t *heap, int ofs, int size ) { PMemBlock blocks; blocks = (TMemBlock *) calloc(2,sizeof(TMemBlock)); if (blocks) { blocks[0].size = size; blocks[0].free = 1; blocks[0].ofs = ofs; blocks[0].next = &blocks[1]; /* Discontinuity - stops JoinBlock from trying to join non-adjacent * ranges. */ blocks[1].size = 0; blocks[1].free = 0; blocks[1].ofs = ofs+size; blocks[1].next = (PMemBlock) heap; return (memHeap_t *)blocks; } else return heap; } static TMemBlock* SliceBlock(TMemBlock *p, int startofs, int size, int reserved, int alignment) { TMemBlock *newblock; /* break left */ if (startofs > p->ofs) { newblock = (TMemBlock*) calloc(1,sizeof(TMemBlock)); newblock->ofs = startofs; newblock->size = p->size - (startofs - p->ofs); newblock->free = 1; newblock->next = p->next; p->size -= newblock->size; p->next = newblock; p = newblock; } /* break right */ if (size < p->size) { newblock = (TMemBlock*) calloc(1,sizeof(TMemBlock)); newblock->ofs = startofs + size; newblock->size = p->size - size; newblock->free = 1; newblock->next = p->next; p->size = size; p->next = newblock; } /* p = middle block */ p->align = alignment; p->free = 0; p->reserved = reserved; return p; } PMemBlock mmAllocMem( memHeap_t *heap, int size, int align2, int startSearch) { int mask,startofs,endofs; TMemBlock *p; if (!heap || align2 < 0 || size <= 0) return NULL; mask = (1 << align2)-1; startofs = 0; p = (TMemBlock *)heap; while (p) { if (ISFREE(p)) { startofs = (p->ofs + mask) & ~mask; if ( startofs < startSearch ) { startofs = startSearch; } endofs = startofs+size; if (endofs <= (p->ofs+p->size)) break; } p = p->next; } if (!p) return NULL; p = SliceBlock(p,startofs,size,0,mask+1); p->heap = heap; return p; } static __inline__ int Join2Blocks(TMemBlock *p) { if (p->free && p->next && p->next->free) { TMemBlock *q = p->next; p->size += q->size; p->next = q->next; free(q); return 1; } return 0; } int mmFreeMem(PMemBlock b) { TMemBlock *p,*prev; if (!b) return 0; if (!b->heap) { fprintf(stderr, "no heap\n"); return -1; } p = b->heap; prev = NULL; while (p && p != b) { prev = p; p = p->next; } if (!p || p->free || p->reserved) { if (!p) fprintf(stderr, "block not found in heap\n"); else if (p->free) fprintf(stderr, "block already free\n"); else fprintf(stderr, "block is reserved\n"); return -1; } p->free = 1; Join2Blocks(p); if (prev) Join2Blocks(prev); return 0; } int mmReserveMem(memHeap_t *heap, int offset,int size) { int endofs; TMemBlock *p; if (!heap || size <= 0) return -1; endofs = offset+size; p = (TMemBlock *)heap; while (p && p->ofs <= offset) { if (ISFREE(p) && endofs <= (p->ofs+p->size)) { SliceBlock(p,offset,size,1,1); return 0; } p = p->next; } return -1; } int mmFreeReserved(memHeap_t *heap, int offset) { TMemBlock *p,*prev; if (!heap) return -1; p = (TMemBlock *)heap; prev = NULL; while (p && p->ofs != offset) { prev = p; p = p->next; } if (!p || !p->reserved) return -1; p->free = 1; p->reserved = 0; Join2Blocks(p); if (prev) Join2Blocks(prev); return 0; } void mmDestroy(memHeap_t *heap) { TMemBlock *p,*q; if (!heap) return; p = (TMemBlock *)heap; while (p) { q = p->next; free(p); p = q; } } --- NEW FILE --- /* sis_ds.h -- Private header for Direct Rendering Manager -*- linux-c -*- * Created: Mon Jan 4 10:05:05 1999 by sc...@si... * * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Sung-Ching Lin <sc...@si...> * */ #ifndef _sis_ds_h_ #define _sis_ds_h_ /* Set Data Structure */ #define SET_SIZE 5000 #define MALLOC(s) kmalloc(s, GFP_KERNEL) #define FREE(s) kfree(s) typedef unsigned int ITEM_TYPE; typedef struct { ITEM_TYPE val; int alloc_next, free_next; } list_item_t; typedef struct { int alloc; int free; int trace; list_item_t list[SET_SIZE]; } set_t; set_t *setInit(void); int setAdd(set_t *set, ITEM_TYPE item); int setDel(set_t *set, ITEM_TYPE item); int setFirst(set_t *set, ITEM_TYPE *item); int setNext(set_t *set, ITEM_TYPE *item); int setDestroy(set_t *set); #endif /* * GLX Hardware Device Driver common code * Copyright (C) 1999 Keith Whitwell * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef MM_INC #define MM_INC struct mem_block_t { struct mem_block_t *next; struct mem_block_t *heap; int ofs,size; int align; int free:1; int reserved:1; }; typedef struct mem_block_t TMemBlock; typedef struct mem_block_t *PMemBlock; /* a heap is just the first block in a chain */ typedef struct mem_block_t memHeap_t; static __inline__ int mmBlockSize(PMemBlock b) { return b->size; } static __inline__ int mmOffset(PMemBlock b) { return b->ofs; } static __inline__ void mmMarkReserved(PMemBlock b) { b->reserved = 1; } /* * input: total size in bytes * return: a heap pointer if OK, NULL if error */ memHeap_t *mmInit( int ofs, int size ); memHeap_t *mmAddRange( memHeap_t *heap, int ofs, int size ); /* * Allocate 'size' bytes with 2^align2 bytes alignment, * restrict the search to free memory after 'startSearch' * depth and back buffers should be in different 4mb banks * to get better page hits if possible * input: size = size of block * align2 = 2^align2 bytes alignment * startSearch = linear offset from start of heap to begin search * return: pointer to the allocated block, 0 if error */ PMemBlock mmAllocMem( memHeap_t *heap, int size, int align2, int startSearch ); /* * Free block starts at offset * input: pointer to a block * return: 0 if OK, -1 if error */ int mmFreeMem( PMemBlock b ); /* * Reserve 'size' bytes block start at offset * This is used to prevent allocation of memory already used * by the X server for the front buffer, pixmaps, and cursor * input: size, offset * output: 0 if OK, -1 if error */ int mmReserveMem( memHeap_t *heap, int offset,int size ); int mmFreeReserved( memHeap_t *heap, int offset ); /* * destroy MM */ void mmDestroy( memHeap_t *mmInit ); /* For debuging purpose. */ void mmDumpMemInfo( memHeap_t *mmInit ); #endif --- NEW FILE --- /* sis_mm.c -- Private header for Direct Rendering Manager -*- linux-c -*- * Created: Mon Jan 4 10:05:05 1999 by sc...@si... * * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Sung-Ching Lin <sc...@si...> * */ #define __NO_VERSION__ #include "sis.h" #include <linux/sisfb.h> #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" #include "sis_ds.h" #define MAX_CONTEXT 100 #define VIDEO_TYPE 0 #define AGP_TYPE 1 typedef struct { int used; int context; set_t *sets[2]; /* 0 for video, 1 for AGP */ } sis_context_t; static sis_context_t global_ppriv[MAX_CONTEXT]; static int add_alloc_set(int context, int type, unsigned int val) { int i, retval = 0; for(i = 0; i < MAX_CONTEXT; i++) if(global_ppriv[i].used && global_ppriv[i].context == context){ retval = setAdd(global_ppriv[i].sets[type], val); break; } return retval; } static int del_alloc_set(int context, int type, unsigned int val) { int i, retval = 0; for(i = 0; i < MAX_CONTEXT; i++) if(global_ppriv[i].used && global_ppriv[i].context == context){ retval = setDel(global_ppriv[i].sets[type], val); break; } return retval; } /* fb management via fb device */ #if 1 int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_mem_t fb; struct sis_memreq req; int retval = 0; if (copy_from_user(&fb, (drm_sis_mem_t *)arg, sizeof(fb))) return -EFAULT; req.size = fb.size; sis_malloc(&req); if(req.offset){ /* TODO */ fb.offset = req.offset; fb.free = req.offset; if(!add_alloc_set(fb.context, VIDEO_TYPE, fb.free)){ DRM_DEBUG("adding to allocation set fails\n"); sis_free(req.offset); retval = -1; } } else{ fb.offset = 0; fb.size = 0; fb.free = 0; } if (copy_to_user((drm_sis_mem_t *)arg, &fb, sizeof(fb))) return -EFAULT; DRM_DEBUG("alloc fb, size = %d, offset = %ld\n", fb.size, req.offset); return retval; } int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_mem_t fb; int retval = 0; if (copy_from_user(&fb, (drm_sis_mem_t *)arg, sizeof(fb))) return -EFAULT; if(!fb.free){ return -1; } sis_free(fb.free); if(!del_alloc_set(fb.context, VIDEO_TYPE, fb.free)) retval = -1; DRM_DEBUG("free fb, offset = %d\n", fb.free); return retval; } #else int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { return -1; } int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { return 0; } #endif /* agp memory management */ #if 1 static memHeap_t *AgpHeap = NULL; int sisp_agp_init(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_agp_t agp; if (copy_from_user(&agp, (drm_sis_agp_t *)arg, sizeof(agp))) return -EFAULT; AgpHeap = mmInit(agp.offset, agp.size); DRM_DEBUG("offset = %u, size = %u", agp.offset, agp.size); return 0; } int sisp_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_mem_t agp; PMemBlock block; int retval = 0; if(!AgpHeap) return -1; if (copy_from_user(&agp, (drm_sis_mem_t *)arg, sizeof(agp))) return -EFAULT; block = mmAllocMem(AgpHeap, agp.size, 0, 0); if(block){ /* TODO */ agp.offset = block->ofs; agp.free = (unsigned int)block; if(!add_alloc_set(agp.context, AGP_TYPE, agp.free)){ DRM_DEBUG("adding to allocation set fails\n"); mmFreeMem((PMemBlock)agp.free); retval = -1; } } else{ agp.offset = 0; agp.size = 0; agp.free = 0; } if (copy_to_user((drm_sis_mem_t *)arg, &agp, sizeof(agp))) return -EFAULT; DRM_DEBUG("alloc agp, size = %d, offset = %d\n", agp.size, agp.offset); return retval; } int sisp_agp_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_mem_t agp; int retval = 0; if(!AgpHeap) return -1; if (copy_from_user(&agp, (drm_sis_mem_t *)arg, sizeof(agp))) return -EFAULT; if(!agp.free){ return -1; } mmFreeMem((PMemBlock)agp.free); if(!del_alloc_set(agp.context, AGP_TYPE, agp.free)) retval = -1; DRM_DEBUG("free agp, free = %d\n", agp.free); return retval; } #endif int sis_init_context(int context) { int i; for(i = 0; i < MAX_CONTEXT ; i++) if(global_ppriv[i].used && (global_ppriv[i].context == context)) break; if(i >= MAX_CONTEXT){ for(i = 0; i < MAX_CONTEXT ; i++){ if(!global_ppriv[i].used){ global_ppriv[i].context = context; global_ppriv[i].used = 1; global_ppriv[i].sets[0] = setInit(); global_ppriv[i].sets[1] = setInit(); DRM_DEBUG("init allocation set, socket=%d, context = %d\n", i, context); break; } } if((i >= MAX_CONTEXT) || (global_ppriv[i].sets[0] == NULL) || (global_ppriv[i].sets[1] == NULL)){ return 0; } } return 1; } int sis_final_context(int context) { int i; for(i=0; i<MAX_CONTEXT; i++) if(global_ppriv[i].used && (global_ppriv[i].context == context)) break; if(i < MAX_CONTEXT){ set_t *set; unsigned int item; int retval; DRM_DEBUG("find socket %d, context = %d\n", i, context); /* Video Memory */ set = global_ppriv[i].sets[0]; retval = setFirst(set, &item); while(retval){ DRM_DEBUG("free video memory 0x%x\n", item); sis_free(item); retval = setNext(set, &item); } setDestroy(set); /* AGP Memory */ set = global_ppriv[i].sets[1]; retval = setFirst(set, &item); while(retval){ DRM_DEBUG("free agp memory 0x%x\n", item); mmFreeMem((PMemBlock)item); retval = setNext(set, &item); } setDestroy(set); global_ppriv[i].used = 0; } /* turn-off auto-flip */ /* TODO */ #if defined(SIS_STEREO) flip_final(); #endif return 1; } |
From: Dave A. <ai...@us...> - 2003-06-10 03:08:07
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv14646/arch/ppc/kernel Added Files: pmac_feature.c Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- /* * BK Id: %F% %I% %G% %U% %#% */ /* * arch/ppc/kernel/pmac_feature.c * * Copyright (C) 1996-2001 Paul Mackerras (pa...@cs...) * Ben. Herrenschmidt (be...@ke...) * * 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. * * TODO: * * - Replace mdelay with some schedule loop if possible * - Shorten some obfuscated delays on some routines (like modem * power) [...2083 lines suppressed...] * be later turned on) */ set_initial_features(); } void __init pmac_feature_late_init(void) { struct device_node* np; /* Request some resources late */ if (uninorth_node) request_OF_resource(uninorth_node, 0, NULL); np = find_devices("hammerhead"); if (np) request_OF_resource(np, 0, NULL); np = find_devices("interrupt-controller"); if (np) request_OF_resource(np, 0, NULL); } |
From: Dave A. <ai...@us...> - 2003-06-10 03:08:06
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/configs In directory sc8-pr-cvs1:/tmp/cvs-serv14646/arch/ppc/configs Added Files: pmac_defconfig Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- # # Automatically generated make config: don't edit # # CONFIG_UID16 is not set # CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_HAVE_DEC_LOCK=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y # # Loadable module support # CONFIG_MODULES=y CONFIG_MODVERSIONS=y CONFIG_KMOD=y [...1037 lines suppressed...] # CONFIG_USB_SERIAL_CYBERJACK is not set # CONFIG_USB_SERIAL_XIRCOM is not set # CONFIG_USB_SERIAL_OMNINET is not set # # USB Miscellaneous drivers # # CONFIG_USB_RIO500 is not set # # Bluetooth support # # CONFIG_BLUEZ is not set # # Kernel hacking # CONFIG_MAGIC_SYSRQ=y # CONFIG_KGDB is not set CONFIG_XMON=y |
From: Dave A. <ai...@us...> - 2003-06-10 03:08:06
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/usb In directory sc8-pr-cvs1:/tmp/cvs-serv14646/Documentation/usb Added Files: stv680.txt Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- Linux driver for STV0680 based USB cameras Copyright, 2001, Kevin Sisson INTRODUCTION: STMicroelectronics produces the STV0680B chip, which comes in two types, -001 and -003. The -003 version allows the recording and downloading of sound clips from the camera, and allows a flash attachment. Otherwise, it uses the same commands as the -001 version. Both versions support a variety of SDRAM sizes and sensors, allowing for a maximum of 26 VGA or 20 CIF pictures. The STV0680 supports either a serial or a usb interface, and video is possible through the usb interface. The following cameras are known to work with this driver, although any camera with Vendor/Product codes of 0553/0202 should work: Aiptek Pencam (various models) Nisis QuickPix 2 Radio Shack 'Kid's digital camera' (#60-1207) At least one Trust Spycam model Several other European brand models WHAT YOU NEED: - USB support - VIDEO4LINUX support More information about USB support for linux can be found at: http://www.linux-usb.org MODULE OPTIONS: When the driver is compiled as a module, you can set a "swapRGB=1" option, if necessary, for those applications that require it (such as xawtv). However, the driver should detect and set this automatically, so this option should not normally be used. KNOWN PROBLEMS: The driver seems to work better with the usb-ohci than the usb-uhci host controller driver. HELP: The latest info on this driver can be found at: http://personal.clt.bellsouth.net/~kjsisson or at http://stv0680-usb.sourceforge.net Any questions to me can be send to: kjs...@be... |
From: Dave A. <ai...@us...> - 2003-06-10 03:08:05
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/filesystems In directory sc8-pr-cvs1:/tmp/cvs-serv14646/Documentation/filesystems Added Files: tmpfs.txt Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- Tmpfs is a file system which keeps all files in virtual memory. Everything in tmpfs is temporary in the sense that no files will be created on your hard drive. If you unmount a tmpfs instance, everything stored therein is lost. tmpfs puts everything into the kernel internal caches and grows and shrinks to accommodate the files it contains and is able to swap unneeded pages out to swap space. It has maximum size limits which can be adjusted on the fly via 'mount -o remount ...' If you compare it to ramfs (which was the template to create tmpfs) you gain swapping and limit checking. Another similar thing is the RAM disk (/dev/ram*), which simulates a fixed size hard disk in physical RAM, where you have to create an ordinary filesystem on top. Ramdisks cannot swap and you do not have the possibility to resize them. Since tmpfs lives completely in the page cache and on swap, all tmpfs pages currently in memory will show up as cached. It will not show up as shared or something like that. Further on you can check the actual RAM+swap use of a tmpfs instance with df(1) and du(1). tmpfs has the following uses: 1) There is always a kernel internal mount which you will not see at all. This is used for shared anonymous mappings and SYSV shared memory. This mount does not depend on CONFIG_TMPFS. If CONFIG_TMPFS is not set, the user visible part of tmpfs is not build. But the internal mechanisms are always present. 2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for POSIX shared memory (shm_open, shm_unlink). Adding the following line to /etc/fstab should take care of this: tmpfs /dev/shm tmpfs defaults 0 0 Remember to create the directory that you intend to mount tmpfs on if necessary (/dev/shm is automagically created if you use devfs). This mount is _not_ needed for SYSV shared memory. The internal mount is used for that. (In the 2.3 kernel versions it was necessary to mount the predecessor of tmpfs (shm fs) to use SYSV shared memory) 3) Some people (including me) find it very convenient to mount it e.g. on /tmp and /var/tmp and have a big swap partition. But be aware: loop mounts of tmpfs files do not work due to the internal design. So mkinitrd shipped by most distributions will fail with a tmpfs /tmp. 4) And probably a lot more I do not know about :-) tmpfs has a couple of mount options: size: The limit of allocated bytes for this tmpfs instance. The default is half of your physical RAM without swap. If you oversize your tmpfs instances the machine will deadlock since the OOM handler will not be able to free that memory. nr_blocks: The same as size, but in blocks of PAGECACHE_SIZE. nr_inodes: The maximum number of inodes for this instance. The default is half of the number of your physical RAM pages. These parameters accept a suffix k, m or g for kilo, mega and giga and can be changed on remount. To specify the initial root directory you can use the following mount options: mode: The permissions as an octal number uid: The user id gid: The group id These options do not have any effect on remount. You can change these parameters with chmod(1), chown(1) and chgrp(1) on a mounted filesystem. So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs' will give you tmpfs instance on /mytmpfs which can allocate 10GB RAM/SWAP in 10240 inodes and it is only accessible by root. TODOs: 1) give the size option a percent semantic: If you give a mount option size=50% the tmpfs instance should be able to grow to 50 percent of RAM + swap. So the instance should adapt automatically if you add or remove swap space. 2) loop mounts: This is difficult since loop.c relies on the readpage operation. This operation gets a page from the caller to be filled with the content of the file at that position. But tmpfs always has the page and thus cannot copy the content to the given page. So it cannot provide this operation. The VM had to be changed seriously to achieve this. 3) Show the number of tmpfs RAM pages. (As shared?) Author: Christoph Rohland <cr...@sa...>, 1.12.01 |
From: Dave A. <ai...@us...> - 2003-06-10 03:08:05
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/fb In directory sc8-pr-cvs1:/tmp/cvs-serv14646/Documentation/fb Added Files: tridentfb.txt Log Message: DA: additional files from 2.4.1[78] kernels.. --- NEW FILE --- Tridentfb is a framebuffer driver for some Trident chip based cards. The following list of chips is thought to be supported although not all are tested: those from the Image series with Cyber in their names - accelerated those with Blade in their names (Blade3D,CyberBlade...) - accelerated the newer CyberBladeXP family - nonaccelerated Only PCI/AGP based cards are supported, none of the older Tridents. How to use it? ============== Just do your usual console work :) When booting you can pass the following parameters ================================================== noaccel - turns off acceleration (when it doesn't work for your card) accel - force text acceleration (for boards which by default are noacceled) fp - use flat panel related stuff crt - assume monitor is present instead of fp center - for flat panels and resolutions smaller than native size center the image, otherwise use stretch memsize - integer value in Kb, use if your card's memory size is misdetected. look at the driver output to see what it says when initializing. memdiff - integer value in Kb,should be nonzero if your card reports more memory than it actually has.For instance mine is 192K less than detection says in all three BIOS selectable situations 2M, 4M, 8M. Only use if your video memory is taken from main memory hence of configurable size.Otherwise use memsize. If in some modes which barely fit the memory you see garbage at the bottom this might help by not letting change to that mode anymore. nativex - the width in pixels of the flat panel.If you know it (usually 1024 800 or 1280) and it is not what the driver seems to detect use it. bpp - bits per pixel (8,16 or 32) mode - a mode name like 800x600 (as described in Documentation/fb/modedb.txt) Using insane values for the above parameters will probably result in driver misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or nativex=93) Contact: ja...@as... |
From: Dave A. <ai...@us...> - 2003-06-10 02:54:29
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/drm-4.0 In directory sc8-pr-cvs1:/tmp/cvs-serv2918/drm-4.0 Log Message: Directory /cvsroot/linux-vax/kernel-2.4/drivers/char/drm-4.0 added to the repository |
From: Dave A. <ai...@us...> - 2003-06-10 02:12:45
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/8260_io In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/ppc/8260_io Modified Files: uart.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: uart.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/8260_io/uart.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- uart.c 10 Apr 2002 15:03:55 -0000 1.2 +++ uart.c 10 Jun 2003 01:45:59 -0000 1.3 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.uart.c 1.6 05/17/01 18:14:20 cort + * BK Id: SCCS/s.uart.c 1.13 12/29/01 14:50:03 trini */ /* * UART driver for MPC8260 CPM SCC or SMC @@ -1736,7 +1736,7 @@ schedule_timeout(char_time); if (signal_pending(current)) break; - if (timeout && ((orig_jiffies + timeout) < jiffies)) + if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; bdp = info->tx_cur; } while (bdp->cbd_sc & BD_SC_READY); @@ -2325,7 +2325,11 @@ __clear_user(&serial_driver,sizeof(struct tty_driver)); serial_driver.magic = TTY_DRIVER_MAGIC; serial_driver.driver_name = "serial"; +#ifdef CONFIG_DEVFS_FS + serial_driver.name = "tts/%d"; +#else serial_driver.name = "ttyS"; +#endif serial_driver.major = TTY_MAJOR; serial_driver.minor_start = 64; serial_driver.num = NR_PORTS; @@ -2363,7 +2367,11 @@ * major number and the subtype code. */ callout_driver = serial_driver; +#ifdef CONFIG_DEVFS_FS + callout_driver.name = "cua/%d"; +#else callout_driver.name = "cua"; +#endif callout_driver.major = TTYAUX_MAJOR; callout_driver.subtype = SERIAL_TYPE_CALLOUT; callout_driver.read_proc = 0; |
From: Dave A. <ai...@us...> - 2003-06-10 02:12:42
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/8xx_io In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/ppc/8xx_io Modified Files: uart.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: uart.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/8xx_io/uart.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- uart.c 10 Apr 2002 15:03:56 -0000 1.2 +++ uart.c 10 Jun 2003 01:46:00 -0000 1.3 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.uart.c 1.19 10/26/01 09:59:32 trini + * BK Id: SCCS/s.uart.c 1.23 12/29/01 14:50:03 trini */ /* * UART driver for MPC860 CPM SCC or SMC @@ -1802,7 +1802,7 @@ schedule_timeout(char_time); if (signal_pending(current)) break; - if (timeout && ((orig_jiffies + timeout) < jiffies)) + if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; /* The 'tx_cur' is really the next buffer to send. We @@ -2529,7 +2529,11 @@ __clear_user(&serial_driver,sizeof(struct tty_driver)); serial_driver.magic = TTY_DRIVER_MAGIC; serial_driver.driver_name = "serial"; +#ifdef CONFIG_DEVFS_FS + serial_driver.name = "tts/%d"; +#else serial_driver.name = "ttyS"; +#endif serial_driver.major = TTY_MAJOR; serial_driver.minor_start = 64; serial_driver.num = NR_PORTS; @@ -2567,7 +2571,11 @@ * major number and the subtype code. */ callout_driver = serial_driver; +#ifdef CONFIG_DEVFS_FS + callout_driver.name = "cua/%d"; +#else callout_driver.name = "cua"; +#endif callout_driver.major = TTYAUX_MAJOR; callout_driver.subtype = SERIAL_TYPE_CALLOUT; callout_driver.read_proc = 0; |
From: Dave A. <ai...@us...> - 2003-06-10 02:10:24
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/cris Modified Files: Makefile config.in Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Makefile 9 Apr 2002 17:03:15 -0000 1.2 +++ Makefile 10 Jun 2003 01:45:49 -0000 1.3 @@ -37,10 +37,9 @@ OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S -# normally, gcc on a linux box adds __linux__ but we do it "manually" -# -mlinux enables -march=v10, -fno-underscores among others +# -mlinux enables -march=v10, -fno-underscores, -D__linux__ among others -CFLAGS := $(CFLAGS) -mlinux -fno-strict-aliasing -pipe -D__linux__ +CFLAGS := $(CFLAGS) -mlinux -pipe ifdef CONFIG_ETRAX_KGDB CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g Index: config.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/config.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- config.in 9 Apr 2002 17:03:15 -0000 1.2 +++ config.in 10 Jun 2003 01:45:49 -0000 1.3 @@ -35,6 +35,9 @@ bool 'Use kernel gdb debugger' CONFIG_ETRAX_KGDB bool 'Enable Etrax100 watchdog' CONFIG_ETRAX_WATCHDOG +if [ "$CONFIG_ETRAX_WATCHDOG" = "y" ]; then + bool 'Disable watchdog during Oops printouts' CONFIG_ETRAX_WATCHDOG_NICE_DOGGY +fi endmenu |
From: Dave A. <ai...@us...> - 2003-06-10 02:10:24
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/arm/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/arm/kernel Modified Files: entry-common.S semaphore.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: entry-common.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/kernel/entry-common.S,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- entry-common.S 10 Apr 2002 13:51:21 -0000 1.2 +++ entry-common.S 10 Jun 2003 01:45:49 -0000 1.3 @@ -22,12 +22,10 @@ * Our do_softirq out of line code. See include/asm-arm/softirq.h for * the calling assembly. */ - .section ".text.lock","ax" ENTRY(__do_softirq) stmfd sp!, {r0 - r3, ip, lr} bl do_softirq ldmfd sp!, {r0 - r3, ip, pc} - .previous .align 5 /* Index: semaphore.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/kernel/semaphore.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- semaphore.c 10 Apr 2002 13:51:21 -0000 1.2 +++ semaphore.c 10 Jun 2003 01:45:49 -0000 1.3 @@ -177,8 +177,7 @@ * value in some cases.. */ #ifdef CONFIG_CPU_26 -asm(" .section .text.lock, \"ax\" - .align 5 +asm(" .align 5 .globl __down_failed __down_failed: stmfd sp!, {r0 - r3, lr} @@ -212,13 +211,11 @@ bl __up ldmfd sp!, {r0 - r3, pc}^ - .previous "); #else /* 32 bit version */ -asm(" .section .text.lock, \"ax\" - .align 5 +asm(" .align 5 .globl __down_failed __down_failed: stmfd sp!, {r0 - r3, lr} @@ -252,7 +249,6 @@ bl __up ldmfd sp!, {r0 - r3, pc} - .previous "); #endif |
From: Dave A. <ai...@us...> - 2003-06-10 02:10:23
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/arm In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/arm Modified Files: vmlinux-armo.lds.in vmlinux-armv.lds.in Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: vmlinux-armo.lds.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/vmlinux-armo.lds.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- vmlinux-armo.lds.in 10 Apr 2002 13:51:19 -0000 1.2 +++ vmlinux-armo.lds.in 10 Jun 2003 01:45:49 -0000 1.3 @@ -48,7 +48,6 @@ *(.text) *(.fixup) *(.gnu.warning) - *(.text.lock) /* out-of-line lock text */ *(.rodata) *(.rodata.*) *(.glue_7) Index: vmlinux-armv.lds.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/vmlinux-armv.lds.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- vmlinux-armv.lds.in 10 Apr 2002 13:51:19 -0000 1.2 +++ vmlinux-armv.lds.in 10 Jun 2003 01:45:49 -0000 1.3 @@ -43,7 +43,6 @@ *(.text) *(.fixup) *(.gnu.warning) - *(.text.lock) /* out-of-line lock text */ *(.rodata) *(.rodata.*) *(.glue_7) |
From: Dave A. <ai...@us...> - 2003-06-10 02:10:23
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/alpha/kernel Modified Files: alpha_ksyms.c pci-noop.c pci_iommu.c proto.h smc37c669.c sys_miata.c time.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: alpha_ksyms.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/alpha_ksyms.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- alpha_ksyms.c 10 Jun 2003 01:13:13 -0000 1.3 +++ alpha_ksyms.c 10 Jun 2003 01:45:48 -0000 1.4 @@ -109,6 +109,7 @@ EXPORT_SYMBOL(strrchr); EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(memmove); +EXPORT_SYMBOL(memscan); EXPORT_SYMBOL(__memcpy); EXPORT_SYMBOL(__memset); EXPORT_SYMBOL(__memsetw); Index: pci-noop.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/pci-noop.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pci-noop.c 10 Apr 2002 13:07:22 -0000 1.2 +++ pci-noop.c 10 Jun 2003 01:45:48 -0000 1.3 @@ -104,21 +104,23 @@ } /* stubs for the routines in pci_iommu.c */ void * -pci_alloc_consistent(struct pci_dev *pdev, long size, dma_addr_t *dma_addrp) +pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) { + return (void *)0; } void -pci_free_consistent(struct pci_dev *pdev, long size, void *cpu_addr, +pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr, dma_addr_t dma_addr) { } dma_addr_t -pci_map_single(struct pci_dev *pdev, void *cpu_addr, long size, +pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int direction) { + return (dma_addr_t)0; } void -pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, long size, +pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, int direction) { } @@ -126,6 +128,7 @@ pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, int direction) { + return 0; } void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, Index: pci_iommu.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/pci_iommu.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pci_iommu.c 10 Apr 2002 13:07:22 -0000 1.2 +++ pci_iommu.c 10 Jun 2003 01:45:48 -0000 1.3 @@ -30,6 +30,10 @@ #define DEBUG_NODIRECT 0 #define DEBUG_FORCEDAC 0 +/* Most Alphas support 32-bit ISA DMA. Exceptions are XL, Ruffian and + Nautilus (see asm/dma.h for details). */ +#define ISA_DMA_MASK (MAX_DMA_ADDRESS - IDENT_ADDR - 1 < 0xffffffff ? \ + MAX_DMA_ADDRESS - IDENT_ADDR - 1 : 0xffffffff) static inline unsigned long mk_iommu_pte(unsigned long paddr) @@ -181,7 +185,7 @@ int dac_allowed) { struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose; - dma_addr_t max_dma = pdev ? pdev->dma_mask : 0x00ffffff; + dma_addr_t max_dma = pdev ? pdev->dma_mask : ISA_DMA_MASK; struct pci_iommu_arena *arena; long npages, dma_ofs, i; unsigned long paddr; @@ -220,7 +224,7 @@ } arena = hose->sg_pci; - if (!arena || arena->dma_base + arena->size > max_dma) + if (!arena || arena->dma_base + arena->size - 1 > max_dma) arena = hose->sg_isa; npages = calc_npages((paddr & ~PAGE_MASK) + size); @@ -247,20 +251,27 @@ dma_addr_t pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int dir) { + int dac_allowed; + if (dir == PCI_DMA_NONE) BUG(); - return pci_map_single_1(pdev, cpu_addr, size, - pdev ? (pdev->dma_mask >> 32) != 0 : 0); + + dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; + return pci_map_single_1(pdev, cpu_addr, size, dac_allowed); } dma_addr_t pci_map_page(struct pci_dev *pdev, struct page *page, unsigned long offset, size_t size, int dir) { + int dac_allowed; + if (dir == PCI_DMA_NONE) BUG(); - return pci_map_single_1(pdev, (char *)page_address(page) + offset, - size, pdev ? (pdev->dma_mask >> 32) != 0 : 0); + + dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; + return pci_map_single_1(pdev, (char *)page_address(page) + offset, + size, dac_allowed); } /* Unmap a single streaming mode DMA translation. The DMA_ADDR and @@ -558,7 +569,7 @@ if (direction == PCI_DMA_NONE) BUG(); - dac_allowed = ((pdev->dma_mask >> 32) != 0); + dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; /* Fast path single entry scatterlists. */ if (nents == 1) { @@ -578,9 +589,9 @@ /* Second, figure out where we're going to map things. */ if (alpha_mv.mv_pci_tbi) { hose = pdev ? pdev->sysdata : pci_isa_hose; - max_dma = pdev ? pdev->dma_mask : 0x00ffffff; + max_dma = pdev ? pdev->dma_mask : ISA_DMA_MASK; arena = hose->sg_pci; - if (!arena || arena->dma_base + arena->size > max_dma) + if (!arena || arena->dma_base + arena->size - 1 > max_dma) arena = hose->sg_isa; } else { max_dma = -1; @@ -641,9 +652,9 @@ return; hose = pdev ? pdev->sysdata : pci_isa_hose; - max_dma = pdev ? pdev->dma_mask : 0x00ffffff; + max_dma = pdev ? pdev->dma_mask : ISA_DMA_MASK; arena = hose->sg_pci; - if (!arena || arena->dma_base + arena->size > max_dma) + if (!arena || arena->dma_base + arena->size - 1 > max_dma) arena = hose->sg_isa; fbeg = -1, fend = 0; @@ -710,11 +721,10 @@ struct pci_iommu_arena *arena; /* If there exists a direct map, and the mask fits either - MAX_DMA_ADDRESS defined such that GFP_DMA does something - useful, or the total system memory as shifted by the - map base. */ + the entire direct mapped space or the total system memory as + shifted by the map base */ if (__direct_map_size != 0 - && (__direct_map_base + MAX_DMA_ADDRESS-IDENT_ADDR-1 <= mask + && (__direct_map_base + __direct_map_size - 1 <= mask || __direct_map_base + (max_low_pfn<<PAGE_SHIFT)-1 <= mask)) return 1; Index: proto.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/proto.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- proto.h 10 Apr 2002 13:07:22 -0000 1.2 +++ proto.h 10 Jun 2003 01:45:48 -0000 1.3 @@ -106,7 +106,7 @@ extern void SMC93x_Init(void); /* smc37c669.c */ -extern void SMC669_Init(int); +extern int SMC669_Init(int); /* es1888.c */ extern void es1888_init(void); Index: smc37c669.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/smc37c669.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- smc37c669.c 25 Feb 2001 23:15:16 -0000 1.1.1.2 +++ smc37c669.c 10 Jun 2003 01:45:48 -0000 1.2 @@ -2528,7 +2528,7 @@ * * RETURNS: * - * Nothing + * 1 if the chip found, 0 otherwise * * ARGUMENTS: * @@ -2539,7 +2539,7 @@ * None * */ -void __init SMC669_Init ( int index ) +int __init SMC669_Init ( int index ) { SMC37c669_CONFIG_REGS *SMC_base; unsigned long flags; @@ -2602,11 +2602,13 @@ __restore_flags(flags); printk( "SMC37c669 Super I/O Controller found @ 0x%lx\n", (unsigned long) SMC_base ); + return 1; } else { __restore_flags(flags); #if SMC_DEBUG printk( "No SMC37c669 Super I/O Controller found\n" ); #endif + return 0; } } Index: sys_miata.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/sys_miata.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- sys_miata.c 10 Apr 2002 13:07:22 -0000 1.2 +++ sys_miata.c 10 Jun 2003 01:45:48 -0000 1.3 @@ -230,7 +230,15 @@ miata_init_pci(void) { cia_init_pci(); - SMC669_Init(0); /* it might be a GL (fails harmlessly if not) */ + /* The PYXIS has data corruption problem with scatter/gather + burst DMA reads crossing 8K boundary. It had been fixed + with off-chip logic on all PYXIS systems except first + MIATAs, so disable SG DMA on such machines. */ + if (!SMC669_Init(0)) { /* MIATA GL has SMC37c669 Super I/O */ + alpha_mv.mv_pci_tbi = NULL; + printk(KERN_INFO "pci: pyxis 8K boundary dma bug - " + "sg dma disabled\n"); + } es1888_init(); } Index: time.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/alpha/kernel/time.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- time.c 10 Apr 2002 13:07:22 -0000 1.2 +++ time.c 10 Jun 2003 01:45:48 -0000 1.3 @@ -379,8 +379,6 @@ /* Startup the timer source. */ alpha_mv.init_rtc(); - do_get_fast_time = do_gettimeofday; - /* * If we had wanted SRM console printk echoing early, undo it now. * |
From: Dave A. <ai...@us...> - 2003-06-10 02:09:15
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/pmac In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/ppc/boot/pmac Modified Files: Makefile Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/pmac/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile 10 Apr 2002 15:04:01 -0000 1.1 +++ Makefile 10 Jun 2003 01:46:01 -0000 1.2 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.14 07/27/01 20:24:17 trini +# BK Id: SCCS/s.Makefile 1.16 09/28/01 07:39:37 trini # # Makefile for making XCOFF bootable images for booting on PowerMacs # using Open Firmware. @@ -48,9 +48,9 @@ cp ../images/vmlinux.coff $(TFTPIMAGE) cp ../images/vmlinux.elf-pmac $(TFTPIMAGE).elf -znetboot.initrd: vmlinux.coff.initrd vmlinux.initrd.elf-pmac - cp ../images/vmlinux.coff.initrd $(TFTPIMAGE) - cp ../images/vmlinux.elf-pmac.initrd $(TFTPIMAGE).elf +znetboot.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac + cp ../images/vmlinux.initrd.coff $(TFTPIMAGE) + cp ../images/vmlinux.initrd.elf-pmac $(TFTPIMAGE).elf #floppy: zImage # mount -t hfs /dev/fd0 /mnt @@ -61,7 +61,7 @@ $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=../images/vmlinux.gz \ dummy.o ../images/$@ -miboot.image.initrd: miboot.image ../images/ramdisk.image.gz +miboot.initrd.image: miboot.image ../images/ramdisk.image.gz $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=../images/ramdisk.image.gz \ ../images/miboot.image ../images/$@ @@ -83,11 +83,11 @@ rm -f coffboot ln -sf vmlinux.coff ../images/zImage.pmac -vmlinux.coff.initrd: coffboot.initrd $(HACKCOFF) +vmlinux.initrd.coff: coffboot.initrd $(HACKCOFF) $(OBJCOPY) $(OBJCOPY_ARGS) coffboot.initrd ../images/$@ $(HACKCOFF) ../images/$@ rm -f coffboot.initrd - ln -sf vmlinux.coff.initrd ../images/zImage.initrd.pmac + ln -sf vmlinux.initrd.coff ../images/zImage.initrd.pmac vmlinux.elf-pmac: $(CHRPOBJS) $(LIBS) ../common/no_initrd.o $(MKNOTE) ../images/vmlinux.gz $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) ../common/no_initrd.o $(LIBS) @@ -110,6 +110,6 @@ zImage: vmlinux.coff vmlinux.elf-pmac miboot.image -zImage.initrd: vmlinux.coff.initrd vmlinux.initrd.elf-pmac miboot.image.initrd +zImage.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac miboot.initrd.image include $(TOPDIR)/Rules.make |
From: Dave A. <ai...@us...> - 2003-06-10 02:09:14
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/utils In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/ppc/boot/utils Modified Files: mksimage.c offset sioffset sisize size Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: mksimage.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/utils/mksimage.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mksimage.c 10 Apr 2002 15:04:02 -0000 1.1 +++ mksimage.c 10 Jun 2003 01:46:02 -0000 1.2 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mksimage.c 1.6 05/18/01 15:16:42 cort + * BK Id: SCCS/s.mksimage.c 1.7 10/11/01 11:59:05 trini */ /* * @@ -96,7 +96,7 @@ die("can't open loader: %s", strerror(errno)); copy_blocks(fd, ofd, &ld_off, &ld_size); - len = sprintf(buffer, "bootloader: %x %x\n", ld_off, ld_size); + len = sprintf(buffer, "bootloader: %lx %lx\n", ld_off, ld_size); close(fd); fd = open(kernel, O_RDONLY); @@ -104,7 +104,7 @@ die("can't open kernel: %s", strerror(errno)); copy_blocks(fd, ofd, &kern_off, &kern_size); - len += sprintf(buffer+len, "zimage: %x %x\n", kern_off, kern_size); + len += sprintf(buffer+len, "zimage: %lx %lx\n", kern_off, kern_size); close(fd); if (rdimage) { @@ -116,7 +116,7 @@ close(fd); } - len += sprintf(buffer+len, "initrd: %x %x", rd_off, rd_size); + len += sprintf(buffer+len, "initrd: %lx %lx", rd_off, rd_size); close(ofd); Index: offset =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/utils/offset,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- offset 10 Apr 2002 15:04:02 -0000 1.1 +++ offset 10 Jun 2003 01:46:02 -0000 1.2 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -OFFSET=`$1 -h $2 | grep $3 | grep -v zvmlinux| awk '{print $6}'` +OFFSET=`$1 -h $2 | grep $3 | grep -v zvmlinux | awk '{print $6}'` echo "0x"$OFFSET Index: sioffset =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/utils/sioffset,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- sioffset 10 Apr 2002 15:04:02 -0000 1.1 +++ sioffset 10 Jun 2003 01:46:02 -0000 1.2 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh OFFSET=`grep $1 sImage.map | awk '{print $2}'` echo "0x"$OFFSET Index: sisize =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/utils/sisize,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- sisize 10 Apr 2002 15:04:03 -0000 1.1 +++ sisize 10 Jun 2003 01:46:02 -0000 1.2 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh OFFSET=`grep $1 sImage.map | awk '{print $3}'` echo "0x"$OFFSET Index: size =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/utils/size,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- size 10 Apr 2002 15:04:03 -0000 1.1 +++ size 10 Jun 2003 01:46:02 -0000 1.2 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -OFFSET=`$1 -h $2 | grep $3 | grep -v zvmlinux | awk '{print $3}'` +OFFSET=`$1 -h $2 | grep $3 | grep -v zvmlinux | awk '{print $3}'` echo "0x"$OFFSET |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:54
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/prep In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/ppc/boot/prep Modified Files: Makefile misc.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/prep/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile 10 Apr 2002 15:04:01 -0000 1.1 +++ Makefile 10 Jun 2003 01:46:01 -0000 1.2 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.26 09/25/01 07:54:40 trini +# BK Id: SCCS/s.Makefile 1.28 10/21/01 20:47:58 trini # # arch/ppc/boot/Makefile # @@ -45,6 +45,12 @@ -DZIMAGE_SIZE=0 -c -o $@ $*.c zvmlinux.initrd: $(obj-y) $(LIBS) ../images/vmlinux.gz +# +# Recompile misc.oagain with more 'correct' bogus offsets +# + $(CC) $(CFLAGS) -DINITRD_OFFSET=0x00138466 -DINITRD_SIZE=0x0000111a \ + -DZIMAGE_OFFSET=0x0001b000 -DZIMAGE_SIZE=0x0011d460 \ + -c -o misc.o misc.c $(LD) $(ZLINKFLAGS) -o $@.tmp $(obj-y) $(LIBS) $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ --add-section=initrd=../images/ramdisk.image.gz \ @@ -60,7 +66,7 @@ --add-section=initrd=../images/ramdisk.image.gz \ --add-section=image=../images/vmlinux.gz \ $@.tmp $@ - rm -f $@.tmp zvmlinux + rm -f $@.tmp zImage: zvmlinux $(MKPREP) $(MKPREP) -pbp zvmlinux ../images/$@.prep @@ -72,6 +78,12 @@ zvmlinux: $(obj-y) $(LIBS) ../images/vmlinux.gz # +# Recompile misc.oagain with more 'correct' bogus offsets +# + $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \ + -DZIMAGE_OFFSET=0x0001b000 -DZIMAGE_SIZE=0x0011d460 \ + -c -o misc.o misc.c +# # build the boot loader image and then compute the offset into it # for the kernel image # @@ -88,7 +100,7 @@ $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(obj-y) $(LIBS) $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ --add-section=image=../images/vmlinux.gz $@.tmp $@ - rm $@.tmp + rm -f $@.tmp floppy: zImage dd if=../images/zImage.prep of=/dev/fd0H1440 bs=64b Index: misc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/prep/misc.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- misc.c 10 Apr 2002 15:04:01 -0000 1.1 +++ misc.c 10 Jun 2003 01:46:01 -0000 1.2 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.misc.c 1.20 09/24/01 18:42:54 trini + * BK Id: SCCS/s.misc.c 1.22 10/15/01 17:46:21 trini * * arch/ppc/boot/prep/misc.c * @@ -48,14 +48,6 @@ RESIDUAL *hold_residual = &hold_resid_buf; unsigned long initrd_start = 0, initrd_end = 0; -/* These values must be variables. If not, the compiler optimizer - * will remove some code, causing the size of the code to vary - * when these values are zero. This is bad because we first - * compile with these zero to determine the size and offsets - * in an image, than compile again with these set to the proper - * discovered value. - */ -unsigned int initrd_offset, initrd_size; char *zimage_start; int zimage_size; @@ -311,14 +303,12 @@ size of the elf header which we strip -- Cort */ zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET); zimage_size = ZIMAGE_SIZE; - initrd_offset = INITRD_OFFSET; - initrd_size = INITRD_SIZE; - if ( initrd_offset ) - initrd_start = load_addr - 0x10000 + initrd_offset; + if ( INITRD_OFFSET ) + initrd_start = load_addr - 0x10000 + INITRD_OFFSET; else initrd_start = 0; - initrd_end = initrd_size + initrd_start; + initrd_end = INITRD_SIZE + initrd_start; /* * Find a place to stick the zimage and initrd and @@ -343,9 +333,9 @@ puts(" "); puthex(initrd_end); puts("\n"); avail_ram = (char *)PAGE_ALIGN( (unsigned long)zimage_size+(unsigned long)zimage_start); - memcpy ((void *)avail_ram, (void *)initrd_start, initrd_size ); + memcpy ((void *)avail_ram, (void *)initrd_start, INITRD_SIZE ); initrd_start = (unsigned long)avail_ram; - initrd_end = initrd_start + initrd_size; + initrd_end = initrd_start + INITRD_SIZE; puts("relocated to: "); puthex(initrd_start); puts(" "); puthex(initrd_end); puts("\n"); } @@ -395,7 +385,7 @@ puts("\n"); /* mappings on early boot can only handle 16M */ - if ( (int)(cmd_line[0]) > (16<<20)) + if ( (int)(cmd_line) > (16<<20)) puts("cmd_line located > 16M\n"); if ( (int)hold_residual > (16<<20)) puts("hold_residual located > 16M\n"); |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:50
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/networking In directory sc8-pr-cvs1:/tmp/cvs-serv23180/Documentation/networking Modified Files: 8139too.txt dl2k.txt ip-sysctl.txt Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: 8139too.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/networking/8139too.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- 8139too.txt 9 Apr 2002 16:55:46 -0000 1.2 +++ 8139too.txt 10 Jun 2003 01:45:46 -0000 1.3 @@ -96,7 +96,10 @@ KTI KF-230TX KTI KF-230TX/2 Lantech FastNet TX +Ovislink Fast Ethernet +Planet ENW-9504 (V.4) 10/100 SMC EZNET 10/100 +UNEX NexNIC ND012C (please add your adapter model to this list) @@ -181,11 +184,18 @@ Change History -------------- +Version 0.9.23 - January 16, 2002 + +* New, compile-time conditional for testing better RX reset +* Only account specific RX errors if rx_status is !OK + + Version 0.9.22 - November 8, 2001 * Additional retries before aborting Tx * Do not write other TxConfig bits when writing clear-abort bit. * Ack TxErr intr status after each Tx abort, too. +* Fix oops in interface restart Version 0.9.21 - November 1, 2001 Index: dl2k.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/networking/dl2k.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- dl2k.txt 9 Apr 2002 16:55:46 -0000 1.1 +++ dl2k.txt 10 Jun 2003 01:45:46 -0000 1.2 @@ -1,7 +1,7 @@ D-Link DL2000-based Gigabit Ethernet Adapter Installation for Linux - Nov 12, 2001 + Jan 02, 2002 Contents ======== @@ -182,7 +182,7 @@ mtu=packet_size - Specifies the maximum packet size. default is 1500. -media=xxxxxxxxx - Specifies the media type the NIC operates at. +media=media_type - Specifies the media type the NIC operates at. autosense Autosensing active media. 10mbps_hd 10Mbps half duplex. 10mbps_fd 10Mbps full duplex. @@ -195,28 +195,41 @@ 2 10Mbps full duplex. 3 100Mbps half duplex. 4 100Mbps full duplex. - 5 1000Mbps full duplex. - 6 1000Mbps half duplex. + 5 1000Mbps half duplex. + 6 1000Mbps full duplex. By default, the NIC operates at autosense. Note that only 1000mbps_fd and 1000mbps_hd types are available for fiber adapter. -vlan=x - Specifies the VLAN ID. If vlan=0, the +vlan=[0|1] - Specifies the VLAN ID. If vlan=0, the Virtual Local Area Network (VLAN) function is disable. -jumbo=x - Specifies the jumbo frame support. If jumbo=1, +jumbo=[0|1] - Specifies the jumbo frame support. If jumbo=1, the NIC accept jumbo frames. By default, this function is disabled. Jumbo frame usually improve the performance int gigabit. -int_count - Rx frame count each interrupt. -int_timeout - Rx DMA wait time for an interrupt. Proper - values of int_count and int_timeout bring - a conspicuous performance in the fast machine. - Ex. int_count=5 and int_timeout=750 +rx_coalesce=n - Rx frame count each interrupt. +rx_timeout=n - Rx DMA wait time for an interrupt. Proper + values of rx_coalesce and rx_timeout bring + a conspicuous performance in the fast machine. + Ex. rx_coalesce=5 and rx_timeout=750 + +tx_coalesce=n - Tx transmit count each TxComp interrupt. + Setting value larger than 1 will improve + performance, but this is possible to lower + stability in slow UP machines. By default, + tx_coalesce=1. (dl2k) + +tx_flow=[1|0] - Specifies the Tx flow control. If tx_flow=1, + the Tx flow control enable. + +rx_flow=[1|0] - Specifies the Rx flow control. If rx_flow=1, + the Rx flow control enable. + Configuration Script Sample =========================== Index: ip-sysctl.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/networking/ip-sysctl.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ip-sysctl.txt 9 Apr 2002 16:55:46 -0000 1.2 +++ ip-sysctl.txt 10 Jun 2003 01:45:46 -0000 1.3 @@ -309,13 +309,20 @@ ICMP ECHO requests sent to it or just those to broadcast/multicast addresses, respectively. -icmp_destunreach_rate - INTEGER -icmp_paramprob_rate - INTEGER -icmp_timeexceed_rate - INTEGER -icmp_echoreply_rate - INTEGER (not enabled per default) - Limit the maximal rates for sending ICMP packets to specific targets. +icmp_ratelimit - INTEGER + Limit the maximal rates for sending ICMP packets whose type matches + icmp_ratemask (see below) to specific targets. 0 to disable any limiting, otherwise the maximal rate in jiffies(1) - See the source for more information. + Default: 1 + +icmp_ratemask - INTEGER + Mask made of ICMP types for which rates are being limited. + Default: 6168 + Note: 6168 = 0x1818 = 1<<ICMP_DEST_UNREACH + 1<<ICMP_SOURCE_QUENCH + + 1<<ICMP_TIME_EXCEEDED + 1<<ICMP_PARAMETERPROB, which means + dest unreachable (3), source quench (4), time exceeded (11) + and parameter problem (12) ICMP packets are rate limited + (check values in icmp.h) icmp_ignore_bogus_error_responses - BOOLEAN Some routers violate RFC 1122 by sending bogus responses to broadcast |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:50
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc64 In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/sparc64 Modified Files: defconfig Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: defconfig =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc64/defconfig,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- defconfig 10 Jun 2003 01:13:18 -0000 1.3 +++ defconfig 10 Jun 2003 01:46:16 -0000 1.4 @@ -483,6 +483,7 @@ # CONFIG_8139TOO_PIO is not set # CONFIG_8139TOO_TUNE_TWISTER is not set # CONFIG_8139TOO_8129 is not set +# CONFIG_8139_NEW_RX_RESET is not set CONFIG_SIS900=m CONFIG_EPIC100=m CONFIG_SUNDANCE=m @@ -683,6 +684,7 @@ # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ISO8859_1 is not set # CONFIG_NLS_ISO8859_2 is not set @@ -785,6 +787,8 @@ CONFIG_USB_OV511=m CONFIG_USB_PWC=m CONFIG_USB_SE401=m +CONFIG_USB_STV680=m +CONFIG_USB_VICAM=m CONFIG_USB_DSBR=m CONFIG_USB_DABUSB=m @@ -813,6 +817,7 @@ CONFIG_USB_SERIAL_EMPEG=m CONFIG_USB_SERIAL_FTDI_SIO=m CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m # CONFIG_USB_SERIAL_IR is not set CONFIG_USB_SERIAL_EDGEPORT=m CONFIG_USB_SERIAL_KEYSPAN_PDA=m @@ -826,6 +831,7 @@ # CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set # CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:50
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/sparc/kernel Modified Files: check_asm.sh devices.c ebus.c init_task.c pcic.c time.c unaligned.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: check_asm.sh =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel/check_asm.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- check_asm.sh 10 Apr 2002 15:17:42 -0000 1.2 +++ check_asm.sh 10 Jun 2003 01:46:16 -0000 1.3 @@ -1,12 +1,12 @@ #!/bin/sh case $1 in -printf) - sed -n -e '/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/(\*//;s/)(.*)//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\ + sed -n -e '/^#/d;/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/(\*//;s/)(.*)//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\ /g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/printf ("#define AOFF_'$2'_\0 0x%08x\\n", check_asm_data[i++]); printf("#define ASIZ_'$2'_\0 0x%08x\\n", check_asm_data[i++]);/' >> $4 echo "printf (\"#define ASIZ_$2\\t0x%08x\\n\", check_asm_data[i++]);" >> $4 ;; -data) - sed -n -e '/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/(\*//;s/)(.*)//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\ + sed -n -e '/^#/d;/struct[ ]*'$2'_struct[ ]*{/,/};/p' < $3 | sed '/struct[ ]*'$2'_struct[ ]*{/d;/:[0-9]*[ ]*;/d;/^[ ]*$/d;/};/d;s/^[ ]*//;s/volatile[ ]*//;s/\(unsigned\|signed\|struct\)[ ]*//;s/\(\[\|__attribute__\).*;[ ]*$//;s/(\*//;s/)(.*)//;s/;[ ]*$//;s/^[^ ]*[ ]*//;s/,/\ /g' | sed 's/^[ *]*//;s/[ ]*$//;s/^.*$/ ((char *)\&((struct '$2'_struct *)0)->\0) - ((char *)((struct '$2'_struct *)0)), sizeof(((struct '$2'_struct *)0)->\0),/' >> $4 echo " sizeof(struct $2_struct)," >> $4 ;; Index: devices.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel/devices.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- devices.c 14 Jan 2001 19:25:28 -0000 1.1.1.1 +++ devices.c 10 Jun 2003 01:46:16 -0000 1.2 @@ -4,9 +4,10 @@ * Copyright (C) 1996 David S. Miller (da...@ca...) */ +#include <linux/config.h> #include <linux/kernel.h> #include <linux/threads.h> -#include <linux/config.h> +#include <linux/string.h> #include <linux/init.h> #include <asm/page.h> Index: ebus.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel/ebus.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Index: init_task.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel/init_task.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- init_task.c 10 Apr 2002 15:17:42 -0000 1.2 +++ init_task.c 10 Jun 2003 01:46:16 -0000 1.3 @@ -14,6 +14,6 @@ * If this is not aligned on a 8k boundry, then you should change code * in etrap.S which assumes it. */ -union task_union init_task_union - __attribute__((__section__(".text"))) = +__asm__(".section \".text\",#alloc\n"); +union task_union init_task_union = { INIT_TASK(init_task_union.task) }; Index: pcic.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel/pcic.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pcic.c 10 Apr 2002 15:17:42 -0000 1.2 +++ pcic.c 10 Jun 2003 01:46:16 -0000 1.3 @@ -759,7 +759,6 @@ unsigned long v; int timer_irq, irq; - do_get_fast_time = pci_do_gettimeofday; /* A hack until do_gettimeofday prototype is moved to arch specific headers and btfixupped. Patch do_gettimeofday with ba pci_do_gettimeofday; nop */ ((unsigned int *)do_gettimeofday)[0] = Index: time.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel/time.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- time.c 10 Apr 2002 15:17:42 -0000 1.2 +++ time.c 10 Jun 2003 01:46:16 -0000 1.3 @@ -371,7 +371,6 @@ struct intersil *iregs; #endif - do_get_fast_time = do_gettimeofday; BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM); btfixup(); Index: unaligned.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/kernel/unaligned.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- unaligned.c 10 Apr 2002 15:17:42 -0000 1.2 +++ unaligned.c 10 Jun 2003 01:46:16 -0000 1.3 @@ -224,7 +224,7 @@ "or %%l1, %%g7, %%g7\n\t" \ "st %%g7, [%0 + 4]\n" \ "0:\n\n\t" \ - ".section __ex_table\n\t" \ + ".section __ex_table,#alloc\n\t" \ ".word 4b, " #errh "\n\t" \ ".word 5b, " #errh "\n\t" \ ".word 6b, " #errh "\n\t" \ @@ -277,7 +277,7 @@ "16:\t" "stb %%l2, [%0]\n" \ "17:\t" "stb %%l1, [%0 + 1]\n" \ "0:\n\n\t" \ - ".section __ex_table\n\t" \ + ".section __ex_table,#alloc\n\t" \ ".word 4b, " #errh "\n\t" \ ".word 5b, " #errh "\n\t" \ ".word 6b, " #errh "\n\t" \ |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:49
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc/prom In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/sparc/prom Modified Files: ranges.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: ranges.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/prom/ranges.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ranges.c 10 Apr 2002 15:17:43 -0000 1.2 +++ ranges.c 10 Jun 2003 01:46:16 -0000 1.3 @@ -16,26 +16,25 @@ int num_obio_ranges; /* Adjust register values based upon the ranges parameters. */ -void +static void prom_adjust_regs(struct linux_prom_registers *regp, int nregs, struct linux_prom_ranges *rangep, int nranges) { int regc, rngc; - for(regc=0; regc < nregs; regc++) { - for(rngc=0; rngc < nranges; rngc++) - if(regp[regc].which_io == rangep[rngc].ot_child_space && - regp[regc].phys_addr >= rangep[rngc].ot_child_base && - regp[regc].phys_addr + regp[regc].reg_size <= rangep[rngc].ot_child_base + rangep[rngc].or_size) + for (regc = 0; regc < nregs; regc++) { + for (rngc = 0; rngc < nranges; rngc++) + if (regp[regc].which_io == rangep[rngc].ot_child_space) break; /* Fount it */ - if(rngc==nranges) /* oops */ + if (rngc == nranges) /* oops */ prom_printf("adjust_regs: Could not find range with matching bus type...\n"); regp[regc].which_io = rangep[rngc].ot_parent_space; + regp[regc].phys_addr -= rangep[rngc].ot_child_base; regp[regc].phys_addr += rangep[rngc].ot_parent_base; } } -void +static void prom_adjust_ranges(struct linux_prom_ranges *ranges1, int nranges1, struct linux_prom_ranges *ranges2, int nranges2) { |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:49
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sh/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/sh/kernel Modified Files: io_7751se.c pci-7751se.c rtc.c sh_ksyms.c traps.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: io_7751se.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sh/kernel/io_7751se.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- io_7751se.c 9 Apr 2002 17:07:20 -0000 1.1 +++ io_7751se.c 10 Jun 2003 01:46:15 -0000 1.2 @@ -17,7 +17,7 @@ #include <asm/hitachi_7751se.h> #include <asm/addrspace.h> -#include <asm/pci.h> +#include <linux/pci.h> #include <asm/pci-sh7751.h> #if 0 @@ -70,7 +70,7 @@ else return (volatile __u16 *) (PA_SUPERIO + (port << 1)); #endif - maybebadio(name,port); + maybebadio(name,(unsigned long)port); return (volatile __u16*)port; } @@ -276,6 +276,7 @@ /* ISA page descriptor. */ static __u32 sh_isa_memmap[256]; +#if 0 static int sh_isa_mmap(__u32 start, __u32 length, __u32 offset) { @@ -286,12 +287,11 @@ idx = start >> 12; sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff); -#if 0 printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n", start, length, offset, idx, sh_isa_memmap[idx]); -#endif return 0; } +#endif unsigned long sh7751se_isa_port2addr(unsigned long offset) Index: pci-7751se.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sh/kernel/pci-7751se.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- pci-7751se.c 9 Apr 2002 17:07:20 -0000 1.1 +++ pci-7751se.c 10 Jun 2003 01:46:15 -0000 1.2 @@ -37,7 +37,6 @@ */ int __init pcibios_init_platform(void) { - unsigned long data; unsigned long bcr1, wcr1, wcr2, wcr3, mcr; unsigned short bcr2; Index: rtc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sh/kernel/rtc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- rtc.c 9 Apr 2002 17:07:20 -0000 1.2 +++ rtc.c 10 Jun 2003 01:46:15 -0000 1.3 @@ -46,7 +46,7 @@ } while ((ctrl_inb(RCR1) & RCR1_CF) != 0); #if RTC_BIT_INVERTED != 0 - /* Work around to avoid reading correct value. */ + /* Work around to avoid reading incorrect value. */ if (sec128 == RTC_BIT_INVERTED) { schedule_timeout(1); goto again; @@ -81,12 +81,18 @@ goto again; } +#if RTC_BIT_INVERTED != 0 + if ((sec128 & RTC_BIT_INVERTED)) + sec--; +#endif + tv->tv_sec = mktime(yr100 * 100 + yr, mon, day, hr, min, sec); - tv->tv_usec = ((sec128 ^ RTC_BIT_INVERTED) * 1000000) / 128; + tv->tv_usec = (sec128 * 1000000) / 128; } -static int set_rtc_time(unsigned long nowtime) +int sh_rtc_settimeofday(const struct timeval *tv) { + unsigned long nowtime = tv->tv_sec; int retval = 0; int real_seconds, real_minutes, cmos_minutes; @@ -122,13 +128,4 @@ ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2); /* Start RTC */ return retval; -} - -int sh_rtc_settimeofday(const struct timeval *tv) -{ -#if RTC_BIT_INVERTED != 0 - /* This is not accurate, but better than nothing. */ - schedule_timeout(HZ/2); -#endif - return set_rtc_time(tv->tv_sec); } Index: sh_ksyms.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sh/kernel/sh_ksyms.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- sh_ksyms.c 9 Apr 2002 17:07:20 -0000 1.2 +++ sh_ksyms.c 10 Jun 2003 01:46:15 -0000 1.3 @@ -39,8 +39,6 @@ /* Networking helper routines. */ EXPORT_SYMBOL(csum_partial_copy); -EXPORT_SYMBOL(simple_strtol); - EXPORT_SYMBOL(strtok); EXPORT_SYMBOL(strpbrk); EXPORT_SYMBOL(strstr); Index: traps.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sh/kernel/traps.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- traps.c 9 Apr 2002 17:07:20 -0000 1.2 +++ traps.c 10 Jun 2003 01:46:15 -0000 1.3 @@ -560,3 +560,8 @@ } } } + +void show_trace_task(struct task_struct *tsk) +{ + printk("Backtrace not yet implemented for SH.\n"); +} |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:48
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/kbuild In directory sc8-pr-cvs1:/tmp/cvs-serv23180/Documentation/kbuild Modified Files: config-language.txt Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: config-language.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/kbuild/config-language.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config-language.txt 14 Jan 2001 20:05:39 -0000 1.1.1.1 +++ config-language.txt 10 Jun 2003 01:45:45 -0000 1.2 @@ -30,7 +30,7 @@ scripts/Configure make config, make oldconfig scripts/Menuconfig make menuconfig scripts/tkparse make xconfig - mconfig (in development) + mconfig ftp.kernel.org/pub/linux/kernel/people/hch/mconfig/ 'Configure' is a bash script which interprets Config.in files by sourcing them. Some of the Config Language commands are native bash commands; @@ -52,9 +52,6 @@ into an internal syntax tree and then hands the syntax tree to one of several user-interface front ends. -This document describes the behaviour of all four interpreters, even though -mconfig has not been released at the time of writing. - === Statements @@ -489,7 +486,7 @@ Configure: implemented Menuconfig: implemented XConfig: implemented -mconfig: not implemented +mconfig: implemented Example: |
From: Dave A. <ai...@us...> - 2003-06-10 02:08:48
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/sparc In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/sparc Modified Files: defconfig Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: defconfig =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/sparc/defconfig,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- defconfig 10 Jun 2003 01:13:17 -0000 1.3 +++ defconfig 10 Jun 2003 01:46:15 -0000 1.4 @@ -373,6 +373,7 @@ # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ISO8859_1 is not set # CONFIG_NLS_ISO8859_2 is not set |