Konstantin Porotchkin | 73cd881 | 2018-02-26 16:06:35 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 Marvell International Ltd. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * https://spdx.org/licenses |
| 6 | */ |
Konstantin Porotchkin | 73cd881 | 2018-02-26 16:06:35 +0200 | [diff] [blame] | 7 | /* This driver provides I2C support for Marvell A8K and compatible SoCs */ |
| 8 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 9 | #ifndef MENTOR_I2C_PLAT_H |
| 10 | #define MENTOR_I2C_PLAT_H |
Konstantin Porotchkin | 73cd881 | 2018-02-26 16:06:35 +0200 | [diff] [blame] | 11 | |
| 12 | #define CONFIG_SYS_TCLK 250000000 |
| 13 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 14 | #define CONFIG_SYS_I2C_SLAVE 0x0 |
Konstantin Porotchkin | 73cd881 | 2018-02-26 16:06:35 +0200 | [diff] [blame] | 15 | |
Icenowy Zheng | d9cb895 | 2018-07-21 19:06:46 +0800 | [diff] [blame] | 16 | #define I2C_CAN_UNSTUCK |
Konstantin Porotchkin | 73cd881 | 2018-02-26 16:06:35 +0200 | [diff] [blame] | 17 | |
Icenowy Zheng | d9cb895 | 2018-07-21 19:06:46 +0800 | [diff] [blame] | 18 | struct mentor_i2c_regs { |
Konstantin Porotchkin | 73cd881 | 2018-02-26 16:06:35 +0200 | [diff] [blame] | 19 | uint32_t slave_address; |
| 20 | uint32_t data; |
| 21 | uint32_t control; |
| 22 | union { |
| 23 | uint32_t status; /* when reading */ |
| 24 | uint32_t baudrate; /* when writing */ |
Icenowy Zheng | d5bdb23 | 2018-07-21 18:19:43 +0800 | [diff] [blame] | 25 | }; |
Konstantin Porotchkin | 73cd881 | 2018-02-26 16:06:35 +0200 | [diff] [blame] | 26 | uint32_t xtnd_slave_addr; |
| 27 | uint32_t reserved[2]; |
| 28 | uint32_t soft_reset; |
| 29 | uint8_t reserved2[0xa0 - 0x20]; |
| 30 | uint32_t unstuck; |
| 31 | }; |
| 32 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 33 | #endif /* MENTOR_I2C_PLAT_H */ |