diff --exclude=*modem* --exclude=*.in --exclude=*digi* --exclude=.* --exclude=*~ -Naur uClinux-2.4.x.orig/drivers/char/68328serial.c linux-2.4.x/drivers/char/68328serial.c --- uClinux-2.4.x.orig/drivers/char/68328serial.c Sun Mar 3 12:34:03 2002 +++ linux-2.4.x/drivers/char/68328serial.c Tue Mar 12 21:06:26 2002 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -1444,7 +1445,51 @@ printk("MC68328 serial driver version 1.00\n"); } -volatile int test_done; +#ifdef CONFIG_PM +/* Serial Power management + * The console (currently fixed at line 0) is a special case for power + * management because the kernel is so chatty. The console will be + * explicitly disabled my our power manager as the last minute, so we won't + * mess with it here. + */ +static struct pm_dev *serial_pm[NR_PORTS]; + +static int serial_pm_callback(struct pm_dev *dev, pm_request_t request, void *data) +{ + struct m68k_serial *info = (struct m68k_serial *)dev->data; + + if(info == NULL) + return -1; + + /* special case for line 0 - pm restores it */ + if(info->line == 0) + return 0; + + switch (request) { + case PM_SUSPEND: + shutdown(info); + break; + + case PM_RESUME: + startup(info); + break; + } + return 0; +} + +void shutdown_console(void) +{ + struct m68k_serial *info = &m68k_soft[0]; + shutdown(info); +} + +void startup_console(void) +{ + struct m68k_serial *info = &m68k_soft[0]; + startup(info); +} +#endif + /* rs_init inits the driver */ static int __init @@ -1545,10 +1590,19 @@ IRQ_FLG_STD, "M68328_UART", NULL)) panic("Unable to attach 68328 serial interrupt\n"); +#ifdef CONFIG_PM + serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback); + if (serial_pm[i]) { + printk("info ptr 0x%p\n", info); + serial_pm[i]->data = info; + } +#endif } restore_flags(flags); return 0; } + + /* * register_serial and unregister_serial allows for serial ports to be diff --exclude=*modem* --exclude=*.in --exclude=*digi* --exclude=.* --exclude=*~ -Naur uClinux-2.4.x.orig/drivers/net/cs89x0.c linux-2.4.x/drivers/net/cs89x0.c --- uClinux-2.4.x.orig/drivers/net/cs89x0.c Sun Mar 3 12:34:35 2002 +++ linux-2.4.x/drivers/net/cs89x0.c Sat Mar 16 14:49:27 2002 @@ -425,6 +425,7 @@ printk("cs89x0: Setting up uCcs8900 Chip Select & IRQ ioaddr = 0x%X\n",ioaddr); #endif +#if 0 /* set up the chip select */ *(volatile unsigned char *)0xfffff42b |= 0x01; /* output /sleep */ *(volatile unsigned short *)0xfffff428 |= 0x0101; /* not sleeping */ @@ -434,6 +435,29 @@ *(volatile unsigned short *)0xfffff102 = 0x8000; /* 0x04000000 */ *(volatile unsigned short *)0xfffff112 = 0x01e1; /* 128k, 2ws, FLASH, en */ +#else + /* set up the chip select */ +// *(volatile unsigned char *)0xfffff42b |= 0x01; /* output /sleep */ +// *(volatile unsigned short *)0xfffff428 |= 0x0101; /* not sleeping */ + + *(volatile unsigned char *)0xfffff430 |= 0x08; +// *(volatile unsigned char *)0xfffff432 &= ~(0x08); + *(volatile unsigned char *)0xfffff433 |= 0x08; + *(volatile unsigned char *)0xfffff431 |= (0x08); /* currently high - drive low for + * hware sleep + * indicator */ + + + *(volatile unsigned char *)0xfffff42b &= ~0x02; /* input irq5 */ + *(volatile unsigned short *)0xfffff428 &= ~0x0202; /* irq5 fcn on */ + + *(volatile unsigned short *)0xfffff102 = 0x8000; /* 0x04000000 */ + *(volatile unsigned short *)0xfffff112 = 0x01e1; /* 128k, 2ws, FLASH, + * en */ + + +#endif + #endif /* Initialize the device structure. */ @@ -1379,6 +1403,8 @@ #endif ); netif_start_queue(dev); + + if (net_debug > 1) printk("cs89x0: net_open() succeeded\n"); return 0; @@ -1617,6 +1643,8 @@ { struct net_local *lp = (struct net_local *)dev->priv; + printk("net_close()\n"); + netif_stop_queue(dev); writereg(dev, PP_RxCFG, 0); @@ -1633,6 +1661,14 @@ } #endif +#if 1 + *(volatile unsigned char *)0xfffff431 &= ~(0x08); + printk("put it to sleep\n"); + writereg(dev, PP_SelfCTL, readreg(dev, PP_SelfCTL) | SLEEP_ON); + +#endif + + /* Update the statistics here. */ return 0; } @@ -1725,7 +1761,25 @@ } #endif +#if 0 +static stuct pm_dev *cs89x0_pm; + +static int cs89x0_pm_callback(struct pm_dev *dev, pm_request_t request, void *data) +{ + + switch(request) { + case PM_SUSPEND: + break; + case PM_RESUME: + break; + } + + return 0; + +} + +#endif #ifdef MODULE