xref: /reactos/hal/halx86/xbox/halxbox.h (revision 177ae91b)
1 /*
2  * PROJECT:         Xbox HAL
3  * LICENSE:         GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:         Xbox specific routines
5  * COPYRIGHT:       Copyright 2004 Gé van Geldorp (gvg@reactos.com)
6  *                  Copyright 2019-2020 Stanislav Motylkov (x86corez@gmail.com)
7  *
8  * REFERENCES:      https://xboxdevwiki.net/SMBus
9  *                  https://github.com/XboxDev/cromwell/blob/master/drivers/pci/i2cio.c
10  *                  https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-amd756.c
11  *                  https://github.com/xqemu/xqemu/blob/master/hw/xbox/smbus_xbox_smc.c
12  */
13 
14 #ifndef HALXBOX_H_INCLUDED
15 #define HALXBOX_H_INCLUDED
16 
17 #include <hal.h>
18 #include <ntdddisk.h>
19 
20 #define TAG_HAL_XBOX 'XlaH'
21 
22 #define SMB_IO_BASE 0xC000
23 
24 #define SMB_GLOBAL_STATUS  (0 + SMB_IO_BASE)
25 #define SMB_GLOBAL_ENABLE  (2 + SMB_IO_BASE)
26 #define SMB_HOST_ADDRESS   (4 + SMB_IO_BASE)
27 #define SMB_HOST_DATA      (6 + SMB_IO_BASE)
28 #define SMB_HOST_COMMAND   (8 + SMB_IO_BASE)
29 
30 #define SMB_DEVICE_SMC_PIC16LC  0x10
31 
32 #define SMC_REG_POWER           0x02
33 #define SMC_REG_POWER_RESET     0x01
34 #define SMC_REG_POWER_CYCLE     0x40
35 #define SMC_REG_POWER_SHUTDOWN  0x80
36 
37 VOID HalpXboxInitPciBus(PBUS_HANDLER BusHandler);
38 VOID HalpXboxInitPartIo(VOID);
39 
40 #endif /* HALXBOX_H_INCLUDED */
41 
42 /* EOF */
43