00e3deef8e
This commit was created with scripts/clean-includes. All .c should include qemu/osdep.h first. The script performs three related cleanups: * Ensure .c files include qemu/osdep.h first. * Including it in a .h is redundant, since the .c already includes it. Drop such inclusions. * Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
40 lines
1.3 KiB
C
40 lines
1.3 KiB
C
/*
|
|
* Aspeed i2c bus interface to reading and writing to i2c device registers
|
|
*
|
|
* Copyright (c) 2023 IBM Corporation
|
|
*
|
|
* Authors:
|
|
* Stefan Berger <stefanb@linux.ibm.com>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
#ifndef QTEST_ASPEED_H
|
|
#define QTEST_ASPEED_H
|
|
|
|
#include "libqtest.h"
|
|
|
|
#define AST2600_ASPEED_I2C_BASE_ADDR 0x1e78a000
|
|
|
|
/* Implements only AST2600 I2C controller */
|
|
|
|
static inline uint32_t ast2600_i2c_calc_bus_addr(uint8_t bus_num)
|
|
{
|
|
return AST2600_ASPEED_I2C_BASE_ADDR + 0x80 + bus_num * 0x80;
|
|
}
|
|
|
|
uint8_t aspeed_i2c_readb(QTestState *s,
|
|
uint32_t baseaddr, uint8_t slave_addr, uint8_t reg);
|
|
uint16_t aspeed_i2c_readw(QTestState *s,
|
|
uint32_t baseaddr, uint8_t slave_addr, uint8_t reg);
|
|
uint32_t aspeed_i2c_readl(QTestState *s,
|
|
uint32_t baseaddr, uint8_t slave_addr, uint8_t reg);
|
|
void aspeed_i2c_writeb(QTestState *s, uint32_t baseaddr, uint8_t slave_addr,
|
|
uint8_t reg, uint8_t v);
|
|
void aspeed_i2c_writew(QTestState *s, uint32_t baseaddr, uint8_t slave_addr,
|
|
uint8_t reg, uint16_t v);
|
|
void aspeed_i2c_writel(QTestState *s, uint32_t baseaddr, uint8_t slave_addr,
|
|
uint8_t reg, uint32_t v);
|
|
|
|
#endif
|