Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / i386 / include / xbox.h
blob8f63fa3b645276a610f597ace783e98c04780bde
1 /* $NetBSD: xbox.h,v 1.2 2007/01/06 18:42:36 jmcneill Exp $ */
3 /*-
4 * Copyright (c) 2005 Rink Springer
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * $FreeBSD: /repoman/r/ncvs/src/sys/i386/include/xbox.h,v 1.3.2.1 2006/08/23 16:28:03 rink Exp $
31 #ifndef _MACHINE_XBOX_H_
32 #define _MACHINE_XBOX_H_
34 #define XBOX_LED_GREEN 0x0f
35 #define XBOX_LED_RED 0xf0
36 #define XBOX_LED_FLASHRED 0xa0
37 #define XBOX_LED_FLASHGREEN 0x03
39 #define XBOX_RAM_SIZE (arch_i386_xbox_memsize * 1024 * 1024)
40 #define XBOX_FB_SIZE (0x400000)
41 #define XBOX_FB_START (0xf0000000 | (XBOX_RAM_SIZE - XBOX_FB_SIZE))
42 #define XBOX_FB_START_PTR (0xFD600800)
45 * Defines for X3LCD controller
47 #define X3LCD_O_LIGHT 0xF503
48 #define X3LCD_O_DAT 0xF504
49 #define X3LCD_O_CMD 0xF505
50 #define X3LCD_O_DIR_DAT 0xF506
51 #define X3LCD_O_DIR_CMD 0xF507
52 #define X3LCD_O_CTR_TIME 2
53 #define X3LCD_DISPCON_RS 0x01
54 #define X3LCD_DISPCON_RW 0x02
55 #define X3LCD_DISPCON_E 0x04
57 #define X3LCD_CMD 0x00
58 #define X3LCD_INI 0x01
59 #define X3LCD_DAT 0x02
61 #define X3LCD_CLEAR 0x01
62 #define X3LCD_HOME 0x02
63 #define X3LCD_ENTRY_MODE 0x04
64 #define X3LCD_S_FLAG 0x01
65 #define X3LCD_ID_FLAG 0x02
67 #define X3LCD_CONTROL 0x08
68 #define X3LCD_D_FLAG 0x04
69 #define X3LCD_C_FLAG 0x02
70 #define X3LCD_B_FLAG 0x01
72 #define X3LCD_FUNC_SET 0x20
73 #define X3LCD_DL_FLAG 0x10
74 #define X3LCD_N_FLAG 0x08
75 #define X3LCD_F_FLAG 0x04
77 #define X3LCD_DDRAM_SET 0x80
79 extern int arch_i386_is_xbox;
80 extern uint32_t arch_i386_xbox_memsize; /* Megabytes */
82 void xbox_setled(uint8_t);
83 void xbox_reboot(void);
84 void xbox_poweroff(void);
85 void xbox_startup(void);
87 void xbox_lcd_init(void);
88 void xbox_lcd_output(unsigned char data, unsigned char command);
89 void xbox_lcd_setpos(unsigned int pos, unsigned int line);
90 void xbox_lcd_writestring(char *lcdstring);
91 void xbox_lcd_writetext(const char *lcdtext);
92 void xbox_lcd_putchar(unsigned char data);
94 /* xboxfb related */
95 int xboxfb_cnattach(void);
98 #endif /* !_MACHINE_XBOX_H_ */