Cyrix DLC patch for 1.1.82

Cyrix DLC patch for 1.1.82

Post by Stephane I. Mat » Wed, 18 Jan 1995 21:55:26



Just finished installing the Cyrix patch for DLC CPUs and the unique DMA
solutions patch for AHA1542 controllers.  Here is a copy of my context diff.

This patch is based on :
        - ftp://sunsite.unc.edu/kernel/patches/CxPatch030.tar.z
        - ftp://sunsite.unc.edu/kernel/patches/linux.cxpatch

Pre-Patch BogoMips(tm)  Post-Patch BogoMips(tm)
        9.47                    13.31

BTW, this is the machine that was registered to Denis Solaro in the
BogoMips document.  I get to babysit until August!

---- cut here ----

diff --recursive --context=10 linux-1.1.82/arch/i386/boot/setup.S linux/arch/i386/boot/setup.S
*** linux-1.1.82/arch/i386/boot/setup.S Thu Jan  5 06:55:40 1995
--- linux/arch/i386/boot/setup.S        Mon Jan 16 15:23:46 1995
***************
*** 169,188 ****
--- 169,280 ----
        int     0x10            ! save it in known place, con_init fetches
        mov     [0],dx          ! it from 0x90000.

  ! Get video-card data:

        mov     ah,#0x0f
        int     0x10
        mov     [4],bx          ! bh = display page
        mov     [6],ax          ! al = video mode, ah = window width

+ ! Set optimal DRAM refresh rate
+ #ifdef CONFIG_BOGOBOOST              
+       mov al,#0x74            ! control byte
+       out #0x43,al
+       mov al,#0x00            ! low-order data byte
+       out #0x41,al    
+       mov al,#0x02            ! high-order data byte
+       out #0x41,al
+ #endif
+
+ ! Turn on Cyrix 486 Cache
+ #ifdef CONFIG_CYRIX_CPU
+       mov al,#0xc0
+       out #0x22,al          ! CCR0
+ #ifdef CONFIG_CYRIX_DLC
+ # ifdef CONFIG_CYRIX_RISKY
+ #  ifdef CONFIG_CYRIX_SOFTWARE_TOGGLE
+        mov al,#0x02            ! enable NC1 (may not be 100% DMA safe)
+ #  else
+         mov al,#0x22            ! enable #BARB/NC1 (may not be 100% DMA safe)
+ # endif
+ # else
+ #  ifdef CONFIG_CYRIX_SOFTWARE_TOGGLE
+       mov al,#0x03            ! enable NC0/NC1 for DLC
+ #  else
+       mov al,#0x23            ! enable #BARB/NC0/NC1 for DLC
+ #  endif
+ # endif
+ #else
+       mov al,#0x12            ! enable #FLUSH/NC1 for DRX
+ #endif
+       out #0x23,al
+
+       mov al,#0xc1
+       out #0x22,al          ! CCR1
+       mov al,#0x00
+       out #0x23,al
+
+       mov al,#0xc4
+       out #0x22,al            ! NCR1
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xc5
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xc6
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+
+       mov al,#0xc7
+       out #0x22,al            ! NCR2
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xc8
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xc9
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+
+       mov al,#0xca
+       out #0x22,al            ! NCR3
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xcb
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xcc
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+
+       mov al,#0xcd
+       out #0x22,al            ! NCR4
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xce
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+       mov al,#0xcf
+       out #0x22,al
+       mov al,#0x00
+       out #0x23,al
+ #endif
+
+
  ! Get hd0 data

        xor     ax,ax           ! clear ax
        mov     ds,ax
        lds     si,[4*0x41]
        mov     ax,#INITSEG
        push    ax
        mov     es,ax
        mov     di,#0x0080
        mov     cx,#0x10
***************
*** 215,243 ****
        mov     es,ax
        mov     di,#0x0090
        mov     cx,#0x10
        xor     ax,ax           ! clear ax
        cld
        rep
        stosb
  is_disk1:

  ! check for PS/2 pointing device
!
        mov     ax,#INITSEG
        mov     ds,ax
        mov     [0x1ff],#0      ! default is no pointing device
        int     0x11            ! int 0x11: equipment determination
        test    al,#0x04        ! check if pointing device installed
        jz      no_psmouse
        mov     [0x1ff],#0xaa   ! device present
  no_psmouse:
  ! now we want to move to protected mode ...

        cli                     ! no interrupts allowed !
        mov     al,#0x80        ! disable NMI for the bootup sequence
        out     #0x70,al

  ! first we move the system to its rightful place

        mov     ax,#0x100       ! start of destination segment
        seg cs
