Files
86Box/src/include/86box/smbus.h

67 lines
1.7 KiB
C
Raw Normal View History

/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Definitions for the SMBus host controllers.
*
*
*
* Authors: RichardG, <richardg867@gmail.com>
*
* Copyright 2020 RichardG.
*/
2022-02-18 19:42:21 -05:00
#ifndef EMU_SMBUS_PIIX4_H
2022-09-18 17:15:38 -04:00
#define EMU_SMBUS_PIIX4_H
2022-09-18 17:15:38 -04:00
#define SMBUS_PIIX4_BLOCK_DATA_SIZE 32
#define SMBUS_PIIX4_BLOCK_DATA_MASK (SMBUS_PIIX4_BLOCK_DATA_SIZE - 1)
2022-09-18 17:15:38 -04:00
#define SMBUS_ALI7101_BLOCK_DATA_SIZE 32
#define SMBUS_ALI7101_BLOCK_DATA_MASK (SMBUS_ALI7101_BLOCK_DATA_SIZE - 1)
enum {
SMBUS_PIIX4 = 0,
SMBUS_VIA
};
typedef struct {
2022-09-18 17:15:38 -04:00
uint32_t local;
uint16_t io_base;
int clock;
double bit_period;
uint8_t stat, next_stat, ctl, cmd, addr,
data0, data1,
index, data[SMBUS_PIIX4_BLOCK_DATA_SIZE];
pc_timer_t response_timer;
void *i2c;
} smbus_piix4_t;
2021-07-04 18:16:35 +02:00
typedef struct {
2022-09-18 17:15:38 -04:00
uint32_t local;
uint16_t io_base;
uint8_t stat, next_stat, ctl, cmd, addr,
data0, data1,
index, data[SMBUS_ALI7101_BLOCK_DATA_SIZE];
pc_timer_t response_timer;
void *i2c;
2021-07-04 18:16:35 +02:00
} smbus_ali7101_t;
2022-09-18 17:15:38 -04:00
extern void smbus_piix4_remap(smbus_piix4_t *dev, uint16_t new_io_base, uint8_t enable);
extern void smbus_piix4_setclock(smbus_piix4_t *dev, int clock);
2022-09-18 17:15:38 -04:00
extern void smbus_ali7101_remap(smbus_ali7101_t *dev, uint16_t new_io_base, uint8_t enable);
#ifdef EMU_DEVICE_H
extern const device_t piix4_smbus_device;
extern const device_t via_smbus_device;
2021-07-04 18:16:35 +02:00
extern const device_t ali7101_smbus_device;
#endif
2022-09-18 17:15:38 -04:00
#endif /*EMU_SMBUS_PIIX4_H*/