a8k_i2c.c 704 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Copyright (C) 2018 Marvell International Ltd.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 * https://spdx.org/licenses
 */

/* This driver provides I2C support for Marvell A8K and compatible SoCs */

#include <mmio.h>

#define CONFIG_SYS_TCLK			250000000
#define CONFIG_SYS_I2C_SPEED		100000
#define CONFIG_SYS_I2C_SLAVE		0x0

16
#define I2C_CAN_UNSTUCK
17

18
struct  mentor_i2c_regs {
19
20
21
22
23
24
	uint32_t slave_address;
	uint32_t data;
	uint32_t control;
	union {
		uint32_t status;	/* when reading */
		uint32_t baudrate;	/* when writing */
25
	};
26
27
28
29
30
31
32
	uint32_t xtnd_slave_addr;
	uint32_t reserved[2];
	uint32_t soft_reset;
	uint8_t  reserved2[0xa0 - 0x20];
	uint32_t unstuck;
};

33
#include "../../mentor/i2c/mi2cv.c"