[linux] porting cvitek asic chips.

1. update cv182x/cv183x configuration file
	2. update cv181x/cv180x configuration file
	3. update clk driver for cvitek
	4. update dma driver for cvitek
	5. update soc driver for cvitek
	6. porting cvitek ion driver from kernel-4.19
	7. compatible with riscv

Change-Id: Icff9fafe0ebe7d6bab824bbadb952e08bdc66c19
This commit is contained in:
wangliang.wang
2023-03-09 14:38:25 +08:00
committed by sam.xiang
parent 4bc998a131
commit 4f810186ab
2062 changed files with 544892 additions and 2134 deletions

View File

@ -19,6 +19,9 @@
#ifndef __LINUX_USB_OTG_FSM_H
#define __LINUX_USB_OTG_FSM_H
#if defined(CONFIG_CVITEK_USB_LEGACY)
#include <linux/device.h>
#endif
#include <linux/mutex.h>
#include <linux/errno.h>
@ -35,8 +38,11 @@
* OTG and EH 2.0 Charpter 6.2.3
* Table:6-5
*/
#if defined(CONFIG_CVITEK_USB_LEGACY) && defined(USB_SIM_SPEED_UP)
#define T_HOST_REQ_POLL (10)
#else
#define T_HOST_REQ_POLL (1500) /* 1500ms, HNP polling interval */
#endif
enum otg_fsm_timer {
/* Standard OTG timers */
@ -69,11 +75,13 @@ enum otg_fsm_timer {
* ADP measurement taken at n-2, differs by more than CADP_THR
* @power_up: TRUE when the OTG device first powers up its USB system and
* ADP measurement taken if ADP capable
* @overcurrent: TRUE when overcurrent condition detected
*
* A-Device state inputs
* @a_srp_det: TRUE if the A-device detects SRP
* @a_vbus_vld: TRUE when VBUS voltage is in regulation
* @b_conn: TRUE if the A-device detects connection from the B-device
* @a_srp_det_not_compliant_dev: TRUE if A-device detected not compliant device
* @a_bus_resume: TRUE when the B-device detects that the A-device is signaling
* a resume (K state)
* B-Device state inputs
@ -133,12 +141,21 @@ enum otg_fsm_timer {
* a_clr_err: Asserted (by application ?) to clear a_vbus_err due to an
* overcurrent condition and causes the A-device to transition
* to a_wait_vfall
*
* Timers
* @a_bidl_adis_tmout: TRUE when TA_BIDL_ADIS timer interrupt occurs
* @b_aidl_bdis_tmout: TRUE when TB_AIDL_BDIS timer interrupt occurs
*
*/
struct otg_fsm {
/* Input */
int id;
int adp_change;
int power_up;
#if defined(CONFIG_CVITEK_USB_LEGACY)
int overcurrent;
int a_srp_det_not_compliant_dev;
#endif
int a_srp_det;
int a_vbus_vld;
int b_conn;
@ -187,6 +204,9 @@ struct otg_fsm {
int a_aidl_bdis_tmout;
int b_ase0_brst_tmout;
int a_bidl_adis_tmout;
#if defined(CONFIG_CVITEK_USB_LEGACY)
int b_aidl_bdis_tmout;
#endif
struct otg_fsm_ops *ops;
struct usb_otg *otg;
@ -197,6 +217,10 @@ struct otg_fsm {
u8 *host_req_flag;
struct delayed_work hnp_polling_work;
bool state_changed;
#if defined(CONFIG_CVITEK_USB_LEGACY)
/* for debug prints */
struct device *dev;
#endif
};
struct otg_fsm_ops {
@ -211,6 +235,9 @@ struct otg_fsm_ops {
void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
int (*start_host)(struct otg_fsm *fsm, int on);
int (*start_gadget)(struct otg_fsm *fsm, int on);
#if defined(CONFIG_CVITEK_USB_LEGACY)
int (*start_enum)(struct usb_bus *bus, unsigned int port_num);
#endif
};