From owner-p4-projects@FreeBSD.ORG Sat Jul 8 13:58:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3393B16A4E0; Sat, 8 Jul 2006 13:58:35 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F351516A4DA for ; Sat, 8 Jul 2006 13:58:34 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A10BF43D49 for ; Sat, 8 Jul 2006 13:58:34 +0000 (GMT) (envelope-from wkoszek@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k68DwYZL042462 for ; Sat, 8 Jul 2006 13:58:34 GMT (envelope-from wkoszek@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k68DwYOn042459 for perforce@freebsd.org; Sat, 8 Jul 2006 13:58:34 GMT (envelope-from wkoszek@FreeBSD.org) Date: Sat, 8 Jul 2006 13:58:34 GMT Message-Id: <200607081358.k68DwYOn042459@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wkoszek@FreeBSD.org using -f From: "Wojciech A. Koszek" To: Perforce Change Reviews Cc: Subject: PERFORCE change 101016 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jul 2006 13:58:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=101016 Change 101016 by wkoszek@wkoszek_laptop on 2006/07/08 13:57:39 Bring intr_enable() to cpufunc.h and uncomment calling in machdep.c. It might be useful to make sure some portions of the code are called with interrupts enabled/disabled (we already have intr_destroy() and intr_restore() couple). XXXMIPS: For know I've been given free hand with modifications on this branch. Since it's P4, we accept things going wrong for a while. It will be basically related with directory structure, since we will have to spend some time on good planning and reviewing, if the chip versions bring big differences between themselves. Affected files ... .. //depot/projects/mips2/src/sys/mips/include/cpufunc.h#11 edit .. //depot/projects/mips2/src/sys/mips/mips/machdep.c#8 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/cpufunc.h#11 (text+ko) ==== @@ -188,6 +188,17 @@ return (s); } +static __inline register_t +intr_enable(void) +{ + register_t s; + + s = mips_rd_status(); + mips_wr_status(s | MIPS_SR_IE); + + return (s); +} + #define intr_restore(s) mips_wr_status((s)) static __inline void ==== //depot/projects/mips2/src/sys/mips/mips/machdep.c#8 (text+ko) ==== @@ -295,6 +295,42 @@ } +void +platform_start(int argc, char **argv) +{ + volatile uint32_t * dest_ch; + +#define MALTA_FPGA_BASE 0x1f000000 /* FPGA: */ +#define MALTA_FPGA_SIZE 0x00c00000 /* 12 MByte */ + +#define MALTA_LEDBAR (MALTA_FPGA_BASE + 0x408) +#define MALTA_ASCIIWORD (MALTA_FPGA_BASE + 0x410) +#define MALTA_ASCII_BASE (MALTA_FPGA_BASE + 0x418) +#define MALTA_ASCIIPOS0 0x00 +#define MALTA_ASCIIPOS1 0x08 +#define MALTA_ASCIIPOS2 0x10 +#define MALTA_ASCIIPOS3 0x18 +#define MALTA_ASCIIPOS4 0x20 +#define MALTA_ASCIIPOS5 0x28 +#define MALTA_ASCIIPOS6 0x30 +#define MALTA_ASCIIPOS7 0x38 + +#define MALTA_PUTCHAR(pos, ch) \ + dest_ch = (uint32_t *) \ + MIPS_PHYS_TO_KSEG0(MALTA_ASCII_BASE + MALTA_ASCIIPOS ## pos); \ + *dest_ch = (uint32_t) (ch); + + MALTA_PUTCHAR(0, 'F'); + MALTA_PUTCHAR(1, 'r'); + MALTA_PUTCHAR(2, 'e'); + MALTA_PUTCHAR(3, 'E'); + MALTA_PUTCHAR(4, 'B'); + MALTA_PUTCHAR(5, 'S'); + MALTA_PUTCHAR(6, 'D'); + + memset((char *)MIPS_PHYS_TO_KSEG0(0x1fc00500 + 0x04), 'x', 10); +} + void setPQL2(int *const size, int *const ways); void