ec/google/chromeec: Update Tablet event call
[coreboot.git] / src / southbridge / via / common / via_early_smbus.h
blob5f66822b884df5c4776eeb1470129ccfad9b9856
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2013 Alexandru Gagniuc <mr.nuke.me@gmail.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 /**
18 * @file via_early_smbus.h
20 * This file contains generic definitions used in VIA SMBus controllers.
22 * Functions defined in device/early/smbus.h are each implemented in a separate
23 * early_smbus_[func_name].c file. This makes it possible to override any of
24 * these functions by not including them in your build, via Makefile.c. This is
25 * useful when there is a need to work around chipset bugs.
27 * These implementations work with most via chipsets. Any VIA port should try
28 * to use these. Makefile.inc needs to be adapted to link against the files
29 * providing SMBus functionality:
30 * @code
31 * romstage-y += ./../../../southbridge/via/common/early_smbus_func.c
32 * @endcode
35 /**
36 * \brief SMBus IO ports in relation to the base IO port
38 #define SMBHSTSTAT(base) ((u16)base + 0x0)
39 #define SMBSLVSTAT(base) ((u16)base + 0x1)
40 #define SMBHSTCTL(base) ((u16)base + 0x2)
41 #define SMBHSTCMD(base) ((u16)base + 0x3)
42 #define SMBXMITADD(base) ((u16)base + 0x4)
43 #define SMBHSTDAT0(base) ((u16)base + 0x5)
44 #define SMBHSTDAT1(base) ((u16)base + 0x6)
45 #define SMBBLKDAT(base) ((u16)base + 0x7)
46 #define SMBSLVCTL(base) ((u16)base + 0x8)
47 #define SMBTRNSADD(base) ((u16)base + 0x9)
48 #define SMBSLVDATA (base) ((u16)base + 0xa)
50 #define SMBUS_TIMEOUT (100*1000*10)
52 #include <device/early_smbus.h>
53 #include <arch/io.h>