--- 307,340 ----
        mov     es,ax
        mov     di,#0x0090
        mov     cx,#0x10
        xor     ax,ax           ! clear ax
        cld
        rep
        stosb
  is_disk1:

  ! check for PS/2 pointing device
! #ifndef CONFIG_BOGOBOOST
        mov     ax,#INITSEG
        mov     ds,ax
        mov     [0x1ff],#0      ! default is no pointing device
        int     0x11            ! int 0x11: equipment determination
        test    al,#0x04        ! check if pointing device installed
        jz      no_psmouse
        mov     [0x1ff],#0xaa   ! device present
  no_psmouse:
+ #else
+ ! disable PS/2 pointing device
+
+       mov     [0x1ff],#0      ! default is no pointing device
+ #endif
  ! now we want to move to protected mode ...

        cli                     ! no interrupts allowed !
        mov     al,#0x80        ! disable NMI for the bootup sequence
        out     #0x70,al

  ! first we move the system to its rightful place

        mov     ax,#0x100       ! start of destination segment
        seg cs
***************
*** 677,706 ****
        jz      l2
        seg es
        cmp     al,(di)
  l2:   loope   l1
        cmp     cx,#0x00
        jne     nogen
        lea     si,dscgenoa
        lea     di,mogenoa
        br      selmod
  nogen:        cld
-       lea     si,idoakvga
-       mov     di,#0x08
-       mov     cx,#0x08
-       repe
-       cmpsb
-       jne     nooak
-       lea     si,dscoakvga
-       lea     di,mooakvga
-       br      selmod
- nooak:        cld
        lea     si,idparadise           ! Check Paradise 'clues'
        mov     di,#0x7d
        mov     cx,#0x04
        repe
        cmpsb
        jne     nopara
        lea     si,dscparadise
        lea     di,moparadise
        br      selmod
  nopara:       mov     dx,#0x3c4               ! Check Trident 'clues'
--- 774,793 ----
***************
*** 951,1007 ****
                db      0x0d, 0x0a, 0x0a, 0x07, 0x00
  modestring:   .ascii  "   "
  modenr:               db      0x00    ! mode number
                .ascii  ":    "
                db      0x00

  idati:                .ascii  "761295520"
  idcandt:      .byte   0xa5
  idgenoa:      .byte   0x77, 0x00, 0x99, 0x66
  idparadise:   .ascii  "VGA="
- idoakvga:     .ascii  "OAK VGA "
  idS3:         .byte   0x81, 0x82, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95
                .byte   0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa8, 0xb0

  ! Manufacturer:         Numofmodes+2: Mode:
  ! Number of modes is the number of chip-specific svga modes plus the extended
  ! modes available on any vga (currently 2)

  moati:                .byte   0x06,   0x23, 0x33, 0x22, 0x21
  moahead:      .byte   0x07,   0x22, 0x23, 0x24, 0x2f, 0x34
  mocandt:      .byte   0x04,   0x60, 0x61
  mocirrus:     .byte   0x06,   0x1f, 0x20, 0x22, 0x31
  moeverex:     .byte   0x0c,   0x03, 0x04, 0x07, 0x08, 0x0a, 0x0b, 0x16, 0x18, 0x21, 0x40
  mogenoa:      .byte   0x0c,   0x58, 0x5a, 0x60, 0x61, 0x62, 0x63, 0x64, 0x72, 0x74, 0x78
  moparadise:   .byte   0x04,   0x55, 0x54
  motrident:    .byte   0x09,   0x50, 0x51, 0x52, 0x57, 0x58, 0x59, 0x5a
  motseng:      .byte   0x07,   0x26, 0x2a, 0x23, 0x24, 0x22
  movideo7:     .byte   0x08,   0x40, 0x43, 0x44, 0x41, 0x42, 0x45
