diff -urN -X kernel-patches/dontdiff linux-2.4.14/Documentation/Configure.help linux-2.4.14-rs/Documentation/Configure.help --- linux-2.4.14/Documentation/Configure.help Mon Nov 5 22:40:59 2001 +++ linux-2.4.14-rs/Documentation/Configure.help Tue Jan 1 16:43:41 2002 @@ -3229,6 +3229,7 @@ - "Pentium-4" for the Intel Pentium 4. - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D). - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird). + - "Elan" for the AMD Elan family (Elan SC400/SC410). - "Crusoe" for the Transmeta Crusoe series. - "Winchip-C6" for original IDT Winchip. - "Winchip-2" for IDT Winchip 2. diff -urN -X kernel-patches/dontdiff linux-2.4.14/arch/i386/boot/setup.S linux-2.4.14-rs/arch/i386/boot/setup.S --- linux-2.4.14/arch/i386/boot/setup.S Sun Aug 5 22:13:19 2001 +++ linux-2.4.14-rs/arch/i386/boot/setup.S Tue Jan 1 16:42:08 2002 @@ -651,6 +651,13 @@ # appropriate # that was painless, now we enable a20 + +# special fix for AMD's Elan family, by Robert Schwebel +#if defined(CONFIG_MELAN) + inb $0xee, %al # reading 0xee enables A20 + jmp a20_done +#endif + call empty_8042 movb $0xD1, %al # command write @@ -684,6 +691,8 @@ movw %ax, %fs:(0x200) # we use the "int 0x80" vector cmpw %gs:(0x210), %ax # and its corresponding HMA addr je a20_wait # loop until no longer aliased + +a20_done: # make sure any possible coprocessor is properly reset.. xorw %ax, %ax diff -urN -X kernel-patches/dontdiff linux-2.4.14/arch/i386/config.in linux-2.4.14-rs/arch/i386/config.in --- linux-2.4.14/arch/i386/config.in Sat Nov 3 02:46:47 2001 +++ linux-2.4.14-rs/arch/i386/config.in Tue Jan 1 16:43:41 2002 @@ -37,6 +37,7 @@ Pentium-4 CONFIG_MPENTIUM4 \ K6/K6-II/K6-III CONFIG_MK6 \ Athlon/Duron/K7 CONFIG_MK7 \ + Elan CONFIG_MELAN \ Crusoe CONFIG_MCRUSOE \ Winchip-C6 CONFIG_MWINCHIPC6 \ Winchip-2 CONFIG_MWINCHIP2 \ @@ -119,6 +120,11 @@ define_bool CONFIG_X86_USE_3DNOW y define_bool CONFIG_X86_PGE y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y +fi +if [ "$CONFIG_MELAN" = "y" ]; then + define_int CONFIG_X86_L1_CACHE_SHIFT 4 + define_bool CONFIG_X86_USE_STRING_486 y + define_bool CONFIG_X86_ALIGNMENT_16 y fi if [ "$CONFIG_MCYRIXIII" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 diff -urN -X kernel-patches/dontdiff linux-2.4.14/arch/i386/kernel/setup.c linux-2.4.14-rs/arch/i386/kernel/setup.c --- linux-2.4.14/arch/i386/kernel/setup.c Thu Oct 25 22:53:46 2001 +++ linux-2.4.14-rs/arch/i386/kernel/setup.c Tue Jan 1 16:43:41 2002 @@ -322,6 +322,10 @@ { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY }, { "fpu", 0xf0, 0xff, IORESOURCE_BUSY } }; +#ifdef CONFIG_ELAN +standard_io_resources[1] = { "pic1", 0x20, 0x21, IORESOURCE_BUSY }; +standard_io_resources[5] = { "pic2", 0xa0, 0xa1, IORESOURCE_BUSY }; +#endif #define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource)) diff -urN -X kernel-patches/dontdiff linux-2.4.14/drivers/char/serial.c linux-2.4.14-rs/drivers/char/serial.c --- linux-2.4.14/drivers/char/serial.c Mon Nov 5 02:35:36 2001 +++ linux-2.4.14-rs/drivers/char/serial.c Tue Jan 1 16:43:42 2002 @@ -57,6 +57,9 @@ * 10/00: add in optional software flow control for serial console. * Kanoj Sarcar (Modified by Theodore Ts'o) * + * 12/01: Fix for AMD Elan bug in transmit irq routine, by + * Christer Weinigel , + * Robert Schwebel */ static char *serial_version = "5.05c"; @@ -844,7 +847,7 @@ if (!info) { info = IRQ_ports[irq]; if (pass_counter++ > RS_ISR_PASS_LIMIT) { -#if 0 +#ifdef SERIAL_DEBUG_INTR printk("rs loop break\n"); #endif break; /* Prevent infinite loops */ @@ -877,6 +880,9 @@ int first_multi = 0; struct rs_multiport_struct *multi; #endif +#ifdef CONFIG_MELAN + int iir; +#endif #ifdef SERIAL_DEBUG_INTR printk("rs_interrupt_single(%d)...", irq); @@ -891,7 +897,9 @@ if (multi->port_monitor) first_multi = inb(multi->port_monitor); #endif - +#ifdef CONFIG_MELAN + iir = serial_in(info, UART_IIR); +#endif do { status = serial_inp(info, UART_LSR); #ifdef SERIAL_DEBUG_INTR @@ -900,10 +908,24 @@ if (status & UART_LSR_DR) receive_chars(info, &status, regs); check_modem_status(info); + +#ifdef CONFIG_M_ELAN + /* + * There is a bug in the UART on the AMD Elan SC4x0 + * embedded processor series; the THRE bit of the line + * status register seems to be delayed one bit clock after + * the interrupt is generated, so kludge this if the + * IIR indicates a Transmit Holding Register Interrupt + * + */ + if (status & UART_LSR_THRE || (iir & UART_IIR_ID) == UART_IIR_THRI) + transmit_chars(info, 0); +#else if (status & UART_LSR_THRE) transmit_chars(info, 0); +#endif if (pass_counter++ > RS_ISR_PASS_LIMIT) { -#if 0 +#ifdef SERIAL_DEBUG_INTR printk("rs_single loop break.\n"); #endif break; diff -urN -X kernel-patches/dontdiff linux-2.4.14/include/asm-i386/timex.h linux-2.4.14-rs/include/asm-i386/timex.h --- linux-2.4.14/include/asm-i386/timex.h Mon Nov 5 21:42:13 2001 +++ linux-2.4.14-rs/include/asm-i386/timex.h Tue Jan 1 16:43:42 2002 @@ -9,7 +9,12 @@ #include #include -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ +#ifdef CONFIG_MELAN +# define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */ +#else +# define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ +#endif + #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \