diff options
Diffstat (limited to 'packages')
9 files changed, 16434 insertions, 9 deletions
diff --git a/packages/linux/linux-mtx-1-2.4.27/23-mtx-1_watchdog_autotrigger.patch b/packages/linux/linux-mtx-1-2.4.27/23-mtx-1_watchdog_autotrigger.patch new file mode 100644 index 0000000000..c6bb0aae68 --- /dev/null +++ b/packages/linux/linux-mtx-1-2.4.27/23-mtx-1_watchdog_autotrigger.patch @@ -0,0 +1,98 @@ +--- linux/arch/mips/au1000/mtx-1/mtx-1_watchdog.c.orig 2005-03-22 17:18:01.000000000 +0100 ++++ linux/arch/mips/au1000/mtx-1/mtx-1_watchdog.c 2005-07-06 12:10:06.000000000 +0200 +@@ -39,6 +39,7 @@ + #include <linux/watchdog.h> + #include <linux/slab.h> + #include <linux/init.h> ++#include <asm/uaccess.h> + + #include <asm/au1000.h> + +@@ -115,6 +116,8 @@ + + //---------[ File Functions ]----------------- + ++static char restart_after_close; ++ + static int mtx1wd_open (struct inode *inode, struct file *file) + { + if (MINOR(inode->i_rdev)!=WATCHDOG_MINOR) return -ENODEV; +@@ -134,6 +137,10 @@ + + static int mtx1wd_release (struct inode *inode, struct file *file) { + if (MINOR(inode->i_rdev)==WATCHDOG_MINOR) { ++ ++ if (restart_after_close) ++ start_wd_timer (); ++ + } + MOD_DEC_USE_COUNT; + return 0; +@@ -141,22 +148,53 @@ + + + static ssize_t mtx1wd_write (struct file *file, const char *buf, size_t count, loff_t *ppos) { +- if (ppos!=&file->f_pos) +- return -ESPIPE; + +- if (count) { + mtx1_trigger_wd (); +- return 1; ++ ++ if (count > 0) { ++ char buffer[10]; ++ int n = (count>9)?9:count; ++ ++ if (copy_from_user (&buffer, buf, n)) ++ return -EFAULT; ++ buffer[n]=0; ++ ++ if (count >= 4 && strncmp("auto", buffer, 4)==0) ++ restart_after_close = 1; ++ ++ else if (count >= 6 && strncmp("manual", buffer, 6)==0) ++ restart_after_close = 0; ++ ++ return n; + } + return 0; + } + + ++static ssize_t mtx1wd_read (struct file *file, char *buf, size_t count, loff_t *ppos) ++{ ++ char * state = restart_after_close ? "auto\n" : "manual\n"; ++ int n = strlen(state)+1; ++ ++ if (file->f_pos >= n) ++ return 0; ++ ++ if (count < n) ++ return -EINVAL; ++ ++ if(copy_to_user(buf, state, n)) ++ return -EFAULT; ++ ++ file->f_pos += n; ++ ++ return n; ++} ++ + + static struct file_operations mtx1wd_fops = { + .owner = THIS_MODULE, + .llseek = NULL, +- .read = NULL, ++ .read = mtx1wd_read, + .write = mtx1wd_write, + .readdir = NULL, + .poll = NULL, +@@ -194,6 +232,8 @@ + { + printk("MTX-1 watchdog driver\n"); + ++ restart_after_close = 0; ++ + mtx1_enable_wd (); + + //-- trigger it for the first time. diff --git a/packages/linux/linux-mtx-1-2.4.27/24-mtx-1_sysbtn.patch b/packages/linux/linux-mtx-1-2.4.27/24-mtx-1_sysbtn.patch new file mode 100644 index 0000000000..9c0808942a --- /dev/null +++ b/packages/linux/linux-mtx-1-2.4.27/24-mtx-1_sysbtn.patch @@ -0,0 +1,257 @@ +diff -Nru linux-old/arch/mips/au1000/mtx-1/Makefile linux/arch/mips/au1000/mtx-1/Makefile +--- linux-old/arch/mips/au1000/mtx-1/Makefile 2005-07-19 18:59:27.000000000 +0200 ++++ linux/arch/mips/au1000/mtx-1/Makefile 2005-07-07 10:15:01.000000000 +0200 +@@ -15,6 +15,6 @@ + + O_TARGET := mtx-1.o + +-obj-y := init.o board_setup.o irqmap.o mtx-1_watchdog.o ++obj-y := init.o board_setup.o irqmap.o mtx-1_watchdog.o mtx-1_sysbtn.o + + include $(TOPDIR)/Rules.make +diff -Nru linux-old/arch/mips/au1000/mtx-1/irqmap.c linux/arch/mips/au1000/mtx-1/irqmap.c +--- linux-old/arch/mips/au1000/mtx-1/irqmap.c 2005-07-19 17:42:05.000000000 +0200 ++++ linux/arch/mips/au1000/mtx-1/irqmap.c 2005-07-06 13:37:25.000000000 +0200 +@@ -50,10 +50,11 @@ + /* Need to define this. + */ + au1xxx_irq_map_t au1xxx_irq_map[] = { ++ { AU1500_GPIO_207, INTC_INT_RISE_AND_FALL_EDGE, 0 }, + { 0, 0, 0} + }; + +-int au1xxx_nr_irqs = 0; ++int au1xxx_nr_irqs = 1; + + #ifdef CONFIG_PCI + +diff -Nru linux-old/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c linux/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c +--- linux-old/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c 2005-07-07 10:29:24.000000000 +0200 +@@ -0,0 +1,226 @@ ++/* ++ * Driver for the MTX-1 System Button. ++ * ++ * (c) Copyright 2005 4G Systems <info@4g-systems.biz>, All Rights Reserved. ++ * http://www.4g-systems.biz ++ * ++ * 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. ++ * ++ * Neither Michael Stickel nor 4G Systeme GmbH admit liability nor provide ++ * warranty for any of this software. This material is provided ++ * "AS-IS" and at no charge. ++ * ++ * (c) Copyright 2005 4G Systems <info@4g-systems.biz> ++ * ++ * Release 0.01. ++ * ++ * Author: Michael Stickel michael.stickel@4g-systems.biz ++ * ++ * ++ * After the module is loaded there is a device /dev/misc/btn ++ * that can be read. It returns one char '1' if the button ++ * has been pressed an '0' if it has been released. ++ */ ++#include <linux/config.h> ++#include <linux/module.h> ++#include <linux/version.h> ++#include <linux/types.h> ++#include <linux/errno.h> ++#include <linux/kernel.h> ++#include <linux/poll.h> ++#include <linux/sched.h> ++#include <linux/miscdevice.h> ++#include <linux/slab.h> ++#include <linux/init.h> ++#include <linux/irq.h> ++ ++#include <asm/uaccess.h> ++ ++#include <asm/au1000.h> ++ ++ ++#ifndef FALSE ++# define FALSE (0) ++#endif ++ ++#ifndef TRUE ++# define TRUE (!FALSE) ++#endif ++ ++ ++//---------[ declarations ]----------------- ++ ++ ++static DECLARE_WAIT_QUEUE_HEAD(mtx1btn_wait_queue); ++static char state_changed; ++static char last_value; ++static char is_inuse; ++ ++ ++//---------[ Hardware Functions ]----------------- ++ ++// The MTX-1 Button is attached to GPIO207. ++#define MTX1_GPIO2_SYSBTN (7) ++#define MTX1_SYSBTN_IRQ (AU1500_GPIO_207) ++ ++ ++static char mtx1_getbtn (int btnno) ++{ ++ if (btnno==0) { ++ return (au_readl(GPIO2_PINSTATE) & (1<<MTX1_GPIO2_SYSBTN)) ? 0 : 1; ++ } ++ return 0; ++} ++ ++static void mtx1_initbuttons (void) ++{ ++ au_writel (au_readl(GPIO2_DIR) & ~(1<<MTX1_GPIO2_SYSBTN), GPIO2_DIR); ++} ++ ++ ++//---------[ Interrupt handling ]----------------- ++ ++ ++static void mtx1_btn_interrupt (int irq, void *private, struct pt_regs *regs) ++{ ++ char value = mtx1_getbtn(0); ++ if (last_value != value) ++ { ++ last_value = value; ++ state_changed = 1; ++ wake_up (&mtx1btn_wait_queue); ++ } ++// kill_fasync(&async_queue, SIGIO, POLL_OUT); ++} ++ ++ ++static int mtx1_btn_startirq (void) ++{ ++ if (!request_irq (MTX1_SYSBTN_IRQ, mtx1_btn_interrupt, 0 /* | SA_INTERRUPT */, "mtx1btn", (void *)&state_changed)) { ++ return 0; ++ } ++ return -1; ++} ++ ++static int mtx1_btn_stopirq (void) ++{ ++ free_irq(MTX1_SYSBTN_IRQ, (void *)&state_changed); ++ return 0; ++} ++ ++ ++ ++//---------[ File Functions ]----------------- ++ ++ ++static int mtx1sysbtn_minor = -1; ++ ++ ++static int mtx1sysbtn_open (struct inode *inode, struct file *file) ++{ ++ if (MINOR(inode->i_rdev)!=mtx1sysbtn_minor) return -ENODEV; ++ if (is_inuse) return -EBUSY; ++ is_inuse=1; ++ last_value = mtx1_getbtn(0); ++ state_changed = 0; ++ MOD_INC_USE_COUNT; ++ return 0; ++} ++ ++ ++static int mtx1sysbtn_release (struct inode *inode, struct file *file) { ++ if (MINOR(inode->i_rdev)==mtx1sysbtn_minor) { ++ is_inuse=0; ++ } ++ MOD_DEC_USE_COUNT; ++ return 0; ++} ++ ++ ++static ssize_t mtx1sysbtn_read (struct file *file, char *buf, size_t count, loff_t *ppos) ++{ ++ if (count < 1) ++ return -EINVAL; ++ if (!state_changed) ++ interruptible_sleep_on (&mtx1btn_wait_queue); ++ state_changed = 0; ++ char c = last_value ? '1' : '0'; /* mtx1_getbtn(0) */ ++ if(copy_to_user(buf, &c, 1)) ++ return -EFAULT; ++ return 1; ++} ++ ++ ++static unsigned int mtx1sysbtn_poll (struct file *file, poll_table * wait) ++{ ++ unsigned int mask = 0; ++ ++ poll_wait (file, &mtx1btn_wait_queue, wait); ++ ++ if (state_changed) // state changed since last time. ++ mask |= POLLIN | POLLRDNORM; ++ ++ return mask; ++} ++ ++ ++static struct file_operations mtx1sysbtn_fops = { ++ .owner = THIS_MODULE, ++ .llseek = NULL, ++ .read = mtx1sysbtn_read, ++ .write = NULL, ++ .readdir = NULL, ++ .poll = mtx1sysbtn_poll, ++ .ioctl = NULL, ++ .mmap = NULL, ++ .open = mtx1sysbtn_open, ++ .flush = NULL, ++ .release = mtx1sysbtn_release ++}; ++ ++ ++static struct miscdevice mtx1sysbtn_miscdev = { ++ MISC_DYNAMIC_MINOR /* SYSBTN_MINOR */ , ++ "btn", ++ &mtx1sysbtn_fops ++}; ++ ++ ++ ++//---------[ Module Functions ]----------------- ++ ++ ++void __exit cleanup_mtx1_sysbtn (void) ++{ ++ is_inuse = 1; ++ mtx1_btn_stopirq (); ++ misc_deregister(&mtx1sysbtn_miscdev); ++} ++ ++ ++int __init init_mtx1_sysbtn (void) ++{ ++ printk("MTX-1 System Button driver\n"); ++ is_inuse = 1; ++ mtx1_initbuttons (); ++ if (misc_register (&mtx1sysbtn_miscdev) >= 0) { ++ mtx1sysbtn_minor = mtx1sysbtn_miscdev.minor; ++ if (mtx1_btn_startirq () == 0) { ++ is_inuse=0; ++ return 0; ++ } ++ misc_deregister(&mtx1sysbtn_miscdev); ++ } ++ return 1; ++} ++ ++__initcall(init_mtx1_sysbtn); ++__exitcall(cleanup_mtx1_sysbtn); ++ ++MODULE_AUTHOR("Michael Stickel"); ++MODULE_DESCRIPTION("Driver for the MTX-1 system button"); ++MODULE_LICENSE("GPL"); ++EXPORT_NO_SYMBOLS; diff --git a/packages/linux/linux-mtx-1-2.4.27/25-mtx-sio2.diff b/packages/linux/linux-mtx-1-2.4.27/25-mtx-sio2.diff new file mode 100644 index 0000000000..4f4775a960 --- /dev/null +++ b/packages/linux/linux-mtx-1-2.4.27/25-mtx-sio2.diff @@ -0,0 +1,12 @@ +--- linux.old/arch/mips/au1000/mtx-1/board_setup.c 2005-08-10 15:22:14.014147000 +0200 ++++ linux/arch/mips/au1000/mtx-1/board_setup.c 2005-08-10 15:26:34.346571264 +0200 +@@ -78,8 +78,7 @@ + + // initialize sys_pinfunc: + // disable second ethernet port (SYS_PF_NI2) +- // set U3/GPIO23 to GPIO23 (SYS_PF_U3) +- au_writel( SYS_PF_NI2 | SYS_PF_U3, SYS_PINFUNC ); ++ au_writel( SYS_PF_NI2, SYS_PINFUNC ); + + // initialize GPIO + au_writel( 0xFFFFFFFF, SYS_TRIOUTCLR ); diff --git a/packages/linux/linux-mtx-1-2.4.27/26-usbd-amd-pb1x00-kit-23may2003-update.diff b/packages/linux/linux-mtx-1-2.4.27/26-usbd-amd-pb1x00-kit-23may2003-update.diff new file mode 100644 index 0000000000..feaf08c563 --- /dev/null +++ b/packages/linux/linux-mtx-1-2.4.27/26-usbd-amd-pb1x00-kit-23may2003-update.diff @@ -0,0 +1,130 @@ +diff -Nru a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c +--- a/arch/mips/au1000/common/irq.c Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/au1000/common/irq.c Fri Feb 27 14:22:51 2004 +@@ -458,7 +458,14 @@ + intc0_req0 |= au_readl(IC0_REQ0INT); + + if (!intc0_req0) return; +- ++#if 0 ++ /* ++ * This is no longer required. The find first bit operation ++ * is almost as fast at finding the correct interrupt, whereas ++ * leaving this in adds a small amount of overhead to all other ++ * interrupts and therefore induces more latency which may ++ * actually cause USB problems. ++ */ + /* + * Because of the tight timing of SETUP token to reply + * transactions, the USB devices-side packet complete +@@ -469,7 +476,7 @@ + do_IRQ(AU1000_USB_DEV_REQ_INT, regs); + return; + } +- ++#endif + irq = au_ffs(intc0_req0) - 1; + intc0_req0 &= ~(1<<irq); + do_IRQ(irq, regs); +diff -Nru a/arch/mips/defconfig-bosporus b/arch/mips/defconfig-bosporus +--- a/arch/mips/defconfig-bosporus Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/defconfig-bosporus Fri Feb 27 14:22:51 2004 +@@ -606,8 +606,6 @@ + # CONFIG_SERIAL_TXX9_CONSOLE is not set + CONFIG_AU1X00_UART=y + CONFIG_AU1X00_SERIAL_CONSOLE=y +-# CONFIG_AU1X00_USB_TTY is not set +-# CONFIG_AU1X00_USB_RAW is not set + # CONFIG_TXX927_SERIAL is not set + CONFIG_UNIX98_PTYS=y + CONFIG_UNIX98_PTY_COUNT=256 +diff -Nru a/arch/mips/defconfig-db1000 b/arch/mips/defconfig-db1000 +--- a/arch/mips/defconfig-db1000 Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/defconfig-db1000 Fri Feb 27 14:22:51 2004 +@@ -509,8 +509,6 @@ + # CONFIG_SERIAL_TXX9_CONSOLE is not set + CONFIG_AU1X00_UART=y + CONFIG_AU1X00_SERIAL_CONSOLE=y +-# CONFIG_AU1X00_USB_TTY is not set +-# CONFIG_AU1X00_USB_RAW is not set + # CONFIG_TXX927_SERIAL is not set + CONFIG_UNIX98_PTYS=y + CONFIG_UNIX98_PTY_COUNT=256 +diff -Nru a/arch/mips/defconfig-db1100 b/arch/mips/defconfig-db1100 +--- a/arch/mips/defconfig-db1100 Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/defconfig-db1100 Fri Feb 27 14:22:51 2004 +@@ -516,8 +516,6 @@ + # CONFIG_SERIAL_TXX9_CONSOLE is not set + CONFIG_AU1X00_UART=y + CONFIG_AU1X00_SERIAL_CONSOLE=y +-# CONFIG_AU1X00_USB_TTY is not set +-# CONFIG_AU1X00_USB_RAW is not set + # CONFIG_TXX927_SERIAL is not set + CONFIG_UNIX98_PTYS=y + CONFIG_UNIX98_PTY_COUNT=256 +diff -Nru a/arch/mips/defconfig-db1500 b/arch/mips/defconfig-db1500 +--- a/arch/mips/defconfig-db1500 Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/defconfig-db1500 Fri Feb 27 14:22:51 2004 +@@ -506,8 +506,6 @@ + # CONFIG_SERIAL_TXX9_CONSOLE is not set + CONFIG_AU1X00_UART=y + CONFIG_AU1X00_SERIAL_CONSOLE=y +-# CONFIG_AU1X00_USB_TTY is not set +-# CONFIG_AU1X00_USB_RAW is not set + # CONFIG_TXX927_SERIAL is not set + CONFIG_UNIX98_PTYS=y + CONFIG_UNIX98_PTY_COUNT=256 +diff -Nru a/arch/mips/defconfig-pb1000 b/arch/mips/defconfig-pb1000 +--- a/arch/mips/defconfig-pb1000 Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/defconfig-pb1000 Fri Feb 27 14:22:51 2004 +@@ -569,8 +569,6 @@ + # CONFIG_SERIAL_TXX9_CONSOLE is not set + CONFIG_AU1X00_UART=y + CONFIG_AU1X00_SERIAL_CONSOLE=y +-# CONFIG_AU1X00_USB_TTY is not set +-# CONFIG_AU1X00_USB_RAW is not set + # CONFIG_TXX927_SERIAL is not set + CONFIG_UNIX98_PTYS=y + CONFIG_UNIX98_PTY_COUNT=256 +diff -Nru a/arch/mips/defconfig-pb1100 b/arch/mips/defconfig-pb1100 +--- a/arch/mips/defconfig-pb1100 Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/defconfig-pb1100 Fri Feb 27 14:22:51 2004 +@@ -515,8 +515,6 @@ + # CONFIG_SERIAL_TXX9_CONSOLE is not set + CONFIG_AU1X00_UART=y + CONFIG_AU1X00_SERIAL_CONSOLE=y +-# CONFIG_AU1X00_USB_TTY is not set +-# CONFIG_AU1X00_USB_RAW is not set + # CONFIG_TXX927_SERIAL is not set + CONFIG_UNIX98_PTYS=y + CONFIG_UNIX98_PTY_COUNT=256 +diff -Nru a/arch/mips/defconfig-pb1500 b/arch/mips/defconfig-pb1500 +--- a/arch/mips/defconfig-pb1500 Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/defconfig-pb1500 Fri Feb 27 14:22:51 2004 +@@ -619,8 +619,6 @@ + # CONFIG_SERIAL_TXX9_CONSOLE is not set + CONFIG_AU1X00_UART=y + CONFIG_AU1X00_SERIAL_CONSOLE=y +-# CONFIG_AU1X00_USB_TTY is not set +-# CONFIG_AU1X00_USB_RAW is not set + # CONFIG_TXX927_SERIAL is not set + CONFIG_UNIX98_PTYS=y + CONFIG_UNIX98_PTY_COUNT=256 +diff -Nru a/drivers/char/Config.in b/drivers/char/Config.in +--- a/drivers/char/Config.in Fri Feb 27 14:22:51 2004 ++++ b/drivers/char/Config.in Fri Feb 27 14:22:51 2004 +@@ -91,14 +91,6 @@ + if [ "$CONFIG_AU1X00_UART" = "y" ]; then + bool ' Enable Au1x00 serial console' CONFIG_AU1X00_SERIAL_CONSOLE + fi +- dep_tristate ' Au1x00 USB TTY Device support' CONFIG_AU1X00_USB_TTY $CONFIG_SOC_AU1X00 +- if [ "$CONFIG_AU1000_USB_TTY" != "y" ]; then +- dep_tristate ' Au1x00 USB Raw Device support' CONFIG_AU1X00_USB_RAW $CONFIG_SOC_AU1X00 +- fi +- if [ "$CONFIG_AU1X00_USB_TTY" != "n" -o \ +- "$CONFIG_AU1X00_USB_RAW" != "n" ]; then +- define_bool CONFIG_AU1X00_USB_DEVICE y +- fi + fi + bool ' TXx927 SIO support' CONFIG_TXX927_SERIAL + if [ "$CONFIG_TXX927_SERIAL" = "y" ]; then diff --git a/packages/linux/linux-mtx-1-2.4.27/27-usbd-amd-pb1x00-kit-23may2003-usbd.diff b/packages/linux/linux-mtx-1-2.4.27/27-usbd-amd-pb1x00-kit-23may2003-usbd.diff new file mode 100644 index 0000000000..7766f71846 --- /dev/null +++ b/packages/linux/linux-mtx-1-2.4.27/27-usbd-amd-pb1x00-kit-23may2003-usbd.diff @@ -0,0 +1,15816 @@ +/home/sl/USB/PB1500/work/usbd-gpl/kits/amd-pb1x00-kit/amd-pb1x00-linux-2.4.21 +diff -Nru a/arch/mips/config-shared.in b/arch/mips/config-shared.in +--- a/arch/mips/config-shared.in Fri Feb 27 14:22:51 2004 ++++ b/arch/mips/config-shared.in Fri Feb 27 14:22:51 2004 +@@ -985,6 +985,7 @@ + endmenu + + source drivers/usb/Config.in ++source drivers/usbd/Config.in + + source net/bluetooth/Config.in + +--- a/drivers/Makefile 2005-08-15 18:51:50.332030952 +0200 ++++ b/drivers/Makefile 2005-08-15 18:53:08.938081016 +0200 +@@ -41,6 +41,7 @@ + subdir-$(CONFIG_ISDN_BOOL) += isdn + subdir-$(CONFIG_ATM) += atm + subdir-$(CONFIG_FC4) += fc4 ++subdir-$(CONFIG_USBD) += usbd + + # CONFIG_HAMRADIO can be set without CONFIG_NETDEVICE being set -- ch + subdir-$(CONFIG_HAMRADIO) += net/hamradio +diff -Nru a/drivers/usbd/Config.in b/drivers/usbd/Config.in +--- /dev/null Wed Dec 31 16:00:00 1969 ++++ b/drivers/usbd/Config.in Fri Feb 27 14:22:51 2004 +@@ -0,0 +1,58 @@ ++# ++# USB device configuration from the device viewpoint (e.g. Linux running inside a USB device, not as host) ++# ++# Copyright (c) 2002-2003 Belcarra ++# ++# ++ ++mainmenu_option next_comment ++ ++comment 'USB clients (devices, not hosts)' ++ ++tristate 'Support for USB Clients (USB Device, not USB Host)' CONFIG_USBD ++ ++if [ "$CONFIG_USBD" = "y" -o "$CONFIG_USBD" = "m" ]; then ++ comment '' ++ bool ' Enable High Speed Descriptors' CONFIG_USBD_HIGH_SPEED ++ ++ bool ' Do Not Use Serial Number in Device Descriptor (Default is no' CONFIG_USBD_NO_SERIAL_NUMBER ++ if [ "$CONFIG_USBD_NO_SERIAL_NUMBER" != "y" ]; then ++ string ' Default Serial number (string)' CONFIG_USBD_SERIAL_NUMBER_STR "" ++ fi ++ ++ int ' Max Power (mA) (Default is zero, whick is self powered)' CONFIG_USBD_MAXPOWER "0" ++ ++ comment '' ++ ++ bool ' USBD Proc FS' CONFIG_USBD_PROCFS ++ ++ tristate ' USBD Proc FS Module' CONFIG_USBD_PROCFSM $CONFIG_USBD ++ ++ comment 'Function Drivers' ++ ++ source drivers/usbd/network_fd/Config.in ++ source drivers/usbd/acm_fd/Config.in ++ ++ source drivers/usbd/mouse_fd/Config.in ++ ++ comment 'Bus Interface' ++ ++ source drivers/usbd/au1x00_bi/Config.in ++ ++ bool ' USB Device Register Tracing' CONFIG_USBD_BI_REGISTER_TRACE ++ if [ "$CONFIG_USBD" = "y" ]; then ++ bool ' USB Device Manual Enable' CONFIG_USBD_BI_DELAY_ENABLE ++ fi ++ ++ ++ #source drivers/usbd/l7205_bi/Config.in ++ #source drivers/usbd/sl11_bi/Config.in ++ ++ #source drivers/usbd/cdc_fd/Config.in ++ #source drivers/usbd/serialnumber/Config.in ++ #source drivers/usbd/audio_fd/Config.in ++ #source drivers/usbd/eg_fd/Config.in ++ #source drivers/usbd/keyboard_fd/Config.in ++fi ++ ++endmenu +diff -Nru a/drivers/usbd/Makefile b/drivers/usbd/Makefile +--- /dev/null Wed Dec 31 16:00:00 1969 ++++ b/drivers/usbd/Makefile Fri Feb 27 14:22:51 2004 +@@ -0,0 +1,157 @@ ++# ++# Makefile for the kernel USBD (device not host) drivers. ++# ++# Copyright (c) 2002 Belcarra ++# Copyright (C) 2001 Lineo, Inc. ++# Copyright (C) 2001 Hewlett-Packard Co. ++ ++# Subdirs. ++# This is a bit complex, because some subdirs are for ++# proprietary code, and are simply not present in a ++# general distribution. ++ ++TOPDIR ?= ../../.. ++ ++# The all-CAPS *_DIRS get nuked in the new versions ++# of Rules.make, so use only the subdir-* methods. ++subdir-y := ++subdir-m := ++subdir-n := ++subdir- := ++ ++# Function Drivers ++subdir-$(CONFIG_USBD_ACM) += acm_fd ++subdir-$(CONFIG_USBD_MOUSE) += mouse_fd ++subdir-$(CONFIG_USBD_NETWORK) += network_fd ++ ++#subdir-$(CONFIG_USBD_AUDIO) += audio_fd ++#subdir-$(CONFIG_USBD_EG) += eg_fd ++#subdir-$(CONFIG_USBD_KEYBOARD) += keyboard_fd ++#subdir-$(CONFIG_USBD_CDC) += cdc_fd ++ ++# Bus Interface Drivers ++subdir-$(CONFIG_USBD_AU1X00_BUS) += au1x00_bi ++ ++#subdir-$(CONFIG_USBD_OMAP_BUS) += omap_bi ++#subdir-$(CONFIG_USBD_TC86C001_BUS) += tc86c001_bi ++ ++#subdir-$(CONFIG_USBD_SL11_BUS) += sl11_bi ++ ++# The target object and module list name. ++ ++O_TARGET := usbdev.o ++ ++# Objects that export symbols. ++ ++export-objs := usbd.o usbd-bops.o usbd-fops.o usbd-bi.o ep0.o ++ ++# Multipart objects. ++ ++list-multi := usbdcore.o ++usbdcore-objs := usbd.o ep0.o usbd-fops.o usbd-bops.o ++usbdprocfs-objs := usbd-procfs.o ++ ++ ++# Optional parts of multipart objects. ++ ++# Object file lists. ++ ++obj-y := ++obj-m := ++obj-n := ++obj- := ++ ++# Each configuration option enables a list of files. ++ ++obj-$(CONFIG_USBD) += usbdcore.o ++obj-$(CONFIG_USBD_PROCFSM) += usbdprocfs.o ++ ++# Object files in subdirectories ++ ++# ++obj-$(CONFIG_USBD_MONITOR) += monitor/monitor.o ++ ++obj-$(CONFIG_USBD_ACM) += acm_fd/acm_fd.o ++obj-$(CONFIG_USBD_MOUSE) += mouse_fd/mouse_fd.o ++obj-$(CONFIG_USBD_NETWORK) += network_fd/network_fd.o ++ ++#obj-$(CONFIG_USBD_AUDIO) += audio_fd/audio_fd.o ++#obj-$(CONFIG_USBD_EG) += eg_fd/eg_fd.o ++#obj-$(CONFIG_USBD_KEYBOARD) += keyboard_fd/keyboard_fd.o ++ ++# Bus Interface Drivers ++obj-$(CONFIG_USBD_AU1X00_BUS) += au1x00_bi/au1x00_bi.o ++ ++#obj-$(CONFIG_USBD_OMAP_BUS) += omap_bi/omap_bi.o ++#obj-$(CONFIG_USBD_TC86C001_BUS) += tc86c001_bi/tc86c001_bi.o ++ ++#obj-$(CONFIG_USBD_SL11_BUS) += sl11_bi/sl11_bi.o ++ ++ ++# Yech. This isn't the best way to do this, but there isn't a config flag ++# common to all the possible bus interfaces ++ ++ ++# Extract lists of the multi-part drivers. ++# The 'int-*' lists are the intermediate files used to build the multi's. ++ ++multi-y := $(filter $(list-multi), $(obj-y)) ++multi-m := $(filter $(list-multi), $(obj-m)) ++int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) ++int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) ++ ++# Files that are both resident and modular: remove from modular. ++ ++obj-m := $(filter-out $(obj-y), $(obj-m)) ++int-m := $(filter-out $(int-y), $(int-m)) ++ ++# Translate to Rules.make lists. ++ ++O_OBJS := $(filter-out $(export-objs), $(obj-y)) ++OX_OBJS := $(filter $(export-objs), $(obj-y)) ++M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) ++MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) ++MI_OBJS := $(sort $(filter-out $(export-objs), $(int-m))) ++MIX_OBJS := $(sort $(filter $(export-objs), $(int-m))) ++ ++# The global Rules.make. ++ ++include $(TOPDIR)/Rules.make ++EXTRA_CFLAGS += -Wno-format -Wall ++ ++# Link rules for multi-part drivers. ++ ++usbdprocfs.o: $(usbdprocfs-objs) ++ $(LD) -r -o $@ $(usbdprocfs-objs) ++ ++usbdcore.o: $(usbdcore-objs) ++ $(LD) -r -o $@ $(usbdcore-objs) ++ ++# dependencies: ++ ++usbd.o: usbd-build.h ++ ++usbd-build.h: ++ echo "#define USBD_BUILD \"000\"" > $@ ++ ++# local ++ ++%.h:%.p ++ release inc build < $< > $@ ++ cp $@ $< ++ ++release.h: release.p ++ ++inc-build: ++ release inc build < release.p > release.h ++ cp release.h release.p ++ ++ ++menuconfig: ++ cd $(TOPDIR); make menuconfig ++ ++xconfig: ++ cd $(TOPDIR); make xconfig ++ ++ ++ +diff -Nru a/drivers/usbd/acm_fd/Config.in b/drivers/usbd/acm_fd/Config.in +--- /dev/null Wed Dec 31 16:00:00 1969 ++++ b/drivers/usbd/acm_fd/Config.in Fri Feb 27 14:22:51 2004 +@@ -0,0 +1,27 @@ ++# ++# CDC ACM Function Driver ++# ++# Copyright (C) 2003,2004 Belcarra ++# ++ ++mainmenu_option next_comment ++comment "CDC ACM Function" ++ ++dep_tristate ' CDC ACM Function' CONFIG_USBD_ACM $CONFIG_USBD ++if [ "$CONFIG_USBD_ACM" = "y" -o "$CONFIG_USBD_ACM" = "m" ]; then ++ hex 'VendorID (hex value)' CONFIG_USBD_ACM_VENDORID "12b9" ++ hex 'ProductID (hex value)' CONFIG_USBD_ACM_PRODUCTID "f002" ++ hex 'bcdDevice (binary-coded decimal)' CONFIG_USBD_ACM_BCDDEVICE "0100" ++ ++ string 'iManufacturer (string)' CONFIG_USBD_ACM_MANUFACTURER "Belcarra" ++ string 'iProduct (string)' CONFIG_USBD_ACM_PRODUCT_NAME "Belcarra ACM Device" ++ ++ string 'iConfiguration (string)' CONFIG_USBD_ACM_DESC "Acm Cfg" ++ string 'Comm Interface iInterface (string)' CONFIG_USBD_ACM_COMM_INTF "Comm Intf" ++ string 'Data Interface iInterface (string)' CONFIG_USBD_ACM_DATA_INTF "Data Intf" ++ ++ bool ' ACM Tracing' CONFIG_USBD_ACM_TRACE ++ comment '' ++fi ++ ++endmenu +diff -Nru a/drivers/usbd/acm_fd/Makefile b/drivers/usbd/acm_fd/Makefile +--- /dev/null Wed Dec 31 16:00:00 1969 ++++ b/drivers/usbd/acm_fd/Makefile Fri Feb 27 14:22:51 2004 +@@ -0,0 +1,65 @@ ++# ++# Function driver for a CDC ACM USB Device ++# ++# Copyright (c) 2003 Belcarra ++ ++# Multipart objects. ++ ++O_TARGET := acm_fd.o ++list-multi := acm_fd.o ++ ++acm_fd-objs := acm.o trace.o ++ ++# Objects that export symbols. ++export-objs := acm.o ++ ++# Object file lists. ++ ++obj-y := ++obj-m := ++obj-n := ++obj- := ++ ++# Each configuration option enables a list of files. ++ ++obj-$(CONFIG_USBD_ACM) += acm_fd.o ++ ++# Extract lists of the multi-part drivers. ++# The 'int-*' lists are the intermediate files used to build the multi's. ++ ++multi-y := $(filter $(list-multi), $(obj-y)) ++multi-m := $(filter $(list-multi), $(obj-m)) ++int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) ++int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) ++ ++# Files that are both resident and modular: remove from modular. ++ ++obj-m := $(filter-out $(obj-y), $(obj-m)) ++int-m := $(filter-out $(int-y), $(int-m)) ++ ++# Translate to Rules.make lists. ++ ++O_OBJS := $(filter-out $(export-objs), $(obj-y)) ++OX_OBJS := $(filter $(export-objs), $(obj-y)) ++M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) ++MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) ++MI_OBJS := $(sort $(filter-out $(export-objs), $(int-m))) ++MIX_OBJS := $(sort $(filter $(export-objs), $(int-m))) ++ ++# The global Rules.make. ++ ++USBD=$(TOPDIR)/drivers/usbd ++ACMD=$(USBD)/acm_fd ++include $(TOPDIR)/Rules.make ++EXTRA_CFLAGS += -I$(ACMD) -I$(USBD) -Wno-unused -Wno-format ++EXTRA_CFLAGS_nostdinc += -I$(ACMD) -I$(USBD) -Wno-unused -Wno-format ++ ++# Link rules for multi-part drivers. ++ ++acm_fd.o: $(acm_fd-objs) ++ $(LD) -r -o $@ $(acm_fd-objs) ++ ++# dependencies: ++ ++acm.o: $(USBD)/usbd.h $(USBD)/usbd-bus.h $(USBD)/usbd-func.h ++ +diff -Nru a/drivers/usbd/acm_fd/acm.c b/drivers/usbd/acm_fd/acm.c +--- /dev/null Wed Dec 31 16:00:00 1969 ++++ b/drivers/usbd/acm_fd/acm.c Fri Feb 27 14:22:51 2004 +@@ -0,0 +1,1662 @@ ++/* ++ * usbd/acm_fd/acm.c ++ * ++ * Copyright (c) 2003, 2004 Belcarra ++ * ++ * By: ++ * Stuart Lynne <sl@belcarra.com>, ++ * Tom Rushworth <tbr@belcarra.com>, ++ * Bruce Balden <balden@belcarra.com> ++ * ++ * 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. ++ * ++ * ++ * Note: this function driver requires the following endpoints: ++ * ++ * BULK-IN ++ * BULK-OUT ++ * INTERRUPT-IN ++ * ++ * This function driver cannot be used on devices (such as the StrongArm ++ * SA1100) that do not have and interrupt endpoint. ++ * ++ */ ++ ++ ++#include <linux/config.h> ++#include <linux/module.h> ++#include <linux/kernel.h> ++#include <linux/version.h> ++ ++#include <usbd-export.h> ++#include <usbd-build.h> ++ ++MODULE_AUTHOR ("sl@belcarra.com, tbr@belcarra.com"); ++ ++MODULE_DESCRIPTION ("Belcarra CDC-ACM Function"); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,17) ++MODULE_LICENSE("GPL"); ++#endif ++ ++#define ACM_TRACE_NAME "acm_trace" ++ ++#undef USE_TICKER ++#undef MCEL ++//#define MCEL 1 ++//#define CONFIG_USBD_ACM_DATALOG 1 ++#undef CONFIG_USBD_ACM_DATALOG ++#undef PST_FD_AVAILABLE ++ ++#include <linux/init.h> ++#include <asm/uaccess.h> ++#include <linux/ctype.h> ++#include <linux/timer.h> ++#include <linux/interrupt.h> ++#include <asm/atomic.h> ++#include <linux/tty.h> ++#include <linux/tty_driver.h> ++#include <linux/tty_flip.h> ++#include <linux/smp_lock.h> ++#include <linux/slab.h> ++ ++#include <usbd-chap9.h> ++#include <usbd-mem.h> ++#include <usbd.h> ++#include <usbd-func.h> ++ ++#include "trace.h" ++// Define the low order 16 bits of an urb's memory address as it's ID for tracing. ++#define urbID(urb) (0xffff & (u32) (void *) urb) ++int acm_interrupts; ++ ++USBD_MODULE_INFO ("acm_fd 2.1-beta"); ++ ++#define MAX_QUEUED_BYTES 256 ++#define MAX_QUEUED_URBS 10 // Max for write ++ ++#define MAX_RECV_URBS 2 // Max for receiving data ++#define RECV_RING_SIZE (MAX_RECV_URBS+1) ++ ++// Endpoint indexes in acm_endpoint_requests[] and the endpoint map. ++#define BULK_OUT 0x00 ++#define BULK_IN 0x01 ++#define INT_IN 0x02 ++#if !defined(CONFIG_USBD_ACM_DATALOG) ++#define ENDPOINTS 0x03 ++#else ++#define DATALOG_BULK_IN 0x03 ++#define ENDPOINTS 0x04 ++#endif ++ ++#define COMM_INTF 0x00 ++#define DATA_INTF 0x01 ++#if defined(CONFIG_USBD_ACM_DATALOG) ++#define DATALOG_INTF 0x02 ++#define TESTCMD_INTF 0x03 ++#endif ++ ++#if defined(CONFIG_USBD_ACM_DATALOG) && defined(PST_FD_AVAILABLE) ++extern int pst_dev_create(struct usb_device_instance *device); ++extern void pst_dev_destroy(void); ++extern void ep0_process_vendor_request( struct urb *urb ); ++extern int pst_urb_sent (struct urb *urb, int rc); ++#endif ++ ++/* Module Parameters ************************************************************************* */ ++ ++static u32 vendor_id; ++static u32 product_id; ++static u32 max_queued_urbs = MAX_QUEUED_URBS; ++static u32 max_queued_bytes = MAX_QUEUED_BYTES; ++ ++MODULE_PARM (vendor_id, "i"); ++MODULE_PARM (product_id, "i"); ++MODULE_PARM (max_queued_urbs, "i"); ++MODULE_PARM (max_queued_bytes, "i"); ++ ++MODULE_PARM_DESC (vendor_id, "Device Vendor ID"); ++MODULE_PARM_DESC (product_id, "Device Product ID"); ++MODULE_PARM_DESC (max_queued_urbs, "Maximum TX Queued Urbs"); ++MODULE_PARM_DESC (max_queued_bytes, "Maximum TX Queued Bytes"); ++ ++/* ++ * CDC ACM Configuration ++ * ++ * Endpoint, Class, Interface, Configuration and Device descriptors/descriptions ++ */ ++ ++/* Endpoints */ ++static __u8 acm_alt_1[] = { 0x07, USB_DT_ENDPOINT, OUT, BULK, 0, 0x00, 0x00, }; ++static __u8 acm_alt_2[] = { 0x07, USB_DT_ENDPOINT, IN, BULK, 0, 0x00, 0x00, }; ++static struct usb_endpoint_descriptor *acm_alt_endpoints[] = { ++ (struct usb_endpoint_descriptor *) acm_alt_1, ++ (struct usb_endpoint_descriptor *) acm_alt_2, }; ++u8 acm_alt_indexes[] = { BULK_OUT, BULK_IN, }; ++ ++static __u8 acm_comm_1[] = { 0x07, USB_DT_ENDPOINT, IN, INTERRUPT, 0, 0x00, 0x0a, }; ++static struct usb_endpoint_descriptor *acm_comm_endpoints[] = { (struct usb_endpoint_descriptor *) acm_comm_1 }; ++u8 acm_comm_indexes[] = { INT_IN, }; ++ ++static __u8 cdc_class_1[] = { 0x05, CS_INTERFACE, USB_ST_HEADER, 0x01, 0x01, /* CLASS_BDC_VERSION, CLASS_BDC_VERSION */ }; ++static __u8 cdc_class_2[] = { 0x05, CS_INTERFACE, USB_ST_CMF, 0x03, 0x01, /* bMasterInterface: 0, bSlaveInterface: 1 */ }; ++static __u8 cdc_class_3[] = { 0x05, CS_INTERFACE, USB_ST_UF, 0x00, 0x01, /* bMasterInterface: 0, bSlaveInterface: 1 */ }; ++ ++/* ACMF - c.f. Table 28 ++ * currenty set to 0x2 - Support Set_Line_Coding etc, ++ * ++ * XXX Should we also set 0x4 - Supports Network_Notification? ++ */ ++static __u8 cdc_class_4[] = { 0x04, CS_INTERFACE, USB_ST_ACMF, 0x02, }; ++ ++static struct usb_generic_class_descriptor *cdc_comm_class_descriptors[] = ++ { (struct usb_generic_class_descriptor *) cdc_class_1, ++ (struct usb_generic_class_descriptor *) cdc_class_2, ++ (struct usb_generic_class_descriptor *) cdc_class_3, ++ (struct usb_generic_class_descriptor *) cdc_class_4, }; ++ ++ ++#if defined(CONFIG_USBD_ACM_DATALOG) ++ ++#if 0 ++/* This is used to get a specific INTERFACE number, by padding the list of interfaces. */ ++static struct usb_alternate_description dummy_alternate_descriptions[] = { ++ { iInterface:"Dummy", }, ++}; ++#endif ++ ++/* Ther |
