home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / linux / linux-2.2.8-m68k-990516.diff.g / linux-2.2.8-m68k-990516.diff
Encoding:
Text File  |  1999-05-16  |  144.1 KB  |  4,993 lines

  1. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/MAINTAINERS ./MAINTAINERS
  2. --- /home/jskov/kernel/dist/linux-2.2.8/MAINTAINERS    Tue May 11 11:25:22 1999
  3. +++ ./MAINTAINERS    Sun May 16 11:35:29 1999
  4. @@ -442,6 +442,13 @@
  5.  L:    linux-pmac@samba.anu.edu.au
  6.  S:    Maintained
  7.  
  8. +LINUX FOR POWERUP AMIGA (POWERPC/APUS)
  9. +P:    Jesper Skov
  10. +M:    jskov@cygnus.co.uk
  11. +W:    http://sunsite.auc.dk/ftp/pub/os/linux/apus/docs/faq.html
  12. +L:    linux-apus@sunsite.auc.dk
  13. +S:    Maintained
  14. +
  15.  M68K
  16.  P:    Jes Sorensen
  17.  M:    Jes.Sorensen@cern.ch
  18. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/Makefile ./Makefile
  19. --- /home/jskov/kernel/dist/linux-2.2.8/Makefile    Tue May 11 11:25:22 1999
  20. +++ ./Makefile    Sat May 15 11:36:59 1999
  21. @@ -3,7 +3,7 @@
  22.  SUBLEVEL = 8
  23.  EXTRAVERSION =
  24.  
  25. -ARCH := m68k
  26. +ARCH := ppc
  27.  
  28.  .EXPORT_ALL_VARIABLES:
  29.  
  30. @@ -18,7 +18,11 @@
  31.  HOSTCC      =gcc
  32.  HOSTCFLAGS    =-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
  33.  
  34. +ifeq (ppc,$(shell uname -m))
  35.  CROSS_COMPILE     =
  36. +else
  37. +CROSS_COMPILE     = powerpc-unknown-linux-
  38. +endif
  39.  
  40.  AS    =$(CROSS_COMPILE)as
  41.  LD    =$(CROSS_COMPILE)ld
  42. @@ -87,6 +91,13 @@
  43.  #
  44.  
  45.  CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
  46. +
  47. +# No -fomit-frame-pointer if compiling a kernel with KGDB support.
  48. +ifeq ($(CONFIG_KGDB),y)
  49. +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -g
  50. +CFLAGS = -Wall -Wstrict-prototypes -O2 -g
  51. +endif
  52. +
  53.  
  54.  ifdef CONFIG_SMP
  55.  CFLAGS += -D__SMP__
  56. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/Makefile ./arch/ppc/amiga/Makefile
  57. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/Makefile    Fri Aug  7 15:53:32 1998
  58. +++ ./arch/ppc/amiga/Makefile    Sat Apr  3 10:27:01 1999
  59. @@ -12,4 +12,8 @@
  60.              bootinfo.o amisound.o chipram.o ints.o
  61.  OX_OBJS  := amiga_ksyms.o
  62.  
  63. +ifdef CONFIG_AMIGA_PCMCIA
  64. +O_OBJS := $(O_OBJS) pcmcia.o
  65. +endif
  66. +
  67.  include $(TOPDIR)/Rules.make
  68. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/amiints.c ./arch/ppc/amiga/amiints.c
  69. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/amiints.c    Sat Jan  9 18:30:34 1999
  70. +++ ./arch/ppc/amiga/amiints.c    Sun May 16 20:07:50 1999
  71. @@ -1,7 +1,3 @@
  72. -/* Rename a few functions. */
  73. -#define amiga_request_irq request_irq
  74. -#define amiga_free_irq free_irq
  75. -
  76.  /*
  77.   * linux/arch/m68k/amiga/amiints.c -- Amiga Linux interrupt handling code
  78.   *
  79. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/bootinfo.c ./arch/ppc/amiga/bootinfo.c
  80. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/bootinfo.c    Mon Jan  4 11:30:09 1999
  81. +++ ./arch/ppc/amiga/bootinfo.c    Mon Jan 11 21:44:38 1999
  82. @@ -16,9 +16,11 @@
  83.  
  84.  extern char cmd_line[CL_SIZE];
  85.  
  86. -int num_memory = 0;
  87. -struct mem_info memory[NUM_MEMINFO];
  88. -struct mem_info ramdisk;
  89. +extern int num_memory;
  90. +extern int m68k_realnum_memory;
  91. +extern struct mem_info memory[NUM_MEMINFO];
  92. +extern struct mem_info m68k_memory[NUM_MEMINFO];
  93. +extern struct mem_info ramdisk;
  94.  
  95.  extern int amiga_parse_bootinfo(const struct bi_record *);
  96.  extern int atari_parse_bootinfo(const struct bi_record *);
  97. @@ -42,6 +44,11 @@
  98.              memory[num_memory].addr = data[0];
  99.              memory[num_memory].size = data[1];
  100.              num_memory++;
  101. +
  102. +            /* FIXME: duplicate for m68k drivers. */
  103. +            m68k_memory[m68k_realnum_memory].addr = data[0];
  104. +            m68k_memory[m68k_realnum_memory].size = data[1];
  105. +            m68k_realnum_memory++;
  106.          } else
  107.              printk("parse_bootinfo: too many memory chunks\n");
  108.          break;
  109. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/chipram.c ./arch/ppc/amiga/chipram.c
  110. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/chipram.c    Fri Aug  7 15:53:33 1998
  111. +++ ./arch/ppc/amiga/chipram.c    Sun Nov 22 13:30:45 1998
  112. @@ -1 +1,174 @@
  113. -#include "../../m68k/amiga/chipram.c"
  114. +/*
  115. +**  linux/amiga/chipram.c
  116. +**
  117. +**      Modified 03-May-94 by Geert Uytterhoeven
  118. +**                           (Geert.Uytterhoeven@cs.kuleuven.ac.be)
  119. +**          - 64-bit aligned allocations for full AGA compatibility
  120. +*/
  121. +
  122. +#include <linux/config.h>
  123. +#include <linux/types.h>
  124. +#include <linux/kernel.h>
  125. +#include <linux/init.h>
  126. +#include <asm/amigahw.h>
  127. +
  128. +struct chip_desc {
  129. +    unsigned first   :  1;
  130. +    unsigned last    :  1;
  131. +    unsigned alloced :  1;
  132. +    unsigned length  : 24;
  133. +    long pad;                    /* We suppose this makes this struct 64 bits long!! */
  134. +};
  135. +
  136. +#define DP(ptr) ((struct chip_desc *)(ptr))
  137. +
  138. +u_long amiga_chip_size;
  139. +static unsigned long chipavail;
  140. +
  141. +unsigned long amiga_chip_avail( void )
  142. +{
  143. +#ifdef DEBUG
  144. +    printk("chip_avail : %ld bytes\n",chipavail);
  145. +#endif
  146. +    return chipavail;
  147. +}
  148. +
  149. +
  150. +__initfunc(void amiga_chip_init (void))
  151. +{
  152. +  struct chip_desc *dp;
  153. +
  154. +  if (!AMIGAHW_PRESENT(CHIP_RAM))
  155. +    return;
  156. +
  157. +#ifndef CONFIG_APUS_FAST_EXCEPT
  158. +  /*
  159. +   * Remove the first 4 pages where PPC exception handlers will
  160. +   * be located.
  161. +   */
  162. +  amiga_chip_size -= 0x4000;
  163. +#endif
  164. +
  165. +  /* initialize start boundary */
  166. +
  167. +  dp = DP(chipaddr);
  168. +  dp->first = 1;
  169. +
  170. +  dp->alloced = 0;
  171. +  dp->length = amiga_chip_size - 2*sizeof(*dp);
  172. +
  173. +  /* initialize end boundary */
  174. +  dp = DP(chipaddr + amiga_chip_size) - 1;
  175. +  dp->last = 1;
  176. +  
  177. +  dp->alloced = 0;
  178. +  dp->length = amiga_chip_size - 2*sizeof(*dp);
  179. +  chipavail = dp->length;  /*MILAN*/
  180. +
  181. +#ifdef DEBUG
  182. +  printk ("chipram end boundary is %p, length is %d\n", dp,
  183. +      dp->length);
  184. +#endif
  185. +}
  186. +
  187. +void *amiga_chip_alloc (long size)
  188. +{
  189. +    /* last chunk */
  190. +    struct chip_desc *dp;
  191. +    void *ptr;
  192. +
  193. +    /* round off */
  194. +    size = (size + 7) & ~7;
  195. +
  196. +#ifdef DEBUG
  197. +   printk("chip_alloc: allocate %ld bytes\n", size);
  198. +#endif
  199. +
  200. +    /*
  201. +     * get pointer to descriptor for last chunk by 
  202. +     * going backwards from end chunk
  203. +     */
  204. +    dp = DP(chipaddr + amiga_chip_size) - 1;
  205. +    dp = DP((unsigned long)dp - dp->length) - 1;
  206. +    
  207. +    while ((dp->alloced || dp->length < size)
  208. +           && !dp->first)
  209. +        dp = DP ((unsigned long)dp - dp[-1].length) - 2;
  210. +
  211. +    if (dp->alloced || dp->length < size) {
  212. +        printk ("no chipmem available for %ld allocation\n", size);
  213. +        return NULL;
  214. +    }
  215. +
  216. +    if (dp->length < (size + 2*sizeof(*dp))) {
  217. +        /* length too small to split; allocate the whole thing */
  218. +        dp->alloced = 1;
  219. +        ptr = (void *)(dp+1);
  220. +        dp = DP((unsigned long)ptr + dp->length);
  221. +        dp->alloced = 1;
  222. +#ifdef DEBUG
  223. +        printk ("chip_alloc: no split\n");
  224. +#endif
  225. +    } else {
  226. +        /* split the extent; use the end part */
  227. +        long newsize = dp->length - (2*sizeof(*dp) + size);
  228. +
  229. +#ifdef DEBUG
  230. +        printk ("chip_alloc: splitting %d to %ld\n", dp->length,
  231. +            newsize);
  232. +#endif
  233. +        dp->length = newsize;
  234. +        dp = DP((unsigned long)(dp+1) + newsize);
  235. +        dp->first = dp->last = 0;
  236. +        dp->alloced = 0;
  237. +        dp->length = newsize;
  238. +        dp++;
  239. +        dp->first = dp->last = 0;
  240. +        dp->alloced = 1;
  241. +        dp->length = size;
  242. +        ptr = (void *)(dp+1);
  243. +        dp = DP((unsigned long)ptr + size);
  244. +        dp->alloced = 1;
  245. +        dp->length = size;
  246. +    }
  247. +
  248. +#ifdef DEBUG
  249. +    printk ("chip_alloc: returning %p\n", ptr);
  250. +#endif
  251. +
  252. +    if ((unsigned long)ptr & 7)
  253. +        panic("chip_alloc: alignment violation\n");
  254. +
  255. +    chipavail -= size + (2*sizeof(*dp)); /*MILAN*/
  256. +
  257. +    return ptr;
  258. +}
  259. +
  260. +void amiga_chip_free (void *ptr)
  261. +{
  262. +    struct chip_desc *sdp = DP(ptr) - 1, *dp2;
  263. +    struct chip_desc *edp = DP((unsigned long)ptr + sdp->length);
  264. +
  265. +    chipavail += sdp->length + (2* sizeof(sdp)); /*MILAN*/
  266. +#ifdef DEBUG
  267. +   printk("chip_free: free %ld bytes at %p\n",sdp->length,ptr);
  268. +#endif
  269. +    /* deallocate the chunk */
  270. +    sdp->alloced = edp->alloced = 0;
  271. +
  272. +    /* check if we should merge with the previous chunk */
  273. +    if (!sdp->first && !sdp[-1].alloced) {
  274. +        dp2 = DP((unsigned long)sdp - sdp[-1].length) - 2;
  275. +        dp2->length += sdp->length + 2*sizeof(*sdp);
  276. +        edp->length = dp2->length;
  277. +        sdp = dp2;
  278. +    }
  279. +
  280. +    /* check if we should merge with the following chunk */
  281. +    if (!edp->last && !edp[1].alloced) {
  282. +        dp2 = DP((unsigned long)edp + edp[1].length) + 2;
  283. +        dp2->length += edp->length + 2*sizeof(*sdp);
  284. +        sdp->length = dp2->length;
  285. +        edp = dp2;
  286. +    }
  287. +}
  288. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/config.c ./arch/ppc/amiga/config.c
  289. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/config.c    Mon Jan  4 11:30:10 1999
  290. +++ ./arch/ppc/amiga/config.c    Sun Jan 31 11:57:25 1999
  291. @@ -1,13 +1,12 @@
  292.  #define m68k_debug_device debug_device
  293. -#define m68k_num_memory num_memory
  294. -#define m68k_memory memory
  295.  
  296.  #include <linux/init.h>
  297.  
  298.  /* machine dependent "kbd-reset" setup function */
  299. -void (*kbd_reset_setup) (char *, int) __initdata = 0;
  300. +void (*mach_kbd_reset_setup) (char *, int) __initdata = 0;
  301.  
  302.  #include <asm/io.h>
  303. +#include <asm/system.h>
  304.  
  305.  /*
  306.   *  linux/arch/m68k/amiga/config.c
  307. @@ -42,6 +41,7 @@
  308.  #include <asm/machdep.h>
  309.  #include <linux/zorro.h>
  310.  
  311. +unsigned long powerup_PCI_present;
  312.  unsigned long amiga_model;
  313.  unsigned long amiga_eclock;
  314.  unsigned long amiga_masterclock;
  315. @@ -62,7 +62,6 @@
  316.  /* amiga specific keyboard functions */
  317.  extern int amiga_keyb_init(void);
  318.  extern int amiga_kbdrate (struct kbd_repeat *);
  319. -extern void amiga_kbd_reset_setup(char*, int);
  320.  /* amiga specific irq functions */
  321.  extern void amiga_init_IRQ (void);
  322.  extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
  323. @@ -138,8 +137,13 @@
  324.  
  325.      switch (record->tag) {
  326.      case BI_AMIGA_MODEL:
  327. -        amiga_model = *data;
  328. -        break;
  329. +    {
  330. +        unsigned long d = *data;
  331. +
  332. +        powerup_PCI_present = d & 0x100;
  333. +        amiga_model = d & 0xff;
  334. +    }
  335. +    break;
  336.  
  337.      case BI_AMIGA_ECLOCK:
  338.          amiga_eclock = *data;
  339. @@ -353,7 +357,6 @@
  340.    mach_sched_init      = amiga_sched_init;
  341.    mach_keyb_init       = amiga_keyb_init;
  342.    mach_kbdrate         = amiga_kbdrate;
  343. -  kbd_reset_setup      = amiga_kbd_reset_setup;
  344.    mach_init_IRQ        = amiga_init_IRQ;
  345.    mach_default_handler = &amiga_default_handler;
  346.  #ifndef CONFIG_APUS
  347. @@ -742,7 +745,7 @@
  348.  static void amiga_serial_putc(char c)
  349.  {
  350.      custom.serdat = (unsigned char)c | 0x100;
  351. -    iobarrier_rw ();
  352. +    mb();
  353.      while (!(custom.serdatr & 0x2000))
  354.         ;
  355.  }
  356. @@ -922,3 +925,30 @@
  357.  
  358.      return(len);
  359.  }
  360. +
  361. +#ifdef CONFIG_APUS
  362. +int get_hardware_list(char *buffer)
  363. +{
  364. +    extern int get_cpuinfo(char *buffer);
  365. +    int len = 0;
  366. +    char model[80];
  367. +    u_long mem;
  368. +    int i;
  369. +
  370. +    if (mach_get_model)
  371. +        mach_get_model(model);
  372. +    else
  373. +        strcpy(model, "Unknown PowerPC");
  374. +    
  375. +    len += sprintf(buffer+len, "Model:\t\t%s\n", model);
  376. +    len += get_cpuinfo(buffer+len);
  377. +    for (mem = 0, i = 0; i < m68k_realnum_memory; i++)
  378. +        mem += m68k_memory[i].size;
  379. +    len += sprintf(buffer+len, "System Memory:\t%ldK\n", mem>>10);
  380. +
  381. +    if (mach_get_hardware_list)
  382. +        len += mach_get_hardware_list(buffer+len);
  383. +
  384. +    return(len);
  385. +}
  386. +#endif
  387. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/ints.c ./arch/ppc/amiga/ints.c
  388. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/ints.c    Fri Aug  7 15:53:34 1998
  389. +++ ./arch/ppc/amiga/ints.c    Sat Nov 21 20:38:10 1998
  390. @@ -42,7 +42,7 @@
  391.   * the IRQ handling routines.
  392.   */
  393.  
  394. -__initfunc(void apus_init_IRQ(void))
  395. +__initfunc(void m68k_init_IRQ(void))
  396.  {
  397.      int i;
  398.  
  399. @@ -134,7 +134,7 @@
  400.      }
  401.  }
  402.  
  403. -int get_irq_list(char *buf)
  404. +int m68k_get_irq_list(char *buf)
  405.  {
  406.      int i, len = 0;
  407.  
  408. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/pcmcia.c ./arch/ppc/amiga/pcmcia.c
  409. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/pcmcia.c    Thu Jan  1 01:00:00 1970
  410. +++ ./arch/ppc/amiga/pcmcia.c    Sun May 16 11:54:04 1999
  411. @@ -0,0 +1 @@
  412. +#include "../../m68k/amiga/pcmcia.c"
  413. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/time.c ./arch/ppc/amiga/time.c
  414. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/amiga/time.c    Thu Nov 19 19:16:53 1998
  415. +++ ./arch/ppc/amiga/time.c    Sun Nov 22 21:02:04 1998
  416. @@ -15,7 +15,7 @@
  417.      unsigned int day, unsigned int hour,
  418.      unsigned int min, unsigned int sec);
  419.  
  420. -unsigned long apus_get_rtc_time(void)
  421. +unsigned long m68k_get_rtc_time(void)
  422.  {
  423.      unsigned int year, mon, day, hour, min, sec;
  424.  
  425. @@ -30,7 +30,7 @@
  426.      return mktime(year, mon, day, hour, min, sec);
  427.  }
  428.  
  429. -int apus_set_rtc_time(unsigned long nowtime)
  430. +int m68k_set_rtc_time(unsigned long nowtime)
  431.  {
  432.    if (mach_set_clock_mmss)
  433.      return mach_set_clock_mmss (nowtime);
  434. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/apus_defconfig ./arch/ppc/apus_defconfig
  435. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/apus_defconfig    Wed Mar 10 19:14:12 1999
  436. +++ ./arch/ppc/apus_defconfig    Sun May 16 20:42:46 1999
  437. @@ -8,11 +8,11 @@
  438.  CONFIG_PPC=y
  439.  CONFIG_6xx=y
  440.  # CONFIG_8xx is not set
  441. -CONFIG_PMAC=y
  442. +# CONFIG_PMAC is not set
  443.  # CONFIG_PREP is not set
  444.  # CONFIG_CHRP is not set
  445.  # CONFIG_ALL_PPC is not set
  446. -# CONFIG_APUS is not set
  447. +CONFIG_APUS=y
  448.  # CONFIG_MBX is not set
  449.  # CONFIG_SMP is not set
  450.  CONFIG_MACH_SPECIFIC=y
  451. @@ -21,33 +21,45 @@
  452.  # General setup
  453.  #
  454.  CONFIG_EXPERIMENTAL=y
  455. -CONFIG_MODULES=y
  456. -# CONFIG_MODVERSIONS is not set
  457. -CONFIG_KMOD=y
  458. -CONFIG_PCI=y
  459. -# CONFIG_PCI_QUIRKS is not set
  460. -CONFIG_PCI_OLD_PROC=y
  461. +# CONFIG_MODULES is not set
  462. +CONFIG_APUS_FAST_EXCEPT=y
  463.  CONFIG_NET=y
  464.  CONFIG_SYSCTL=y
  465.  CONFIG_SYSVIPC=y
  466.  # CONFIG_BSD_PROCESS_ACCT is not set
  467.  CONFIG_BINFMT_ELF=y
  468.  CONFIG_KERNEL_ELF=y
  469. -CONFIG_BINFMT_MISC=m
  470. +# CONFIG_BINFMT_MISC is not set
  471.  # CONFIG_BINFMT_JAVA is not set
  472.  # CONFIG_PARPORT is not set
  473.  # CONFIG_VGA_CONSOLE is not set
  474.  CONFIG_FB=y
  475. -CONFIG_FB_COMPAT_XPMAC=y
  476. -CONFIG_PMAC_PBOOK=y
  477. -CONFIG_MAC_KEYBOARD=y
  478. -CONFIG_MAC_FLOPPY=y
  479. -CONFIG_MAC_SERIAL=y
  480. -CONFIG_ADBMOUSE=y
  481. -CONFIG_PROC_DEVICETREE=y
  482. -# CONFIG_KGDB is not set
  483. -# CONFIG_XMON is not set
  484. +# CONFIG_FB_COMPAT_XPMAC is not set
  485. +# CONFIG_PMAC_PBOOK is not set
  486. +# CONFIG_MAC_KEYBOARD is not set
  487. +# CONFIG_MAC_FLOPPY is not set
  488. +# CONFIG_MAC_SERIAL is not set
  489. +# CONFIG_ADBMOUSE is not set
  490. +# CONFIG_PROC_DEVICETREE is not set
  491.  # CONFIG_TOTALMP is not set
  492. +# CONFIG_BOOTX_TEXT is not set
  493. +# CONFIG_MOTOROLA_HOTSWAP is not set
  494. +CONFIG_AMIGA=y
  495. +CONFIG_ZORRO=y
  496. +CONFIG_AMIGAMOUSE=y
  497. +CONFIG_AMIGA_PCMCIA=y
  498. +CONFIG_AMIGA_BUILTIN_SERIAL=y
  499. +CONFIG_GVPIOEXT=y
  500. +# CONFIG_GVPIOEXT_LP is not set
  501. +CONFIG_GVPIOEXT_PLIP=y
  502. +CONFIG_MULTIFACE_III_TTY=y
  503. +# CONFIG_SERIAL_CONSOLE is not set
  504. +CONFIG_WHIPPET_SERIAL=y
  505. +# CONFIG_PARPORT is not set
  506. +# CONFIG_M68K_PRINTER is not set
  507. +# CONFIG_MULTIFACE_III_LP is not set
  508. +CONFIG_HEARTBEAT=y
  509. +CONFIG_PROC_HARDWARE=y
  510.  
  511.  #
  512.  # Plug and Play support
  513. @@ -58,6 +70,7 @@
  514.  # Block devices
  515.  #
  516.  # CONFIG_BLK_DEV_FD is not set
  517. +CONFIG_AMIGA_FLOPPY=y
  518.  CONFIG_BLK_DEV_IDE=y
  519.  
  520.  #
  521. @@ -67,22 +80,20 @@
  522.  CONFIG_BLK_DEV_IDEDISK=y
  523.  CONFIG_BLK_DEV_IDECD=y
  524.  # CONFIG_BLK_DEV_IDETAPE is not set
  525. -CONFIG_BLK_DEV_IDEFLOPPY=y
  526. +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  527.  # CONFIG_BLK_DEV_IDESCSI is not set
  528. +# CONFIG_BLK_DEV_PCIDE is not set
  529. +CONFIG_BLK_DEV_GAYLE=y
  530. +CONFIG_BLK_DEV_IDEDOUBLER=y
  531. +CONFIG_BLK_DEV_BUDDHA=y
  532.  # CONFIG_BLK_DEV_CMD640 is not set
  533. -# CONFIG_BLK_DEV_RZ1000 is not set
  534. -# CONFIG_BLK_DEV_IDEPCI is not set
  535. -# CONFIG_BLK_DEV_SL82C105 is not set
  536. -CONFIG_BLK_DEV_IDE_PMAC=y
  537. -CONFIG_BLK_DEV_IDEDMA_PMAC=y
  538. -CONFIG_BLK_DEV_IDEDMA=y
  539. -CONFIG_PMAC_IDEDMA_AUTO=y
  540.  # CONFIG_IDE_CHIPSETS is not set
  541. +CONFIG_AMIGA_Z2RAM=y
  542.  
  543.  #
  544.  # Additional Block Devices
  545.  #
  546. -# CONFIG_BLK_DEV_LOOP is not set
  547. +CONFIG_BLK_DEV_LOOP=y
  548.  # CONFIG_BLK_DEV_NBD is not set
  549.  # CONFIG_BLK_DEV_MD is not set
  550.  CONFIG_BLK_DEV_RAM=y
  551. @@ -95,37 +106,33 @@
  552.  #
  553.  # Networking options
  554.  #
  555. -CONFIG_PACKET=y
  556. -CONFIG_NETLINK=y
  557. -# CONFIG_RTNETLINK is not set
  558. -# CONFIG_NETLINK_DEV is not set
  559. +# CONFIG_PACKET is not set
  560. +# CONFIG_NETLINK is not set
  561.  # CONFIG_FIREWALL is not set
  562.  # CONFIG_FILTER is not set
  563.  CONFIG_UNIX=y
  564.  CONFIG_INET=y
  565. -CONFIG_IP_MULTICAST=y
  566. +# CONFIG_IP_MULTICAST is not set
  567.  # CONFIG_IP_ADVANCED_ROUTER is not set
  568.  # CONFIG_IP_PNP is not set
  569.  # CONFIG_IP_ROUTER is not set
  570.  # CONFIG_NET_IPIP is not set
  571.  # CONFIG_NET_IPGRE is not set
  572. -# CONFIG_IP_MROUTE is not set
  573. -CONFIG_IP_ALIAS=y
  574. +# CONFIG_IP_ALIAS is not set
  575.  # CONFIG_SYN_COOKIES is not set
  576.  
  577.  #
  578.  # (it is safe to leave these untouched)
  579.  #
  580. -CONFIG_INET_RARP=y
  581. -CONFIG_IP_NOSR=y
  582. -CONFIG_SKB_LARGE=y
  583. +# CONFIG_INET_RARP is not set
  584. +# CONFIG_SKB_LARGE is not set
  585.  # CONFIG_IPV6 is not set
  586.  
  587.  #
  588.  #  
  589.  #
  590.  # CONFIG_IPX is not set
  591. -CONFIG_ATALK=m
  592. +# CONFIG_ATALK is not set
  593.  # CONFIG_X25 is not set
  594.  # CONFIG_LAPB is not set
  595.  # CONFIG_BRIDGE is not set
  596. @@ -135,6 +142,10 @@
  597.  # CONFIG_NET_FASTROUTE is not set
  598.  # CONFIG_NET_HW_FLOWCONTROL is not set
  599.  # CONFIG_CPU_IS_SLOW is not set
  600. +
  601. +#
  602. +# QoS and/or fair queueing
  603. +#
  604.  # CONFIG_NET_SCHED is not set
  605.  
  606.  #
  607. @@ -146,7 +157,7 @@
  608.  # SCSI support type (disk, tape, CD-ROM)
  609.  #
  610.  CONFIG_BLK_DEV_SD=y
  611. -CONFIG_CHR_DEV_ST=y
  612. +# CONFIG_CHR_DEV_ST is not set
  613.  CONFIG_BLK_DEV_SR=y
  614.  CONFIG_BLK_DEV_SR_VENDOR=y
  615.  # CONFIG_CHR_DEV_SG is not set
  616. @@ -155,49 +166,29 @@
  617.  # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  618.  #
  619.  # CONFIG_SCSI_MULTI_LUN is not set
  620. -CONFIG_SCSI_CONSTANTS=y
  621. +# CONFIG_SCSI_CONSTANTS is not set
  622.  # CONFIG_SCSI_LOGGING is not set
  623.  
  624.  #
  625.  # SCSI low-level drivers
  626.  #
  627. -# CONFIG_SCSI_7000FASST is not set
  628. -# CONFIG_SCSI_AHA152X is not set
  629. -# CONFIG_SCSI_AHA1542 is not set
  630. -# CONFIG_SCSI_AHA1740 is not set
  631. -CONFIG_SCSI_AIC7XXX=y
  632. -# CONFIG_OVERRIDE_CMDS is not set
  633. -CONFIG_AIC7XXX_PROC_STATS=y
  634. -CONFIG_AIC7XXX_RESET_DELAY=15
  635. -# CONFIG_SCSI_ADVANSYS is not set
  636. -# CONFIG_SCSI_IN2000 is not set
  637. -# CONFIG_SCSI_AM53C974 is not set
  638. -# CONFIG_SCSI_BUSLOGIC is not set
  639. -# CONFIG_SCSI_DTC3280 is not set
  640. -# CONFIG_SCSI_EATA_DMA is not set
  641. -# CONFIG_SCSI_EATA_PIO is not set
  642. -# CONFIG_SCSI_EATA is not set
  643. -# CONFIG_SCSI_FUTURE_DOMAIN is not set
  644. -# CONFIG_SCSI_GDTH is not set
  645. -# CONFIG_SCSI_GENERIC_NCR5380 is not set
  646. -# CONFIG_SCSI_NCR53C406A is not set
  647. -# CONFIG_SCSI_NCR53C7xx is not set
  648. -# CONFIG_SCSI_NCR53C8XX is not set
  649. -# CONFIG_SCSI_PAS16 is not set
  650. -# CONFIG_SCSI_PCI2000 is not set
  651. -# CONFIG_SCSI_PCI2220I is not set
  652. -# CONFIG_SCSI_PSI240I is not set
  653. -# CONFIG_SCSI_QLOGIC_FAS is not set
  654. -# CONFIG_SCSI_QLOGIC_ISP is not set
  655. -# CONFIG_SCSI_SEAGATE is not set
  656. -# CONFIG_SCSI_DC390T is not set
  657. -# CONFIG_SCSI_T128 is not set
  658. -# CONFIG_SCSI_U14_34F is not set
  659. -# CONFIG_SCSI_ULTRASTOR is not set
  660. +CONFIG_SCSI_ALL=y
  661. +# CONFIG_SCSI_ALL is not set
  662. +CONFIG_A3000_SCSI=y
  663. +CONFIG_A4000T_SCSI=y
  664. +# CONFIG_SCSI_ALL is not set
  665. +CONFIG_A2091_SCSI=y
  666. +CONFIG_GVP11_SCSI=y
  667. +# CONFIG_CYBERSTORM_SCSI is not set
  668. +# CONFIG_CYBERSTORMII_SCSI is not set
  669. +# CONFIG_BLZ2060_SCSI is not set
  670. +# CONFIG_BLZ1230_SCSI is not set
  671. +# CONFIG_FASTLANE_SCSI is not set
  672. +CONFIG_A4091_SCSI=y
  673. +# CONFIG_WARPENGINE_SCSI is not set
  674. +CONFIG_BLZ603EPLUS_SCSI=y
  675. +CONFIG_OKTAGON_SCSI=y
  676.  # CONFIG_SCSI_DEBUG is not set
  677. -CONFIG_SCSI_MESH=y
  678. -CONFIG_SCSI_MESH_SYNC_RATE=5
  679. -CONFIG_SCSI_MAC53C94=y
  680.  
  681.  #
  682.  # Network device support
  683. @@ -206,51 +197,40 @@
  684.  # CONFIG_ARCNET is not set
  685.  # CONFIG_DUMMY is not set
  686.  # CONFIG_EQUALIZER is not set
  687. -# CONFIG_ETHERTAP is not set
  688.  CONFIG_NET_ETHERNET=y
  689. -CONFIG_MACE=y
  690. -CONFIG_BMAC=y
  691. +# CONFIG_MACE is not set
  692. +# CONFIG_BMAC is not set
  693. +CONFIG_ARIADNE=y
  694. +CONFIG_ARIADNE2=y
  695. +CONFIG_A2065=y
  696. +CONFIG_HYDRA=y
  697. +CONFIG_APNE=y
  698.  # CONFIG_NET_VENDOR_3COM is not set
  699.  # CONFIG_LANCE is not set
  700.  # CONFIG_NET_VENDOR_SMC is not set
  701.  # CONFIG_NET_VENDOR_RACAL is not set
  702.  # CONFIG_RTL8139 is not set
  703.  # CONFIG_YELLOWFIN is not set
  704. +# CONFIG_ACENIC is not set
  705.  # CONFIG_NET_ISA is not set
  706. -CONFIG_NET_EISA=y
  707. -# CONFIG_PCNET32 is not set
  708. -# CONFIG_AC3200 is not set
  709. -# CONFIG_APRICOT is not set
  710. -# CONFIG_CS89x0 is not set
  711. -CONFIG_DE4X5=y
  712. -CONFIG_DEC_ELCP=m
  713. -# CONFIG_DGRS is not set
  714. -# CONFIG_EEXPRESS_PRO100 is not set
  715. -# CONFIG_LNE390 is not set
  716. -# CONFIG_NE3210 is not set
  717. -# CONFIG_NE2K_PCI is not set
  718. -# CONFIG_TLAN is not set
  719. -# CONFIG_VIA_RHINE is not set
  720. -# CONFIG_ES3210 is not set
  721. -# CONFIG_EPIC100 is not set
  722. -# CONFIG_ZNET is not set
  723. +# CONFIG_NET_EISA is not set
  724.  # CONFIG_NET_POCKET is not set
  725.  # CONFIG_FDDI is not set
  726.  # CONFIG_HIPPI is not set
  727.  # CONFIG_DLCI is not set
  728. -# CONFIG_LTPC is not set
  729. -# CONFIG_COPS is not set
  730. -# CONFIG_IPDDP is not set
  731.  CONFIG_PPP=y
  732.  
  733.  #
  734.  # CCP compressors for PPP are only built as modules.
  735.  #
  736. -# CONFIG_SLIP is not set
  737. +CONFIG_SLIP=y
  738. +CONFIG_SLIP_COMPRESSED=y
  739. +CONFIG_SLIP_SMART=y
  740. +# CONFIG_SLIP_MODE_SLIP6 is not set
  741.  # CONFIG_NET_RADIO is not set
  742.  # CONFIG_TR is not set
  743.  # CONFIG_SHAPER is not set
  744. -# CONFIG_HOSTESS_SV11 is not set
  745. +# CONFIG_RCPCI is not set
  746.  
  747.  #
  748.  # Amateur Radio support
  749. @@ -263,7 +243,7 @@
  750.  # CONFIG_ISDN is not set
  751.  
  752.  #
  753. -# CD-ROM drivers (not for SCSI or IDE/ATAPI drives)
  754. +# Old CD-ROM drivers (not SCSI, not IDE)
  755.  #
  756.  # CONFIG_CD_NO_IDESCSI is not set
  757.  
  758. @@ -271,47 +251,61 @@
  759.  # Console drivers
  760.  #
  761.  CONFIG_DUMMY_CONSOLE=y
  762. -CONFIG_FB_OF=y
  763. -CONFIG_FB_CONTROL=y
  764. -CONFIG_FB_PLATINUM=y
  765. -CONFIG_FB_VALKYRIE=y
  766. -CONFIG_FB_ATY=y
  767. -CONFIG_FB_IMSTT=y
  768. -CONFIG_FB_CT65550=y
  769. -# CONFIG_FB_S3TRIO is not set
  770. +CONFIG_FB_PM2=y
  771. +CONFIG_FB_PM2_CVPPC=y
  772. +CONFIG_FB_AMIGA=y
  773. +CONFIG_FB_AMIGA_OCS=y
  774. +CONFIG_FB_AMIGA_ECS=y
  775. +CONFIG_FB_AMIGA_AGA=y
  776. +CONFIG_FB_CYBER=y
  777. +CONFIG_FB_VIRGE=y
  778. +CONFIG_FB_RETINAZ3=y
  779. +CONFIG_FB_CLGEN=y
  780. +# CONFIG_FB_FM2 is not set
  781. +# CONFIG_FB_OF is not set
  782. +# CONFIG_FB_MATROX is not set
  783. +# CONFIG_FB_ATY is not set
  784.  # CONFIG_FB_VIRTUAL is not set
  785.  # CONFIG_FBCON_ADVANCED is not set
  786. +CONFIG_FBCON_MFB=y
  787.  CONFIG_FBCON_CFB8=y
  788.  CONFIG_FBCON_CFB16=y
  789.  CONFIG_FBCON_CFB24=y
  790.  CONFIG_FBCON_CFB32=y
  791. -# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
  792. -CONFIG_FBCON_FONTS=y
  793. -# CONFIG_FONT_8x8 is not set
  794. +CONFIG_FBCON_AFB=y
  795. +CONFIG_FBCON_ILBM=y
  796. +CONFIG_FBCON_FONTWIDTH8_ONLY=y
  797. +# CONFIG_FBCON_FONTS is not set
  798. +CONFIG_FONT_8x8=y
  799.  CONFIG_FONT_8x16=y
  800. -CONFIG_FONT_SUN8x16=y
  801. -CONFIG_FONT_SUN12x22=y
  802. -# CONFIG_FONT_6x11 is not set
  803. -# CONFIG_FONT_PEARL_8x8 is not set
  804. -# CONFIG_FONT_ACORN_8x8 is not set
  805. +CONFIG_FONT_PEARL_8x8=y
  806.  
  807.  #
  808.  # Character devices
  809.  #
  810.  CONFIG_VT=y
  811.  CONFIG_VT_CONSOLE=y
  812. -CONFIG_SERIAL=m
  813. +CONFIG_SERIAL=y
  814. +# CONFIG_SERIAL_CONSOLE is not set
  815.  # CONFIG_SERIAL_EXTENDED is not set
  816.  # CONFIG_SERIAL_NONSTANDARD is not set
  817. -CONFIG_UNIX98_PTYS=y
  818. -CONFIG_UNIX98_PTY_COUNT=256
  819. +# CONFIG_UNIX98_PTYS is not set
  820.  # CONFIG_MOUSE is not set
  821.  # CONFIG_QIC02_TAPE is not set
  822.  # CONFIG_WATCHDOG is not set
  823. +# CONFIG_NVRAM is not set
  824.  # CONFIG_RTC is not set
  825. +
  826. +#
  827. +# Video For Linux
  828. +#
  829.  # CONFIG_VIDEO_DEV is not set
  830. -CONFIG_NVRAM=y
  831. +
  832. +#
  833. +# Joystick support
  834. +#
  835.  # CONFIG_JOYSTICK is not set
  836. +# CONFIG_DTLK is not set
  837.  
  838.  #
  839.  # Ftape, the floppy tape device driver
  840. @@ -322,42 +316,57 @@
  841.  # Filesystems
  842.  #
  843.  # CONFIG_QUOTA is not set
  844. -# CONFIG_MINIX_FS is not set
  845. -CONFIG_EXT2_FS=y
  846. +# CONFIG_AUTOFS_FS is not set
  847. +# CONFIG_ADFS_FS is not set
  848. +CONFIG_AFFS_FS=y
  849. +CONFIG_HFS_FS=y
  850. +CONFIG_FAT_FS=y
  851. +CONFIG_MSDOS_FS=y
  852. +# CONFIG_UMSDOS_FS is not set
  853. +CONFIG_VFAT_FS=y
  854.  CONFIG_ISO9660_FS=y
  855.  # CONFIG_JOLIET is not set
  856. -CONFIG_FAT_FS=m
  857. -CONFIG_MSDOS_FS=m
  858. -# CONFIG_UMSDOS_FS is not set
  859. -CONFIG_VFAT_FS=m
  860. +CONFIG_MINIX_FS=y
  861. +# CONFIG_NTFS_FS is not set
  862. +# CONFIG_HPFS_FS is not set
  863.  CONFIG_PROC_FS=y
  864. +# CONFIG_QNX4FS_FS is not set
  865. +# CONFIG_ROMFS_FS is not set
  866. +CONFIG_EXT2_FS=y
  867. +# CONFIG_SYSV_FS is not set
  868. +# CONFIG_UFS_FS is not set
  869. +
  870. +#
  871. +# Network File Systems
  872. +#
  873. +# CONFIG_CODA_FS is not set
  874.  CONFIG_NFS_FS=y
  875. -CONFIG_NFSD=y
  876. +# CONFIG_NFSD is not set
  877.  CONFIG_SUNRPC=y
  878.  CONFIG_LOCKD=y
  879. -# CONFIG_CODA_FS is not set
  880.  # CONFIG_SMB_FS is not set
  881. -# CONFIG_HPFS_FS is not set
  882. -# CONFIG_NTFS_FS is not set
  883. -# CONFIG_SYSV_FS is not set
  884. -# CONFIG_AFFS_FS is not set
  885. -CONFIG_HFS_FS=y
  886. -# CONFIG_ROMFS_FS is not set
  887. -CONFIG_AUTOFS_FS=y
  888. -# CONFIG_UFS_FS is not set
  889. +# CONFIG_NCP_FS is not set
  890. +
  891. +#
  892. +# Partition Types
  893. +#
  894. +CONFIG_AMIGA_PARTITION=y
  895. +CONFIG_FOREIGN_PARTITIONS=y
  896. +CONFIG_MSDOS_PARTITION=y
  897. +# CONFIG_OSF_PARTITION is not set
  898. +# CONFIG_SUN_PARTITION is not set
  899. +# CONFIG_ATARI_PARTITION is not set
  900. +CONFIG_MAC_PARTITION=y
  901.  # CONFIG_BSD_DISKLABEL is not set
  902.  # CONFIG_SMD_DISKLABEL is not set
  903.  # CONFIG_SOLARIS_X86_PARTITION is not set
  904. -CONFIG_DEVPTS_FS=y
  905. -# CONFIG_ADFS_FS is not set
  906. -# CONFIG_QNX4FS_FS is not set
  907. -CONFIG_MAC_PARTITION=y
  908. +# CONFIG_UNIXWARE_DISKLABEL is not set
  909.  CONFIG_NLS=y
  910.  
  911.  #
  912.  # Native Language Support
  913.  #
  914. -CONFIG_NLS_CODEPAGE_437=y
  915. +# CONFIG_NLS_CODEPAGE_437 is not set
  916.  # CONFIG_NLS_CODEPAGE_737 is not set
  917.  # CONFIG_NLS_CODEPAGE_775 is not set
  918.  # CONFIG_NLS_CODEPAGE_850 is not set
  919. @@ -382,16 +391,17 @@
  920.  # CONFIG_NLS_ISO8859_7 is not set
  921.  # CONFIG_NLS_ISO8859_8 is not set
  922.  # CONFIG_NLS_ISO8859_9 is not set
  923. +# CONFIG_NLS_ISO8859_15 is not set
  924.  # CONFIG_NLS_KOI8_R is not set
  925.  
  926.  #
  927.  # Sound
  928.  #
  929. -CONFIG_SOUND=y
  930. -CONFIG_DMASOUND=y
  931. -# CONFIG_SOUND_ES1370 is not set
  932. -# CONFIG_SOUND_ES1371 is not set
  933. -# CONFIG_SOUND_SONICVIBES is not set
  934. -# CONFIG_SOUND_MSNDCLAS is not set
  935. -# CONFIG_SOUND_MSNDPIN is not set
  936. -# CONFIG_SOUND_OSS is not set
  937. +# CONFIG_SOUND is not set
  938. +
  939. +#
  940. +# Kernel hacking
  941. +#
  942. +# CONFIG_MAGIC_SYSRQ is not set
  943. +# CONFIG_KGDB is not set
  944. +# CONFIG_XMON is not set
  945. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/config.in ./arch/ppc/config.in
  946. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/config.in    Wed May 12 10:02:44 1999
  947. +++ ./arch/ppc/config.in    Sat May 15 11:38:26 1999
  948. @@ -22,7 +22,10 @@
  949.  bool 'Symmetric multi-processing support' CONFIG_SMP
  950.  if [ "$CONFIG_ALL_PPC" != "y" ];then
  951.    define_bool CONFIG_MACH_SPECIFIC y
  952. +else
  953. +  bool 'Include APUS support' CONFIG_APUS
  954.  fi
  955. +
  956.  endmenu
  957.  
  958.  if [ "$CONFIG_MBX" = "y" ];then
  959. @@ -40,7 +43,11 @@
  960.  fi
  961.  
  962.  if [ "$CONFIG_APUS" = "y" ]; then
  963. -  define_bool CONFIG_PCI n
  964. +  if [ "$CONFIG_MACH_SPECIFIC" = "y" ];then
  965. +    define_bool CONFIG_APUS_FAST_EXCEPT y
  966. +  else
  967. +    define_bool CONFIG_PCI y
  968. +  fi
  969.  else
  970.    define_bool CONFIG_PCI y
  971.  fi
  972. @@ -99,14 +106,15 @@
  973.  fi
  974.  
  975.  if [ "$CONFIG_APUS" = "y" ]; then
  976. -  define_bool CONFIG_FB_CONSOLE y
  977.    define_bool CONFIG_AMIGA y
  978.    define_bool CONFIG_ZORRO y
  979.    define_bool CONFIG_AMIGAMOUSE y
  980. -  define_bool CONFIG_ABSTRACT_CONSOLE y
  981. -  define_bool CONFIG_FB y
  982. +  if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  983. +    bool 'Amiga 1200/600 PCMCIA support' CONFIG_AMIGA_PCMCIA
  984. +  fi
  985. +
  986. +  # Serial
  987.    tristate 'Amiga builtin serial support' CONFIG_AMIGA_BUILTIN_SERIAL
  988. -  tristate 'Parallel printer support' CONFIG_M68K_PRINTER
  989.    tristate 'GVP IO-Extender support' CONFIG_GVPIOEXT
  990.    dep_tristate 'GVP IO-Extender parallel printer support' CONFIG_GVPIOEXT_LP $CONFIG_GVPIOEXT
  991.    dep_tristate 'GVP IO-Extender PLIP support' CONFIG_GVPIOEXT_PLIP $CONFIG_GVPIOEXT
  992. @@ -115,6 +123,35 @@
  993.         "$CONFIG_MULTIFACE_III_TTY" = "y" ]; then
  994.      bool 'Support for serial port console' CONFIG_SERIAL_CONSOLE
  995.    fi
  996. +  if [ "$CONFIG_AMIGA_PCMCIA" = "y" ]; then
  997. +    tristate 'Hisoft Whippet PCMCIA serial support' CONFIG_WHIPPET_SERIAL
  998. +  fi
  999. +
  1000. +  # Parallel
  1001. +  if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  1002. +    tristate 'Parallel port support (EXPERIMENTAL, disables old lp driver!)' CONFIG_PARPORT
  1003. +    if [ "$CONFIG_PARPORT" != "n" ]; then
  1004. +      if [ "$CONFIG_AMIGA" != "n" ]; then
  1005. +        dep_tristate '   Amiga builtin port' CONFIG_PARPORT_AMIGA $CONFIG_PARPORT
  1006. +        if [ "$CONFIG_ZORRO" != "n" ]; then
  1007. +          dep_tristate '    Multiface III parallel port' CONFIG_PARPORT_MFC3 $CONFIG_PARPORT
  1008. +        fi
  1009. +      fi
  1010. +    fi
  1011. +  fi
  1012. +  if [ "$CONFIG_PARPORT" = "n" ]; then
  1013. +    tristate 'Parallel printer support' CONFIG_M68K_PRINTER
  1014. +    if [ "$CONFIG_ZORRO" = "y" ]; then
  1015. +      dep_tristate 'Multiface Card III parallel support' CONFIG_MULTIFACE_III_LP $CONFIG_M68K_PRINTER
  1016. +    fi
  1017. +  else
  1018. +    dep_tristate 'Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
  1019. +    if [ "$CONFIG_PRINTER" != "n" ]; then
  1020. +      bool '  Support IEEE1284 status readback' CONFIG_PRINTER_READBACK
  1021. +    fi
  1022. +  fi   
  1023. +
  1024. +  # Misc
  1025.    bool 'Use power LED as a heartbeat' CONFIG_HEARTBEAT
  1026.    bool '/proc/hardware support' CONFIG_PROC_HARDWARE
  1027.  fi
  1028. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/Makefile ./arch/ppc/kernel/Makefile
  1029. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/Makefile    Tue May 11 11:26:14 1999
  1030. +++ ./arch/ppc/kernel/Makefile    Sat May 15 11:39:25 1999
  1031. @@ -15,10 +15,8 @@
  1032.  
  1033.  
  1034.  O_OBJS := traps.o irq.o idle.o time.o process.o signal.o syscalls.o misc.o \
  1035. -      bitops.o ptrace.o align.o ppc_htab.o
  1036. -ifdef CONFIG_PCI
  1037. -O_OBJS += pci.o
  1038. -endif
  1039. +      bitops.o ptrace.o align.o ppc_htab.o pci.o
  1040. +
  1041.  ifdef CONFIG_KGDB
  1042.  O_OBJS += ppc-stub.o
  1043.  endif
  1044. @@ -29,18 +27,12 @@
  1045.  ifeq ($(CONFIG_MBX),y)
  1046.  O_OBJS += mbx_setup.o mbx_pci.o softemu8xx.o i8259.o ppc8xx_pic.o
  1047.  else
  1048. -ifeq ($(CONFIG_APUS),y)
  1049. -O_OBJS += apus_setup.o prom.o openpic.o
  1050. -else
  1051. -ifneq ($(CONFIG_MBX),y)
  1052.  O_OBJS += prep_time.o pmac_time.o chrp_time.o \
  1053.        pmac_setup.o pmac_support.o \
  1054.        prep_pci.o pmac_pci.o chrp_pci.o \
  1055. -      residual.o prom.o openpic.o feature.o \
  1056. +      residual.o prom.o openpic.o feature.o apus_setup.o \
  1057.        prep_nvram.o open_pic.o i8259.o pmac_pic.o indirect_pci.o
  1058.  OX_OBJS += chrp_setup.o prep_setup.o
  1059. -endif
  1060. -endif
  1061.  endif
  1062.  
  1063.  ifdef CONFIG_SMP
  1064. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/apus_setup.c ./arch/ppc/kernel/apus_setup.c
  1065. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/apus_setup.c    Tue May 11 11:26:15 1999
  1066. +++ ./arch/ppc/kernel/apus_setup.c    Sun May 16 20:13:49 1999
  1067. @@ -1,11 +1,16 @@
  1068.  /*
  1069.   *  linux/arch/ppc/kernel/apus_setup.c
  1070.   *
  1071. - *  Copyright (C) 1998  Jesper Skov
  1072. + *  Copyright (C) 1998, 1999  Jesper Skov
  1073.   *
  1074.   *  Basically what is needed to replace functionality found in
  1075.   *  arch/m68k allowing Amiga drivers to work under APUS.
  1076.   *  Bits of code and/or ideas from arch/m68k and arch/ppc files.
  1077. + *
  1078. + * TODO:
  1079. + *  This file needs a *really* good cleanup. Restructure and optimize.
  1080. + *  Make sure it can be compiled for non-APUS configs. Begine to move
  1081. + *  Amiga specific stuff into linux/machine/amiga.
  1082.   */
  1083.  
  1084.  #include <linux/config.h>
  1085. @@ -14,7 +19,10 @@
  1086.  #include <linux/sched.h>
  1087.  #include <linux/kd.h>
  1088.  #include <linux/init.h>
  1089. +#include <linux/serial.h>
  1090.  #include <linux/hdreg.h>
  1091. +#include <linux/blk.h>
  1092. +#include <linux/pci.h>
  1093.  
  1094.  /* Get the IDE stuff from the 68k file */
  1095.  #define ide_init_hwif_ports m68k_ide_init_hwif_ports
  1096. @@ -26,67 +34,74 @@
  1097.  #define ide_fix_driveid m68k_ide_fix_driveid
  1098.  #include <asm-m68k/ide.h>
  1099.  #undef ide_init_hwif_ports
  1100. -#define ide_default_irq
  1101. -#define ide_default_io_base
  1102. -#define ide_check_region
  1103. -#define ide_request_region
  1104. -#define ide_release_region
  1105. -#define ide_fix_driveid
  1106. +#undef ide_default_irq
  1107. +#undef ide_default_io_base
  1108. +#undef ide_check_region
  1109. +#undef ide_request_region
  1110. +#undef ide_release_region
  1111. +#undef ide_fix_driveid
  1112. +/* But do define the magic ppc ide structure */
  1113. +struct ide_machdep_calls {
  1114. +        void        (*insw)(ide_ioreg_t port, void *buf, int ns);
  1115. +        void        (*outsw)(ide_ioreg_t port, void *buf, int ns);
  1116. +        int         (*default_irq)(ide_ioreg_t base);
  1117. +        ide_ioreg_t (*default_io_base)(int index);
  1118. +        int         (*check_region)(ide_ioreg_t from, unsigned int extent);
  1119. +        void        (*request_region)(ide_ioreg_t from,
  1120. +                                      unsigned int extent,
  1121. +                                      const char *name);
  1122. +        void        (*release_region)(ide_ioreg_t from,
  1123. +                                      unsigned int extent);
  1124. +        void        (*fix_driveid)(struct hd_driveid *id);
  1125. +        void        (*ide_init_hwif)(ide_ioreg_t *p,
  1126. +                                     ide_ioreg_t base,
  1127. +                                     int *irq); 
  1128. +
  1129. +        int io_base;
  1130. +};
  1131.  
  1132. +extern struct ide_machdep_calls ppc_ide_md;
  1133. +/*-------------------------------------------*/
  1134.  
  1135. +#include <asm/bootinfo.h>
  1136.  #include <asm/setup.h>
  1137.  #include <asm/amigahw.h>
  1138.  #include <asm/amigappc.h>
  1139.  #include <asm/pgtable.h>
  1140.  #include <asm/io.h>
  1141. +#include <asm/dma.h>
  1142.  #include <asm/machdep.h>
  1143. -#include <asm/ide.h>
  1144.  
  1145. -#include "time.h"
  1146.  #include "local_irq.h"
  1147.  
  1148. -unsigned long apus_get_rtc_time(void);
  1149. -int apus_set_rtc_time(unsigned long nowtime);
  1150. -
  1151. -/* APUS defs */
  1152. -extern int parse_bootinfo(const struct bi_record *);
  1153. -extern char _end[];
  1154. -#ifdef CONFIG_APUS
  1155. -struct mem_info ramdisk;
  1156. -unsigned long isa_io_base;
  1157. -unsigned long isa_mem_base;
  1158. -unsigned long pci_dram_offset;
  1159. -#endif
  1160. -/* END APUS defs */
  1161. -
  1162. -unsigned long m68k_machtype;
  1163. -char debug_device[6] = "";
  1164. +unsigned long m68k_machtype __apusdata;
  1165. +char debug_device[6] __apusdata = "";
  1166.  
  1167.  void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata;
  1168.  /* machine dependent keyboard functions */
  1169.  int (*mach_keyb_init) (void) __initdata;
  1170. -int (*mach_kbdrate) (struct kbd_repeat *) = NULL;
  1171. -void (*mach_kbd_leds) (unsigned int) = NULL;
  1172. +int (*mach_kbdrate) (struct kbd_repeat *) __apusdata = NULL;
  1173. +void (*mach_kbd_leds) (unsigned int) __apusdata = NULL;
  1174.  /* machine dependent irq functions */
  1175.  void (*mach_init_IRQ) (void) __initdata;
  1176. -void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
  1177. -void (*mach_get_model) (char *model) = NULL;
  1178. -int (*mach_get_hardware_list) (char *buffer) = NULL;
  1179. -int (*mach_get_irq_list) (char *) = NULL;
  1180. -void (*mach_process_int) (int, struct pt_regs *) = NULL;
  1181. +void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) __apusdata = NULL;
  1182. +void (*mach_get_model) (char *model) __apusdata = NULL;
  1183. +int (*mach_get_hardware_list) (char *buffer) __apusdata = NULL;
  1184. +int (*mach_get_irq_list) (char *) __apusdata = NULL;
  1185. +void (*mach_process_int) (int, struct pt_regs *) __apusdata = NULL;
  1186.  /* machine dependent timer functions */
  1187. -unsigned long (*mach_gettimeoffset) (void);
  1188. -void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
  1189. -int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
  1190. -int (*mach_set_clock_mmss) (unsigned long) = NULL;
  1191. -void (*mach_reset)( void );
  1192. -long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
  1193. -#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
  1194. +unsigned long (*mach_gettimeoffset) (void) __apusdata;
  1195. +void (*mach_gettod) (int*, int*, int*, int*, int*, int*) __apusdata;
  1196. +int (*mach_hwclk) (int, struct hwclk_time*) __apusdata = NULL;
  1197. +int (*mach_set_clock_mmss) (unsigned long) __apusdata = NULL;
  1198. +void (*mach_reset)( void ) __apusdata;
  1199. +long mach_max_dma_address __apusdata = 0x00ffffff; /* default set to the lower 16MB */
  1200. +#if defined(CONFIG_AMIGA_FLOPPY)
  1201.  void (*mach_floppy_setup) (char *, int *) __initdata = NULL;
  1202. -void (*mach_floppy_eject) (void) = NULL;
  1203. +void (*mach_floppy_eject) (void) __apusdata = NULL;
  1204.  #endif
  1205.  #ifdef CONFIG_HEARTBEAT
  1206. -void (*mach_heartbeat) (int) = NULL;
  1207. +void (*mach_heartbeat) (int) __apusdata = NULL;
  1208.  #endif
  1209.  
  1210.  extern unsigned long amiga_model;
  1211. @@ -94,22 +109,155 @@
  1212.  extern unsigned count_period_num; /* 1 decrementer count equals */
  1213.  extern unsigned count_period_den; /* count_period_num / count_period_den us */
  1214.  
  1215. -extern struct mem_info memory[NUM_MEMINFO];/* memory description */
  1216. +int num_memory __apusdata = 0;
  1217. +struct mem_info memory[NUM_MEMINFO] __apusdata;/* memory description */
  1218. +/* FIXME: Duplicate memory data to avoid conflicts with m68k shared code. */
  1219. +int m68k_realnum_memory __apusdata = 0;
  1220. +struct mem_info m68k_memory[NUM_MEMINFO] __apusdata;/* memory description */
  1221. +
  1222. +struct mem_info ramdisk __apusdata;
  1223.  
  1224.  extern void amiga_floppy_setup(char *, int *);
  1225.  extern void config_amiga(void);
  1226.  
  1227. -static int __60nsram = 0;
  1228. +static int __60nsram __apusdata = 0;
  1229. +
  1230. +/* for cpuinfo */
  1231. +static int __bus_speed __apusdata = 0;
  1232. +static int __speed_test_failed __apusdata = 0;
  1233. +
  1234. +/********************************************** COMPILE PROTECTION */
  1235. +/* Provide some stubs that links to Amiga specific functions. 
  1236. + * This allows CONFIG_APUS to be removed from generic PPC files while
  1237. + * preventing link errors for other PPC targets.
  1238. + */
  1239. +__apus
  1240. +unsigned long apus_get_rtc_time(void)
  1241. +{
  1242. +#ifdef CONFIG_APUS
  1243. +    extern unsigned long m68k_get_rtc_time(void);
  1244. +    
  1245. +    return m68k_get_rtc_time ();
  1246. +#else
  1247. +    return 0;
  1248. +#endif
  1249. +}
  1250. +
  1251. +__apus
  1252. +int apus_set_rtc_time(unsigned long nowtime)
  1253. +{
  1254. +#ifdef CONFIG_APUS
  1255. +    extern int m68k_set_rtc_time(unsigned long nowtime);
  1256. +
  1257. +    return m68k_set_rtc_time (nowtime);
  1258. +#else
  1259. +    return 0;
  1260. +#endif
  1261. +}
  1262. +
  1263. +__apus
  1264. +int  apus_request_irq(unsigned int irq, 
  1265. +              void (*handler)(int, void *, struct pt_regs *),
  1266. +              unsigned long flags, const char *devname, 
  1267. +              void *dev_id)
  1268. +{
  1269. +#ifdef CONFIG_APUS
  1270. +    extern int  amiga_request_irq(unsigned int irq, 
  1271. +                      void (*handler)(int, void *, 
  1272. +                              struct pt_regs *),
  1273. +                      unsigned long flags, 
  1274. +                      const char *devname, 
  1275. +                      void *dev_id);
  1276. +
  1277. +    return amiga_request_irq (irq, handler, flags, devname, dev_id);
  1278. +#else
  1279. +    return 0;
  1280. +#endif
  1281. +}
  1282. +
  1283. +__apus
  1284. +void apus_free_irq(unsigned int irq, void *dev_id)
  1285. +{
  1286. +#ifdef CONFIG_APUS
  1287. +    extern void amiga_free_irq(unsigned int irq, void *dev_id);
  1288. +
  1289. +    amiga_free_irq (irq, dev_id);
  1290. +#endif
  1291. +}
  1292. +
  1293. +__apus
  1294. +void apus_process_int(unsigned long vec, void *fp)
  1295. +{
  1296. +#ifdef CONFIG_APUS
  1297. +    extern void process_int(unsigned long vec, struct pt_regs *fp);
  1298. +
  1299. +    process_int (vec, (struct pt_regs*)fp);
  1300. +#endif
  1301. +}
  1302. +
  1303. +__apus
  1304. +int apus_get_irq_list(char *buf)
  1305. +{
  1306. +#ifdef CONFIG_APUS
  1307. +    extern int m68k_get_irq_list (char*);
  1308. +    
  1309. +    return m68k_get_irq_list (buf);
  1310. +#else
  1311. +    return 0;
  1312. +#endif
  1313. +}
  1314. +
  1315. +
  1316. +/* Here some functions we don't support, but which the other ports reference */
  1317. +int pckbd_setkeycode(unsigned int scancode, unsigned int keycode)
  1318. +{
  1319. +    printk("Bogus call to " __FILE__ ":" __FUNCTION__ "\n");
  1320. +    return 0; 
  1321. +}
  1322. +int pckbd_getkeycode(unsigned int scancode) 
  1323. +{ 
  1324. +    printk("Bogus call to " __FILE__ ":" __FUNCTION__ "\n");
  1325. +    return 0; 
  1326. +}
  1327. +int pckbd_translate(unsigned char scancode, unsigned char *keycode,
  1328. +            char raw_mode) 
  1329. +{
  1330. +    printk("Bogus call to " __FILE__ ":" __FUNCTION__ "\n");
  1331. +    return 0; 
  1332. +}
  1333. +char pckbd_unexpected_up(unsigned char keycode)
  1334. +{
  1335. +    printk("Bogus call to " __FILE__ ":" __FUNCTION__ "\n");
  1336. +    return 0;
  1337. +}
  1338. +void pckbd_leds(unsigned char leds)
  1339. +{
  1340. +    printk("Bogus call to " __FILE__ ":" __FUNCTION__ "\n");
  1341. +}
  1342. +void pckbd_init_hw(void)
  1343. +{
  1344. +    printk("Bogus call to " __FILE__ ":" __FUNCTION__ "\n");
  1345. +}
  1346. +unsigned char pckbd_sysrq_xlate[128];
  1347. +
  1348. +struct pci_dev *pci_devices = NULL;
  1349. +struct pci_bus * __init pci_scan_peer_bridge(int bus)
  1350. +{
  1351. +    printk("Bogus call to " __FILE__ ":" __FUNCTION__ "\n");
  1352. +    return NULL;
  1353. +}
  1354.  
  1355.  /*********************************************************** SETUP */
  1356.  /* From arch/m68k/kernel/setup.c. */
  1357.  __initfunc(void apus_setup_arch(unsigned long * memory_start_p,
  1358.                  unsigned long * memory_end_p))
  1359.  {
  1360. +#ifdef CONFIG_APUS
  1361.      extern char cmd_line[];
  1362.      int i;
  1363.      char *p, *q;
  1364.  
  1365. +    /* Let m68k-shared code know it should do the Amiga thing. */
  1366.      m68k_machtype = MACH_AMIGA;
  1367.  
  1368.      /* Parse the command line for arch-specific options.
  1369. @@ -141,12 +289,34 @@
  1370.          if ((p = strchr( p, ' ' ))) ++p;
  1371.          }
  1372.      }
  1373. -
  1374.      config_amiga();
  1375. +#endif
  1376.  }
  1377.  
  1378. +__apus
  1379. +int
  1380. +apus_get_cpuinfo(char *buffer)
  1381. +{
  1382. +#ifdef CONFIG_APUS
  1383. +    extern int __map_without_bats;
  1384. +    extern unsigned long powerup_PCI_present;
  1385. +    int len;
  1386. +
  1387. +    len = sprintf(buffer, "machine\t\t: Amiga\n");
  1388. +    len += sprintf(buffer+len, "bus speed\t: %d%s", __bus_speed,
  1389. +               (__speed_test_failed) ? " [failed]\n" : "\n");
  1390. +    len += sprintf(buffer+len, "using BATs\t: %s\n",
  1391. +               (__map_without_bats) ? "No" : "Yes");
  1392. +    len += sprintf(buffer+len, "ram speed\t: %dns\n", 
  1393. +               (__60nsram) ? 60 : 70);
  1394. +    len += sprintf(buffer+len, "PCI bridge\t: %s\n",
  1395. +               (powerup_PCI_present) ? "Yes" : "No");
  1396. +    return len;
  1397. +#endif
  1398. +}
  1399.  
  1400. -void get_current_tb(unsigned long long *time)
  1401. +__apus
  1402. +static void get_current_tb(unsigned long long *time)
  1403.  {
  1404.      __asm __volatile ("1:mftbu 4      \n\t"
  1405.                "  mftb  5      \n\t"
  1406. @@ -161,14 +331,17 @@
  1407.  }
  1408.  
  1409.  
  1410. +__apus
  1411.  void apus_calibrate_decr(void)
  1412.  {
  1413. +#ifdef CONFIG_APUS
  1414.      int freq, divisor;
  1415.  
  1416.      /* This algorithm for determining the bus speed was
  1417.             contributed by Ralph Schmidt. */
  1418.      unsigned long long start, stop;
  1419.      int bus_speed;
  1420. +    int speed_test_failed = 0;
  1421.  
  1422.      {
  1423.          unsigned long loop = amiga_eclock / 10;
  1424. @@ -200,16 +373,23 @@
  1425.              "Defaulting to 50MHz", bus_speed);
  1426.          bus_speed = 50;
  1427.          freq = 12500000;
  1428. +        speed_test_failed = 1;
  1429.      }
  1430.  
  1431.      /* Ease diagnostics... */
  1432.      {
  1433.          extern int __map_without_bats;
  1434. +        extern unsigned long powerup_PCI_present;
  1435.  
  1436. -        printk ("APUS: BATs=%d, BUS=%dMHz, RAM=%dns\n",
  1437. +        printk ("APUS: BATs=%d, BUS=%dMHz",
  1438.              (__map_without_bats) ? 0 : 1,
  1439. -            bus_speed,
  1440. -            (__60nsram) ? 60 : 70);
  1441. +            bus_speed);
  1442. +        if (speed_test_failed)
  1443. +            printk ("[FAILED - please report]");
  1444. +
  1445. +        printk (", RAM=%dns, PCI bridge=%d\n",
  1446. +            (__60nsram) ? 60 : 70,
  1447. +            (powerup_PCI_present) ? 1 : 0);
  1448.  
  1449.          /* print a bit more if asked politely... */
  1450.          if (!(ciaa.pra & 0x40)){
  1451. @@ -232,25 +412,65 @@
  1452.          decrementer_count = freq / HZ / divisor;
  1453.          count_period_num = divisor;
  1454.          count_period_den = freq / 1000000;
  1455. +
  1456. +    __bus_speed = bus_speed;
  1457. +    __speed_test_failed = speed_test_failed;
  1458. +#endif
  1459.  }
  1460.  
  1461. +__apus
  1462.  void arch_gettod(int *year, int *mon, int *day, int *hour,
  1463.           int *min, int *sec)
  1464.  {
  1465. +#ifdef CONFIG_APUS
  1466.      if (mach_gettod)
  1467.          mach_gettod(year, mon, day, hour, min, sec);
  1468.      else
  1469.          *year = *mon = *day = *hour = *min = *sec = 0;
  1470. +#endif
  1471. +}
  1472. +
  1473. +/* for "kbd-reset" cmdline param */
  1474. +__initfunc(void kbd_reset_setup(char *str, int *ints))
  1475. +{
  1476.  }
  1477.  
  1478. +#if defined(CONFIG_WHIPPET_SERIAL)||defined(CONFIG_MULTIFACE_III_TTY)||defined(CONFIG_GVPIOEXT)||defined(CONFIG_AMIGA_BUILTIN_SERIAL)
  1479. +
  1480. +long m68k_rs_init(void);
  1481. +int m68k_register_serial(struct serial_struct *);
  1482. +void m68k_unregister_serial(int);
  1483. +long m68k_serial_console_init(long, long );
  1484. +
  1485. +int rs_init(void)
  1486. +{
  1487. +    return m68k_rs_init();
  1488. +}
  1489. +int register_serial(struct serial_struct *p)
  1490. +{
  1491. +    return m68k_register_serial(p);
  1492. +}
  1493. +void unregister_serial(int i)
  1494. +{
  1495. +    m68k_unregister_serial(i);
  1496. +}
  1497. +#ifdef CONFIG_SERIAL_CONSOLE
  1498. +long serial_console_init(long kmem_start, long kmem_end)
  1499. +{
  1500. +    return m68k_serial_console_init(kmem_start, kmem_end);
  1501. +}
  1502. +#endif
  1503. +#endif
  1504. +
  1505.  /*********************************************************** FLOPPY */
  1506. -#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
  1507. +#if defined(CONFIG_AMIGA_FLOPPY)
  1508.  __initfunc(void floppy_setup(char *str, int *ints))
  1509.  {
  1510.      if (mach_floppy_setup)
  1511.          mach_floppy_setup (str, ints);
  1512.  }
  1513.  
  1514. +__apus
  1515.  void floppy_eject(void)
  1516.  {
  1517.      if (mach_floppy_eject)
  1518. @@ -259,44 +479,13 @@
  1519.  #endif
  1520.  
  1521.  /*********************************************************** MEMORY */
  1522. -extern void
  1523. -map_page(struct task_struct *tsk, unsigned long va,
  1524. -     unsigned long pa, int flags);
  1525. -
  1526. -#define KMAP_MAX 8
  1527. -static unsigned long kmap_chunks[KMAP_MAX*3];
  1528. -static int kmap_chunk_count = 0;
  1529. -
  1530. -/* Based on arch/ppc/mm/init.c:ioremap() which maps the address range
  1531. -   to the same virtual address as the physical address - which may
  1532. -   cause problems since Z3 IO space is not the same as PCI/ISA.
  1533. -   This should be rewritten to something more like the m68k version. */
  1534. -unsigned long kernel_map (unsigned long phys_addr, unsigned long size,
  1535. -              int cacheflag, unsigned long *memavailp)
  1536. -{
  1537. -    unsigned long v_ret, end;
  1538. -    /* Remap to 0x90000000. Related comment in ppc/mm/init.c. */
  1539. -    static unsigned long virt = 0x90000000;
  1540. -    v_ret = virt;
  1541. -
  1542. -    if (kmap_chunk_count == KMAP_MAX*3)
  1543. -        panic ("kernel_map: Can only map %d chunks.\n",
  1544. -               KMAP_MAX);
  1545. -
  1546. -    kmap_chunks[kmap_chunk_count++] = phys_addr;
  1547. -    kmap_chunks[kmap_chunk_count++] = size;
  1548. -    kmap_chunks[kmap_chunk_count++] = v_ret;
  1549. -
  1550. -    for (end = phys_addr + size ; phys_addr < end; 
  1551. -         phys_addr += PAGE_SIZE, virt += PAGE_SIZE) {
  1552. -        map_page(&init_task, virt, phys_addr,
  1553. -             pgprot_val(PAGE_KERNEL_CI) | _PAGE_GUARDED);
  1554. -    }
  1555. -    return v_ret;
  1556. -}
  1557. +#define KMAP_MAX 32
  1558. +unsigned long kmap_chunks[KMAP_MAX*3] __apusdata;
  1559. +int kmap_chunk_count __apusdata = 0;
  1560.  
  1561.  /* From pgtable.h */
  1562. -extern __inline__ pte_t *my_find_pte(struct mm_struct *mm,unsigned long va)
  1563. +__apus
  1564. +static __inline__ pte_t *my_find_pte(struct mm_struct *mm,unsigned long va)
  1565.  {
  1566.      pgd_t *dir = 0;
  1567.      pmd_t *pmd = 0;
  1568. @@ -318,10 +507,11 @@
  1569.  
  1570.  
  1571.  /* Again simulating an m68k/mm/kmap.c function. */
  1572. +__apus
  1573.  void kernel_set_cachemode( unsigned long address, unsigned long size,
  1574.                 unsigned int cmode )
  1575.  {
  1576. -    int mask, flags;
  1577. +    unsigned long mask, flags;
  1578.  
  1579.      switch (cmode)
  1580.      {
  1581. @@ -360,6 +550,7 @@
  1582.      }
  1583.  }
  1584.  
  1585. +__apus
  1586.  unsigned long mm_ptov (unsigned long paddr)
  1587.  {
  1588.      unsigned long ret;
  1589. @@ -388,6 +579,7 @@
  1590.      return ret;
  1591.  }
  1592.  
  1593. +__apus
  1594.  int mm_end_of_chunk (unsigned long addr, int len)
  1595.  {
  1596.      if (memory[0].addr + memory[0].size == addr + len)
  1597. @@ -399,6 +591,7 @@
  1598.  
  1599.  #define L1_CACHE_BYTES 32
  1600.  #define MAX_CACHE_SIZE 8192
  1601. +__apus
  1602.  void cache_push(__u32 addr, int length)
  1603.  {
  1604.      addr = mm_ptov(addr);
  1605. @@ -417,6 +610,8 @@
  1606.             "sync \n\t"
  1607.             : : "r" (addr));
  1608.  }
  1609. +
  1610. +__apus
  1611.  void cache_clear(__u32 addr, int length)
  1612.  {
  1613.      if (MAX_CACHE_SIZE < length)
  1614. @@ -450,6 +645,7 @@
  1615.             : : "r" (addr));
  1616.  }
  1617.  
  1618. +/****************************************************** from setup.c */
  1619.  void
  1620.  apus_restart(char *cmd)
  1621.  {
  1622. @@ -478,37 +674,13 @@
  1623.     apus_restart(NULL);
  1624.  }
  1625.  
  1626. -void
  1627. -apus_do_IRQ(struct pt_regs *regs,
  1628. -        int            cpu,
  1629. -            int            isfake)
  1630. -{
  1631. -        int old_level, new_level;
  1632. -
  1633. -    /* I don't think we need SMP code here - Corey */
  1634. -
  1635. -        old_level = ~(regs->mq) & IPLEMU_IPLMASK;
  1636. -        new_level = (~(regs->mq) >> 3) & IPLEMU_IPLMASK;
  1637. -        if (new_level != 0)
  1638. -        {
  1639. -                APUS_WRITE(APUS_IPL_EMU, IPLEMU_IPLMASK);
  1640. -                APUS_WRITE(APUS_IPL_EMU, (IPLEMU_SETRESET
  1641. -                                          | (~(new_level) & IPLEMU_IPLMASK)));
  1642. -                APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
  1643. -
  1644. -                process_int (VEC_SPUR+new_level, regs);
  1645. -                APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_DISABLEINT);
  1646. -                APUS_WRITE(APUS_IPL_EMU, IPLEMU_IPLMASK);
  1647. -                APUS_WRITE(APUS_IPL_EMU, (IPLEMU_SETRESET
  1648. -                                          | (~(old_level) & IPLEMU_IPLMASK)));
  1649. -        }
  1650. -        APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
  1651. -}
  1652. -
  1653. +/****************************************************** from setup.c/IDE */
  1654.  #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
  1655.  /*
  1656.   * IDE stuff.
  1657.   */
  1658. +void ide_insw(ide_ioreg_t port, void *buf, int ns);
  1659. +void ide_outsw(ide_ioreg_t port, void *buf, int ns);
  1660.  void
  1661.  apus_ide_insw(ide_ioreg_t port, void *buf, int ns)
  1662.  {
  1663. @@ -524,13 +696,13 @@
  1664.  int
  1665.  apus_ide_default_irq(ide_ioreg_t base)
  1666.  {
  1667. -        m68k_ide_default_irq(base);
  1668. +        return m68k_ide_default_irq(base);
  1669.  }
  1670.  
  1671.  ide_ioreg_t
  1672.  apus_ide_default_io_base(int index)
  1673.  {
  1674. -        m68k_ide_default_io_base(index);
  1675. +        return 0;
  1676.  }
  1677.  
  1678.  int
  1679. @@ -565,20 +737,113 @@
  1680.  {
  1681.          m68k_ide_init_hwif_ports(p, base, irq);
  1682.  }
  1683. +
  1684. +
  1685. +
  1686.  #endif
  1687.  
  1688. +/****************************************************** from irq.c */
  1689. +#define VEC_SPUR    (24)
  1690. +
  1691. +void
  1692. +apus_do_IRQ(struct pt_regs *regs,
  1693. +        int            cpu,
  1694. +            int            isfake)
  1695. +{
  1696. +    int old_level, new_level;
  1697. +
  1698. +    new_level = (~(regs->mq) >> 3) & IPLEMU_IPLMASK;
  1699. +        
  1700. +    if (0 != new_level && 7 != new_level) {
  1701. +        old_level = ~(regs->mq) & IPLEMU_IPLMASK;
  1702. +
  1703. +        apus_process_int (VEC_SPUR+new_level, regs);
  1704. +        
  1705. +        APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_DISABLEINT);
  1706. +        APUS_WRITE(APUS_IPL_EMU, IPLEMU_IPLMASK);
  1707. +        APUS_WRITE(APUS_IPL_EMU, (IPLEMU_SETRESET
  1708. +                      | (~(old_level) & IPLEMU_IPLMASK)));
  1709. +        APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
  1710. +    }
  1711. +}
  1712. +
  1713. +/****************************************************** keyboard */
  1714. +__apus
  1715. +static int apus_kbd_setkeycode(unsigned int scancode, unsigned int keycode)
  1716. +{
  1717. +    return -EOPNOTSUPP;
  1718. +}
  1719. +
  1720. +__apus
  1721. +static int apus_kbd_getkeycode(unsigned int scancode)
  1722. +{
  1723. +    return scancode > 127 ? -EINVAL : scancode;
  1724. +}
  1725. +
  1726. +__apus
  1727. +static int apus_kbd_translate(unsigned char keycode, unsigned char *keycodep,
  1728. +                  char raw_mode)
  1729. +{
  1730. +    *keycodep = keycode;
  1731. +    return 1;
  1732. +}
  1733. +
  1734. +__apus
  1735. +static char apus_kbd_unexpected_up(unsigned char keycode)
  1736. +{
  1737. +    return 0200;
  1738. +}
  1739. +
  1740. +__apus  
  1741. +static void apus_kbd_leds(unsigned char leds)
  1742. +{
  1743. +}
  1744. +
  1745. +__apus  
  1746. +static void apus_kbd_init_hw(void)
  1747. +{
  1748. +#ifdef CONFIG_APUS
  1749. +    extern int amiga_keyb_init(void);
  1750. +
  1751. +printk("**** " __FUNCTION__ "\n");
  1752. +    amiga_keyb_init();
  1753. +#endif
  1754. +}
  1755. +
  1756. +
  1757. +/****************************************************** init */
  1758. +extern void amiga_disable_irq(unsigned int irq);
  1759. +extern void amiga_enable_irq(unsigned int irq);
  1760. +extern void m68k_init_IRQ (void);
  1761. +
  1762. +struct hw_interrupt_type amiga_irq_ctl = {
  1763. +    " Amiga    ",
  1764. +        NULL,
  1765. +        NULL,
  1766. +        NULL,
  1767. +        amiga_enable_irq,
  1768. +        amiga_disable_irq,
  1769. +        NULL,
  1770. +        0
  1771. +};
  1772. +
  1773.  __initfunc(void
  1774. -apus_local_init_IRQ(void))
  1775. +apus_init_IRQ(void))
  1776.  {
  1777. -    ppc_md.mask_irq = amiga_disable_irq;
  1778. -    ppc_md.unmask_irq = amiga_enable_irq;
  1779. -    apus_init_IRQ();
  1780. +    int i;
  1781. +
  1782. +    for (i = 0; i < NR_IRQS; i++)
  1783. +        irq_desc[i].ctl = &amiga_irq_ctl;
  1784. +    m68k_init_IRQ ();
  1785.  }
  1786.  
  1787.  __initfunc(void
  1788.  apus_init(unsigned long r3, unsigned long r4, unsigned long r5,
  1789.        unsigned long r6, unsigned long r7))
  1790.  {
  1791. +    extern int parse_bootinfo(const struct bi_record *);
  1792. +    extern char _end[];
  1793. +    
  1794.      /* Parse bootinfo. The bootinfo is located right after
  1795.             the kernel bss */
  1796.      parse_bootinfo((const struct bi_record *)&_end);
  1797. @@ -591,9 +856,6 @@
  1798.          initrd_end = (unsigned long) 
  1799.              __va(ramdisk.size + ramdisk.addr);
  1800.      }
  1801. -    /* Make sure code below is not executed. */
  1802. -    r4 = 0;
  1803. -    r6 = 0;
  1804.  #endif /* CONFIG_BLK_DEV_INITRD */
  1805.  
  1806.      ISA_DMA_THRESHOLD = 0x00ffffff;
  1807. @@ -604,7 +866,7 @@
  1808.      ppc_md.irq_cannonicalize = NULL;
  1809.      ppc_md.init_IRQ       = apus_init_IRQ;
  1810.      ppc_md.do_IRQ         = apus_do_IRQ;
  1811. -    ppc_md.get_irq_source = NULL;
  1812. +
  1813.      ppc_md.init           = NULL;
  1814.  
  1815.      ppc_md.restart        = apus_restart;
  1816. @@ -616,15 +878,20 @@
  1817.      ppc_md.get_rtc_time   = apus_get_rtc_time;
  1818.      ppc_md.calibrate_decr = apus_calibrate_decr;
  1819.  
  1820. +    ppc_md.nvram_read_val = NULL;
  1821. +    ppc_md.nvram_write_val = NULL;
  1822. +
  1823.      /* These should not be used for the APUS yet, since it uses
  1824.         the M68K keyboard now. */
  1825. -    ppc_md.kbd_setkeycode    = NULL;
  1826. -    ppc_md.kbd_getkeycode    = NULL;
  1827. -    ppc_md.kbd_translate     = NULL;
  1828. -    ppc_md.kbd_unexpected_up = NULL;
  1829. -    ppc_md.kbd_leds          = NULL;
  1830. -    ppc_md.kbd_init_hw       = NULL;
  1831. +    ppc_md.kbd_setkeycode    = apus_kbd_setkeycode;
  1832. +    ppc_md.kbd_getkeycode    = apus_kbd_getkeycode;
  1833. +    ppc_md.kbd_translate     = apus_kbd_translate;
  1834. +    ppc_md.kbd_unexpected_up = apus_kbd_unexpected_up;
  1835. +    ppc_md.kbd_leds          = apus_kbd_leds;
  1836. +    ppc_md.kbd_init_hw       = apus_kbd_init_hw;
  1837. +#ifdef CONFIG_MAGIC_SYSRQ
  1838.      ppc_md.kbd_sysrq_xlate     = NULL;
  1839. +#endif
  1840.  
  1841.  #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
  1842.          ppc_ide_md.insw = apus_ide_insw;
  1843. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/debug.h ./arch/ppc/kernel/debug.h
  1844. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/debug.h    Thu Jan  1 01:00:00 1970
  1845. +++ ./arch/ppc/kernel/debug.h    Tue Sep  1 21:59:02 1998
  1846. @@ -0,0 +1,111 @@
  1847. +/* Roman Zippel's debug functions */
  1848. +
  1849. +#include <asm/amigappc.h>
  1850. +
  1851. +#define INITSERIAL()           \
  1852. +       lis     r4,0x00bf;      \
  1853. +       ori     r4,r4,0xd000;   \
  1854. +       lis     r5,0x00df;      \
  1855. +       ori     r5,r5,0xf032;   \
  1856. +       lbz     r0,0(r4);       \
  1857. +       clrlwi  r0,r0,25;       \
  1858. +       stb     r0,0(r4);       \
  1859. +       li      r0,368;         \
  1860. +       sth     r0,0(r5)
  1861. +
  1862. +#define SENDCHAR()             \
  1863. +       lis     r4,0x00df;      \
  1864. +       ori     r4,r4,0xf000;   \
  1865. +       clrlwi  r3,r3,24;       \
  1866. +       ori     r3,r3,0x100;    \
  1867. +       sth     r3,0x30(r4);    \
  1868. +       eieio;                  \
  1869. +50:    lhz     r0,0x18(r4);    \
  1870. +       andi.   r0,r0,8192;     \
  1871. +       beq     50b
  1872. +
  1873. +#define SENDNL()               \
  1874. +       li      r3,'\n';        \
  1875. +       SENDCHAR();             \
  1876. +       li      r3,'\r';        \
  1877. +       SENDCHAR()
  1878. +
  1879. +#define        SENDLONG()              \
  1880. +       mr      r5,r3;          \
  1881. +       li      r3,' ';         \
  1882. +       SENDCHAR();             \
  1883. +       li      r6,0;           \
  1884. +51:    addi    r6,r6,4;        \
  1885. +       rlwnm   r3,r5,r6,28,31; \
  1886. +       addi    r3,r3,'0';      \
  1887. +       cmpwi   r3,'9';         \
  1888. +       ble     52f;            \
  1889. +       addi    r3,r3,'A'-'9'-1;\
  1890. +52:    SENDCHAR();             \
  1891. +       cmpwi   r6,32;          \
  1892. +       bne     51b
  1893. +
  1894. +#define SENDCHAR2()            \
  1895. +       lis     r4,0x80df;      \
  1896. +       ori     r4,r4,0xf000;   \
  1897. +       clrlwi  r3,r3,24;       \
  1898. +       ori     r3,r3,0x100;    \
  1899. +       sth     r3,0x30(r4);    \
  1900. +       eieio;                  \
  1901. +50:    lhz     r0,0x18(r4);    \
  1902. +       andi.   r0,r0,8192;     \
  1903. +       beq     50b
  1904. +
  1905. +#define SENDNL2()              \
  1906. +       li      r3,'\n';        \
  1907. +       SENDCHAR2();            \
  1908. +       li      r3,'\r';        \
  1909. +       SENDCHAR2()
  1910. +
  1911. +#define        SENDLONG2()             \
  1912. +       mr      r5,r3;          \
  1913. +       li      r3,' ';         \
  1914. +       SENDCHAR2();            \
  1915. +       li      r6,0;           \
  1916. +51:    addi    r6,r6,4;        \
  1917. +       rlwnm   r3,r5,r6,28,31; \
  1918. +       addi    r3,r3,'0';      \
  1919. +       cmpwi   r3,'9';         \
  1920. +       ble     52f;            \
  1921. +       addi    r3,r3,'A'-'9'-1;\
  1922. +52:    SENDCHAR2();            \
  1923. +       cmpwi   r6,32;          \
  1924. +       bne     51b
  1925. +
  1926. +#ifdef __ASSEMBLY__
  1927. +
  1928. +initserial:
  1929. +       INITSERIAL()
  1930. +       blr
  1931. +
  1932. +       .global sendchar
  1933. +sendchar:
  1934. +       SENDCHAR()
  1935. +       blr
  1936. +sendnl:
  1937. +       SENDNL()
  1938. +       blr
  1939. +
  1940. +       .global sendlong
  1941. +sendlong:
  1942. +       SENDLONG()
  1943. +       blr
  1944. +
  1945. +sendchar2:
  1946. +       SENDCHAR2()
  1947. +       blr
  1948. +
  1949. +sendnl2:
  1950. +       SENDNL2()
  1951. +       blr
  1952. +
  1953. +sendlong2:
  1954. +       SENDLONG2()
  1955. +       blr
  1956. +
  1957. +#endif
  1958. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/head.S ./arch/ppc/kernel/head.S
  1959. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/head.S    Wed May 12 09:56:44 1999
  1960. +++ ./arch/ppc/kernel/head.S    Sun May 16 12:01:08 1999
  1961. @@ -41,6 +41,19 @@
  1962.  #include <asm/amigappc.h>
  1963.  #endif
  1964.  
  1965. +#if 1
  1966. +#define APUS_PROGRESS(_a)
  1967. +#else
  1968. +#define APUS_PROGRESS(_a)            \
  1969. +    lis    r3,0xfff0;            \
  1970. +    ori    r3,r3,0xeff0;            \
  1971. +    lis    r4,0x1234;            \
  1972. +    ori    r4,r4,(_a);            \
  1973. +    stw    r4,0x0(r3);            \
  1974. +    dcbf    0,r3;                \
  1975. +    sync;                    \
  1976. +    isync
  1977. +#endif
  1978.  /* optimization for 603 to load the tlb directly from the linux table */
  1979.  #define NO_RELOAD_HTAB 1
  1980.      
  1981. @@ -103,27 +116,27 @@
  1982.      lwz    RB,offset+4(reg);    \
  1983.      mtspr    IBAT##n##U,RA;    \
  1984.      mtspr    IBAT##n##L,RB;    \
  1985. -    beq    1f;        \
  1986. +    beq    0f;        \
  1987.      lwz    RA,offset+8(reg);    \
  1988.      lwz    RB,offset+12(reg);    \
  1989.      mtspr    DBAT##n##U,RA;    \
  1990.      mtspr    DBAT##n##L,RB;    \
  1991. -1:     
  1992. +0:     
  1993. +
  1994. +#define tophys(rd,rs)                \
  1995. +0:    addis    rd,rs,-KERNELBASE@h;        \
  1996. +    .section ".vtop_fixup","aw";        \
  1997. +    .align  1;                \
  1998. +    .long   0b;                \
  1999. +    .previous
  2000. +
  2001. +#define tovirt(rd,rs)                \
  2002. +0:    addis    rd,rs,KERNELBASE@h;        \
  2003. +    .section ".ptov_fixup","aw";        \
  2004. +    .align  1;                \
  2005. +    .long   0b;                \
  2006. +    .previous
  2007.  
  2008. -#ifndef CONFIG_APUS
  2009. -#define tophys(rd,rs,rt)    addis    rd,rs,-KERNELBASE@h
  2010. -#define tovirt(rd,rs,rt)    addis    rd,rs,KERNELBASE@h
  2011. -#else
  2012. -#define tophys(rd,rs,rt)     \
  2013. -    lis    rt,CYBERBASEp@h; \
  2014. -    lwz    rt,0(rt);     \
  2015. -    add    rd,rs,rt
  2016. -#define tovirt(rd,rs,rt)     \
  2017. -    lis    rt,CYBERBASEp@h; \
  2018. -    lwz    rt,0(rt);     \
  2019. -    sub    rd,rs,rt
  2020. -#endif
  2021. -    
  2022.      .text
  2023.      .globl    _stext
  2024.  _stext:
  2025. @@ -154,6 +167,7 @@
  2026.   *
  2027.   * APUS
  2028.   *   r3: 'APUS'
  2029. + *   r4: physical address of memory base
  2030.   *   Linux/m68k style BootInfo structure at &_end.
  2031.   *
  2032.   * PREP
  2033. @@ -221,6 +235,16 @@
  2034.      bl    prom_init
  2035.      .globl    __secondary_start
  2036.  __secondary_start:
  2037. +/* On APUS the __va/__pa constants need to be set to the correct 
  2038. + * values before continuing. 
  2039. + */
  2040. +    lis    r3,0x6170
  2041. +    ori    r3,r3,0x7573
  2042. +    cmpw    4,r3,r31        /* cr4.eq is true if this is APUS */
  2043. +    bne    4,1f
  2044. +    mr    r4,r30
  2045. +    bl    fix_mem_constants
  2046. +1:
  2047.  /*
  2048.   * Use the first pair of BAT registers to map the 1st 16MB
  2049.   * of RAM to KERNELBASE.  From this point on we can't safely
  2050. @@ -241,16 +265,17 @@
  2051.      mtspr    IBAT1L,r10
  2052.      b    5f
  2053.  4:
  2054. -#ifdef CONFIG_APUS
  2055. -    ori    r11,r11,BL_8M<<2|0x2    /* set up an 8MB mapping */
  2056. -    ori    r11,r11,0xfe        /* set up an 8MB mapping */
  2057. -    lis    r8,CYBERBASEp@h
  2058. -    lwz    r8,0(r8)
  2059. -    addis    r8,r8,KERNELBASE@h
  2060. -    addi    r8,r8,2
  2061. -#else
  2062. +    tophys(r8,r11)                  /* phys memory base */
  2063. +    ori    r8,r8,2            /* R/W access */
  2064. +    beq    4,1f                    /* only set up 8MB on APUS */
  2065.      ori    r11,r11,BL_256M<<2|0x2    /* set up BAT registers for 604 */
  2066. -    li    r8,2            /* R/W access */
  2067. +1:    ori    r11,r11,BL_8M<<2|0x2    /* set up 8MB BAT registers for 604 */
  2068. +    mtspr    DBAT0L,r8        /* N.B. 6xx (not 601) have valid */
  2069. +    mtspr    DBAT0U,r11        /* bit in upper BAT register */
  2070. +    mtspr    IBAT0L,r8
  2071. +    mtspr    IBAT0U,r11
  2072. +
  2073. +#ifndef CONFIG_APUS                /* out of space! :( */
  2074.      /* 
  2075.       * allow secondary cpus to get at all of ram in early bootup
  2076.       * since their init_task may be up there -- Cort
  2077. @@ -269,33 +294,8 @@
  2078.      mtspr    IBAT2L,r28
  2079.      mtspr    IBAT2U,r21
  2080.  #endif
  2081. -    mtspr    DBAT0L,r8        /* N.B. 6xx (not 601) have valid */
  2082. -    mtspr    DBAT0U,r11        /* bit in upper BAT register */
  2083. -    mtspr    IBAT0L,r8
  2084. -    mtspr    IBAT0U,r11
  2085.  5:    isync
  2086.  
  2087. -#ifdef CONFIG_APUS
  2088. -    /* Unfortunately the APUS specific instructions bloat the
  2089. -     * code so it cannot fit in the 0x100 bytes available. We have
  2090. -     * to do it the crude way. */
  2091. -
  2092. -    /* Map 0xfff00000 so we can access VTOP/PTOV constant when
  2093. -       MMU is enabled. */
  2094. -    lis    r8,0xfff0
  2095. -    ori    r11,r8,0x2        /* r/w */
  2096. -    ori    r8,r8,0x2        /* 128KB, supervisor */
  2097. -    mtspr    DBAT3U,r8
  2098. -    mtspr    DBAT3L,r11
  2099. -    
  2100. -    /* Copy exception code to exception vector base. */
  2101. -    lis    r3,KERNELBASE@h
  2102. -    tophys(r4,r3,r5)
  2103. -    lis    r3,0xfff0        /* Copy to 0xfff00000 on APUS */
  2104. -    li    r5,0x4000        /* # bytes of memory to copy */
  2105. -    li    r6,0
  2106. -    bl    copy_and_flush        /* copy the first 0x4000 bytes */
  2107. -#else /* CONFIG_APUS */
  2108.  /*
  2109.   * We need to run with _start at physical address 0.
  2110.   * On CHRP, we are loaded at 0x10000 since OF on CHRP uses
  2111. @@ -304,6 +304,7 @@
  2112.   * If the MMU is already turned on, we copy stuff to KERNELBASE,
  2113.   * otherwise we copy it to 0.
  2114.   */
  2115. +    beq    4,2f                    /* skip this on APUS */
  2116.      bl    reloc_offset
  2117.      mr    r26,r3
  2118.      addis    r4,r3,KERNELBASE@h    /* current address of _start */
  2119. @@ -317,7 +318,7 @@
  2120.      cmpw    0,r4,r3            /* already running at KERNELBASE? */
  2121.      bne    relocate_kernel
  2122.  2:
  2123. -#endif /* CONFIG_APUS */
  2124. +
  2125.  /*
  2126.   * we now have the 1st 16M of ram mapped with the bats.
  2127.   * prep needs the mmu to be turned on here, but pmac already has it on.
  2128. @@ -430,7 +431,7 @@
  2129.      mfspr    r21,SPRG2;        /* exception stack to use from */ \
  2130.      cmpwi    0,r21,0;        /* user mode or RTAS */ \
  2131.      bne    1f;        \
  2132. -    tophys(r21,r1,r21);        /* use tophys(kernel sp) otherwise */ \
  2133. +    tophys(r21,r1);            /* use tophys(kernel sp) otherwise */ \
  2134.      subi    r21,r21,INT_FRAME_SIZE+STACK_UNDERHEAD;    /* alloc exc. frame */\
  2135.  1:    stw    r20,_CCR(r21);        /* save registers */ \
  2136.      stw    r22,GPR22(r21);    \
  2137. @@ -451,7 +452,7 @@
  2138.      stw    r1,GPR1(r21);    \
  2139.      stw    r2,GPR2(r21);    \
  2140.      stw    r1,0(r21);    \
  2141. -    tovirt(r1,r21,r1);        /* set new kernel sp */    \
  2142. +    tovirt(r1,r21);            /* set new kernel sp */    \
  2143.      SAVE_4GPRS(3, r21);
  2144.  /*
  2145.   * Note: code which follows this uses cr0.eq (set if from kernel),
  2146. @@ -535,44 +536,18 @@
  2147.      .long    int_return
  2148.  
  2149.  /* External interrupt */
  2150. -    . = 0x500;
  2151. +    . = 0x500
  2152.  HardwareInterrupt:
  2153.      EXCEPTION_PROLOG;
  2154. -#ifdef CONFIG_APUS
  2155. -    /* This is horrible, but there's no way around it. Enable the
  2156. -    data cache so the IRQ hardware register can be accessed
  2157. -    without cache intervention. Then disable interrupts and get
  2158. -    the current emulated m68k IPL value. */
  2159. -    
  2160. -    mfmsr    20
  2161. -    xori    r20,r20,MSR_DR
  2162. -    sync
  2163. -    mtmsr    r20
  2164. -    sync
  2165.  
  2166. -    lis    r3,APUS_IPL_EMU@h
  2167. -
  2168. -    li    r20,(IPLEMU_SETRESET|IPLEMU_DISABLEINT)
  2169. -    stb    r20,APUS_IPL_EMU@l(r3)
  2170. -    eieio
  2171. -
  2172. -    lbz    r3,APUS_IPL_EMU@l(r3)
  2173. -
  2174. -    mfmsr    r20
  2175. -    xori    r20,r20,MSR_DR
  2176. -    sync
  2177. -    mtmsr    r20
  2178. -    sync
  2179. -
  2180. -    stw    r3,(_CCR+4)(r21);
  2181. -#endif
  2182.      addi    r3,r1,STACK_FRAME_OVERHEAD
  2183.      li    r20,MSR_KERNEL
  2184. -    li    r4,0
  2185. -    bl    transfer_to_handler
  2186. -    .long    do_IRQ;
  2187. +apusIRQ:    
  2188. +    bl    transfer_to_handler         /* On APUS these three words */
  2189. +    .long    do_IRQ                      /* will be replaced with NOPs */
  2190.      .long    int_return
  2191. -    
  2192. +
  2193. +    bl    apus_interrupt_entry
  2194.  
  2195.  /* Alignment exception */
  2196.      . = 0x600
  2197. @@ -655,13 +630,13 @@
  2198.      /* Get PTE (linux-style) and check access */
  2199.      mfspr    r2,SPRG3
  2200.      lwz    r2,PG_TABLES(r2)
  2201. -    tophys(r2,r2,r3)
  2202. +    tophys(r2,r2)
  2203.      mfspr    r3,IMISS
  2204.      rlwimi    r2,r3,12,20,29        /* insert top 10 bits of address */
  2205.      lwz    r2,0(r2)        /* get pmd entry */
  2206.      rlwinm.    r2,r2,0,0,19        /* extract address of pte page */
  2207.      beq-    InstructionAddressInvalid    /* return if no mapping */
  2208. -    tophys(r2,r2,r1)
  2209. +    tophys(r2,r2)
  2210.      rlwimi    r2,r3,22,20,29        /* insert next 10 bits of address */
  2211.      lwz    r1,0(r2)        /* get linux-style pte */
  2212.      /* setup access flags in r3 */
  2213. @@ -758,13 +733,13 @@
  2214.      /* Get PTE (linux-style) and check access */
  2215.      mfspr    r2,SPRG3
  2216.      lwz    r2,PG_TABLES(r2)        
  2217. -    tophys(r2,r2,r3)
  2218. +    tophys(r2,r2)
  2219.      mfspr    r3,DMISS
  2220.      rlwimi    r2,r3,12,20,29        /* insert top 10 bits of address */
  2221.      lwz    r2,0(r2)        /* get pmd entry */
  2222.      rlwinm.    r2,r2,0,0,19        /* extract address of pte page */
  2223.      beq-    DataAddressInvalid    /* return if no mapping */
  2224. -    tophys(r2,r2,r1)
  2225. +    tophys(r2,r2)
  2226.      rlwimi    r2,r3,22,20,29        /* insert next 10 bits of address */
  2227.      lwz    r1,0(r2)        /* get linux-style pte */
  2228.      /* setup access flags in r3 */
  2229. @@ -865,7 +840,7 @@
  2230.      /* We have a pte table, so load the MI_TWC with the attributes
  2231.       * for this page, which has only bit 31 set.
  2232.       */
  2233. -    tophys(r21,r21,0)
  2234. +    tophys(r21,r21)
  2235.      ori    r21,r21,1        /* Set valid bit */
  2236.      mtspr    MI_TWC, r21    /* Set page attributes */
  2237.      mtspr    MD_TWC, r21    /* Load pte table base address */
  2238. @@ -920,13 +895,13 @@
  2239.      /* Get PTE (linux-style) and check access */
  2240.      mfspr    r2,SPRG3
  2241.      lwz    r2,PG_TABLES(r2)        
  2242. -    tophys(r2,r2,r3)
  2243. +    tophys(r2,r2)
  2244.      mfspr    r3,DMISS
  2245.      rlwimi    r2,r3,12,20,29        /* insert top 10 bits of address */
  2246.      lwz    r2,0(r2)        /* get pmd entry */
  2247.      rlwinm.    r2,r2,0,0,19        /* extract address of pte page */
  2248.      beq-    DataAddressInvalid    /* return if no mapping */
  2249. -    tophys(r2,r2,r1)
  2250. +    tophys(r2,r2)
  2251.      rlwimi    r2,r3,22,20,29        /* insert next 10 bits of address */
  2252.      lwz    r1,0(r2)        /* get linux-style pte */
  2253.      /* setup access flags in r3 */
  2254. @@ -988,7 +963,7 @@
  2255.  
  2256.      /* We have a pte table, so load fetch the pte from the table.
  2257.       */
  2258. -    tophys(r21, r21, 0)
  2259. +    tophys(r21, r21)
  2260.      ori    r21, r21, 1    /* Set valid bit in physical L2 page */
  2261.      mtspr    MD_TWC, r21    /* Load pte table base address */
  2262.      mfspr    r21, MD_TWC    /* ....and get the pte address */
  2263. @@ -1072,7 +1047,7 @@
  2264.  
  2265.      /* We have a pte table, so fetch the pte from the table.
  2266.       */
  2267. -    tophys(r21, r21, 0)
  2268. +    tophys(r21, r21)
  2269.      ori    r21, r21, 1        /* Set valid bit in physical L2 page */
  2270.      mtspr    MD_TWC, r21        /* Load pte table base address */
  2271.      mfspr    r21, MD_TWC        /* ....and get the pte address */
  2272. @@ -1178,7 +1153,7 @@
  2273.      addi    r24,r1,STACK_FRAME_OVERHEAD
  2274.      stw    r24,PT_REGS(r23)
  2275.  2:    addi    r2,r23,-TSS        /* set r2 to current */
  2276. -    tovirt(r2,r2,r23)
  2277. +    tovirt(r2,r2)
  2278.      mflr    r23
  2279.      andi.    r24,r23,0x3f00        /* get vector offset */
  2280.      stw    r24,TRAP(r21)
  2281. @@ -1246,7 +1221,7 @@
  2282.      eieio
  2283.      lis    r2,hash_table_lock@h
  2284.      ori    r2,r2,hash_table_lock@l
  2285. -    tophys(r2,r2,r6)
  2286. +    tophys(r2,r2)
  2287.      lis    r6,100000000@h
  2288.      mtctr    r6
  2289.      lwz    r0,PROCESSOR-TSS(r5)
  2290. @@ -1263,7 +1238,7 @@
  2291.  #endif
  2292.      /* Get PTE (linux-style) and check access */
  2293.      lwz    r5,PG_TABLES(r5)        
  2294. -    tophys(r5,r5,r2)        /* convert to phys addr */
  2295. +    tophys(r5,r5)            /* convert to phys addr */
  2296.      rlwimi    r5,r3,12,20,29        /* insert top 10 bits of address */
  2297.      lwz    r5,0(r5)        /* get pmd entry */
  2298.      rlwinm.    r5,r5,0,0,19        /* extract address of pte page */
  2299. @@ -1276,7 +1251,7 @@
  2300.         to the address following the rfi. */
  2301.      beqlr-
  2302.  #endif
  2303. -    tophys(r2,r5,r2)
  2304. +    tophys(r2,r5)
  2305.      rlwimi    r2,r3,22,20,29        /* insert next 10 bits of address */
  2306.      lwz    r6,0(r2)        /* get linux-style pte */
  2307.      ori    r4,r4,1            /* set _PAGE_PRESENT bit in access */
  2308. @@ -1384,7 +1359,7 @@
  2309.      /* update counter of evicted pages */
  2310.      lis    r2,htab_evicts@h
  2311.      ori    r2,r2,htab_evicts@l
  2312. -    tophys(r2,r2,r4)
  2313. +    tophys(r2,r2)
  2314.      lwz    r4,0(r2)
  2315.      addi    r4,r4,1
  2316.      stw    r4,0(r2)
  2317. @@ -1439,14 +1414,14 @@
  2318.   */
  2319.      lis    r2,htab_reloads@h
  2320.      ori    r2,r2,htab_reloads@l
  2321. -    tophys(r2,r2,r3)
  2322. +    tophys(r2,r2)
  2323.      lwz    r3,0(r2)
  2324.      addi    r3,r3,1
  2325.      stw    r3,0(r2)
  2326.  
  2327.  #ifdef __SMP__
  2328.      lis    r2,hash_table_lock@ha
  2329. -    tophys(r2,r2,r6)
  2330. +    tophys(r2,r2)
  2331.      li    r0,0
  2332.      stw    r0,hash_table_lock@l(r2)
  2333.      eieio
  2334. @@ -1473,7 +1448,7 @@
  2335.  #ifdef __SMP__
  2336.  hash_page_out:
  2337.      lis    r2,hash_table_lock@ha
  2338. -    tophys(r2,r2,r6)
  2339. +    tophys(r2,r2)
  2340.      li    r0,0
  2341.      stw    r0,hash_table_lock@l(r2)
  2342.      eieio
  2343. @@ -1506,12 +1481,8 @@
  2344.   * to another.  Instead we call giveup_fpu in switch_to.
  2345.   */
  2346.  #ifndef __SMP__
  2347. -#ifndef CONFIG_APUS
  2348. -    lis    r6,-KERNELBASE@h
  2349. -#else
  2350. -    lis    r6,CYBERBASEp@h
  2351. -    lwz    r6,0(r6)
  2352. -#endif
  2353. +    lis    r6,0                    /* get __pa constant */
  2354. +    tophys(r6,r6)
  2355.      addis    r3,r6,last_task_used_math@ha
  2356.      lwz    r4,last_task_used_math@l(r3)
  2357.      cmpi    0,r4,0
  2358. @@ -1662,14 +1633,164 @@
  2359.      addi    r6,r6,4
  2360.      blr
  2361.  
  2362. -#ifdef CONFIG_APUS
  2363. -    /* On APUS the first 0x4000 bytes of the kernel    will be mapped
  2364. -     * at a different physical address than the rest. For this
  2365. -     * reason, the exception code cannot use relative branches to
  2366. -     * access the code below.
  2367. +/*
  2368. + * On APUS the physical base address of the kernel is not known at compile
  2369. + * time, which means the __pa/__va constants used are incorect. In the
  2370. + * __init section is recorded the virtual addresses of instructions using
  2371. + * these constants, so all that has to be done is fix these before
  2372. + * continuing the kernel boot.
  2373. + *
  2374. + * r4 = The physical address of the kernel base.
  2375. + */
  2376. +fix_mem_constants:
  2377. +    mr    r10,r4
  2378. +    addis    r10,r10,-KERNELBASE@h    /* virt_to_phys constant */
  2379. +    neg    r11,r10                     /* phys_to_virt constant */
  2380. +
  2381. +     APUS_PROGRESS(2)
  2382. +
  2383. +    lis    r12,__vtop_table_begin@h
  2384. +    ori    r12,r12,__vtop_table_begin@l
  2385. +    add    r12,r12,r10             /* table begin phys address */
  2386. +    lis    r13,__vtop_table_end@h
  2387. +    ori    r13,r13,__vtop_table_end@l
  2388. +    add    r13,r13,r10             /* table end phys address */
  2389. +    subi    r12,r12,4
  2390. +    subi    r13,r13,4
  2391. +1:    lwzu    r14,4(r12)               /* virt address of instruction */
  2392. +    add     r14,r14,r10              /* phys address of instruction */
  2393. +    lwz     r15,0(r14)               /* instruction, now insert top */
  2394. +    rlwimi  r15,r10,16,16,31         /* half of vp const in low half */
  2395. +    stw    r15,0(r14)               /* of instruction and restore. */
  2396. +    dcbst    r0,r14             /* write it to memory */
  2397. +    sync
  2398. +    icbi    r0,r14             /* flush the icache line */
  2399. +    cmpw    r12,r13
  2400. +    bne     1b
  2401. +
  2402. +     APUS_PROGRESS(3)
  2403. +
  2404. +    lis    r12,__ptov_table_begin@h
  2405. +    ori    r12,r12,__ptov_table_begin@l
  2406. +    add    r12,r12,r10             /* table begin phys address */
  2407. +    lis    r13,__ptov_table_end@h
  2408. +    ori    r13,r13,__ptov_table_end@l
  2409. +    add    r13,r13,r10             /* table end phys address */
  2410. +    subi    r12,r12,4
  2411. +    subi    r13,r13,4
  2412. +1:    lwzu    r14,4(r12)               /* virt address of instruction */
  2413. +    add     r14,r14,r10              /* phys address of instruction */
  2414. +    lwz     r15,0(r14)               /* instruction, now insert top */
  2415. +    rlwimi  r15,r11,16,16,31         /* half of pv const in low half*/
  2416. +    stw    r15,0(r14)               /* of instruction and restore. */
  2417. +    dcbst    r0,r14             /* write it to memory */
  2418. +    sync
  2419. +    icbi    r0,r14             /* flush the icache line */
  2420. +    cmpw    r12,r13
  2421. +    bne     1b
  2422. +
  2423. +     APUS_PROGRESS(4)
  2424. +    /*
  2425. +     * Let Hardware Interrupts fall through to APUS specific 
  2426. +     * handling.
  2427.       */
  2428. -    . = 0x4000
  2429. +    lis    r12,apusIRQ@h
  2430. +    ori    r12,r12,apusIRQ@l
  2431. +    add    r12,r12,r10              /* phys address of instructions */
  2432. +    lis     r8,0x38600000@h
  2433. +    ori     r8,r8,0x38600000@l
  2434. +    stw    r8,0(r12)
  2435. +    stwu    r8,4(r12)
  2436. +    stwu    r8,4(r12)
  2437. +    dcbst    r0,r12             /* write it to memory */
  2438. +    sync
  2439. +    icbi    r0,r12             /* flush the icache line */
  2440. +    subi    r12,r12,8
  2441. +    dcbst    r0,r12             /* write it to memory */
  2442. +    sync
  2443. +    icbi    r0,r12             /* flush the icache line */
  2444. +
  2445. +     APUS_PROGRESS(5)
  2446. +    
  2447. +    /*
  2448. +     * Map the memory where the exception handlers will
  2449. +       * be copied to when hash constants have been patched.  
  2450. +     */
  2451. +#ifdef CONFIG_APUS_FAST_EXCEPT
  2452. +    lis    r8,0xfff0
  2453. +#else
  2454. +    lis    r8,0
  2455.  #endif
  2456. +    ori    r8,r8,0x2        /* 128KB, supervisor */
  2457. +    mtspr    DBAT3U,r8
  2458. +    mtspr    DBAT3L,r8
  2459. +
  2460. +
  2461. +     APUS_PROGRESS(6)
  2462. +    isync                /* No speculative loading until now */
  2463. +    blr
  2464. +    
  2465. +apus_interrupt_entry:
  2466. +    /* This is horrible, but there's no way around it. Enable the
  2467. +     * data cache so the IRQ hardware register can be accessed
  2468. +     * without cache intervention. Then disable interrupts and get
  2469. +     * the current emulated m68k IPL value. 
  2470. +     */
  2471. +    
  2472. +    mfmsr    20
  2473. +    xori    r20,r20,MSR_DR
  2474. +    sync
  2475. +    mtmsr    r20
  2476. +    sync
  2477. +
  2478. +    lis    r4,APUS_IPL_EMU@h
  2479. +
  2480. +    li    r20,(IPLEMU_SETRESET|IPLEMU_DISABLEINT)
  2481. +    stb    r20,APUS_IPL_EMU@l(r4)
  2482. +    eieio
  2483. +
  2484. +    lbz    r3,APUS_IPL_EMU@l(r4)
  2485. +
  2486. +    li    r2,IPLEMU_IPLMASK
  2487. +    rlwinm. r20,r3,32-3,29,31
  2488. +    bne    2f
  2489. +    mr    r20,r2        /* lvl7! Need to reset state machine. */
  2490. +    b    3f
  2491. +2:    cmp    0,r20,r2
  2492. +    beq    1f
  2493. +3:    eieio
  2494. +    stb     r2,APUS_IPL_EMU@l(r4)
  2495. +    ori    r20,r20,IPLEMU_SETRESET
  2496. +    eieio
  2497. +    stb     r20,APUS_IPL_EMU@l(r4)
  2498. +1:    eieio
  2499. +    li    r20,IPLEMU_DISABLEINT
  2500. +    stb    r20,APUS_IPL_EMU@l(r4)
  2501. +
  2502. +    /* At this point we could do some magic to avoid the overhead
  2503. +     * of calling the C interrupt handler. Could not get a simple
  2504. +     * hack to work though.
  2505. +     */
  2506. +    
  2507. +    mfmsr    r20
  2508. +    xori    r20,r20,MSR_DR
  2509. +    sync
  2510. +    mtmsr    r20
  2511. +    sync
  2512. +
  2513. +    stw    r3,(_CCR+4)(r21);
  2514. +
  2515. +    addi    r3,r1,STACK_FRAME_OVERHEAD;
  2516. +    li    r20,MSR_KERNEL;
  2517. +    bl    transfer_to_handler;
  2518. +    .long    do_IRQ;
  2519. +    .long    int_return
  2520. +    
  2521. +/***********************************************************************
  2522. + *  Please note that on APUS the exception handlers are located at the
  2523. + *  physical address 0xfff0000. For this reason, the exception handlers
  2524. + *  cannot use relative branches to access the code below.
  2525. + ***********************************************************************/
  2526.  
  2527.  #ifdef CONFIG_SMP
  2528.      .globl    __secondary_start_psurge
  2529. @@ -1694,7 +1815,7 @@
  2530.      /* our cpu # was at addr 0 - go */
  2531.      lis    r5,__secondary_start@h
  2532.      ori    r5,r5,__secondary_start@l
  2533. -    tophys(r5,r5,r4)
  2534. +    tophys(r5,r5)
  2535.      mtlr    r5
  2536.      mr    r24,r3            /* cpu # */
  2537.      blr
  2538. @@ -1705,6 +1826,7 @@
  2539.   */
  2540.  start_here:
  2541.  #ifndef CONFIG_8xx
  2542. +     APUS_PROGRESS(7)
  2543.      /*
  2544.       * Enable caches and 604-specific features if necessary.
  2545.       */
  2546. @@ -1783,6 +1905,7 @@
  2547.  /*
  2548.   * Decide what sort of machine this is and initialize the MMU.
  2549.   */
  2550. +     APUS_PROGRESS(8)
  2551.      mr    r3,r31
  2552.      mr    r4,r30
  2553.      mr    r5,r29
  2554. @@ -1790,6 +1913,23 @@
  2555.      mr    r7,r27
  2556.      bl    identify_machine
  2557.      bl    MMU_init
  2558. +     APUS_PROGRESS(9)
  2559. +
  2560. +    /* Copy exception code to exception vector base on APUS. */
  2561. +    bne    4,1f
  2562. +    lis    r4,KERNELBASE@h
  2563. +#ifdef CONFIG_APUS_FAST_EXCEPT
  2564. +    lis    r3,0xfff0        /* Copy to 0xfff00000 */
  2565. +#else
  2566. +    lis    r3,0            /* Copy to 0x00000000 */
  2567. +#endif
  2568. +    li    r5,0x4000        /* # bytes of memory to copy */
  2569. +    li    r6,0
  2570. +    bl    copy_and_flush        /* copy the first 0x4000 bytes */
  2571. +1:
  2572. +
  2573. +     APUS_PROGRESS(10)
  2574. +
  2575.  /*
  2576.   * Go back to running unmapped so we can load up new values
  2577.   * for SDR1 (hash table pointer) and the segment registers
  2578. @@ -1806,13 +1946,13 @@
  2579.       * easier......until someone changes init's static structures.
  2580.       */
  2581.      lis    r6, swapper_pg_dir@h
  2582. -    tophys(r6,r6,0)
  2583. +    tophys(r6,r6)
  2584.      ori    r6, r6, swapper_pg_dir@l
  2585.      mtspr    M_TWB, r6
  2586.  #endif
  2587.      lis    r4,2f@h
  2588.      ori    r4,r4,2f@l
  2589. -    tophys(r4,r4,r3)
  2590. +    tophys(r4,r4)
  2591.      li    r3,MSR_KERNEL & ~(MSR_IR|MSR_DR)
  2592.      mtspr    SRR0,r4
  2593.      mtspr    SRR1,r3
  2594. @@ -1843,7 +1983,7 @@
  2595.      cmpwi    r3,1
  2596.      lis    r3,BATS@ha
  2597.      addi    r3,r3,BATS@l
  2598. -    tophys(r3,r3,r4)
  2599. +    tophys(r3,r3)
  2600.      LOAD_BAT(0,0,r3,r4,r5)
  2601.      LOAD_BAT(1,16,r3,r4,r5)
  2602.      LOAD_BAT(2,32,r3,r4,r5)
  2603. @@ -1851,12 +1991,13 @@
  2604.  #endif /* CONFIG_8xx */
  2605.  /* Set up for using our exception vectors */
  2606.      /* ptr to phys current tss */
  2607. -    tophys(r4,r2,r4)
  2608. +    tophys(r4,r2)
  2609.      addi    r4,r4,TSS    /* init task's TSS */
  2610.      mtspr    SPRG3,r4
  2611.      li    r3,0
  2612.      mtspr    SPRG2,r3    /* 0 => r1 has kernel sp */
  2613.  /* Now turn on the MMU for real! */
  2614. +     APUS_PROGRESS(12)
  2615.      li    r4,MSR_KERNEL
  2616.      lis    r3,start_kernel@h
  2617.      ori    r3,r3,start_kernel@l
  2618. @@ -1866,7 +2007,7 @@
  2619.       */
  2620.      lis    r5,first_cpu_booted@h
  2621.      ori    r5,r5,first_cpu_booted@l
  2622. -    tophys(r5,r5,r3)
  2623. +    tophys(r5,r5)
  2624.      lwz    r5,0(r5)
  2625.      cmpi    0,r5,0
  2626.      beq    10f
  2627. @@ -2066,7 +2207,7 @@
  2628.      stw    r0,TRAP(r1)
  2629.      stw    r1,KSP(r3)    /* Set old stack pointer */
  2630.      sync
  2631. -    tophys(r0,r4,r3)
  2632. +    tophys(r0,r4)
  2633.      mtspr    SPRG3,r0    /* Update current TSS phys addr */
  2634.      SYNC
  2635.      lwz    r1,KSP(r4)    /* Load new stack pointer */
  2636. @@ -2102,7 +2243,7 @@
  2637.      beq+    10f        /* if not, don't adjust kernel stack */
  2638.  8:    addi    r4,r1,INT_FRAME_SIZE+STACK_UNDERHEAD    /* size of frame */
  2639.      stw    r4,TSS+KSP(r2)    /* save kernel stack pointer */
  2640. -    tophys(r9,r1,r9)
  2641. +    tophys(r9,r1)
  2642.      mtspr    SPRG2,r9    /* phys exception stack pointer */
  2643.  10:    lwz    r2,_CTR(r1)
  2644.      lwz    r0,_LINK(r1)
  2645. @@ -2139,7 +2280,7 @@
  2646.  ret_from_syscall:    
  2647.      .globl    int_return
  2648.  int_return:
  2649. -0:    mfmsr    r30        /* Disable interrupts */
  2650. +00:    mfmsr    r30        /* Disable interrupts */
  2651.      li    r4,0
  2652.      ori    r4,r4,MSR_EE
  2653.      andc    r30,r30,r4
  2654. @@ -2177,7 +2318,7 @@
  2655.      cmpi    0,r3,0        /* check need_resched flag */
  2656.      beq+    7f
  2657.      bl    schedule
  2658. -    b    0b
  2659. +    b    00b
  2660.  7:    lwz    r5,SIGPENDING(r2) /* Check for pending unblocked signals */
  2661.      cmpwi    0,r5,0
  2662.      beq+    8f
  2663. @@ -2186,10 +2327,10 @@
  2664.      bl    do_signal
  2665.      .globl    do_signal_ret
  2666.  do_signal_ret:
  2667. -    b    0b
  2668. +    b    00b
  2669.  8:    addi    r4,r1,INT_FRAME_SIZE+STACK_UNDERHEAD    /* size of frame */
  2670.      stw    r4,TSS+KSP(r2)    /* save kernel stack pointer */
  2671. -    tophys(r3,r1,r3)
  2672. +    tophys(r3,r1)
  2673.      mtspr    SPRG2,r3    /* phys exception stack pointer */
  2674.  10:    lwz    r2,_CTR(r1)
  2675.      lwz    r0,_LINK(r1)
  2676. @@ -2339,14 +2480,14 @@
  2677.      li    r4,4096/CACHE_LINE_SIZE    /* Number of lines in a page */
  2678.      mtctr    r4
  2679.      mr    r6,r3
  2680. -0:    dcbst    0,r3            /* Write line to ram */
  2681. +00:    dcbst    0,r3            /* Write line to ram */
  2682.      addi    r3,r3,CACHE_LINE_SIZE
  2683. -    bdnz    0b
  2684. +    bdnz    00b
  2685.      sync
  2686.      mtctr    r4
  2687. -1:    icbi    0,r6
  2688. +10:    icbi    0,r6
  2689.      addi    r6,r6,CACHE_LINE_SIZE
  2690. -    bdnz    1b
  2691. +    bdnz    10b
  2692.      sync
  2693.      isync
  2694.      blr
  2695. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/irq.c ./arch/ppc/kernel/irq.c
  2696. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/irq.c    Tue May 11 11:26:17 1999
  2697. +++ ./arch/ppc/kernel/irq.c    Sun May 16 20:05:36 1999
  2698. @@ -61,6 +61,13 @@
  2699.  
  2700.  #include "local_irq.h"
  2701.  
  2702. +extern int  apus_request_irq(unsigned int irq, 
  2703. +                            void (*handler)(int, void *, struct pt_regs *),
  2704. +                            unsigned long flags, const char *devname, 
  2705. +                            void *dev_id);
  2706. +extern void apus_free_irq(unsigned int irq, void *dev_id);
  2707. +extern void apus_process_int(unsigned long, void *);
  2708. +
  2709.  extern volatile unsigned long ipi_count;
  2710.  void enable_irq(unsigned int irq_nr);
  2711.  void disable_irq(unsigned int irq_nr);
  2712. @@ -68,14 +75,6 @@
  2713.  /* Fixme - Need to figure out a way to get rid of this - Corey */
  2714.  volatile unsigned char *chrp_int_ack_special;
  2715.  
  2716. -#ifdef CONFIG_APUS
  2717. -/* Rename a few functions. Requires the CONFIG_APUS protection. */
  2718. -#define request_irq nop_ppc_request_irq
  2719. -#define free_irq nop_ppc_free_irq
  2720. -#define get_irq_list nop_get_irq_list
  2721. -#define VEC_SPUR    (24)
  2722. -#endif
  2723. -
  2724.  #define MAXCOUNT 10000000
  2725.  
  2726.  #define NR_MASK_WORDS    ((NR_IRQS + 31) / 32)
  2727. @@ -133,6 +132,10 @@
  2728.      struct irqaction *old, **p, *action;
  2729.      unsigned long flags;
  2730.  
  2731. +    if (is_apus)
  2732. +        return apus_request_irq (irq, handler, irqflags, 
  2733. +                     devname, dev_id);
  2734. +
  2735.      if (irq >= NR_IRQS)
  2736.          return -EINVAL;
  2737.      if (!handler)
  2738. @@ -187,7 +190,10 @@
  2739.  
  2740.  void free_irq(unsigned int irq, void *dev_id)
  2741.  {
  2742. -    request_irq(irq, NULL, 0, NULL, dev_id);
  2743. +    if (is_apus)
  2744. +        apus_free_irq (irq, dev_id);
  2745. +    else
  2746. +        request_irq(irq, NULL, 0, NULL, dev_id);
  2747.  }
  2748.  
  2749.  void disable_irq(unsigned int irq_nr)
  2750. @@ -205,6 +211,9 @@
  2751.  {
  2752.      int i, len = 0, j;
  2753.      struct irqaction * action;
  2754. +
  2755. +    if (_MACH_apus == _machine)
  2756. +        return apus_get_irq_list (buf);
  2757.  
  2758.      len += sprintf(buf+len, "           ");
  2759.      for (j=0; j<smp_num_cpus; j++)
  2760. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/misc.S ./arch/ppc/kernel/misc.S
  2761. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/misc.S    Tue May 11 11:26:19 1999
  2762. +++ ./arch/ppc/kernel/misc.S    Sat May 15 11:35:12 1999
  2763. @@ -243,10 +242,8 @@
  2764.      subi    r5,r5,1        /* Perform 'add' operation */
  2765.      stwcx.    r5,0,r3        /* Update with new value */
  2766.      bne-    10b        /* Retry if "reservation" (i.e. lock) lost */
  2767. -    cmpi    0,r5,0        /* Return 'true' IFF 0 */
  2768. -    li    r3,1
  2769. -    beqlr
  2770. -    li    r3,0
  2771. +    cntlzw    r3,r5        /* Return 'true' IFF 0 */
  2772. +    srwi    r3,r3,5        /* But do it the clever way */
  2773.      blr
  2774.  _GLOBAL(atomic_clear_mask)
  2775.  10:    lwarx    r5,0,r4
  2776. @@ -370,38 +367,59 @@
  2777.      blr    
  2778.  
  2779.  /*
  2780. - * Extended precision shifts
  2781. + * Extended precision shifts.
  2782. + * 
  2783. + * Updated to be valid for shift counts from 0 to 63 inclusive.
  2784. + * -- Gabriel 
  2785.   *
  2786.   * R3/R4 has 64 bit value
  2787.   * R5    has shift count
  2788.   * result in R3/R4
  2789.   *
  2790. - *  ashrdi3:     XXXYYY/ZZZAAA -> SSSXXX/YYYZZZ
  2791. - *  ashldi3:     XXXYYY/ZZZAAA -> YYYZZZ/AAA000
  2792. + *  ashrdi3: arithmetic right shift (sign propagation)     
  2793. + *  lslhdi3: logical right shift    
  2794. + *  ashldi3: left shift
  2795.   */
  2796.  _GLOBAL(__ashrdi3)
  2797. -    li    r6,32
  2798. -    sub    r6,r6,r5
  2799. -    slw    r7,r3,r6    /* isolate YYY */
  2800. -    srw    r4,r4,r5    /* isolate ZZZ */
  2801. -    or    r4,r4,r7    /* YYYZZZ */
  2802. -    sraw    r3,r3,r5    /* SSSXXX */
  2803. +    subfic    r6,r5,32    
  2804. +    srw    r4,r4,r5    # LSW = count > 31 ? 0 : LSW >> count
  2805. +    addi    r7,r5,32    # could be xori, or addi with -32
  2806. +    slw    r6,r3,r6    # t1 = count > 31 ? 0 :    MSW << (32-count)
  2807. +    rlwinm    r8,r7,0,32    # t3 = (count < 32) ? 32 : 0
  2808. +    sraw    r7,r3,r7    # t2 = MSW >> (count-32)
  2809. +    or    r4,r4,r6    # LSW |= t1
  2810. +    slw    r7,r7,r8    # t2 = (count < 32) ? 0 : t2
  2811. +    sraw    r3,r3,r5    # MSW = MSW >> count
  2812. +    or    r4,r4,r7    # LSW |= t2
  2813.      blr
  2814. -    
  2815. +
  2816.  _GLOBAL(__ashldi3)
  2817. -    li    r6,32
  2818. -    sub    r6,r6,r5
  2819. -    srw    r7,r4,r6    /* isolate ZZZ */
  2820. -    slw    r4,r4,r5    /* AAA000 */
  2821. -    slw    r3,r3,r5    /* YYY--- */
  2822. -    or    r3,r3,r7    /* YYYZZZ */
  2823. +    subfic    r6,r5,32    
  2824. +    slw    r3,r3,r5    # MSW = count > 31 ? 0 : MSW << count
  2825. +    addi    r7,r5,32    # could be xori, or addi with -32
  2826. +    srw    r6,r4,r6    # t1 = count > 31 ? 0 :    LSW >> (32-count)
  2827. +    slw    r7,r4,r7    # t2 = count < 32 ? 0 :    LSW << (count-32)
  2828. +    or    r3,r3,r6    # MSW |= t1
  2829. +    slw    r4,r4,r5    # LSW = LSW << count
  2830. +    or    r3,r3,r7    # MSW |= t2
  2831. +    blr
  2832. +
  2833. +_GLOBAL(__lshrdi3)
  2834. +    subfic    r6,r5,32    
  2835. +    srw    r4,r4,r5    # LSW = count > 31 ? 0 : LSW >> count
  2836. +    addi    r7,r5,32    # could be xori, or addi with -32
  2837. +    slw    r6,r3,r6    # t1 = count > 31 ? 0 :    MSW << (32-count)
  2838. +    srw    r7,r3,r7    # t2 = count < 32 ? 0 :    MSW >> (count-32)
  2839. +    or    r4,r4,r6    # LSW |= t1
  2840. +    srw    r3,r3,r5    # MSW = MSW >> count
  2841. +    or    r4,r4,r7    # LSW |= t2 
  2842.      blr
  2843.  
  2844.  _GLOBAL(abs)
  2845. -    cmpi    0,r3,0
  2846. -    bge    10f
  2847. -    neg    r3,r3
  2848. -10:    blr
  2849. +    srawi    r4,r3,31
  2850. +    xor    r3,r3,r4
  2851. +    sub    r3,r3,r4
  2852. +    blr
  2853.  
  2854.  _GLOBAL(_get_SP)
  2855.      mr    r3,r1        /* Close enough */
  2856. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/pci.c ./arch/ppc/kernel/pci.c
  2857. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/pci.c    Tue May 11 11:26:20 1999
  2858. +++ ./arch/ppc/kernel/pci.c    Sat May 15 11:35:12 1999
  2859. @@ -60,6 +60,8 @@
  2860.  
  2861.  int pcibios_present(void)
  2862.  {
  2863. +    if (is_apus)
  2864. +        return 0;
  2865.      return 1;
  2866.  }
  2867.  
  2868. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/pmac_setup.c ./arch/ppc/kernel/pmac_setup.c
  2869. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/pmac_setup.c    Wed May 12 09:56:47 1999
  2870. +++ ./arch/ppc/kernel/pmac_setup.c    Sun May 16 11:13:10 1999
  2871. @@ -54,6 +54,7 @@
  2872.  #include <asm/mediabay.h>
  2873.  #include <asm/feature.h>
  2874.  #include <asm/ide.h>
  2875. +#include <asm/dma.h>
  2876.  #include <asm/machdep.h>
  2877.  
  2878.  #include "time.h"
  2879. @@ -277,7 +278,7 @@
  2880.  
  2881.      feature_init();
  2882.  
  2883. -#ifdef CONFIG_KGDB
  2884. +#if defined(CONFIG_KGDB) && defined(CONFIG_MAC_SERIAL)
  2885.      zs_kgdb_hook(0);
  2886.  #endif
  2887.  
  2888. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/ppc-stub.c ./arch/ppc/kernel/ppc-stub.c
  2889. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/ppc-stub.c    Fri Aug  7 15:53:43 1998
  2890. +++ ./arch/ppc/kernel/ppc-stub.c    Sat Feb 20 16:32:45 1999
  2891. @@ -112,6 +112,32 @@
  2892.  #include <asm/pgtable.h>
  2893.  #include <asm/ptrace.h>
  2894.  
  2895. +#include <asm/io.h>
  2896. +#include <asm/amigahw.h>
  2897. +#include <asm/amigaints.h>
  2898. +
  2899. +extern int amiga_ser_out( unsigned char c );
  2900. +extern unsigned char amiga_ser_in( void );
  2901. +
  2902. +#define getDebugChar amiga_ser_in
  2903. +#define putDebugChar amiga_ser_out
  2904. +
  2905. +void kgdb_interruptible (int stat)
  2906. +{
  2907. +    if (stat) {
  2908. +        custom.intreq = IF_RBF;
  2909. +        mb();
  2910. +        custom.intena = IF_SETCLR | IF_RBF;
  2911. +    } else
  2912. +        custom.intena = IF_RBF;
  2913. +}
  2914. +
  2915. +void kgdb_abort (void)
  2916. +{
  2917. +    breakpoint ();
  2918. +}
  2919. +
  2920. +
  2921.  void breakinst(void);
  2922.  
  2923.  /*
  2924. @@ -181,7 +207,7 @@
  2925.   * return 0.
  2926.   */
  2927.  static unsigned char *
  2928. -mem2hex(char *mem, char *buf, int count)
  2929. +mem2hex(const char *mem, char *buf, int count)
  2930.  {
  2931.      unsigned char ch;
  2932.  
  2933. @@ -343,7 +369,7 @@
  2934.      flush_instruction_cache();
  2935.  }
  2936.  
  2937. -static inline int get_msr()
  2938. +static inline int get_msr(void)
  2939.  {
  2940.      int msr;
  2941.      asm volatile("mfmsr %0" : "=r" (msr):);
  2942. @@ -358,12 +384,23 @@
  2943.  /* Set up exception handlers for tracing and breakpoints
  2944.   * [could be called kgdb_init()]
  2945.   */
  2946. +
  2947. +void kgdb_init(void)
  2948. +{
  2949. +
  2950. +  set_debug_traps();
  2951. +}
  2952. +
  2953. +extern void amiga_serinit(void);
  2954. +
  2955.  void set_debug_traps(void)
  2956.  {
  2957. -#if 0
  2958. +
  2959. +#if 1
  2960.      unsigned char c;
  2961. +    amiga_serinit();
  2962.  
  2963. -    save_and_cli(flags);
  2964. +/*    save_and_cli(flags);*/
  2965.  
  2966.      /* In case GDB is started before us, ack any packets (presumably
  2967.       * "$?#xx") sitting there.
  2968. @@ -373,10 +410,12 @@
  2969.       * now starting either before or after the kernel   -bwb
  2970.       */
  2971.  
  2972. +#if 0
  2973.      while((c = getDebugChar()) != '$');
  2974.      while((c = getDebugChar()) != '#');
  2975.      c = getDebugChar(); /* eat first csum byte */
  2976.      c = getDebugChar(); /* eat second csum byte */
  2977. +#endif
  2978.      putDebugChar('+'); /* ack it */
  2979.  #endif
  2980.      debugger = kgdb;
  2981. @@ -701,4 +740,17 @@
  2982.      asm("    .globl breakinst
  2983.           breakinst: trap
  2984.              ");
  2985. +}
  2986. +
  2987. +void
  2988. +__gdb_output_string (const char* s, unsigned int count)
  2989. +{
  2990. +    char buffer[512];
  2991. +
  2992. +    count = (count <= (sizeof(buffer) / 2 - 2)) 
  2993. +        ? count : (sizeof(buffer) / 2 - 2);
  2994. +
  2995. +    buffer[0] = 'O';
  2996. +    mem2hex (s, &buffer[1], count);
  2997. +    putpacket(buffer);
  2998.  }
  2999. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/ppc_ksyms.c ./arch/ppc/kernel/ppc_ksyms.c
  3000. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/ppc_ksyms.c    Tue May 11 11:26:23 1999
  3001. +++ ./arch/ppc/kernel/ppc_ksyms.c    Sat May 15 12:29:33 1999
  3002. @@ -47,6 +47,7 @@
  3003.  extern int do_signal(sigset_t *, struct pt_regs *);
  3004.  
  3005.  asmlinkage long long __ashrdi3(long long, int);
  3006. +asmlinkage long long __lshrdi3(long long, int);
  3007.  asmlinkage int abs(int);
  3008.  
  3009.  EXPORT_SYMBOL(clear_page);
  3010. @@ -149,6 +150,7 @@
  3011.  EXPORT_SYMBOL(ioremap);
  3012.  EXPORT_SYMBOL(__ioremap);
  3013.  EXPORT_SYMBOL(iounmap);
  3014. +EXPORT_SYMBOL(iopa);
  3015.  
  3016.  EXPORT_SYMBOL(ide_insw);
  3017.  EXPORT_SYMBOL(ide_outsw);
  3018. @@ -200,19 +202,28 @@
  3019.  EXPORT_SYMBOL(find_path_device);
  3020.  EXPORT_SYMBOL(find_phandle);
  3021.  EXPORT_SYMBOL(get_property);
  3022. +EXPORT_SYMBOL(device_is_compatible);
  3023. +#ifdef CONFIG_PCI
  3024.  EXPORT_SYMBOL(pci_io_base);
  3025.  EXPORT_SYMBOL(pci_device_loc);
  3026. +#endif
  3027.  EXPORT_SYMBOL(feature_set);
  3028.  EXPORT_SYMBOL(feature_clear);
  3029.  EXPORT_SYMBOL(feature_test);
  3030. -#ifdef CONFIG_SCSI
  3031. +#if defined(CONFIG_SCSI) && defined(CONFIG_PMAC)
  3032.  EXPORT_SYMBOL(note_scsi_host);
  3033. -#endif
  3034. +#endif 
  3035.  EXPORT_SYMBOL(kd_mksound);
  3036.  #ifdef CONFIG_PMAC
  3037.  EXPORT_SYMBOL(nvram_read_byte);
  3038.  EXPORT_SYMBOL(nvram_write_byte);
  3039.  #endif /* CONFIG_PMAC */
  3040. +#ifdef CONFIG_APUS
  3041. +extern char debug_device[];
  3042. +EXPORT_SYMBOL(debug_device);
  3043. +extern unsigned long m68k_machtype;
  3044. +EXPORT_SYMBOL(m68k_machtype);
  3045. +#endif /* CONFIG_APUS */
  3046.  
  3047.  EXPORT_SYMBOL(abs);
  3048.  EXPORT_SYMBOL(device_is_compatible);
  3049. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/setup.c ./arch/ppc/kernel/setup.c
  3050. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/setup.c    Tue May 11 11:26:26 1999
  3051. +++ ./arch/ppc/kernel/setup.c    Sat May 15 18:35:05 1999
  3052. @@ -79,6 +79,7 @@
  3053.  int have_of = 0;
  3054.  int is_prep = 0;
  3055.  int is_chrp = 0;
  3056. +int is_apus = 0;
  3057.  /* For MTX/MVME boards.. with Raven/Falcon Chipset
  3058.        Real close to CHRP, but boot like PReP (via PPCbug)
  3059.        There's probably a nicer way to do this.. --Troy */
  3060. @@ -342,8 +343,8 @@
  3061.      /* boot loader will tell us if we're APUS */
  3062.      if ( r3 == 0x61707573 )
  3063.      {
  3064. +        is_apus = 1;
  3065.          _machine = _MACH_apus;
  3066. -        r3 = 0;
  3067.      }
  3068.      /* prep boot loader tells us if we're prep or not */
  3069.      else if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) ) {
  3070. @@ -397,6 +398,7 @@
  3071.  #elif defined(CONFIG_FADS)
  3072.      _machine = _MACH_fads;
  3073.  #elif defined(CONFIG_APUS)
  3074. +    is_apus  = 1;
  3075.      _machine = _MACH_apus;
  3076.  #else
  3077.  #error "Machine not defined correctly"
  3078. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/syscalls.c ./arch/ppc/kernel/syscalls.c
  3079. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/kernel/syscalls.c    Tue May 11 11:26:27 1999
  3080. +++ ./arch/ppc/kernel/syscalls.c    Sun May 16 10:19:38 1999
  3081. @@ -205,15 +205,12 @@
  3082.  
  3083.      lock_kernel();
  3084.      if (!(flags & MAP_ANONYMOUS)) {
  3085. -        file = fget(fd);
  3086. -        if (!file)
  3087. +        if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
  3088.              goto out;
  3089.      }
  3090.      
  3091.      flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
  3092.      ret = do_mmap(file, addr, len, prot, flags, offset);
  3093. -    if (file)
  3094. -        fput(file);
  3095.  out:
  3096.      unlock_kernel();
  3097.      return ret;
  3098. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/mm/init.c ./arch/ppc/mm/init.c
  3099. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/mm/init.c    Wed May 12 09:56:50 1999
  3100. +++ ./arch/ppc/mm/init.c    Sun May 16 14:22:32 1999
  3101. @@ -50,10 +50,8 @@
  3102.  #include <asm/mbx.h>
  3103.  #include <asm/smp.h>
  3104.  #include <asm/bootx.h>
  3105. -/* APUS includes */
  3106. -#include <asm/setup.h>
  3107. -#include <asm/amigahw.h>
  3108. -/* END APUS includes */
  3109. +#include <asm/setup.h>        /* struct mem_info */
  3110. +#include <asm/amigahw.h>    /* zTwoBase */
  3111.  
  3112.  int prom_trashed;
  3113.  atomic_t next_mmu_context;
  3114. @@ -65,18 +63,19 @@
  3115.  extern char __init_begin, __init_end;
  3116.  extern char __prep_begin, __prep_end;
  3117.  extern char __pmac_begin, __pmac_end;
  3118. +extern char __apus_begin, __apus_end;
  3119.  extern char __openfirmware_begin, __openfirmware_end;
  3120.  char *klimit = _end;
  3121.  struct device_node *memory_node;
  3122.  unsigned long ioremap_base;
  3123.  unsigned long ioremap_bot;
  3124.  unsigned long avail_start;
  3125. -extern int num_memory;
  3126. -extern struct mem_info memory[NUM_MEMINFO];
  3127. -extern boot_infos_t *boot_infos;
  3128.  #ifndef __SMP__
  3129.  struct pgtable_cache_struct quicklists;
  3130.  #endif
  3131. +extern int num_memory;
  3132. +extern struct mem_info memory[];
  3133. +extern boot_infos_t *boot_infos;
  3134.  
  3135.  void MMU_init(void);
  3136.  static void *MMU_get_page(void);
  3137. @@ -388,6 +387,23 @@
  3138.              v = (ioremap_bot -= size);
  3139.      }
  3140.  
  3141. +#if 1
  3142. +    /* FIXME: Temporary hack to allow ptov conversions. */
  3143. +    {
  3144. +        extern unsigned long kmap_chunks[];
  3145. +        extern int kmap_chunk_count;
  3146. +
  3147. +        kmap_chunks[kmap_chunk_count++] = p;
  3148. +        kmap_chunks[kmap_chunk_count++] = size;
  3149. +        kmap_chunks[kmap_chunk_count++] = v;
  3150. +
  3151. +#if 0
  3152. +        printk ("ioremap: %08lx (%08lx) -> %08lx\n",
  3153. +            p, size, v);
  3154. +#endif
  3155. +    }
  3156. +#endif
  3157. +
  3158.      if ((flags & _PAGE_PRESENT) == 0)
  3159.          flags |= pgprot_val(PAGE_KERNEL);
  3160.      if (flags & (_PAGE_NO_CACHE | _PAGE_WRITETHRU))
  3161. @@ -425,13 +441,7 @@
  3162.      /* Check the BATs */
  3163.      for (b = 0; b < 4; ++b)
  3164.          if (addr >= bat_addrs[b].start && addr <= bat_addrs[b].limit)
  3165. -#ifndef CONFIG_APUS
  3166. -            return bat_addrs[b].phys | idx;
  3167. -#else
  3168. -            /* Do a more precise remapping of virtual address */
  3169. -            /* --Carsten */
  3170.              return (bat_addrs[b].phys - bat_addrs[b].start + addr) | idx;
  3171. -#endif /* CONFIG_APUS */
  3172.  #endif /* CONFIG_8xx */
  3173.      /* Do we have a page table? */
  3174.      if (init_task.mm->pgd == NULL)
  3175. @@ -961,7 +971,8 @@
  3176.  {
  3177.      unsigned long a;
  3178.      unsigned long num_freed_pages = 0, num_prep_pages = 0,
  3179. -        num_pmac_pages = 0, num_openfirmware_pages = 0;
  3180. +        num_pmac_pages = 0, num_openfirmware_pages = 0,
  3181. +        num_apus_pages = 0;
  3182.  #define FREESEC(START,END,CNT) do { \
  3183.      a = (unsigned long)(&START); \
  3184.      for (; a < (unsigned long)(&END); a += PAGE_SIZE) { \
  3185. @@ -976,25 +987,33 @@
  3186.      switch (_machine)
  3187.      {
  3188.      case _MACH_Pmac:
  3189. +        FREESEC(__apus_begin,__apus_end,num_apus_pages);
  3190.          FREESEC(__prep_begin,__prep_end,num_prep_pages);
  3191.          break;
  3192.      case _MACH_chrp:
  3193. +        FREESEC(__apus_begin,__apus_end,num_apus_pages);
  3194.          FREESEC(__pmac_begin,__pmac_end,num_pmac_pages);
  3195.          FREESEC(__prep_begin,__prep_end,num_prep_pages);
  3196.          break;
  3197.      case _MACH_prep:
  3198. +        FREESEC(__apus_begin,__apus_end,num_apus_pages);
  3199.          FREESEC(__pmac_begin,__pmac_end,num_pmac_pages);
  3200.          break;
  3201.      case _MACH_mbx:
  3202. +        FREESEC(__apus_begin,__apus_end,num_apus_pages);
  3203. +        FREESEC(__pmac_begin,__pmac_end,num_pmac_pages);
  3204. +        FREESEC(__prep_begin,__prep_end,num_prep_pages);
  3205. +        break;
  3206. +    case _MACH_apus:
  3207.          FREESEC(__pmac_begin,__pmac_end,num_pmac_pages);
  3208.          FREESEC(__prep_begin,__prep_end,num_prep_pages);
  3209.          break;
  3210.      }
  3211. -
  3212. +    
  3213.      if ( !have_of )
  3214.          FREESEC( __openfirmware_begin, __openfirmware_end,
  3215.               num_openfirmware_pages );
  3216. -    
  3217. +
  3218.      printk ("Freeing unused kernel memory: %ldk init",
  3219.          (num_freed_pages * PAGE_SIZE) >> 10);
  3220.      if ( num_prep_pages )
  3221. @@ -1003,6 +1022,8 @@
  3222.          printk(" %ldk pmac",(num_pmac_pages*PAGE_SIZE)>>10);
  3223.      if ( num_openfirmware_pages )
  3224.          printk(" %ldk open firmware",(num_openfirmware_pages*PAGE_SIZE)>>10);
  3225. +    if ( num_apus_pages )
  3226. +        printk(" %ldk apus",(num_apus_pages*PAGE_SIZE)>>10);
  3227.      printk("\n");
  3228.  }
  3229.  
  3230. @@ -1067,9 +1089,6 @@
  3231.          setbat(0, 0xfff00000, 0xfff00000, 0x00020000, RAM_PAGE);
  3232.          /* Map chip and ZorroII memory */
  3233.          setbat(1, zTwoBase,   0x00000000, 0x01000000, IO_PAGE);
  3234. -        /* Note: a temporary hack in arch/ppc/amiga/setup.c
  3235. -           (kernel_map) remaps individual IO regions to
  3236. -           0x90000000. */
  3237.          break;
  3238.      }
  3239.      ioremap_bot = ioremap_base;
  3240. @@ -1412,7 +1431,6 @@
  3241.      return (__va(total));
  3242.  }
  3243.  
  3244. -#ifdef CONFIG_APUS
  3245.  #define HARDWARE_MAPPED_SIZE (512*1024)
  3246.  __initfunc(unsigned long *apus_find_end_of_memory(void))
  3247.  {
  3248. @@ -1487,7 +1505,6 @@
  3249.         using the z2ram device. */
  3250.      return __va(memory[0].addr + memory[0].size);
  3251.  }
  3252. -#endif /* CONFIG_APUS */
  3253.  
  3254.  /*
  3255.   * Initialize the hash table and patch the instructions in head.S.
  3256. @@ -1543,11 +1560,6 @@
  3257.             ramsize >> 20, Hash_size >> 10, Hash);
  3258.      if ( Hash_size )
  3259.      {
  3260. -#ifdef CONFIG_APUS
  3261. -#define b(x) ((unsigned int*)(((unsigned long)(x)) - KERNELBASE + 0xfff00000))
  3262. -#else
  3263. -#define b(x) (x)
  3264. -#endif
  3265.          /*memset(Hash, 0, Hash_size);*/
  3266.          __clear_user(Hash, Hash_size);
  3267.          
  3268. @@ -1557,20 +1569,20 @@
  3269.           * Patch up the instructions in head.S:hash_page
  3270.           */
  3271.          Hash_bits = ffz(~Hash_size) - 6;
  3272. -        *b(hash_page_patch_A) = (*b(hash_page_patch_A) & ~0xffff)
  3273. +        hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff)
  3274.              | (__pa(Hash) >> 16);
  3275. -        *b(hash_page_patch_A + 1) = (*b(hash_page_patch_A + 1)& ~0x7c0)
  3276. +        hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0)
  3277.              | ((26 - Hash_bits) << 6);
  3278.          if (Hash_bits > 16)
  3279.              Hash_bits = 16;
  3280. -        *b(hash_page_patch_A + 2) = (*b(hash_page_patch_A + 2)& ~0x7c0)
  3281. +        hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0)
  3282.              | ((26 - Hash_bits) << 6);
  3283. -        *b(hash_page_patch_B) = (*b(hash_page_patch_B) & ~0xffff)
  3284. +        hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff)
  3285.              | (Hash_mask >> 10);
  3286. -        *b(hash_page_patch_C) = (*b(hash_page_patch_C) & ~0xffff)
  3287. +        hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff)
  3288.              | (Hash_mask >> 10);
  3289.  #if 0    /* see hash_page in head.S, note also patch_C ref below */
  3290. -        *b(hash_page_patch_D) = (*b(hash_page_patch_D) & ~0xffff)
  3291. +        hash_page_patch_D[0] = (hash_page_patch_D[0] & ~0xffff)
  3292.              | (Hash_mask >> 10);
  3293.  #endif
  3294.          /*
  3295. @@ -1578,8 +1590,8 @@
  3296.           * out from the data cache and invalidated in the instruction
  3297.           * cache, on those machines with split caches.
  3298.           */
  3299. -        flush_icache_range((unsigned long) b(hash_page_patch_A),
  3300. -                   (unsigned long) b(hash_page_patch_C + 1));
  3301. +        flush_icache_range((unsigned long) &hash_page_patch_A[0],
  3302. +                   (unsigned long) &hash_page_patch_C[1]);
  3303.      }
  3304.      else {
  3305.          Hash_end = 0;
  3306. @@ -1588,9 +1600,9 @@
  3307.           * start of hash_page, since we can still get DSI
  3308.           * exceptions on a 603.
  3309.           */
  3310. -        *b(hash_page) = 0x4e800020;
  3311. -        flush_icache_range((unsigned long) b(hash_page),
  3312. -                   (unsigned long) b(hash_page + 1));
  3313. +        hash_page[0] = 0x4e800020;
  3314. +        flush_icache_range((unsigned long) &hash_page[0],
  3315. +                   (unsigned long) &hash_page[1]);
  3316.      }
  3317.  }
  3318.  #endif /* ndef CONFIG_8xx */
  3319. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/vmlinux.lds ./arch/ppc/vmlinux.lds
  3320. --- /home/jskov/kernel/dist/linux-2.2.8/arch/ppc/vmlinux.lds    Mon Jan  4 15:15:08 1999
  3321. +++ ./arch/ppc/vmlinux.lds    Mon Jan 11 22:56:56 1999
  3322. @@ -70,7 +70,15 @@
  3323.    . = ALIGN(4096);
  3324.    __init_begin = .;
  3325.    .text.init : { *(.text.init) }
  3326. -  .data.init : { *(.data.init) }
  3327. +  .data.init : { 
  3328. +    *(.data.init);
  3329. +    __vtop_table_begin = .;
  3330. +    *(.vtop_fixup);
  3331. +    __vtop_table_end = .;
  3332. +    __ptov_table_begin = .;
  3333. +    *(.ptov_fixup);
  3334. +    __ptov_table_end = .;
  3335. +  }
  3336.    . = ALIGN(4096);
  3337.    __init_end = .;
  3338.  
  3339. @@ -87,6 +95,13 @@
  3340.    .data.prep : { *(.data.prep) }
  3341.    . = ALIGN(4096);
  3342.    __prep_end = .;
  3343. +
  3344. +  . = ALIGN(4096);
  3345. +  __apus_begin = .;
  3346. +  .text.apus : { *(.text.apus) }
  3347. +  .data.apus : { *(.data.apus) }
  3348. +  . = ALIGN(4096);
  3349. +  __apus_end = .;
  3350.  
  3351.    . = ALIGN(4096);
  3352.    __openfirmware_begin = .;
  3353. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/char/Makefile ./drivers/char/Makefile
  3354. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/char/Makefile    Tue May 11 11:26:42 1999
  3355. +++ ./drivers/char/Makefile    Sat May 15 18:55:43 1999
  3356. @@ -196,9 +196,11 @@
  3357.  L_OBJS += defkeymap.o
  3358.  endif
  3359.  
  3360. +ifndef CONFIG_APUS
  3361.  ifneq ($(ARCH),m68k)
  3362.  L_OBJS += pc_keyb.o
  3363.  endif
  3364. +endif
  3365.  
  3366.  ifdef CONFIG_Q40
  3367.  L_OBJS += q40_keyb.o
  3368. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/char/lp_m68k.c ./drivers/char/lp_m68k.c
  3369. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/char/lp_m68k.c    Tue Jan 19 11:56:05 1999
  3370. +++ ./drivers/char/lp_m68k.c    Fri Feb  5 20:42:53 1999
  3371. @@ -45,6 +45,10 @@
  3372.  #include <linux/init.h>
  3373.  #include <linux/kmod.h>
  3374.  
  3375. +#ifdef CONFIG_APUS
  3376. +#define m68k_debug_device debug_device
  3377. +#endif
  3378. +
  3379.  #ifdef CONFIG_AMIGA
  3380.  #ifdef CONFIG_MULTIFACE_III_LP
  3381.  #include <linux/lp_mfc.h>
  3382. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/char/ser_ioext.c ./drivers/char/ser_ioext.c
  3383. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/char/ser_ioext.c    Fri Apr 23 17:27:53 1999
  3384. +++ ./drivers/char/ser_ioext.c    Sat May 15 11:35:25 1999
  3385. @@ -776,6 +776,7 @@
  3386.  {
  3387.      /* Wait for the uart to get empty */
  3388.      while (!(uart->LSR & TEMT)) {
  3389. +        mb();
  3390.  #if IOEXT_DEBUG
  3391.      printk("Waiting for transmitter to finish\n");
  3392.  #endif
  3393. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/net/8390.c ./drivers/net/8390.c
  3394. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/net/8390.c    Tue May 11 11:26:58 1999
  3395. +++ ./drivers/net/8390.c    Sun May 16 10:39:37 1999
  3396. @@ -256,8 +256,12 @@
  3397.          spin_unlock_irqrestore(&ei_local->page_lock, flags);
  3398.  
  3399.          /* Ugly but a reset can be slow, yet must be protected */
  3400. -        
  3401. +#if    0 /* FIXME:APUS: */
  3402.          disable_irq_nosync(dev->irq);
  3403. +#else
  3404. +        disable_irq(dev->irq);
  3405. +        synchronize_irq();
  3406. +#endif
  3407.          spin_lock(&ei_local->page_lock);
  3408.          
  3409.          /* Try to restart the card.  Perhaps the user has fixed something. */
  3410. @@ -285,7 +289,12 @@
  3411.       *    Slow phase with lock held.
  3412.       */
  3413.       
  3414. -    disable_irq_nosync(dev->irq);
  3415. +#if    0 /* FIXME:APUS: */
  3416. +        disable_irq_nosync(dev->irq);
  3417. +#else
  3418. +        disable_irq(dev->irq);
  3419. +        synchronize_irq();
  3420. +#endif
  3421.      
  3422.      spin_lock(&ei_local->page_lock);
  3423.      
  3424. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/net/Config.in ./drivers/net/Config.in
  3425. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/net/Config.in    Wed Mar 24 11:31:05 1999
  3426. +++ ./drivers/net/Config.in    Sat May 15 11:35:29 1999
  3427. @@ -41,6 +41,9 @@
  3428.      tristate 'A2065 support' CONFIG_A2065
  3429.      tristate 'Hydra support' CONFIG_HYDRA
  3430.    fi
  3431. +  if [ "$CONFIG_AMIGA_PCMCIA" = "y" ]; then
  3432. +    tristate 'PCMCIA NE2000 support' CONFIG_APNE
  3433. +  fi
  3434.    if [ "$CONFIG_MIPS_JAZZ" = "y" ]; then
  3435.      bool 'MIPS JAZZ onboard SONIC Ethernet support' CONFIG_MIPS_JAZZ_SONIC
  3436.    fi
  3437. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/net/slhc.c ./drivers/net/slhc.c
  3438. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/net/slhc.c    Mon Jan  4 11:30:51 1999
  3439. +++ ./drivers/net/slhc.c    Sun May 16 20:55:44 1999
  3440. @@ -518,7 +518,7 @@
  3441.          x = *cp++;    /* Read conn index */
  3442.          if(x < 0 || x > comp->rslot_limit)
  3443.              goto bad;
  3444. -
  3445. +        if (comp->rstate[x].cs_hsize==0) goto bad;    /* header lost */
  3446.          comp->flags &=~ SLF_TOSS;
  3447.          comp->recv_current = x;
  3448.      } else {
  3449. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/Config.in ./drivers/scsi/Config.in
  3450. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/Config.in    Tue May 11 11:27:19 1999
  3451. +++ ./drivers/scsi/Config.in    Sat May 15 11:35:36 1999
  3452. @@ -18,6 +18,73 @@
  3453.  mainmenu_option next_comment
  3454.  comment 'SCSI low-level drivers'
  3455.  
  3456. +# Default is to ask for all drivers. This may be disabled in the below
  3457. +# code handling specific platforms.
  3458. +define_bool CONFIG_SCSI_ALL y
  3459. +
  3460. +if [ "$CONFIG_AMIGA" = "y" ]; then
  3461. +  define_bool CONFIG_SCSI_ALL n
  3462. +
  3463. +  dep_tristate 'A3000 WD33C93A support' CONFIG_A3000_SCSI $CONFIG_SCSI
  3464. +  if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  3465. +    bool 'A4000T SCSI support' CONFIG_A4000T_SCSI
  3466. +  fi
  3467. +fi
  3468. +if [ "$CONFIG_ZORRO" = "y" ]; then
  3469. +  define_bool CONFIG_SCSI_ALL n
  3470. +
  3471. +  dep_tristate 'A2091 WD33C93A support' CONFIG_A2091_SCSI $CONFIG_SCSI
  3472. +  dep_tristate 'GVP Series II WD33C93A support' CONFIG_GVP11_SCSI $CONFIG_SCSI
  3473. +  dep_tristate 'CyberStorm SCSI support' CONFIG_CYBERSTORM_SCSI $CONFIG_SCSI
  3474. +  dep_tristate 'CyberStorm Mk II SCSI support' CONFIG_CYBERSTORMII_SCSI $CONFIG_SCSI
  3475. +  dep_tristate 'Blizzard 2060 SCSI support' CONFIG_BLZ2060_SCSI $CONFIG_SCSI
  3476. +  dep_tristate 'Blizzard 1230IV/1260 SCSI support' CONFIG_BLZ1230_SCSI $CONFIG_SCSI
  3477. +  dep_tristate 'Fastlane SCSI support' CONFIG_FASTLANE_SCSI $CONFIG_SCSI
  3478. +  if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  3479. +    bool 'A4091 SCSI support' CONFIG_A4091_SCSI
  3480. +    bool 'WarpEngine SCSI support' CONFIG_WARPENGINE_SCSI
  3481. +    bool 'Blizzard PowerUP 603e+ SCSI' CONFIG_BLZ603EPLUS_SCSI
  3482. +    dep_tristate 'BSC Oktagon SCSI support' CONFIG_OKTAGON_SCSI $CONFIG_SCSI
  3483. +#    bool 'Cyberstorm Mk III SCSI support' CONFIG_CYBERSTORMIII_SCSI
  3484. +#    bool 'GVP Turbo 040/060 SCSI support' CONFIG_GVP_TURBO_SCSI
  3485. +  fi
  3486. +fi
  3487. +
  3488. +if [ "$CONFIG_ATARI" = "y" ]; then
  3489. +  define_bool CONFIG_SCSI_ALL n
  3490. +
  3491. +  dep_tristate 'Atari native SCSI support' CONFIG_ATARI_SCSI $CONFIG_SCSI
  3492. +  if [ "$CONFIG_ATARI_SCSI" != "n" ]; then
  3493. +    bool '  Long delays for Toshiba CD-ROMs' CONFIG_ATARI_SCSI_TOSHIBA_DELAY
  3494. +    bool '  Reset SCSI-devices at boottime' CONFIG_ATARI_SCSI_RESET_BOOT
  3495. +    if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_HADES" = "y" ]; then
  3496. +      bool '  Hades SCSI DMA emulator (EXPERIMENTAL)' CONFIG_TT_DMA_EMUL
  3497. +    fi
  3498. +  fi
  3499. +fi
  3500. +
  3501. +if [ "$CONFIG_MAC" = "y" ]; then
  3502. +  define_bool CONFIG_SCSI_ALL n
  3503. +
  3504. +  bool 'MAC NCR5380 SCSI' CONFIG_MAC_SCSI
  3505. +  dep_tristate 'MAC NCR53c9[46] SCSI' CONFIG_SCSI_MAC_ESP $CONFIG_SCSI
  3506. +fi
  3507. +
  3508. +if [ "$CONFIG_VME" = "y" -a "$CONFIG_MVME16x" = "y" ]; then
  3509. +  define_bool CONFIG_SCSI_ALL n
  3510. +
  3511. +  bool 'NCR53C710 SCSI driver for MVME16x' CONFIG_MVME16x_SCSI
  3512. +fi
  3513. +
  3514. +if [ "$CONFIG_VME" = "y" -a "$CONFIG_BVME6000" = "y" ]; then
  3515. +  define_bool CONFIG_SCSI_ALL n
  3516. +
  3517. +  bool 'NCR53C710 SCSI driver for BVME6000' CONFIG_BVME6000_SCSI
  3518. +fi
  3519. +
  3520. +# Generic SCSI
  3521. +if [ "CONFIG_SCSI_ALL" = "y" ];then
  3522. +
  3523.  dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST $CONFIG_SCSI
  3524.  dep_tristate 'ACARD SCSI support' CONFIG_SCSI_ACARD $CONFIG_SCSI
  3525.  dep_tristate 'Adaptec AHA152X/2825 support' CONFIG_SCSI_AHA152X $CONFIG_SCSI
  3526. @@ -140,6 +207,7 @@
  3527.      int  '  maximum number of queued commands' CONFIG_SCSI_U14_34F_MAX_TAGS 8
  3528.    fi
  3529.  dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI
  3530. +fi # CONFIG_SCSI_ALL
  3531.  #
  3532.  # Note - this is a very special 'host' adapter that simulates the presence of some disks.
  3533.  # It can come in very handy for troubleshooting.  Anyone else is welcome to use it - all
  3534. @@ -151,7 +219,7 @@
  3535.  if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  3536.    dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI
  3537.  fi
  3538. -if [ "$CONFIG_PPC" = "y" ]; then
  3539. +if [ "$CONFIG_PMAC" = "y" ]; then
  3540.    dep_tristate 'MESH (Power Mac internal SCSI) support' CONFIG_SCSI_MESH $CONFIG_SCSI
  3541.    if [ "$CONFIG_SCSI_MESH" != "n" ]; then
  3542.      int '  maximum synchronous transfer rate (MB/s) (0 = async)' CONFIG_SCSI_MESH_SYNC_RATE 5
  3543. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/a2091.c ./drivers/scsi/a2091.c
  3544. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/a2091.c    Tue May 11 11:02:46 1999
  3545. +++ ./drivers/scsi/a2091.c    Sun May 16 20:49:27 1999
  3546. @@ -53,6 +53,7 @@
  3547.      unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
  3548.      unsigned long addr = virt_to_bus(cmd->SCp.ptr);
  3549.      struct Scsi_Host *instance = cmd->host;
  3550. +    static int scsi_alloc_out_of_range = 0;
  3551.  
  3552.      /* don't allow DMA if the physical address is bad */
  3553.      if (addr & A2091_XFER_MASK ||
  3554. @@ -60,41 +61,55 @@
  3555.      {
  3556.      HDATA(instance)->dma_bounce_len = (cmd->SCp.this_residual + 511)
  3557.          & ~0x1ff;
  3558. -    HDATA(instance)->dma_bounce_buffer =
  3559. -        scsi_malloc (HDATA(instance)->dma_bounce_len);
  3560. -    
  3561. -    /* can't allocate memory; use PIO */
  3562. -    if (!HDATA(instance)->dma_bounce_buffer) {
  3563. -        HDATA(instance)->dma_bounce_len = 0;
  3564. -        return 1;
  3565. +     if( !scsi_alloc_out_of_range ) {
  3566. +        HDATA(cmd->host)->dma_bounce_buffer =
  3567. +        scsi_malloc (HDATA(cmd->host)->dma_bounce_len);
  3568. +        HDATA(cmd->host)->dma_buffer_pool = BUF_SCSI_ALLOCED;
  3569.      }
  3570.  
  3571. -    /* get the physical address of the bounce buffer */
  3572. -    addr = virt_to_bus(HDATA(instance)->dma_bounce_buffer);
  3573. +    if ( scsi_alloc_out_of_range || !HDATA(cmd->host)->dma_bounce_buffer) {
  3574. +        HDATA(cmd->host)->dma_bounce_buffer =
  3575. +        amiga_chip_alloc(HDATA(cmd->host)->dma_bounce_len);
  3576. +
  3577. +        if(!HDATA(cmd->host)->dma_bounce_buffer)
  3578. +        {
  3579. +        HDATA(cmd->host)->dma_bounce_len = 0;
  3580. +        return 1;
  3581. +        }
  3582.  
  3583. -    /* the bounce buffer may not be in the first 16M of physmem */
  3584. -    if (addr & A2091_XFER_MASK) {
  3585. -        /* we could use chipmem... maybe later */
  3586. -        scsi_free (HDATA(instance)->dma_bounce_buffer,
  3587. -               HDATA(instance)->dma_bounce_len);
  3588. -        HDATA(instance)->dma_bounce_buffer = NULL;
  3589. -        HDATA(instance)->dma_bounce_len = 0;
  3590. -        return 1;
  3591. +        HDATA(cmd->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
  3592.      }
  3593.  
  3594. +    /* check if the address of the bounce buffer is OK */
  3595. +    addr = virt_to_bus(HDATA(cmd->host)->dma_bounce_buffer);
  3596. +
  3597. +    if (addr & A2091_XFER_MASK) {
  3598. +        /* fall back to Chip RAM if address out of range */
  3599. +        if( HDATA(cmd->host)->dma_buffer_pool == BUF_SCSI_ALLOCED) {
  3600. +        scsi_free (HDATA(cmd->host)->dma_bounce_buffer,
  3601. +               HDATA(cmd->host)->dma_bounce_len);
  3602. +        scsi_alloc_out_of_range = 1;
  3603. +        } else {
  3604. +        amiga_chip_free (HDATA(cmd->host)->dma_bounce_buffer);
  3605. +            }
  3606. +        
  3607. +        HDATA(cmd->host)->dma_bounce_buffer =
  3608. +        amiga_chip_alloc(HDATA(cmd->host)->dma_bounce_len);
  3609. +
  3610. +        if(!HDATA(cmd->host)->dma_bounce_buffer)
  3611. +        {
  3612. +        HDATA(cmd->host)->dma_bounce_len = 0;
  3613. +        return 1;
  3614. +        }
  3615. +
  3616. +        addr = virt_to_bus(HDATA(cmd->host)->dma_bounce_buffer);
  3617. +        HDATA(cmd->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
  3618. +    }
  3619. +        
  3620.      if (!dir_in) {
  3621.          /* copy to bounce buffer for a write */
  3622. -        if (cmd->use_sg)
  3623. -#if 0
  3624. -        panic ("scsi%ddma: incomplete s/g support",
  3625. -               instance->host_no);
  3626. -#else
  3627. -        memcpy (HDATA(instance)->dma_bounce_buffer,
  3628. -            cmd->SCp.ptr, cmd->SCp.this_residual);
  3629. -#endif
  3630. -        else
  3631. -        memcpy (HDATA(instance)->dma_bounce_buffer,
  3632. -            cmd->request_buffer, cmd->request_bufflen);
  3633. +        memcpy (HDATA(cmd->host)->dma_bounce_buffer,
  3634. +            cmd->SCp.ptr, cmd->SCp.this_residual);
  3635.      }
  3636.      }
  3637.  
  3638. @@ -118,7 +133,9 @@
  3639.      cache_push (addr, cmd->SCp.this_residual);
  3640.        }
  3641.      /* start DMA */
  3642. +    mb();            /* make sure setup is completed */
  3643.      DMA(cmd->host)->ST_DMA = 1;
  3644. +    mb();            /* make sure DMA has started before next IO */
  3645.  
  3646.      /* return success */
  3647.      return 0;
  3648. @@ -135,12 +152,15 @@
  3649.  
  3650.      /* disable SCSI interrupts */
  3651.      DMA(instance)->CNTR = cntr;
  3652. +    mb();            /* make sure CNTR is updated before next IO */
  3653.  
  3654.      /* flush if we were reading */
  3655.      if (HDATA(instance)->dma_dir) {
  3656.      DMA(instance)->FLUSH = 1;
  3657. +    mb();            /* don't allow prefetch */
  3658.      while (!(DMA(instance)->ISTR & ISTR_FE_FLG))
  3659. -        ;
  3660. +        barrier();
  3661. +    mb();            /* no IO until FLUSH is done */
  3662.      }
  3663.  
  3664.      /* clear a possible interrupt */
  3665. @@ -148,38 +168,27 @@
  3666.  
  3667.      /* stop DMA */
  3668.      DMA(instance)->SP_DMA = 1;
  3669. +    mb();            /* make sure DMA is stopped before next IO */
  3670.  
  3671.      /* restore the CONTROL bits (minus the direction flag) */
  3672.      DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN;
  3673. +    mb();            /* make sure CNTR is updated before next IO */
  3674.  
  3675.      /* copy from a bounce buffer, if necessary */
  3676.      if (status && HDATA(instance)->dma_bounce_buffer) {
  3677. -    if (SCpnt && SCpnt->use_sg) {
  3678. -#if 0
  3679. -        panic ("scsi%d: incomplete s/g support",
  3680. -           instance->host_no);
  3681. -#else
  3682. -        if( HDATA(instance)->dma_dir )
  3683. -        memcpy (SCpnt->SCp.ptr, 
  3684. -            HDATA(instance)->dma_bounce_buffer,
  3685. -            SCpnt->SCp.this_residual);
  3686. -        scsi_free (HDATA(instance)->dma_bounce_buffer,
  3687. -               HDATA(instance)->dma_bounce_len);
  3688. -        HDATA(instance)->dma_bounce_buffer = NULL;
  3689. -        HDATA(instance)->dma_bounce_len = 0;
  3690. -        
  3691. -#endif
  3692. -    } else {
  3693. -        if (HDATA(instance)->dma_dir && SCpnt)
  3694. -        memcpy (SCpnt->request_buffer,
  3695. -            HDATA(instance)->dma_bounce_buffer,
  3696. -            SCpnt->request_bufflen);
  3697. -
  3698. +    if (HDATA(instance)->dma_dir && SCpnt)
  3699. +        memcpy (SCpnt->SCp.ptr, 
  3700. +            HDATA(instance)->dma_bounce_buffer,
  3701. +            SCpnt->SCp.this_residual);
  3702. +    
  3703. +    if (HDATA(instance)->dma_buffer_pool == BUF_SCSI_ALLOCED)
  3704.          scsi_free (HDATA(instance)->dma_bounce_buffer,
  3705.                 HDATA(instance)->dma_bounce_len);
  3706. -        HDATA(instance)->dma_bounce_buffer = NULL;
  3707. -        HDATA(instance)->dma_bounce_len = 0;
  3708. -    }
  3709. +    else
  3710. +        amiga_chip_free(HDATA(instance)->dma_bounce_buffer);
  3711. +    
  3712. +    HDATA(instance)->dma_bounce_buffer = NULL;
  3713. +    HDATA(instance)->dma_bounce_len = 0;
  3714.      }
  3715.  }
  3716.  
  3717. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/a3000.c ./drivers/scsi/a3000.c
  3718. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/a3000.c    Tue Sep  1 18:56:07 1998
  3719. +++ ./drivers/scsi/a3000.c    Tue Mar 23 21:32:27 1999
  3720. @@ -32,7 +32,7 @@
  3721.  
  3722.  static void a3000_intr (int irq, void *dummy, struct pt_regs *fp)
  3723.  {
  3724. -    unsigned int status = DMA(a3000_host)->ISTR;
  3725. +    unsigned short status = DMA(a3000_host)->ISTR;
  3726.  
  3727.      if (!(status & ISTR_INT_P))
  3728.      return;
  3729. @@ -102,7 +102,9 @@
  3730.      cache_push (addr, cmd->SCp.this_residual);
  3731.  
  3732.      /* start DMA */
  3733. +    mb();            /* make sure setup is completed */
  3734.      DMA(a3000_host)->ST_DMA = 1;
  3735. +    mb();            /* make sure DMA has started before next IO */
  3736.  
  3737.      /* return success */
  3738.      return 0;
  3739. @@ -118,12 +120,15 @@
  3740.      cntr |= CNTR_DDIR;
  3741.  
  3742.      DMA(instance)->CNTR = cntr;
  3743. +    mb();            /* make sure CNTR is updated before next IO */
  3744.  
  3745.      /* flush if we were reading */
  3746.      if (HDATA(instance)->dma_dir) {
  3747.      DMA(instance)->FLUSH = 1;
  3748. +    mb();            /* don't allow prefetch */
  3749.      while (!(DMA(instance)->ISTR & ISTR_FE_FLG))
  3750. -        ;
  3751. +        barrier();
  3752. +    mb();            /* no IO until FLUSH is done */
  3753.      }
  3754.  
  3755.      /* clear a possible interrupt */
  3756. @@ -134,9 +139,11 @@
  3757.  
  3758.      /* stop DMA */
  3759.      DMA(instance)->SP_DMA = 1;
  3760. +    mb();            /* make sure DMA is stopped before next IO */
  3761.  
  3762.      /* restore the CONTROL bits (minus the direction flag) */
  3763.      DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN;
  3764. +    mb();            /* make sure CNTR is updated before next IO */
  3765.  
  3766.      /* copy from a bounce buffer, if necessary */
  3767.      if (status && HDATA(instance)->dma_bounce_buffer) {
  3768. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/gvp11.c ./drivers/scsi/gvp11.c
  3769. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/gvp11.c    Wed May 12 10:03:07 1999
  3770. +++ ./drivers/scsi/gvp11.c    Sat May 15 11:35:36 1999
  3771. @@ -127,6 +127,7 @@
  3772.  
  3773.      HDATA(cmd->host)->dma_dir = dir_in;
  3774.      DMA(cmd->host)->CNTR = cntr;
  3775. +    mb();            /* make sure CNTR is updated before next IO */
  3776.  
  3777.      /* setup DMA *physical* address */
  3778.      DMA(cmd->host)->ACR = addr;
  3779. @@ -142,7 +143,9 @@
  3780.          DMA(cmd->host)->BANK = bank_mask & (addr >> 18);
  3781.  
  3782.      /* start DMA */
  3783. +    mb();            /* make sure setup is completed */
  3784.      DMA(cmd->host)->ST_DMA = 1;
  3785. +    mb();            /* make sure DMA has started before next IO */
  3786.  
  3787.      /* return success */
  3788.      return 0;
  3789. @@ -155,6 +158,7 @@
  3790.      DMA(instance)->SP_DMA = 1;
  3791.      /* remove write bit from CONTROL bits */
  3792.      DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE;
  3793. +    mb();            /* make sure CNTR is updated before next IO */
  3794.  
  3795.      /* copy from a bounce buffer, if necessary */
  3796.      if (status && HDATA(instance)->dma_bounce_buffer) {
  3797. @@ -316,9 +320,14 @@
  3798.  
  3799.  
  3800.      DMA(instance)->secret2 = 1;
  3801. +    mb();            /* ensure IO order */
  3802.      DMA(instance)->secret1 = 0;
  3803. +    mb();            /* ensure IO order */
  3804.      DMA(instance)->secret3 = 15;
  3805. -    while (DMA(instance)->CNTR & GVP11_DMAC_BUSY) ;
  3806. +    mb();            /* ensure IO order */
  3807. +    while (DMA(instance)->CNTR & GVP11_DMAC_BUSY)
  3808. +        barrier();
  3809. +    mb();            /* ensure IO order */
  3810.      DMA(instance)->CNTR = 0;
  3811.  
  3812.      DMA(instance)->BANK = 0;
  3813. @@ -341,6 +350,7 @@
  3814.          request_irq(IRQ_AMIGA_PORTS, gvp11_intr, 0,
  3815.                  "GVP11 SCSI", gvp11_intr);
  3816.      }
  3817. +    mb();            /* ensure IO order */
  3818.      DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE;
  3819.      zorro_config_board(key, 0);
  3820.      }
  3821. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/sd.c ./drivers/scsi/sd.c
  3822. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/scsi/sd.c    Tue May 11 11:27:33 1999
  3823. +++ ./drivers/scsi/sd.c    Sat May 15 11:35:38 1999
  3824. @@ -68,13 +68,13 @@
  3825.  #define N_USED_SCSI_DISKS  (sd_template.dev_max + SCSI_DISKS_PER_MAJOR - 1)
  3826.  #define N_USED_SD_MAJORS   (N_USED_SCSI_DISKS / SCSI_DISKS_PER_MAJOR)
  3827.  
  3828. -#define MAX_RETRIES 5
  3829. +#define MAX_RETRIES 100
  3830.  
  3831.  /*
  3832.   *  Time out in seconds for disks and Magneto-opticals (which are slower).
  3833.   */
  3834.  
  3835. -#define SD_TIMEOUT (15 * HZ)
  3836. +#define SD_TIMEOUT (50 * HZ)
  3837.  #define SD_MOD_TIMEOUT (75 * HZ)
  3838.  
  3839.  #define CLUSTERABLE_DEVICE(SC) (SC->host->use_clustering && \
  3840. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/sound/dmasound.c ./drivers/sound/dmasound.c
  3841. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/sound/dmasound.c    Fri Mar 26 11:54:46 1999
  3842. +++ ./drivers/sound/dmasound.c    Sat May 15 11:35:41 1999
  3843. @@ -107,7 +107,7 @@
  3844.  #include <asm/amigahw.h>
  3845.  #include <asm/amigaints.h>
  3846.  #endif /* CONFIG_AMIGA */
  3847. -#ifdef CONFIG_PPC
  3848. +#ifdef CONFIG_PMAC
  3849.  #include <asm/prom.h>
  3850.  #include <asm/io.h>
  3851.  #include <asm/dbdma.h>
  3852. @@ -117,7 +117,7 @@
  3853.  #include "awacs_defs.h"
  3854.  #include <linux/nvram.h>
  3855.  #include <linux/vt_kern.h>
  3856. -#endif /* CONFIG_PPC */
  3857. +#endif /* CONFIG_PMAC */
  3858.  
  3859.  #include "dmasound.h"
  3860.  #include <linux/soundcard.h>
  3861. @@ -164,7 +164,7 @@
  3862.  
  3863.  #endif /* CONFIG_AMIGA */
  3864.  
  3865. -#ifdef CONFIG_PPC
  3866. +#ifdef CONFIG_PMAC
  3867.  /*
  3868.   * Interrupt numbers and addresses, obtained from the device tree.
  3869.   */
  3870. @@ -261,7 +261,7 @@
  3871.  };
  3872.  #endif /* CONFIG_PMAC_PBOOK */
  3873.  
  3874. -#endif /* CONFIG_PPC */
  3875. +#endif /* CONFIG_PMAC */
  3876.  
  3877.  /*** Some declarations *******************************************************/
  3878.  
  3879. @@ -599,7 +599,7 @@
  3880.                  ssize_t frameLeft);
  3881.  #endif /* CONFIG_AMIGA */
  3882.  
  3883. -#ifdef CONFIG_PPC
  3884. +#ifdef CONFIG_PMAC
  3885.  static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
  3886.                 u_char frame[], ssize_t *frameUsed,
  3887.                 ssize_t frameLeft);
  3888. @@ -630,7 +630,7 @@
  3889.  static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount,
  3890.                  u_char frame[], ssize_t *frameUsed,
  3891.                  ssize_t frameLeft);
  3892. -#endif /* CONFIG_PPC */
  3893. +#endif /* CONFIG_PMAC */
  3894.  
  3895.  /*** Machine definitions *****************************************************/
  3896.  
  3897. @@ -687,7 +687,7 @@
  3898.      int treble;
  3899.      int gain;
  3900.      int minDev;        /* minor device number currently open */
  3901. -#if defined(CONFIG_ATARI) || defined(CONFIG_PPC)
  3902. +#if defined(CONFIG_ATARI) || defined(CONFIG_PMAC)
  3903.      int bal;        /* balance factor for expanding (not volume!) */
  3904.      u_long data;        /* data for expanding */
  3905.  #endif /* CONFIG_ATARI */
  3906. @@ -736,7 +736,7 @@
  3907.  static void ami_sq_interrupt(int irq, void *dummy, struct pt_regs *fp);
  3908.  #endif /* CONFIG_AMIGA */
  3909.  
  3910. -#ifdef CONFIG_PPC
  3911. +#ifdef CONFIG_PMAC
  3912.  static void *PMacAlloc(unsigned int size, int flags);
  3913.  static void PMacFree(void *ptr, unsigned int size);
  3914.  static int PMacIrqInit(void);
  3915. @@ -755,7 +755,7 @@
  3916.  static int awacs_volume_setter(int volume, int n, int mute, int lshift);
  3917.  static void awacs_mksound(unsigned int hz, unsigned int ticks);
  3918.  static void awacs_nosound(unsigned long xx);
  3919. -#endif /* CONFIG_PPC */
  3920. +#endif /* CONFIG_PMAC */
  3921.  
  3922.  /*** Mid level stuff *********************************************************/
  3923.  
  3924. @@ -1789,7 +1789,7 @@
  3925.  }
  3926.  #endif /* CONFIG_AMIGA */
  3927.  
  3928. -#ifdef CONFIG_PPC
  3929. +#ifdef CONFIG_PMAC
  3930.  static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
  3931.                 u_char frame[], ssize_t *frameUsed,
  3932.                 ssize_t frameLeft)
  3933. @@ -2171,7 +2171,7 @@
  3934.      return stereo? utotal * 4: utotal * 2;
  3935.  }
  3936.  
  3937. -#endif /* CONFIG_PPC */
  3938. +#endif /* CONFIG_PMAC */
  3939.  
  3940.  
  3941.  #ifdef CONFIG_ATARI
  3942. @@ -2201,7 +2201,7 @@
  3943.  };
  3944.  #endif /* CONFIG_AMIGA */
  3945.  
  3946. -#ifdef CONFIG_PPC
  3947. +#ifdef CONFIG_PMAC
  3948.  static TRANS transAwacsNormal = {
  3949.      pmac_ct_law, pmac_ct_law, pmac_ct_s8, pmac_ct_u8,
  3950.      pmac_ct_s16, pmac_ct_u16, pmac_ct_s16, pmac_ct_u16
  3951. @@ -2211,7 +2211,7 @@
  3952.      pmac_ctx_law, pmac_ctx_law, pmac_ctx_s8, pmac_ctx_u8,
  3953.      pmac_ctx_s16, pmac_ctx_u16, pmac_ctx_s16, pmac_ctx_u16
  3954.  };
  3955. -#endif /* CONFIG_PPC */
  3956. +#endif /* CONFIG_PMAC */
  3957.  
  3958.  /*** Low level stuff *********************************************************/
  3959.  
  3960. @@ -2981,7 +2981,7 @@
  3961.  }
  3962.  #endif /* CONFIG_AMIGA */
  3963.  
  3964. -#ifdef CONFIG_PPC
  3965. +#ifdef CONFIG_PMAC
  3966.  
  3967.  /*
  3968.   * PCI PowerMac, with AWACS and DBDMA.
  3969. @@ -3609,7 +3609,7 @@
  3970.      while (!req.complete) cuda_poll();
  3971.  }
  3972.  
  3973. -#endif /* CONFIG_PPC */
  3974. +#endif /* CONFIG_PMAC */
  3975.  
  3976.  /*** Machine definitions *****************************************************/
  3977.  
  3978. @@ -3648,7 +3648,7 @@
  3979.  };
  3980.  #endif /* CONFIG_AMIGA */
  3981.  
  3982. -#ifdef CONFIG_PPC
  3983. +#ifdef CONFIG_PMAC
  3984.  static MACHINE machPMac = {
  3985.      DMASND_AWACS, PMacAlloc, PMacFree, PMacIrqInit,
  3986.  #ifdef MODULE
  3987. @@ -3949,7 +3949,7 @@
  3988.          break;
  3989.  #endif /* CONFIG_AMIGA */
  3990.  
  3991. -#ifdef CONFIG_PPC
  3992. +#ifdef CONFIG_PMAC
  3993.      case DMASND_AWACS:
  3994.          if (awacs_revision<AWACS_BURGUNDY) { /* Different IOCTLS for burgundy*/
  3995.              switch (cmd) {
  3996. @@ -4297,10 +4297,10 @@
  3997.  
  3998.  static void sq_setup(int numBufs, int bufSize, char **buffers)
  3999.  {
  4000. -#ifdef CONFIG_PPC
  4001. +#ifdef CONFIG_PMAC
  4002.      int i;
  4003.      volatile struct dbdma_cmd *cp;
  4004. -#endif /* CONFIG_PPC */
  4005. +#endif /* CONFIG_PMAC */
  4006.  
  4007.      sq.max_count = numBufs;
  4008.      sq.max_active = numBufs;
  4009. @@ -4319,7 +4319,7 @@
  4010.      sq.block_size_half = sq.block_size>>1;
  4011.      sq.block_size_quarter = sq.block_size_half>>1;
  4012.  #endif /* CONFIG_AMIGA */
  4013. -#ifdef CONFIG_PPC
  4014. +#ifdef CONFIG_PMAC
  4015.      cp = awacs_tx_cmds;
  4016.      memset((void *) cp, 0, (numBufs + 1) * sizeof(struct dbdma_cmd));
  4017.      for (i = 0; i < numBufs; ++i, ++cp) {
  4018. @@ -4329,7 +4329,7 @@
  4019.      st_le32(&cp->cmd_dep, virt_to_bus(awacs_tx_cmds));
  4020.      out_le32(&awacs_txdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
  4021.      out_le32(&awacs_txdma->cmdptr, virt_to_bus(awacs_tx_cmds));
  4022. -#endif /* CONFIG_PPC */
  4023. +#endif /* CONFIG_PMAC */
  4024.  }
  4025.  
  4026.  static void sq_play(void)
  4027. @@ -4649,11 +4649,11 @@
  4028.          sound.dsp.speed = 8000;
  4029.          break;
  4030.  #endif /* CONFIG_AMIGA */
  4031. -#ifdef CONFIG_PPC
  4032. +#ifdef CONFIG_PMAC
  4033.      case DMASND_AWACS:
  4034.          sound.dsp.speed = 8000;
  4035.          break;
  4036. -#endif /* CONFIG_PPC */
  4037. +#endif /* CONFIG_PMAC */
  4038.      }
  4039.  
  4040.      /* before the first open to /dev/dsp this wouldn't be set */
  4041. @@ -4694,11 +4694,11 @@
  4042.          mach = "Amiga ";
  4043.          break;
  4044.  #endif /* CONFIG_AMIGA */
  4045. -#ifdef CONFIG_PPC
  4046. +#ifdef CONFIG_PMAC
  4047.      case DMASND_AWACS:
  4048.          sprintf(mach, "PowerMac (AWACS rev %d) ", awacs_revision);
  4049.          break;
  4050. -#endif /* CONFIG_PPC */
  4051. +#endif /* CONFIG_PMAC */
  4052.      }
  4053.      len += sprintf(buffer+len, "%sDMA sound driver:\n", mach);
  4054.  
  4055. @@ -4838,7 +4838,7 @@
  4056.  void __init dmasound_init(void)
  4057.  {
  4058.      int has_sound = 0;
  4059. -#ifdef CONFIG_PPC
  4060. +#ifdef CONFIG_PMAC
  4061.      struct device_node *np;
  4062.  #endif
  4063.  
  4064. @@ -4872,7 +4872,7 @@
  4065.      }
  4066.  #endif /* __mc68000__||CONFIG_APUS */
  4067.  
  4068. -#ifdef CONFIG_PPC
  4069. +#ifdef CONFIG_PMAC
  4070.      awacs_subframe = 0;
  4071.      awacs_revision = 0;
  4072.      np = find_devices("awacs");
  4073. @@ -4951,7 +4951,7 @@
  4074.                      &awacs_sleep_notifier);
  4075.  #endif /* CONFIG_PMAC_PBOOK */
  4076.      }
  4077. -#endif /* CONFIG_PPC */
  4078. +#endif /* CONFIG_PMAC */
  4079.  
  4080.      if (!has_sound)
  4081.          return;
  4082. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/drivers/video/cyberfb.c ./drivers/video/cyberfb.c
  4083. --- /home/jskov/kernel/dist/linux-2.2.8/drivers/video/cyberfb.c    Sun Mar 28 17:54:33 1999
  4084. +++ ./drivers/video/cyberfb.c    Sat May 15 11:35:43 1999
  4085. @@ -905,7 +905,7 @@
  4086.      cyberfb_get_fix(&fix, con, info);
  4087.      if (con == -1)
  4088.          con = 0;
  4089. -    display->screen_base = (unsigned char *)CyberMem;
  4090. +    display->screen_base = (char*) CyberMem;
  4091.      display->visual = fix.visual;
  4092.      display->type = fix.type;
  4093.      display->type_aux = fix.type_aux;
  4094. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/fs/Config.in ./fs/Config.in
  4095. --- /home/jskov/kernel/dist/linux-2.2.8/fs/Config.in    Thu Jan 21 12:10:37 1999
  4096. +++ ./fs/Config.in    Fri Feb  5 21:36:32 1999
  4097. @@ -135,9 +135,13 @@
  4098.      if [ "$CONFIG_PREP" = "y" -o "$CONFIG_CHRP" = "y" ]; then
  4099.        define_bool CONFIG_MSDOS_PARTITION y
  4100.      fi
  4101. +    if [ "$CONFIG_APUS" = "y" ]; then
  4102. +      define_bool CONFIG_AMIGA_PARTITION y
  4103. +    fi
  4104.    else
  4105.      define_bool CONFIG_MAC_PARTITION y
  4106.      define_bool CONFIG_MSDOS_PARTITION y
  4107. +    define_bool CONFIG_AMIGA_PARTITION y
  4108.    fi
  4109.  fi
  4110.  bool 'Support for foreign partition tables' CONFIG_FOREIGN_PARTITIONS
  4111. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-m68k/ide.h ./include/asm-m68k/ide.h
  4112. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-m68k/ide.h    Fri Apr 23 17:28:02 1999
  4113. +++ ./include/asm-m68k/ide.h    Sat May 15 20:34:06 1999
  4114. @@ -177,7 +177,7 @@
  4115.  #endif
  4116.  #endif
  4117.  
  4118. -
  4119. +#ifndef CONFIG_APUS
  4120.  #define insl(data_reg, buffer, wcount) insw(data_reg, buffer, (wcount)<<1)
  4121.  #define outsl(data_reg, buffer, wcount) outsw(data_reg, buffer, (wcount)<<1)
  4122.  
  4123. @@ -377,6 +377,7 @@
  4124.          : "d0", "a0", "a1", "d6")
  4125.  
  4126.  #endif /* CONFIG_ATARI */
  4127. +#endif /* CONFIG_APUS */
  4128.  
  4129.  #define T_CHAR          (0x0000)        /* char:  don't touch  */
  4130.  #define T_SHORT         (0x4000)        /* short: 12 -> 21     */
  4131. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-m68k/traps.h ./include/asm-m68k/traps.h
  4132. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-m68k/traps.h    Mon Jan 11 14:20:40 1999
  4133. +++ ./include/asm-m68k/traps.h    Sun May 16 10:14:46 1999
  4134. @@ -13,6 +13,8 @@
  4135.  
  4136.  #ifndef __ASSEMBLY__
  4137.  
  4138. +#include <asm/ptrace.h>
  4139. +
  4140.  typedef void (*e_vector)(void);
  4141.  
  4142.  extern e_vector vectors[];
  4143. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amigahw.h ./include/asm-ppc/amigahw.h
  4144. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amigahw.h    Fri Aug  7 15:56:15 1998
  4145. +++ ./include/asm-ppc/amigahw.h    Sun Nov 22 12:57:55 1998
  4146. @@ -1 +1,339 @@
  4147. -#include <asm-m68k/amigahw.h>
  4148. +/*
  4149. +** asm-m68k/amigahw.h -- This header defines some macros and pointers for
  4150. +**                    the various Amiga custom hardware registers.
  4151. +**                    The naming conventions used here conform to those
  4152. +**                    used in the Amiga Hardware Reference Manual, 3rd Edition
  4153. +**
  4154. +** Copyright 1992 by Greg Harp
  4155. +**
  4156. +** This file is subject to the terms and conditions of the GNU General Public
  4157. +** License.  See the file COPYING in the main directory of this archive
  4158. +** for more details.
  4159. +**
  4160. +** Created: 9/24/92 by Greg Harp
  4161. +*/
  4162. +
  4163. +#ifndef _M68K_AMIGAHW_H
  4164. +#define _M68K_AMIGAHW_H
  4165. +
  4166. +    /*
  4167. +     *  Different Amiga models
  4168. +     */
  4169. +
  4170. +extern unsigned long amiga_model;
  4171. +
  4172. +#define AMI_UNKNOWN    (0)
  4173. +#define AMI_500        (1)
  4174. +#define AMI_500PLUS    (2)
  4175. +#define AMI_600        (3)
  4176. +#define AMI_1000    (4)
  4177. +#define AMI_1200    (5)
  4178. +#define AMI_2000    (6)
  4179. +#define AMI_2500    (7)
  4180. +#define AMI_3000    (8)
  4181. +#define AMI_3000T    (9)
  4182. +#define AMI_3000PLUS    (10)
  4183. +#define AMI_4000    (11)
  4184. +#define AMI_4000T    (12)
  4185. +#define AMI_CDTV    (13)
  4186. +#define AMI_CD32    (14)
  4187. +#define AMI_DRACO    (15)
  4188. +
  4189. +
  4190. +    /*
  4191. +     *  Chipsets
  4192. +     */
  4193. +
  4194. +extern unsigned long amiga_chipset;
  4195. +
  4196. +#define CS_STONEAGE    (0)
  4197. +#define CS_OCS        (1)
  4198. +#define CS_ECS        (2)
  4199. +#define CS_AGA        (3)
  4200. +
  4201. +
  4202. +    /*
  4203. +     *  Miscellaneous
  4204. +     */
  4205. +
  4206. +extern unsigned long amiga_eclock;    /* 700 kHz E Peripheral Clock */
  4207. +extern unsigned long amiga_masterclock;    /* 28 MHz Master Clock */
  4208. +extern unsigned long amiga_colorclock;    /* 3.5 MHz Color Clock */
  4209. +extern unsigned long amiga_chip_size;    /* Chip RAM Size (bytes) */
  4210. +extern unsigned char amiga_vblank;    /* VBLANK Frequency */
  4211. +extern unsigned char amiga_psfreq;    /* Power Supply Frequency */
  4212. +
  4213. +
  4214. +#define AMIGAHW_DECLARE(name)    unsigned name : 1
  4215. +#define AMIGAHW_SET(name)    (amiga_hw_present.name = 1)
  4216. +#define AMIGAHW_PRESENT(name)    (amiga_hw_present.name)
  4217. +
  4218. +struct amiga_hw_present {
  4219. +    /* video hardware */
  4220. +    AMIGAHW_DECLARE(AMI_VIDEO);        /* Amiga Video */
  4221. +    AMIGAHW_DECLARE(AMI_BLITTER);    /* Amiga Blitter */
  4222. +    AMIGAHW_DECLARE(AMBER_FF);        /* Amber Flicker Fixer */
  4223. +    /* sound hardware */
  4224. +    AMIGAHW_DECLARE(AMI_AUDIO);        /* Amiga Audio */
  4225. +    /* disk storage interfaces */
  4226. +    AMIGAHW_DECLARE(AMI_FLOPPY);    /* Amiga Floppy */
  4227. +    AMIGAHW_DECLARE(A3000_SCSI);    /* SCSI (wd33c93, A3000 alike) */
  4228. +    AMIGAHW_DECLARE(A4000_SCSI);    /* SCSI (ncr53c710, A4000T alike) */
  4229. +    AMIGAHW_DECLARE(A1200_IDE);        /* IDE (A1200 alike) */
  4230. +    AMIGAHW_DECLARE(A4000_IDE);        /* IDE (A4000 alike) */
  4231. +    AMIGAHW_DECLARE(CD_ROM);        /* CD ROM drive */
  4232. +    /* other I/O hardware */
  4233. +    AMIGAHW_DECLARE(AMI_KEYBOARD);    /* Amiga Keyboard */
  4234. +    AMIGAHW_DECLARE(AMI_MOUSE);        /* Amiga Mouse */
  4235. +    AMIGAHW_DECLARE(AMI_SERIAL);    /* Amiga Serial */
  4236. +    AMIGAHW_DECLARE(AMI_PARALLEL);    /* Amiga Parallel */
  4237. +    /* real time clocks */
  4238. +    AMIGAHW_DECLARE(A2000_CLK);        /* Hardware Clock (A2000 alike) */
  4239. +    AMIGAHW_DECLARE(A3000_CLK);        /* Hardware Clock (A3000 alike) */
  4240. +    /* supporting hardware */
  4241. +    AMIGAHW_DECLARE(CHIP_RAM);        /* Chip RAM */
  4242. +    AMIGAHW_DECLARE(PAULA);        /* Paula (8364) */
  4243. +    AMIGAHW_DECLARE(DENISE);        /* Denise (8362) */
  4244. +    AMIGAHW_DECLARE(DENISE_HR);        /* Denise (8373) */
  4245. +    AMIGAHW_DECLARE(LISA);        /* Lisa (8375) */
  4246. +    AMIGAHW_DECLARE(AGNUS_PAL);        /* Normal/Fat PAL Agnus (8367/8371) */
  4247. +    AMIGAHW_DECLARE(AGNUS_NTSC);    /* Normal/Fat NTSC Agnus (8361/8370) */
  4248. +    AMIGAHW_DECLARE(AGNUS_HR_PAL);    /* Fat Hires PAL Agnus (8372) */
  4249. +    AMIGAHW_DECLARE(AGNUS_HR_NTSC);    /* Fat Hires NTSC Agnus (8372) */
  4250. +    AMIGAHW_DECLARE(ALICE_PAL);        /* PAL Alice (8374) */
  4251. +    AMIGAHW_DECLARE(ALICE_NTSC);    /* NTSC Alice (8374) */
  4252. +    AMIGAHW_DECLARE(MAGIC_REKICK);    /* A3000 Magic Hard Rekick */
  4253. +    AMIGAHW_DECLARE(PCMCIA);        /* PCMCIA Slot */
  4254. +    AMIGAHW_DECLARE(ZORRO);        /* Zorro AutoConfig */
  4255. +    AMIGAHW_DECLARE(ZORRO3);        /* Zorro III */
  4256. +};
  4257. +
  4258. +extern struct amiga_hw_present amiga_hw_present;
  4259. +
  4260. +struct CUSTOM {
  4261. +    unsigned short bltddat;
  4262. +    unsigned short dmaconr;
  4263. +    unsigned short vposr;
  4264. +    unsigned short vhposr;
  4265. +    unsigned short dskdatr;
  4266. +    unsigned short joy0dat;
  4267. +    unsigned short joy1dat;
  4268. +    unsigned short clxdat;
  4269. +    unsigned short adkconr;
  4270. +    unsigned short pot0dat;
  4271. +    unsigned short pot1dat;
  4272. +    unsigned short potgor;
  4273. +    unsigned short serdatr;
  4274. +    unsigned short dskbytr;
  4275. +    unsigned short intenar;
  4276. +    unsigned short intreqr;
  4277. +    unsigned char  *dskptr;
  4278. +    unsigned short dsklen;
  4279. +    unsigned short dskdat;
  4280. +    unsigned short refptr;
  4281. +    unsigned short vposw;
  4282. +    unsigned short vhposw;
  4283. +    unsigned short copcon;
  4284. +    unsigned short serdat;
  4285. +    unsigned short serper;
  4286. +    unsigned short potgo;
  4287. +    unsigned short joytest;
  4288. +    unsigned short strequ;
  4289. +    unsigned short strvbl;
  4290. +    unsigned short strhor;
  4291. +    unsigned short strlong;
  4292. +    unsigned short bltcon0;
  4293. +    unsigned short bltcon1;
  4294. +    unsigned short bltafwm;
  4295. +    unsigned short bltalwm;
  4296. +    unsigned char  *bltcpt;
  4297. +    unsigned char  *bltbpt;
  4298. +    unsigned char  *bltapt;
  4299. +    unsigned char  *bltdpt;
  4300. +    unsigned short bltsize;
  4301. +    unsigned char  pad2d;
  4302. +    unsigned char  bltcon0l;
  4303. +    unsigned short bltsizv;
  4304. +    unsigned short bltsizh;
  4305. +    unsigned short bltcmod;
  4306. +    unsigned short bltbmod;
  4307. +    unsigned short bltamod;
  4308. +    unsigned short bltdmod;
  4309. +    unsigned short spare2[4];
  4310. +    unsigned short bltcdat;
  4311. +    unsigned short bltbdat;
  4312. +    unsigned short bltadat;
  4313. +    unsigned short spare3[3];
  4314. +    unsigned short deniseid;
  4315. +    unsigned short dsksync;
  4316. +    unsigned short *cop1lc;
  4317. +    unsigned short *cop2lc;
  4318. +    unsigned short copjmp1;
  4319. +    unsigned short copjmp2;
  4320. +    unsigned short copins;
  4321. +    unsigned short diwstrt;
  4322. +    unsigned short diwstop;
  4323. +    unsigned short ddfstrt;
  4324. +    unsigned short ddfstop;
  4325. +    unsigned short dmacon;
  4326. +    unsigned short clxcon;
  4327. +    unsigned short intena;
  4328. +    unsigned short intreq;
  4329. +    unsigned short adkcon;
  4330. +    struct {
  4331. +    unsigned short    *audlc;
  4332. +    unsigned short audlen;
  4333. +    unsigned short audper;
  4334. +    unsigned short audvol;
  4335. +    unsigned short auddat;
  4336. +    unsigned short audspare[2];
  4337. +    } aud[4];
  4338. +    unsigned char  *bplpt[8];
  4339. +    unsigned short bplcon0;
  4340. +    unsigned short bplcon1;
  4341. +    unsigned short bplcon2;
  4342. +    unsigned short bplcon3;
  4343. +    unsigned short bpl1mod;
  4344. +    unsigned short bpl2mod;
  4345. +    unsigned short bplcon4;
  4346. +    unsigned short clxcon2;
  4347. +    unsigned short bpldat[8];
  4348. +    unsigned char  *sprpt[8];
  4349. +    struct {
  4350. +    unsigned short pos;
  4351. +    unsigned short ctl;
  4352. +    unsigned short dataa;
  4353. +    unsigned short datab;
  4354. +    } spr[8];
  4355. +    unsigned short color[32];
  4356. +    unsigned short htotal;
  4357. +    unsigned short hsstop;
  4358. +    unsigned short hbstrt;
  4359. +    unsigned short hbstop;
  4360. +    unsigned short vtotal;
  4361. +    unsigned short vsstop;
  4362. +    unsigned short vbstrt;
  4363. +    unsigned short vbstop;
  4364. +    unsigned short sprhstrt;
  4365. +    unsigned short sprhstop;
  4366. +    unsigned short bplhstrt;
  4367. +    unsigned short bplhstop;
  4368. +    unsigned short hhposw;
  4369. +    unsigned short hhposr;
  4370. +    unsigned short beamcon0;
  4371. +    unsigned short hsstrt;
  4372. +    unsigned short vsstrt;
  4373. +    unsigned short hcenter;
  4374. +    unsigned short diwhigh;
  4375. +    unsigned short spare4[11];
  4376. +    unsigned short fmode;
  4377. +};
  4378. +
  4379. +/*
  4380. + * DMA register bits
  4381. + */
  4382. +#define DMAF_SETCLR        (0x8000)
  4383. +#define DMAF_AUD0        (0x0001)
  4384. +#define DMAF_AUD1        (0x0002)
  4385. +#define DMAF_AUD2        (0x0004)
  4386. +#define DMAF_AUD3        (0x0008)
  4387. +#define DMAF_DISK        (0x0010)
  4388. +#define DMAF_SPRITE        (0x0020)
  4389. +#define DMAF_BLITTER        (0x0040)
  4390. +#define DMAF_COPPER        (0x0080)
  4391. +#define DMAF_RASTER        (0x0100)
  4392. +#define DMAF_MASTER        (0x0200)
  4393. +#define DMAF_BLITHOG        (0x0400)
  4394. +#define DMAF_BLTNZERO        (0x2000)
  4395. +#define DMAF_BLTDONE        (0x4000)
  4396. +#define DMAF_ALL        (0x01FF)
  4397. +
  4398. +struct CIA {
  4399. +    unsigned char pra;         char pad0[0xff];
  4400. +    unsigned char prb;         char pad1[0xff];
  4401. +    unsigned char ddra;        char pad2[0xff];
  4402. +    unsigned char ddrb;        char pad3[0xff];
  4403. +    unsigned char talo;        char pad4[0xff];
  4404. +    unsigned char tahi;        char pad5[0xff];
  4405. +    unsigned char tblo;        char pad6[0xff];
  4406. +    unsigned char tbhi;        char pad7[0xff];
  4407. +    unsigned char todlo;    char pad8[0xff];
  4408. +    unsigned char todmid;    char pad9[0xff];
  4409. +    unsigned char todhi;    char pada[0x1ff];
  4410. +    unsigned char sdr;         char padb[0xff];
  4411. +    unsigned char icr;         char padc[0xff];
  4412. +    unsigned char cra;         char padd[0xff];
  4413. +    unsigned char crb;         char pade[0xff];
  4414. +};
  4415. +
  4416. +#define zTwoBase (0x80000000)
  4417. +#define ZTWO_PADDR(x) (((unsigned long)(x))-zTwoBase)
  4418. +#define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase)
  4419. +
  4420. +#define CUSTOM_PHYSADDR     (0xdff000)
  4421. +#define custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR)))
  4422. +
  4423. +#define CIAA_PHYSADDR      (0xbfe001)
  4424. +#define CIAB_PHYSADDR      (0xbfd000)
  4425. +#define ciaa   ((*(volatile struct CIA *)(zTwoBase + CIAA_PHYSADDR)))
  4426. +#define ciab   ((*(volatile struct CIA *)(zTwoBase + CIAB_PHYSADDR)))
  4427. +
  4428. +#ifdef CONFIG_APUS_CHIP_EXCEPT
  4429. +#define CHIP_PHYSADDR        (0x004000)
  4430. +#else
  4431. +#define CHIP_PHYSADDR        (0x000000)
  4432. +#endif
  4433. +#define chipaddr ((unsigned long)(zTwoBase + CHIP_PHYSADDR))
  4434. +void amiga_chip_init (void);
  4435. +void *amiga_chip_alloc (long size);
  4436. +void amiga_chip_free (void *);
  4437. +unsigned long amiga_chip_avail( void ); /*MILAN*/
  4438. +
  4439. +struct tod3000 {
  4440. +  unsigned int  :28, second2:4;    /* lower digit */
  4441. +  unsigned int  :28, second1:4;    /* upper digit */
  4442. +  unsigned int  :28, minute2:4;    /* lower digit */
  4443. +  unsigned int  :28, minute1:4;    /* upper digit */
  4444. +  unsigned int  :28, hour2:4;    /* lower digit */
  4445. +  unsigned int  :28, hour1:4;    /* upper digit */
  4446. +  unsigned int  :28, weekday:4;
  4447. +  unsigned int  :28, day2:4;    /* lower digit */
  4448. +  unsigned int  :28, day1:4;    /* upper digit */
  4449. +  unsigned int  :28, month2:4;    /* lower digit */
  4450. +  unsigned int  :28, month1:4;    /* upper digit */
  4451. +  unsigned int  :28, year2:4;    /* lower digit */
  4452. +  unsigned int  :28, year1:4;    /* upper digit */
  4453. +  unsigned int  :28, cntrl1:4;    /* control-byte 1 */
  4454. +  unsigned int  :28, cntrl2:4;    /* control-byte 2 */  
  4455. +  unsigned int  :28, cntrl3:4;    /* control-byte 3 */
  4456. +};
  4457. +#define TOD3000_CNTRL1_HOLD    0
  4458. +#define TOD3000_CNTRL1_FREE    9
  4459. +#define TOD_3000 ((struct tod3000 *)(zTwoBase+0xDC0000))
  4460. +
  4461. +struct tod2000 {
  4462. +  unsigned int  :28, second2:4;    /* lower digit */
  4463. +  unsigned int  :28, second1:4;    /* upper digit */
  4464. +  unsigned int  :28, minute2:4;    /* lower digit */
  4465. +  unsigned int  :28, minute1:4;    /* upper digit */
  4466. +  unsigned int  :28, hour2:4;    /* lower digit */
  4467. +  unsigned int  :28, hour1:4;    /* upper digit */
  4468. +  unsigned int  :28, day2:4;    /* lower digit */
  4469. +  unsigned int  :28, day1:4;    /* upper digit */
  4470. +  unsigned int  :28, month2:4;    /* lower digit */
  4471. +  unsigned int  :28, month1:4;    /* upper digit */
  4472. +  unsigned int  :28, year2:4;    /* lower digit */
  4473. +  unsigned int  :28, year1:4;    /* upper digit */
  4474. +  unsigned int  :28, weekday:4;
  4475. +  unsigned int  :28, cntrl1:4;    /* control-byte 1 */
  4476. +  unsigned int  :28, cntrl2:4;    /* control-byte 2 */  
  4477. +  unsigned int  :28, cntrl3:4;    /* control-byte 3 */
  4478. +};
  4479. +
  4480. +#define TOD2000_CNTRL1_HOLD    (1<<0)
  4481. +#define TOD2000_CNTRL1_BUSY    (1<<1)
  4482. +#define TOD2000_CNTRL3_24HMODE    (1<<2)
  4483. +#define TOD2000_HOUR1_PM    (1<<2)
  4484. +#define TOD_2000 ((struct tod2000 *)(zTwoBase+0xDC0000))
  4485. +
  4486. +#endif /* _M68K_AMIGAHW_H */
  4487. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amigappc.h ./include/asm-ppc/amigappc.h
  4488. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amigappc.h    Mon Jan  4 11:32:04 1999
  4489. +++ ./include/asm-ppc/amigappc.h    Sat May 15 19:30:27 1999
  4490. @@ -16,30 +16,23 @@
  4491.  
  4492.  #ifndef __ASSEMBLY__
  4493.  
  4494. -#ifndef iobarrier_rw /* Don't include io.h - avoid circular dependency */
  4495. -#define iobarrier_rw() eieio()
  4496. -#endif
  4497. +#include <asm/system.h>
  4498.  
  4499.  #define APUS_WRITE(_a_, _v_)                \
  4500.  do {                            \
  4501.      (*((volatile unsigned char *)(_a_)) = (_v_));    \
  4502. -    iobarrier_rw ();                \
  4503. +    mb();                        \
  4504.  } while (0)
  4505.  
  4506. -#define APUS_READ(_a_, _v_)                 \
  4507. +#define APUS_READ(_a_, _v_)                \
  4508.  do {                            \
  4509.      (_v_) = (*((volatile unsigned char *)(_a_)));    \
  4510. -    iobarrier_rw ();                \
  4511. +    mb();                        \
  4512.  } while (0)
  4513.  #endif /* ndef __ASSEMBLY__ */
  4514.  
  4515.  /* Maybe add a [#ifdef WANT_ZTWOBASE] condition to amigahw.h? */
  4516.  #define zTwoBase (0x80000000)
  4517. -
  4518. -/* At CYBERBASEp we find the following sum:
  4519. - * -KERNELBASE+CyberStormMemoryBase
  4520. - */
  4521. -#define CYBERBASEp (0xfff00000)
  4522.  
  4523.  #define APUS_IPL_BASE       (zTwoBase + 0x00f60000)
  4524.  #define APUS_REG_RESET        (APUS_IPL_BASE + 0x00)
  4525. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amigayle.h ./include/asm-ppc/amigayle.h
  4526. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amigayle.h    Mon Oct  5 22:09:06 1998
  4527. +++ ./include/asm-ppc/amigayle.h    Sat May 15 18:53:25 1999
  4528. @@ -1 +1 @@
  4529. -#include "../asm-m68k/amigayle.h"
  4530. +#include <asm-m68k/amigayle.h>
  4531. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amipcmcia.h ./include/asm-ppc/amipcmcia.h
  4532. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/amipcmcia.h    Mon Oct  5 22:09:06 1998
  4533. +++ ./include/asm-ppc/amipcmcia.h    Sat May 15 18:53:32 1999
  4534. @@ -1 +1 @@
  4535. -#include "../asm-m68k/amipcmcia.h"
  4536. +#include <asm-m68k/amipcmcia.h>
  4537. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/ide.h ./include/asm-ppc/ide.h
  4538. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/ide.h    Tue May 11 11:29:01 1999
  4539. +++ ./include/asm-ppc/ide.h    Sun May 16 14:22:59 1999
  4540. @@ -145,7 +145,7 @@
  4541.  /*
  4542.   * The following are not needed for the non-m68k ports
  4543.   */
  4544. -#define ide_ack_intr(base, irq)        (1)
  4545. +#define ide_ack_intr(hwif)    ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
  4546.  #define ide_release_lock(lock)        do {} while (0)
  4547.  #define ide_get_lock(lock, hdlr, data)    do {} while (0)
  4548.  
  4549. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/init.h ./include/asm-ppc/init.h
  4550. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/init.h    Mon Jan  4 15:16:13 1999
  4551. +++ ./include/asm-ppc/init.h    Tue Jan  5 20:12:11 1999
  4552. @@ -20,6 +20,12 @@
  4553.      __argprep __prep; \
  4554.      __argprep
  4555.  
  4556. +#define __apus __attribute__ ((__section__ (".text.apus")))
  4557. +#define __apusdata __attribute__ ((__section__ (".data.apus")))
  4558. +#define __apusfunc(__argapus) \
  4559. +    __argapus __apus; \
  4560. +    __argapus
  4561. +
  4562.  /* this is actually just common chrp/pmac code, not OF code -- Cort */
  4563.  #define __openfirmware __attribute__ ((__section__ (".text.openfirmware")))
  4564.  #define __openfirmwaredata __attribute__ ((__section__ (".data.openfirmware")))
  4565. @@ -51,6 +57,10 @@
  4566.  #define __prep
  4567.  #define __prepdata
  4568.  #define __prepfunc(x) x
  4569. +
  4570. +#define __apus
  4571. +#define __apusdata
  4572. +#define __apusfunc(x) x
  4573.  
  4574.  #define __openfirmware
  4575.  #define __openfirmwaredata
  4576. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/io.h ./include/asm-ppc/io.h
  4577. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/io.h    Tue May 11 11:29:01 1999
  4578. +++ ./include/asm-ppc/io.h    Sun May 16 13:37:55 1999
  4579. @@ -3,7 +3,9 @@
  4580.  
  4581.  #include <linux/config.h>
  4582.  #include <asm/page.h>
  4583. +#include <asm/pgtable.h>
  4584.  #include <asm/byteorder.h>
  4585. +#include <asm/processor.h>
  4586.  
  4587.  #define SIO_CONFIG_RA    0x398
  4588.  #define SIO_CONFIG_RD    0x399
  4589. @@ -24,33 +26,26 @@
  4590.  #define _ISA_MEM_BASE   0
  4591.  #define PCI_DRAM_OFFSET 0x80000000
  4592.  #else /* CONFIG_MBX8xx */
  4593. -#ifdef CONFIG_APUS
  4594. -#define _IO_BASE 0
  4595. -#define _ISA_MEM_BASE 0
  4596. -#define PCI_DRAM_OFFSET 0
  4597. -#else
  4598.  extern unsigned long isa_io_base;
  4599.  extern unsigned long isa_mem_base;
  4600.  extern unsigned long pci_dram_offset;
  4601.  #define _IO_BASE    isa_io_base
  4602.  #define _ISA_MEM_BASE    isa_mem_base
  4603.  #define PCI_DRAM_OFFSET    pci_dram_offset
  4604. -#endif /* CONFIG_APUS */
  4605.  #endif /* CONFIG_MBX8xx */
  4606.  
  4607.  #define readb(addr) in_8((volatile unsigned char *)(addr))
  4608.  #define writeb(b,addr) out_8((volatile unsigned char *)(addr), (b))
  4609. -#if defined(CONFIG_APUS)
  4610. -#define readw(addr) (*(volatile unsigned short *) (addr))
  4611. -#define readl(addr) (*(volatile unsigned int *) (addr))
  4612. -#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
  4613. -#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
  4614. -#else
  4615. -#define readw(addr) in_le16((volatile unsigned short *)(addr))
  4616. -#define readl(addr) in_le32((volatile unsigned *)(addr))
  4617. -#define writew(b,addr) out_le16((volatile unsigned short *)(addr),(b))
  4618. -#define writel(b,addr) out_le32((volatile unsigned *)(addr),(b))
  4619. -#endif
  4620. +#define readw(addr) ((is_apus) ? (*(volatile unsigned short *) (addr)) : \
  4621. +             in_le16((volatile unsigned short *)(addr)))
  4622. +#define readl(addr) ((is_apus) ? (*(volatile unsigned int *) (addr)) :    \
  4623. +             in_le32((volatile unsigned *)addr)) 
  4624. +#define writew(b,addr) ((is_apus) ?                      \
  4625. +            ((*(volatile unsigned short *) (addr)) = (b)) :     \
  4626. +            out_le16((volatile unsigned short *)(addr),(b)))
  4627. +#define writel(b,addr) ((is_apus) ?                    \
  4628. +            ((*(volatile unsigned int *) (addr)) = (b)) :    \
  4629. +            out_le32((volatile unsigned *)(addr),(b)))
  4630.  
  4631.  #define insb(port, buf, ns)    _insb((unsigned char *)((port)+_IO_BASE), (buf), (ns))
  4632.  #define outsb(port, buf, ns)    _outsb((unsigned char *)((port)+_IO_BASE), (buf), (ns))
  4633. @@ -61,17 +56,18 @@
  4634.  
  4635.  #define inb(port)        in_8((unsigned char *)((port)+_IO_BASE))
  4636.  #define outb(val, port)        out_8((unsigned char *)((port)+_IO_BASE), (val))
  4637. -#if defined(CONFIG_APUS)
  4638. -#define inw(port)        in_be16((unsigned short *)((port)+_IO_BASE))
  4639. -#define outw(val, port)        out_be16((unsigned short *)((port)+_IO_BASE), (val))
  4640. -#define inl(port)        in_be32((unsigned *)((port)+_IO_BASE))
  4641. -#define outl(val, port)        out_be32((unsigned *)((port)+_IO_BASE), (val))
  4642. -#else
  4643. -#define inw(port)        in_le16((unsigned short *)((port)+_IO_BASE))
  4644. -#define outw(val, port)        out_le16((unsigned short *)((port)+_IO_BASE), (val))
  4645. -#define inl(port)        in_le32((unsigned *)((port)+_IO_BASE))
  4646. -#define outl(val, port)        out_le32((unsigned *)((port)+_IO_BASE), (val))
  4647. -#endif
  4648. +#define inw(port) ((is_apus) ?                        \
  4649. +           in_be16((unsigned short *)(port)) :            \
  4650. +           in_le16((unsigned short *)((port)+_IO_BASE)))
  4651. +#define outw(val, port) ((is_apus) ?                        \
  4652. +             out_be16((unsigned short *)(port), (val)) :        \
  4653. +             out_le16((unsigned short *)((port)+_IO_BASE), (val)))
  4654. +#define inl(port) ((is_apus) ?                    \
  4655. +           in_be32((unsigned *)(port)) :        \
  4656. +           in_le32((unsigned *)((port)+_IO_BASE)))
  4657. +#define outl(val, port) ((is_apus) ?                     \
  4658. +             out_be32((unsigned *)(port), (val)) :         \
  4659. +             out_le32((unsigned *)((port)+_IO_BASE), (val)))
  4660.  
  4661.  #define inb_p(port)        in_8((unsigned char *)((port)+_IO_BASE))
  4662.  #define outb_p(val, port)    out_8((unsigned char *)((port)+_IO_BASE), (val))
  4663. @@ -105,6 +101,14 @@
  4664.  #define memcpy_toio(a,b,c)    memcpy((a),(b),(c))
  4665.  
  4666.  #ifdef __KERNEL__
  4667. +/* These are not used by the PPC ioremap, but prevents
  4668. +   compilation errors. */
  4669. +/* Values for nocacheflag and cmode */
  4670. +#define    IOMAP_FULL_CACHING        0
  4671. +#define    IOMAP_NOCACHE_SER        1
  4672. +#define    IOMAP_NOCACHE_NONSER        2
  4673. +#define    IOMAP_WRITETHROUGH        3
  4674. +
  4675.  /*
  4676.   * Map in an area of physical address space, for accessing
  4677.   * I/O devices etc.
  4678. @@ -113,20 +117,11 @@
  4679.                 unsigned long flags);
  4680.  extern void *ioremap(unsigned long address, unsigned long size);
  4681.  #define ioremap_nocache(addr, size)    ioremap((addr), (size))
  4682. +#define ioremap_writethrough(addr, size) \
  4683. +        __ioremap((addr), (size), _PAGE_WRITETHRU)
  4684.  extern void iounmap(void *addr);
  4685.  extern unsigned long iopa(unsigned long addr);
  4686. -#ifdef CONFIG_APUS
  4687.  extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const));
  4688. -#endif
  4689. -
  4690. -/* Values for nocacheflag and cmode */
  4691. -/* These are not used by the APUS kernel_map, but prevents
  4692. -   compilation errors. */
  4693. -#define    IOMAP_FULL_CACHING        0
  4694. -#define    IOMAP_NOCACHE_SER        1
  4695. -#define    IOMAP_NOCACHE_NONSER        2
  4696. -#define    IOMAP_WRITETHROUGH        3
  4697. -
  4698.  
  4699.  /*
  4700.   * The PCI bus is inherently Little-Endian.  The PowerPC is being
  4701. @@ -137,24 +132,22 @@
  4702.   */
  4703.  extern inline unsigned long virt_to_bus(volatile void * address)
  4704.  {
  4705. -#ifndef CONFIG_APUS
  4706. +    if (is_apus)
  4707. +        return iopa ((unsigned long) address);
  4708. +
  4709.          if (address == (void *)0)
  4710.          return 0;
  4711.          return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET;
  4712. -#else
  4713. -    return iopa ((unsigned long) address);
  4714. -#endif
  4715.  }
  4716.  
  4717.  extern inline void * bus_to_virt(unsigned long address)
  4718.  {
  4719. -#ifndef CONFIG_APUS
  4720. +    if (is_apus)
  4721. +        return (void*) mm_ptov (address);
  4722. +
  4723.          if (address == 0)
  4724.          return 0;
  4725.          return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
  4726. -#else
  4727. -    return (void*) mm_ptov (address);
  4728. -#endif
  4729.  }
  4730.  
  4731.  /*
  4732. @@ -163,20 +156,18 @@
  4733.   */
  4734.  extern inline unsigned long virt_to_phys(volatile void * address)
  4735.  {
  4736. -#ifndef CONFIG_APUS
  4737. +    if (is_apus)
  4738. +        return iopa ((unsigned long) address);
  4739. +
  4740.      return (unsigned long) address - KERNELBASE;
  4741. -#else
  4742. -    return iopa ((unsigned long) address);
  4743. -#endif
  4744.  }
  4745.  
  4746.  extern inline void * phys_to_virt(unsigned long address)
  4747.  {
  4748. -#ifndef CONFIG_APUS
  4749. +    if (is_apus)
  4750. +        return (void*) mm_ptov (address);
  4751. +
  4752.      return (void *) (address + KERNELBASE);
  4753. -#else
  4754. -    return (void*) mm_ptov (address);
  4755. -#endif
  4756.  }
  4757.  
  4758.  #endif /* __KERNEL__ */
  4759. @@ -190,13 +181,6 @@
  4760.  {
  4761.      __asm__ __volatile__ ("eieio" : : : "memory");
  4762.  }
  4763. -
  4764. -/* Enforce in-order execution of data I/O. 
  4765. - * No distinction between read/write on PPC; use eieio for all three.
  4766. - */
  4767. -#define iobarrier_rw() eieio()
  4768. -#define iobarrier_r()  eieio()
  4769. -#define iobarrier_w()  eieio()
  4770.  
  4771.  /*
  4772.   * 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
  4773. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/keyboard.h ./include/asm-ppc/keyboard.h
  4774. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/keyboard.h    Tue May 11 11:29:02 1999
  4775. +++ ./include/asm-ppc/keyboard.h    Sun May 16 11:31:09 1999
  4776. @@ -18,9 +18,6 @@
  4777.  #include <linux/config.h>
  4778.  #include <asm/adb.h>
  4779.  #include <asm/machdep.h>
  4780. -#ifdef CONFIG_APUS
  4781. -#include <asm-m68k/keyboard.h>
  4782. -#else
  4783.  
  4784.  #define KEYBOARD_IRQ            1
  4785.  #define DISABLE_KBD_DURING_INTERRUPTS    0
  4786. @@ -30,28 +27,28 @@
  4787.  {
  4788.      return ppc_md.kbd_setkeycode(scancode, keycode);
  4789.  }
  4790. -
  4791. -static inline int kbd_getkeycode(unsigned int x)
  4792. +  
  4793. +static inline int kbd_getkeycode(unsigned int scancode)
  4794.  {
  4795.      return ppc_md.kbd_getkeycode(scancode);
  4796.  }
  4797. -
  4798. +  
  4799.  static inline int kbd_translate(unsigned char keycode, unsigned char *keycodep,
  4800. -             char raw_mode)
  4801. +                char raw_mode)
  4802.  {
  4803.      return ppc_md.kbd_translate(keycode, keycodep, raw_mode);
  4804.  }
  4805. -
  4806. +  
  4807.  static inline int kbd_unexpected_up(unsigned char keycode)
  4808.  {
  4809.      return ppc_md.kbd_unexpected_up(keycode);
  4810.  }
  4811. -
  4812. +  
  4813.  static inline void kbd_leds(unsigned char leds)
  4814.  {
  4815.      ppc_md.kbd_leds(leds);
  4816.  }
  4817. -
  4818. +  
  4819.  static inline void kbd_init_hw(void)
  4820.  {
  4821.      ppc_md.kbd_init_hw();
  4822. @@ -64,8 +61,6 @@
  4823.  #else
  4824.  # define SYSRQ_KEY 0x54
  4825.  #endif
  4826. -
  4827. -#endif /* CONFIG_APUS */
  4828.  
  4829.  #endif /* __KERNEL__ */
  4830.  
  4831. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/linux_logo.h ./include/asm-ppc/linux_logo.h
  4832. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/linux_logo.h    Mon Oct  5 22:09:10 1998
  4833. +++ ./include/asm-ppc/linux_logo.h    Tue Jan  5 21:53:17 1999
  4834. @@ -12,14 +12,6 @@
  4835.   */
  4836.   
  4837.  #include <linux/config.h>
  4838. -#ifdef CONFIG_APUS
  4839. -#include <asm-m68k/linux_logo.h>
  4840. -
  4841. -#undef linux_logo_banner
  4842. -#define linux_logo_banner "Linux/PPC version " UTS_RELEASE
  4843. -
  4844. -#else
  4845. -
  4846.  #include <linux/init.h>
  4847.  
  4848.  #define linux_logo_banner "Linux/PPC version " UTS_RELEASE
  4849. @@ -48,4 +40,3 @@
  4850.  extern unsigned char linux_logo16[];
  4851.  
  4852.  #endif
  4853. -#endif /* CONFIG_APUS */
  4854. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/m68kserial.h ./include/asm-ppc/m68kserial.h
  4855. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/m68kserial.h    Thu Jan  1 01:00:00 1970
  4856. +++ ./include/asm-ppc/m68kserial.h    Sun May 16 11:55:59 1999
  4857. @@ -0,0 +1 @@
  4858. +#include <asm-m68k/m68kserial.h>
  4859. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/page.h ./include/asm-ppc/page.h
  4860. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/page.h    Tue May 11 11:29:03 1999
  4861. +++ ./include/asm-ppc/page.h    Sat May 15 11:35:57 1999
  4862. @@ -67,15 +67,34 @@
  4863.  #define copy_page(to,from)    memcpy((void *)(to), (void *)(from), PAGE_SIZE)
  4864.  
  4865.  /* map phys->virtual and virtual->phys for RAM pages */
  4866. -#ifdef CONFIG_APUS
  4867. -#include <asm/amigappc.h>
  4868. -/* Word at CYBERBASEp has the value (-KERNELBASE+CYBERBASE). */
  4869. -#define __pa(x)            ((unsigned long)(x)+(*(unsigned long*)CYBERBASEp))
  4870. -#define __va(x)            ((void *)((unsigned long)(x)-(*(unsigned long*)CYBERBASEp)))
  4871. -#else
  4872. -#define __pa(x)            ((unsigned long)(x)-PAGE_OFFSET)
  4873. -#define __va(x)            ((void *)((unsigned long)(x)+PAGE_OFFSET))
  4874. -#endif
  4875. +static inline unsigned long ___pa(unsigned long v)
  4876. +{ 
  4877. +    unsigned long p;
  4878. +    asm volatile ("1: addis %0, %1, %2;" 
  4879. +              ".section \".vtop_fixup\",\"aw\";"
  4880. +              ".align  1;"
  4881. +              ".long   1b;"
  4882. +              ".previous;"
  4883. +              : "=r" (p) 
  4884. +              : "b" (v), "K" (((-PAGE_OFFSET) >> 16) & 0xffff));
  4885. +
  4886. +    return p;
  4887. +}
  4888. +static inline void* ___va(unsigned long p)
  4889. +{ 
  4890. +    unsigned long v;
  4891. +    asm volatile ("1: addis %0, %1, %2;" 
  4892. +              ".section \".ptov_fixup\",\"aw\";"
  4893. +              ".align  1;"
  4894. +              ".long   1b;"
  4895. +              ".previous;"
  4896. +              : "=r" (v) 
  4897. +              : "b" (p), "K" (((PAGE_OFFSET) >> 16) & 0xffff));
  4898. +
  4899. +    return (void*) v;
  4900. +}
  4901. +#define __pa(x) ___pa ((unsigned long)(x))
  4902. +#define __va(x) ___va ((unsigned long)(x))
  4903.  
  4904.  #define MAP_NR(addr)        (((unsigned long)addr-PAGE_OFFSET) >> PAGE_SHIFT)
  4905.  #define MAP_PAGE_RESERVED    (1<<15)
  4906. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/pgtable.h ./include/asm-ppc/pgtable.h
  4907. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/pgtable.h    Tue May 11 11:29:03 1999
  4908. +++ ./include/asm-ppc/pgtable.h    Sun May 16 13:37:55 1999
  4909. @@ -610,7 +611,6 @@
  4910.  #define module_map      vmalloc
  4911.  #define module_unmap    vfree
  4912.  
  4913. -/* CONFIG_APUS */
  4914.  /* For virtual address to physical address conversion */
  4915.  extern void cache_clear(__u32 addr, int length);
  4916.  extern void cache_push(__u32 addr, int length);
  4917. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/processor.h ./include/asm-ppc/processor.h
  4918. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/processor.h    Wed May 12 09:57:47 1999
  4919. +++ ./include/asm-ppc/processor.h    Sat May 15 18:33:35 1999
  4920. @@ -24,7 +24,7 @@
  4921.  #define MSR_RI        (1<<1)        /* Recoverable Exception */
  4922.  #define MSR_LE        (1<<0)        /* Little-Endian enable */
  4923.  
  4924. -#ifdef CONFIG_APUS
  4925. +#ifdef CONFIG_APUS_FAST_EXCEPT
  4926.  #define MSR_        MSR_ME|MSR_IP|MSR_RI
  4927.  #else
  4928.  #define MSR_        MSR_ME|MSR_RI
  4929. @@ -181,6 +181,7 @@
  4930.  extern int have_of;
  4931.  extern int is_prep;
  4932.  extern int is_chrp;
  4933. +extern int is_apus;
  4934.  extern int is_powerplus;
  4935.  
  4936.  /* what kind of prep workstation we are */
  4937. @@ -288,5 +289,4 @@
  4938.  
  4939.  #endif /* ndef ASSEMBLY*/
  4940.  
  4941. -  
  4942.  #endif /* __ASM_PPC_PROCESSOR_H */
  4943. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/serial.h ./include/asm-ppc/serial.h
  4944. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/serial.h    Fri Aug  7 15:56:22 1998
  4945. +++ ./include/asm-ppc/serial.h    Sat May 15 18:52:39 1999
  4946. @@ -4,10 +4,6 @@
  4947.  
  4948.  #include <linux/config.h>
  4949.  
  4950. -#ifdef CONFIG_APUS
  4951. -#include <asm-m68k/serial.h>
  4952. -#else
  4953. -
  4954.  /*
  4955.   * This assumes you have a 1.8432 MHz clock for your UART.
  4956.   *
  4957. @@ -119,5 +115,3 @@
  4958.      EXTRA_SERIAL_PORT_DEFNS        \
  4959.      HUB6_SERIAL_PORT_DFNS        \
  4960.      MCA_SERIAL_PORT_DFNS
  4961. -
  4962. -#endif /* CONFIG_APUS */
  4963. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/system.h ./include/asm-ppc/system.h
  4964. --- /home/jskov/kernel/dist/linux-2.2.8/include/asm-ppc/system.h    Wed May 12 09:57:49 1999
  4965. +++ ./include/asm-ppc/system.h    Sat May 15 18:35:15 1999
  4966. @@ -39,6 +39,14 @@
  4967.      asm("dcbf %0,%1; sync" : : "r" (line), "r" (0));
  4968.  }
  4969.  
  4970. +extern __inline__ void dcbi(void *line)
  4971. +{
  4972. +    asm("dcbi %0,%1\n\t"
  4973. +        "sync \n\t"
  4974. +        "isync \n\t"
  4975. +        :: "r" (line), "r" (0));
  4976. +}
  4977. +
  4978.  extern __inline__ void __restore_flags(unsigned long flags)
  4979.  {
  4980.          extern atomic_t ppc_n_lost_interrupts;
  4981. diff -u --recursive -B --exclude-from=/home/jskov/lib/diff-excludes -P /home/jskov/kernel/dist/linux-2.2.8/include/linux/socket.h ./include/linux/socket.h
  4982. --- /home/jskov/kernel/dist/linux-2.2.8/include/linux/socket.h    Thu Apr 22 15:01:41 1999
  4983. +++ ./include/linux/socket.h    Sat May 15 18:27:25 1999
  4984. @@ -1,7 +1,7 @@
  4985.  #ifndef _LINUX_SOCKET_H
  4986.  #define _LINUX_SOCKET_H
  4987.  
  4988. -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
  4989. +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) || (defined(__powerpc__) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
  4990.  
  4991.  #include <asm/socket.h>            /* arch-dependent defines    */
  4992.  #include <linux/sockios.h>        /* the SIOCxxx I/O controls    */
  4993.