Merge tag 'dm-9oct18' of git://git.denx.de/u-boot-dm
[platform/kernel/u-boot.git] / arch / sandbox / include / asm / test.h
index 451a78e..8e60f80 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Test-related constants for sandbox
  *
  * Copyright (c) 2014 Google, Inc
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __ASM_TEST_H
 #define SANDBOX_PCI_CLASS_CODE         PCI_CLASS_CODE_COMM
 #define SANDBOX_PCI_CLASS_SUB_CODE     PCI_CLASS_SUB_CODE_COMM_SERIAL
 
+#define PCI_CAP_ID_PM_OFFSET           0x50
+#define PCI_CAP_ID_EXP_OFFSET          0x60
+#define PCI_CAP_ID_MSIX_OFFSET         0x70
+
+#define PCI_EXT_CAP_ID_ERR_OFFSET      0x100
+#define PCI_EXT_CAP_ID_VC_OFFSET       0x200
+#define PCI_EXT_CAP_ID_DSN_OFFSET      0x300
+
+/* Useful for PCI_VDEVICE() macro */
+#define PCI_VENDOR_ID_SANDBOX          SANDBOX_PCI_VENDOR_ID
+#define SWAP_CASE_DRV_DATA             0x55aa
+
 #define SANDBOX_CLK_RATE               32768
 
 /* System controller driver data */
@@ -79,4 +90,27 @@ long sandbox_i2c_rtc_get_set_base_time(struct udevice *dev, long base_time);
 
 int sandbox_usb_keyb_add_string(struct udevice *dev, const char *str);
 
+/**
+ * sandbox_osd_get_mem() - get the internal memory of a sandbox OSD
+ *
+ * @dev:       OSD device for which to access the internal memory for
+ * @buf:       pointer to buffer to receive the OSD memory data
+ * @buflen:    length of buffer in bytes
+ */
+int sandbox_osd_get_mem(struct udevice *dev, u8 *buf, size_t buflen);
+
+/**
+ * sandbox_pwm_get_config() - get the PWM config for a channel
+ *
+ * @dev: Device to check
+ * @channel: Channel number to check
+ * @period_ns: Period of the PWM in nanoseconds
+ * @duty_ns: Current duty cycle of the PWM in nanoseconds
+ * @enable: true if the PWM is enabled
+ * @polarity: true if the PWM polarity is active high
+ * @return 0 if OK, -ENOSPC if the PWM number is invalid
+ */
+int sandbox_pwm_get_config(struct udevice *dev, uint channel, uint *period_nsp,
+                          uint *duty_nsp, bool *enablep, bool *polarityp);
+
 #endif