/* * linux/arch/m68k/boot/amiga/linuxboot.h -- Generic routine to boot Linux/m68k * on Amiga, used by both Amiboot and * Amiga-Lilo. * * Created 1996 by Geert Uytterhoeven * * * This file is based on the original bootstrap code (bootstrap.c): * * Copyright (C) 1993, 1994 Hamish Macdonald * Greg Harp * * with work by Michael Rausch * Geert Uytterhoeven * Frank Neumann * Andreas Schwab * * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details. */ #include #include /* * Amiboot Version */ #define AMIBOOT_VERSION "4.0" /* * Parameters passed to linuxboot() */ struct linuxboot_args { const char *kernelname; const char *ramdiskname; const char *commandline; int debugflag; int keep_video; int reset_boards; void (*puts)(const char *str); long (*getchar)(void); void (*putchar)(char c); void (*printf)(const char *fmt, ...); int (*open)(const char *path); int (*seek)(int fd, int offset); int (*read)(int fd, char *buf, int count); void (*close)(int fd); int (*filesize)(const char *path); void (*sleep)(u_long micros); int (*modify_bootinfo)(struct bootinfo *bi); }; /* * Boot the Linux/m68k Operating System */ extern u_long linuxboot(const struct linuxboot_args *args); /* * Amiga Models */ extern const char *amiga_models[]; extern const u_long first_amiga_model; extern const u_long last_amiga_model; /* * Exec Library Definitions */ #define TRUE (1) #define FALSE (0) struct List { struct Node *lh_Head; struct Node *lh_Tail; struct Node *lh_TailPred; u_char lh_Type; u_char l_pad; }; struct MemChunk { struct MemChunk *mc_Next; /* pointer to next chunk */ u_long mc_Bytes; /* chunk byte size */ }; #define MEMF_PUBLIC (1<<0) #define MEMF_CHIP (1<<1) #define MEMF_FAST (1<<2) #define MEMF_LOCAL (1<<8) #define MEMF_CLEAR (1<<16) struct MemHeader { struct Node mh_Node; u_short mh_Attributes; /* characteristics of this region */ struct MemChunk *mh_First; /* first free region */ void *mh_Lower; /* lower memory bound */ void *mh_Upper; /* upper memory bound+1 */ u_long mh_Free; /* total number of free bytes */ }; struct ExecBase { u_char fill1[20]; u_short Version; u_char fill2[274]; u_short AttnFlags; u_char fill3[24]; struct List MemList; u_char fill4[194]; u_char VBlankFrequency; u_char PowerSupplyFrequency; u_char fill5[36]; u_long ex_EClockFrequency; u_char fill6[60]; }; #define AFB_68020 (1) #define AFF_68020 (1<AttnFlags & AFF_68040) __asm __volatile ("moveq #0,d0;" ".long 0x4e7b0003;" /* movec d0,tc */ ".long 0x4e7b0004;" /* movec d0,itt0 */ ".long 0x4e7b0005;" /* movec d0,itt1 */ ".long 0x4e7b0006;" /* movec d0,dtt0 */ ".long 0x4e7b0007" /* movec d0,dtt1 */ : /* no outputs */ : /* no inputs */ : "d0"); else { __asm __volatile ("subl #4,sp;" "pmove tc,sp@;" "bclr #7,sp@;" "pmove sp@,tc;" "addl #4,sp"); if (SysBase->AttnFlags & AFF_68030) __asm __volatile ("clrl sp@-;" ".long 0xf0170800;" /* pmove sp@,tt0 */ ".long 0xf0170c00;" /* pmove sp@,tt1 */ "addql #4,sp"); } }