- mooakvga:     .byte   0x08,   0x00, 0x07, 0x4e, 0x4f, 0x50, 0x51
  mo_S3:                .byte   0x04,   0x54, 0x55
  mounknown:    .byte   0x02

  !                     msb = Cols lsb = Rows:
  ! The first two modes are standard vga modes available on any vga.
  ! mode 0 is 80x50 and mode 1 is 80x28

  dscati:               .word   0x5032, 0x501c, 0x8419, 0x842c, 0x641e, 0x6419
  dscahead:     .word   0x5032, 0x501c, 0x842c, 0x8419, 0x841c, 0xa032, 0x5042
  dsccandt:     .word   0x5032, 0x501c, 0x8419, 0x8432
  dsccirrus:    .word   0x5032, 0x501c, 0x8419, 0x842c, 0x841e, 0x6425
  dsceverex:    .word   0x5032, 0x501c, 0x5022, 0x503c, 0x642b, 0x644b, 0x8419, 0x842c, 0x501e, 0x641b, 0xa040, 0x841e
  dscgenoa:     .word   0x5032, 0x501c, 0x5020, 0x642a, 0x8419, 0x841d, 0x8420, 0x842c, 0x843c, 0x503c, 0x5042, 0x644b
  dscparadise:  .word   0x5032, 0x501c, 0x8419, 0x842c
  dsctrident:   .word   0x5032, 0x501c, 0x501e, 0x502b, 0x503c, 0x8419, 0x841e, 0x842b, 0x843c
  dsctseng:     .word   0x5032, 0x501c, 0x503c, 0x6428, 0x8419, 0x841c, 0x842c
  dscvideo7:    .word   0x5032, 0x501c, 0x502b, 0x503c, 0x643c, 0x8419, 0x842c, 0x841c
- dscoakvga:    .word   0x5032, 0x501c, 0x2819, 0x5019, 0x503c, 0x843c, 0x8419, 0x842b
  dsc_S3:               .word   0x5032, 0x501c, 0x842b, 0x8419
  dsunknown:    .word   0x5032, 0x501c
  modesave:     .word   SVGA_MODE

  ! This must be last
  setup_sig1:   .word   SIG1
  setup_sig2:   .word   SIG2

  .text
  endtext:
--- 1038,1091 ----
diff --recursive --context=10 linux-1.1.82/arch/i386/config.in linux/arch/i386/config.in
*** linux-1.1.82/arch/i386/config.in    Mon Jan 16 15:05:43 1995
--- linux/arch/i386/config.in   Mon Jan 16 15:23:46 1995
***************
*** 26,45 ****
--- 26,52 ----
  bool 'PCI bios support' CONFIG_PCI n
  if [ "$CONFIG_PCI" = "y" ]; then
   bool '   PCI bridge optimisation (experimental)' CONFIG_PCI_OPTIMIZE n
  fi
  bool 'System V IPC' CONFIG_SYSVIPC y
  bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
  #bool 'Use -mpentium flag for Pentium-specific optimizations' CONFIG_M586 n
  #if [ "$CONFIG_M586" = "n" ]; then
  bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
  #fi
+ bool 'Enable BogoBoost refresh rate patch' CONFIG_BOGOBOOST y
+ bool 'Enable cache on Cyrix Cx486 series CPU' CONFIG_CYRIX_CPU y
+ bool 'Modify cache coherency for Cyrix Cx486DLC CPU (needed only for DLC/SLC)' CONFIG_CYRIX_DLC y
+ if [ "$CONFIG_CYRIX_DLC" = "y" ]; then
+ bool 'Try software cache control (only if you use the Adaptec 154x and no other DMA peripherals)' CONFIG_CYRIX_SOFTWARE_TOGGLE y
+ bool 'Try the alternate DLC cache setting (not safe on all machines)' CONFIG_CYRIX_RISKY n
+ fi

  if [ "$CONFIG_NET" = "y" ]; then
  comment 'Networking options'
  bool 'TCP/IP networking' CONFIG_INET y
  if [ "$CONFIG_INET" "=" "y" ]; then
  bool 'IP forwarding/gatewaying' CONFIG_IP_FORWARD n
  bool 'IP multicasting (ALPHA)' CONFIG_IP_MULTICAST n
  bool 'IP firewalling' CONFIG_IP_FIREWALL n
  bool 'IP accounting' CONFIG_IP_ACCT n
  comment '(it is safe to leave these untouched)'
