xref: /openbmc/linux/drivers/phy/broadcom/phy-brcm-usb-init.h (revision 9c92ab61914157664a2fbdf926df0eb937838e45)
1*9c92ab61SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
249859e55SAl Cooper /*
349859e55SAl Cooper  * Copyright (C) 2014-2017 Broadcom
449859e55SAl Cooper  */
549859e55SAl Cooper 
649859e55SAl Cooper #ifndef _USB_BRCM_COMMON_INIT_H
749859e55SAl Cooper #define _USB_BRCM_COMMON_INIT_H
849859e55SAl Cooper 
949859e55SAl Cooper #define USB_CTLR_MODE_HOST 0
1049859e55SAl Cooper #define USB_CTLR_MODE_DEVICE 1
1149859e55SAl Cooper #define USB_CTLR_MODE_DRD 2
1249859e55SAl Cooper #define USB_CTLR_MODE_TYPEC_PD 3
1349859e55SAl Cooper 
1449859e55SAl Cooper struct  brcm_usb_init_params;
1549859e55SAl Cooper 
1649859e55SAl Cooper struct  brcm_usb_init_params {
1749859e55SAl Cooper 	void __iomem *ctrl_regs;
1849859e55SAl Cooper 	void __iomem *xhci_ec_regs;
1949859e55SAl Cooper 	int ioc;
2049859e55SAl Cooper 	int ipp;
2149859e55SAl Cooper 	int mode;
2249859e55SAl Cooper 	u32 family_id;
2349859e55SAl Cooper 	u32 product_id;
2449859e55SAl Cooper 	int selected_family;
2549859e55SAl Cooper 	const char *family_name;
2649859e55SAl Cooper 	const u32 *usb_reg_bits_map;
2749859e55SAl Cooper };
2849859e55SAl Cooper 
2949859e55SAl Cooper void brcm_usb_set_family_map(struct brcm_usb_init_params *params);
3049859e55SAl Cooper int brcm_usb_init_get_dual_select(struct brcm_usb_init_params *params);
3149859e55SAl Cooper void brcm_usb_init_set_dual_select(struct brcm_usb_init_params *params,
3249859e55SAl Cooper 				   int mode);
3349859e55SAl Cooper 
3449859e55SAl Cooper void brcm_usb_init_ipp(struct brcm_usb_init_params *ini);
3549859e55SAl Cooper void brcm_usb_init_common(struct brcm_usb_init_params *ini);
3649859e55SAl Cooper void brcm_usb_init_eohci(struct brcm_usb_init_params *ini);
3749859e55SAl Cooper void brcm_usb_init_xhci(struct brcm_usb_init_params *ini);
3849859e55SAl Cooper void brcm_usb_uninit_common(struct brcm_usb_init_params *ini);
3949859e55SAl Cooper void brcm_usb_uninit_eohci(struct brcm_usb_init_params *ini);
4049859e55SAl Cooper void brcm_usb_uninit_xhci(struct brcm_usb_init_params *ini);
4149859e55SAl Cooper 
4249859e55SAl Cooper #endif /* _USB_BRCM_COMMON_INIT_H */
43