Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Initial commit for merging A7000/NC with the RISCPC...



details:   https://anonhg.NetBSD.org/src/rev/aac5afbd13d8
branches:  trunk
changeset: 512327:aac5afbd13d8
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Mon Jul 09 21:46:19 2001 +0000

description:
Initial commit for merging A7000/NC with the RISCPC in order to get _one_
bootable GENERAL kernel for the 3 machines.

This is done by integrating the ARM7500 in a better way. In various places
the IOMD ID is checked and action is taken at runtime compared to
compiletime.

The small piece of assembler that is changed now uses the flag
`arm7500_ioc_found' that is set up by iomd.c at startup. When this chip
isnt found at startup it will skip reading the ARM7500 extended IRQ
registers and wont clear them either.

The next step will be getting the mode-definition files to the bootloader.
Currently they are compiled in.

diffstat:

 sys/arch/arm/include/cpu.h            |  11 +----
 sys/arch/arm32/include/irqhandler.h   |  67 +++++++++++++++------------
 sys/arch/arm32/include/vidc.h         |   8 +--
 sys/arch/arm32/iomd/iomd.c            |  10 +++-
 sys/arch/arm32/iomd/iomd_dma.c        |  85 ++--------------------------------
 sys/arch/arm32/iomd/iomd_irq.S        |  48 ++++++++++++++----
 sys/arch/arm32/iomd/iomd_irqhandler.c |  23 +++++++--
 sys/arch/arm32/podulebus/podulebus.c  |   6 +--
 sys/arch/arm32/riscpc/rpc_machdep.c   |  12 +----
 sys/arch/arm32/vidc/beep.c            |   5 +-
 sys/arch/arm32/vidc/vidc20.c          |  22 ++++++++-
 sys/arch/arm32/vidc/vidcaudio.c       |   5 +-
 12 files changed, 134 insertions(+), 168 deletions(-)

diffs (truncated from 627 to 300 lines):

diff -r eabbaff288a3 -r aac5afbd13d8 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Mon Jul 09 21:33:03 2001 +0000
+++ b/sys/arch/arm/include/cpu.h        Mon Jul 09 21:46:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.13 2001/06/14 22:56:56 thorpej Exp $ */
+/*     $NetBSD: cpu.h,v 1.14 2001/07/09 21:46:19 reinoud Exp $ */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -89,15 +89,6 @@
 #ifndef CPU_ARM7
 #error "option CPU_ARM7 is required with CPU_ARM7500"
 #endif
-#ifdef CPU_ARM6
-#error "CPU options CPU_ARM6 and CPU_ARM7500 are not compatible"
-#endif
-#ifdef CPU_ARM8
-#error "CPU options CPU_ARM8 and CPU_ARM7500 are not compatible"
-#endif
-#ifdef CPU_SA110
-#error "CPU options CPU_SA110 and CPU_ARM7500 are not compatible"
-#endif
 #endif /* CPU_ARM7500 */
 
 #endif /* !_LKM */
diff -r eabbaff288a3 -r aac5afbd13d8 sys/arch/arm32/include/irqhandler.h
--- a/sys/arch/arm32/include/irqhandler.h       Mon Jul 09 21:33:03 2001 +0000
+++ b/sys/arch/arm32/include/irqhandler.h       Mon Jul 09 21:46:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irqhandler.h,v 1.17 2001/05/30 12:28:40 mrg Exp $      */
+/*     $NetBSD: irqhandler.h,v 1.18 2001/07/09 21:46:19 reinoud Exp $  */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -60,10 +60,10 @@
 
 #if defined(RISCPC) || defined(CPU_ARM7500)
 
-#ifdef CPU_ARM7500
+/* Only for ARM7500 : */
 
 /*#define IRQ_PRINTER  0x00*/
-#define IRQ_RESERVED0  0x01
+/*#define IRQ_RESERVED0        0x01*/
 #define IRQ_BUTTON     0x02
 #define IRQ_FLYBACK    0x03
 #define IRQ_POR                0x04
@@ -93,8 +93,9 @@
 #define IRQ_ATOD       0x1A
 #define IRQ_CLOCK      0x1B
 #define IRQ_PANIC      0x1C
-#define IRQ_RESERVED2  0x1D
-#define IRQ_RESERVED3  0x1E
+/*#define IRQ_RESERVED2        0x1D*/
+/*#define IRQ_RESERVED3        0x1E*/
+
 
 /*
  * Note that Sound DMA IRQ is on the 31st vector.
@@ -111,34 +112,39 @@
 
 #else  /* RC7500 */
 
-#define IRQ_RESERVED1  0x07
+/*#define IRQ_RESERVED1        0x07 */
 #define IRQ_EXTENDED   0x0B
 #define IRQ_PODULE     0x0D
 
-#define IRQ_EXPCARD0   0x20
-#define IRQ_EXPCARD1   0x21
-#define IRQ_EXPCARD2   0x22
-#define IRQ_EXPCARD3   0x23
-#define IRQ_EXPCARD4   0x24
-#define IRQ_EXPCARD5   0x25
-#define IRQ_EXPCARD6   0x26
-#define IRQ_EXPCARD7   0x27
+#define ARM7500_IOC_IRQ_EXPCARD0       0x20
+/*
+       define IRQ_EXPCARD1     0x21
+       define IRQ_EXPCARD2     0x22
+       define IRQ_EXPCARD3     0x23
+       define IRQ_EXPCARD4     0x24
+       define IRQ_EXPCARD5     0x25
+       define IRQ_EXPCARD6     0x26
+       define IRQ_EXPCARD7     0x27
+*/
 
 #endif /* RC7500 */
 
-#else  /* CPU_ARM7500 */
+
+
+
+/* for non ARM7500 machines : */
 
 #ifdef RISCPC
 /*#define IRQ_PRINTER  0x00*/
-#define IRQ_RESERVED0  0x01
+/*#define IRQ_RESERVED0        0x01*/
 /*#define IRQ_FLOPPYIDX        0x02*/
 #define IRQ_FLYBACK    0x03
 #define IRQ_POR                0x04
 #define IRQ_TIMER0     0x05
 #define IRQ_TIMER1     0x06
-#define IRQ_RESERVED1  0x07
+/*#define IRQ_RESERVED1        0x07*/
 
-#define IRQ_RESERVED2  0x08
+/*#define IRQ_RESERVED2        0x08*/
 /*#define IRQ_HD       0x09*/
 /*#define IRQ_SERIAL   0x0A*/
 #define IRQ_EXTENDED   0x0B
@@ -153,21 +159,22 @@
 #define IRQ_DMACH3     0x13
 #define IRQ_DMASCH0    0x14
 #define IRQ_DMASCH1    0x15
-#define IRQ_RESERVED3  0x16
-#define IRQ_RESERVED4  0x17
+/*#define IRQ_RESERVED3        0x16*/
+/*#define IRQ_RESERVED4        0x17*/
 
-#define IRQ_EXPCARD0   0x18
-#define IRQ_EXPCARD1   0x19
-#define IRQ_EXPCARD2   0x1A
-#define IRQ_EXPCARD3   0x1B
-#define IRQ_EXPCARD4   0x1C
-#define IRQ_EXPCARD5   0x1D
-#define IRQ_EXPCARD6   0x1E
-#define IRQ_EXPCARD7   0x1F
+#define RPC600_IOMD_IRQ_EXPCARD0       0x18
+/*
+       define IRQ_EXPCARD1     0x19
+       define IRQ_EXPCARD2     0x1A
+       define IRQ_EXPCARD3     0x1B
+       define IRQ_EXPCARD4     0x1C
+       define IRQ_EXPCARD5     0x1D
+       define IRQ_EXPCARD6     0x1E
+       define IRQ_EXPCARD7     0x1F
+*/
+
 #endif /* RISCPC */
 
-#endif /* CPU_ARM7500 */
-
 #endif /* RISPC || CPU_ARM7500 */
 
 #ifdef  OFWGENCFG
diff -r eabbaff288a3 -r aac5afbd13d8 sys/arch/arm32/include/vidc.h
--- a/sys/arch/arm32/include/vidc.h     Mon Jul 09 21:33:03 2001 +0000
+++ b/sys/arch/arm32/include/vidc.h     Mon Jul 09 21:46:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vidc.h,v 1.12 2001/05/30 12:28:40 mrg Exp $    */
+/*     $NetBSD: vidc.h,v 1.13 2001/07/09 21:46:19 reinoud Exp $        */
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -201,11 +201,7 @@
        int dctl;
 };
 
-#ifdef CPU_ARM7500
-#define        VIDC_FREF       32000000
-#else
-#define VIDC_FREF      24000000
-#endif /* CPU_ARM7500 */
+extern int vidc_fref;          /* reference frequency of detected VIDC */
 
 #ifdef _KERNEL
 extern int  vidc_write         __P((u_int /*reg*/, int /*value*/));
diff -r eabbaff288a3 -r aac5afbd13d8 sys/arch/arm32/iomd/iomd.c
--- a/sys/arch/arm32/iomd/iomd.c        Mon Jul 09 21:33:03 2001 +0000
+++ b/sys/arch/arm32/iomd/iomd.c        Mon Jul 09 21:46:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iomd.c,v 1.11 2001/05/13 14:30:00 bjh21 Exp $  */
+/*     $NetBSD: iomd.c,v 1.12 2001/07/09 21:46:19 reinoud Exp $        */
 
 /*
  * Copyright (c) 1996-1997 Mark Brinicombe.
@@ -95,6 +95,10 @@
 int       iomd_found;
 u_int32_t iomd_base = IOMD_BASE;
 
+/* following flag is used in iomd_irq.s ... has to be cleaned up one day ! */
+u_int32_t arm7500_ioc_found = 0;
+
+
 /* Declare prototypes */
 
 /*
@@ -178,18 +182,22 @@
        case ARM7500_IOC_ID:
                printf("ARM7500 IOMD ");
                refresh = bus_space_read_1(iot, ioh, IOMD_REFCR) & 0x0f;
+               arm7500_ioc_found = 1;
                break;
        case ARM7500FE_IOC_ID:
                printf("ARM7500FE IOMD ");
                refresh = bus_space_read_1(iot, ioh, IOMD_REFCR) & 0x0f;
+               arm7500_ioc_found = 1;
                break;
        case RPC600_IOMD_ID:
                printf("IOMD20 ");
                refresh = bus_space_read_1(iot, ioh, IOMD_VREFCR) & 0x09;
+               arm7500_ioc_found = 0;
                break;
        default:
                printf("Unknown IOMD ID=%04x ", sc->sc_id);
                refresh = -1;
+               arm7500_ioc_found = 0;          /* just in case */
                break;
        }
        
diff -r eabbaff288a3 -r aac5afbd13d8 sys/arch/arm32/iomd/iomd_dma.c
--- a/sys/arch/arm32/iomd/iomd_dma.c    Mon Jul 09 21:33:03 2001 +0000
+++ b/sys/arch/arm32/iomd/iomd_dma.c    Mon Jul 09 21:46:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iomd_dma.c,v 1.9 2001/02/27 20:23:11 reinoud Exp $     */
+/*     $NetBSD: iomd_dma.c,v 1.10 2001/07/09 21:46:20 reinoud Exp $    */
 
 /*
  * Copyright (c) 1995 Scott Stevens
@@ -49,7 +49,11 @@
 #include <arm32/iomd/iomdvar.h>
 #include <arm32/iomd/iomd_dma.h>
 
-#ifndef CPU_ARM7500
+
+/*
+ * Only for non ARM7500 machines but the kernel could be booted on a different machine
+ */
+
 static struct dma_ctrl ctrl[6];
 
 void dma_dumpdc __P((struct dma_ctrl *));
@@ -319,81 +323,4 @@
 
        return(dp);
 }
-#else
-void
-dma_go(dp)
-       struct dma_ctrl *dp;
-{
-       panic("dma_go\n");
-}
 
-int
-dma_reset(dp)
-       struct dma_ctrl *dp;
-{
-       panic("dma_reset\n");
-       return(0);
-}
-
-/*
- * Setup dma transfer, prior to the dma_go call
- */
-int
-dma_setup(dp, start, len, readp)
-       struct dma_ctrl *dp;
-       int readp;
-       u_char *start;
-       int len;
-{
-       panic("dma_setup\n");
-       return(0);
-}
-
-/*
- * return true if DMA is active
- */
-int
-dma_isactive(dp)
-       struct dma_ctrl *dp;
-{
-       panic("dma_isactive\n");
-       return(0);
-}
-
-/*
- * return true if interrupt pending
- */
-int
-dma_isintr(dp)
-       struct dma_ctrl *dp;
-{
-       panic("dma_isintr\n");
-       return(0);
-}
-
-int
-dma_intr(dp)
-       struct dma_ctrl *dp;
-{
-       panic("dma_intr\n");
-       return(0);
-}
-
-void
-dma_dumpdc(dc)



Home | Main Index | Thread Index | Old Index