From 80ac49e0495eb6f461ada9f723af1a182f24d05c Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Thu, 28 Oct 2010 05:13:21 +0000 Subject: [PATCH] arch/m68k-amiga: Move Custom hw regs out of start .. just noticed hardware/custom.h .. I need to use that instead of this, but that is for another day. Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@34991 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/m68k-amiga/boot/amiga_hwreg.h | 61 ++++++++++++++++++++++++++++++++++++++ arch/m68k-amiga/boot/start.c | 44 +-------------------------- 2 files changed, 62 insertions(+), 43 deletions(-) create mode 100644 arch/m68k-amiga/boot/amiga_hwreg.h diff --git a/arch/m68k-amiga/boot/amiga_hwreg.h b/arch/m68k-amiga/boot/amiga_hwreg.h new file mode 100644 index 0000000000..56bb21a753 --- /dev/null +++ b/arch/m68k-amiga/boot/amiga_hwreg.h @@ -0,0 +1,61 @@ +/* + Copyright © 1995-2010, The AROS Development Team. All rights reserved. + $Id$ + + Desc: m68k-amiga hardware registers + Lang: english + */ + +#ifndef AMIGA_HWREG_H +#define AMIGA_HWREG_H + +/** Interrupts */ +#define INTENAR 0x1c +#define INTREQR 0x1e +#define INTENA 0x9a +#define INTREQ 0x9c + +/** Screen/Serial Debug **/ + +#define SERPER_BASE_PAL 3546895 +#define SERPER_BASE_NTSC 3579545 +#define SERPER 0x32 +#define SERPER_BAUD(base, x) (((base)/(x)-1) & 0x7fff) /* Baud rate */ +#define SERDATR 0x18 +#define SERDATR_OVRUN (1 << 15) /* Overrun */ +#define SERDATR_RBF (1 << 14) /* Rx Buffer Full */ +#define SERDATR_TBE (1 << 13) /* Tx Buffer Empty */ +#define SERDATR_TSRE (1 << 12) /* Tx Shift Empty */ +#define SERDATR_RXD (1 << 11) /* Rx Pin */ +#define SERDATR_STP9 (1 << 9) /* Stop bit (if 9 data) */ +#define SERDATR_STP8 (1 << 8) /* Stop bit (if 8 data) */ +#define SERDATR_DB9_of(x) ((x) & 0x1ff) /* 9-bit data */ +#define SERDATR_DB8_of(x) ((x) & 0xff) /* 8-bit data */ +#define ADKCON 0x9e +#define ADKCON_SETCLR (1 << 15) +#define ADKCON_UARTBRK (1 << 11) /* Force break */ +#define SERDAT 0x30 +#define SERDAT_STP9 (1 << 9) +#define SERDAT_STP8 (1 << 8) +#define SERDAT_DB9(x) ((x) & 0x1ff) +#define SERDAT_DB8(x) ((x) & 0xff) + +#define BPLCON0 0x100 +#define BPL1DAT 0x110 +#define COLOR00 0x180 + +static inline void reg_w(ULONG reg, UWORD val) +{ + volatile UWORD *r = (void *)(0xdff000 + reg); + + *r = val; +} + +static inline UWORD reg_r(ULONG reg) +{ + volatile UWORD *r = (void *)(0xdff000 + reg); + + return *r; +} + +#endif /* AMIGA_HWREG_H */ diff --git a/arch/m68k-amiga/boot/start.c b/arch/m68k-amiga/boot/start.c index 9abec40917..a73c41c98e 100644 --- a/arch/m68k-amiga/boot/start.c +++ b/arch/m68k-amiga/boot/start.c @@ -15,54 +15,12 @@ #include "kernel_romtags.h" #define USE_GDBSTUB +#include "amiga_hwreg.h" extern const struct Resident Exec_resident; extern void __clear_bss(const struct KernelBSS *bss); -/** Screen/Serial Debug **/ - -#define SERPER_BASE_PAL 3546895 -#define SERPER_BASE_NTSC 3579545 -#define SERPER 0x32 -#define SERPER_BAUD(base, x) (((base)/(x)-1) & 0x7fff) /* Baud rate */ -#define SERDATR 0x18 -#define SERDATR_OVRUN (1 << 15) /* Overrun */ -#define SERDATR_RBF (1 << 14) /* Rx Buffer Full */ -#define SERDATR_TBE (1 << 13) /* Tx Buffer Empty */ -#define SERDATR_TSRE (1 << 12) /* Tx Shift Empty */ -#define SERDATR_RXD (1 << 11) /* Rx Pin */ -#define SERDATR_STP9 (1 << 9) /* Stop bit (if 9 data) */ -#define SERDATR_STP8 (1 << 8) /* Stop bit (if 8 data) */ -#define SERDATR_DB9_of(x) ((x) & 0x1ff) /* 9-bit data */ -#define SERDATR_DB8_of(x) ((x) & 0xff) /* 8-bit data */ -#define ADKCON 0x9e -#define ADKCON_SETCLR (1 << 15) -#define ADKCON_UARTBRK (1 << 11) /* Force break */ -#define SERDAT 0x30 -#define SERDAT_STP9 (1 << 9) -#define SERDAT_STP8 (1 << 8) -#define SERDAT_DB9(x) ((x) & 0x1ff) -#define SERDAT_DB8(x) ((x) & 0xff) - -#define BPLCON0 0x100 -#define BPL1DAT 0x110 -#define COLOR00 0x180 - -static inline void reg_w(ULONG reg, UWORD val) -{ - volatile UWORD *r = (void *)(0xdff000 + reg); - - *r = val; -} - -static inline UWORD reg_r(ULONG reg) -{ - volatile UWORD *r = (void *)(0xdff000 + reg); - - return *r; -} - #define RGB(r,g,b) ((((r) & 0xf) << 8) | (((g) & 0xf) << 4) | (((b) & 0xf) << 0)) #define CODE_ROM_CHECK RGB( 4, 4, 4) -- 2.11.4.GIT