diff --recursive --context=10 linux-1.1.82/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c
*** linux-1.1.82/drivers/scsi/aha1542.c Mon Jan 16 15:06:07 1995
--- linux/drivers/scsi/aha1542.c        Mon Jan 16 15:23:46 1995
***************
*** 101,120 ****
--- 101,128 ----
  #define HOSTDATA(host) ((struct aha1542_hostdata *) &host->hostdata)

  static struct Scsi_Host * aha_host[7] = {NULL,};  /* One for each IRQ level (9-15) */

  #define WAITnexttimeout 3000000
...

read more »

 
 
 

Cyrix DLC patch for 1.1.82

Post by Daniel Quinl » Fri, 20 Jan 1995 09:39:21



Quote:> Just finished installing the Cyrix patch for DLC CPUs and the unique
> DMA solutions patch for AHA1542 controllers.  Here is a copy of my
> context diff.

Can't the patches be integrated into the main kernel?

Quote:> [...]
> Pre-Patch BogoMips(tm)     Post-Patch BogoMips(tm)
>    9.47                    13.31

There isn't a more worthless indicator of processor speed than
BogoMips.  Real MIPS are worthless enough.

Please use a better indicator of such as compile-time on identical
kernels.

--
Daniel Quinlan


 
 
 

Cyrix DLC patch for 1.1.82

Post by Marten Liebst » Sat, 21 Jan 1995 05:13:58



: > Just finished installing the Cyrix patch for DLC CPUs and the unique
: > DMA solutions patch for AHA1542 controllers.  Here is a copy of my
: > context diff.

: Can't the patches be integrated into the main kernel?

Yah, just put a flag in the config screen.  Isn't there a version coming
out soon for the Pentium?  Just have a choice when you compile a kernel!

--
Marten Liebster               Sybase  -  Unify Vision 4GL  -  SunOs

87' VW GTI 8v 113k miles      Dal Cowboys - 2peat  - Team of the 90s
Pioneer - MB Quart - sounds   NY Mets     - 1peat (once in a while peat)

 
 
 

Cyrix DLC patch for 1.1.82

Post by Stephane I. Mat » Sun, 22 Jan 1995 13:07:29



: > Pre-Patch BogoMips(tm)   Post-Patch BogoMips(tm)
: >  9.47                    13.31

: There isn't a more worthless indicator of processor speed than
: BogoMips.  Real MIPS are worthless enough.

        Well, how about the fact that it is just an indicator of the fact
that the DLC has it's cache on, versus off.  At 9.47, I can garantee the
configuration from BIOS doesn't turn on the cache.

        Is it enough ... well, there is that small 1K cache, and I want it
on.  :^)  So, it is on.

: Please use a better indicator of such as compile-time on identical
: kernels.

Probablly slim changes under 16 MB ... but at least the CPU is doing
everything it is supposed to.

: --
: Daniel Quinlan

--
petergun                        

R-name : Stephane I. Matis

 
 
 

1. soundcard bug in 1.1.82 + patch

It appears that the snd_set_irq_handler() function in
drivers/sound/soundcard.c was changed in 1.1.82, but the function header
in sound_calls.h wasn't updated.  Here's a patch to update it.  I've
compiled my kernel with this patch, and it works for me, sound and all.

--- linux/drivers/sound/sound_calls.h.orig      Wed Jul 20 07:00:55 1994

 void request_sound_timer (int count);
 void sound_stop_timer(void);
 int snd_ioctl_return(int *addr, int value);
-int snd_set_irq_handler (int interrupt_level, void(*hndlr)(int));
+int snd_set_irq_handler (int interrupt_level,
+                        void (*hndlr) (int, struct pt_regs *));
 void snd_release_irq(int vect);
 void sound_dma_malloc(int dev);
 void sound_dma_free(int dev);

--

    Oatmeal Stout: It's the Right Thing to Drink!

2. PCMCIA SCSI Card

3. sound_calls.h patch for 1.1.82

4. prompt name completion (tab key) control?

5. Kernel change summary 1.1.81 -> 1.1.82

6. help: nfs / pcnfs setup

7. kernel 1.1.82 won't compile

8. PC-9800 subarch. support for 2.5.62-AC1 (1/21) ALSA

9. 1.1.82 Netstat Bug ?

10. CDROM bug in kernel 1.1.82 and higher

11. linux 1.1.82 not makeing a zIage file

12. lilo says 1.1.82 kernel too big

13. tar in dos with 1.1.82