summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2021-08-20 12:19:52 +0200
committerCommit Bot <commit-bot@chromium.org>2021-09-02 21:00:56 +0000
commit16245fe2c3f2b8b98627a06f0577c84c22ef1eb4 (patch)
tree97275fbda753bf3e5cb6c797cda0d9e943f6d43e /driver
parent20c87cd1de3c0a06be92bf64b01ea9d2584f5b5b (diff)
downloadchrome-ec-16245fe2c3f2b8b98627a06f0577c84c22ef1eb4.tar.gz
zephyr: Add BB retimer emulator
Add BB retimer emulator on i2c bus. Emulator properties can be defined using device tree or runtime emulator API. Emulator checks if RO registers and reserved bits are accessed correctly. API allows to set custom read/write i2c messagess handlers to emulate complex behaviour. BUG=b:184856919 BRANCH=none TEST=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I4b641a90e6fb55e89aaee388c0ac04ab7bf367ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3110085 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/retimer/bb_retimer.c2
-rw-r--r--driver/retimer/bb_retimer.h46
2 files changed, 1 insertions, 47 deletions
diff --git a/driver/retimer/bb_retimer.c b/driver/retimer/bb_retimer.c
index 75da6c653d..319c965228 100644
--- a/driver/retimer/bb_retimer.c
+++ b/driver/retimer/bb_retimer.c
@@ -5,7 +5,7 @@
* Driver for Intel Burnside Bridge - Thunderbolt/USB/DisplayPort Retimer
*/
-#include "bb_retimer.h"
+#include "driver/retimer/bb_retimer.h"
#include "chipset.h"
#include "common.h"
#include "console.h"
diff --git a/driver/retimer/bb_retimer.h b/driver/retimer/bb_retimer.h
deleted file mode 100644
index ddbdec0986..0000000000
--- a/driver/retimer/bb_retimer.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2019 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * Driver header for Intel Burnside Bridge - Thunderbolt/USB/DisplayPort Retimer
- */
-
-#ifndef __CROS_EC_BB_RETIMER_H
-#define __CROS_EC_BB_RETIMER_H
-
-#include "gpio.h"
-#include "usb_mux.h"
-#include "driver/retimer/bb_retimer_public.h"
-
-/* Burnside Bridge I2C Configuration Space */
-#define BB_RETIMER_REG_VENDOR_ID 0
-#define BB_RETIMER_VENDOR_ID_1 0x8086
-#define BB_RETIMER_VENDOR_ID_2 0x8087
-
-#define BB_RETIMER_REG_DEVICE_ID 1
-#define BB_RETIMER_DEVICE_ID 0x15EE
-
-/* Connection State Register Attributes */
-#define BB_RETIMER_REG_CONNECTION_STATE 4
-#define BB_RETIMER_DATA_CONNECTION_PRESENT BIT(0)
-#define BB_RETIMER_CONNECTION_ORIENTATION BIT(1)
-#define BB_RETIMER_RE_TIMER_DRIVER BIT(2)
-#define BB_RETIMER_USB_2_CONNECTION BIT(4)
-#define BB_RETIMER_USB_3_CONNECTION BIT(5)
-#define BB_RETIMER_USB_3_SPEED BIT(6)
-#define BB_RETIMER_USB_DATA_ROLE BIT(7)
-#define BB_RETIMER_DP_CONNECTION BIT(8)
-#define BB_RETIMER_DP_PIN_ASSIGNMENT BIT(10)
-#define BB_RETIMER_IRQ_HPD BIT(14)
-#define BB_RETIMER_HPD_LVL BIT(15)
-#define BB_RETIMER_TBT_CONNECTION BIT(16)
-#define BB_RETIMER_TBT_TYPE BIT(17)
-#define BB_RETIMER_TBT_CABLE_TYPE BIT(18)
-#define BB_RETIMER_VPRO_DOCK_DP_OVERDRIVE BIT(19)
-#define BB_RETIMER_TBT_ACTIVE_LINK_TRAINING BIT(20)
-#define BB_RETIMER_ACTIVE_PASSIVE BIT(22)
-#define BB_RETIMER_USB4_ENABLED BIT(23)
-#define BB_RETIMER_USB4_TBT_CABLE_SPEED_SUPPORT(x) (((x) & 0x7) << 25)
-#define BB_RETIMER_TBT_CABLE_GENERATION(x) (((x) & 0x3) << 28)
-
-#endif /* __CROS_EC_BB_RETIMER_H */