Modify usb_check_phymode

This commit is contained in:
songyanguang 2024-09-03 16:26:48 +08:00
parent ab8ba67a83
commit c9838c2161
1 changed files with 8 additions and 5 deletions

View File

@ -82,10 +82,12 @@ static void usb_check_phymode(int id)
#define PIPE_PHY_GRF0 0xFDC70000 #define PIPE_PHY_GRF0 0xFDC70000
#define PIPE_PHY_GRF1 0xFDC80000 #define PIPE_PHY_GRF1 0xFDC80000
#define PIPE_PHY_GRF_PIPE_CON0 0x00 #define PIPE_PHY_GRF_PIPE_CON0 0x00
#define PIPE_PHY_GRF_PIPE_CON3 0x0C
#define PIPE_PHY_GRF_VIRADDR_BASE 0x0000002100000000ULL #define PIPE_PHY_GRF_VIRADDR_BASE 0x0000002100000000ULL
void *base = (void *)PIPE_PHY_GRF0; void *base = (void *)PIPE_PHY_GRF0;
void *base_vir = (void *)PIPE_PHY_GRF_VIRADDR_BASE; void *base_vir = (void *)PIPE_PHY_GRF_VIRADDR_BASE;
uint32_t pipe_phymode; uint32_t con0;
uint32_t con3;
if (USB3_0_ID == id) { if (USB3_0_ID == id) {
base = (void *)PIPE_PHY_GRF0; base = (void *)PIPE_PHY_GRF0;
@ -98,10 +100,11 @@ static void usb_check_phymode(int id)
USB_LOG_ERR("usb_check_phy mmap fail\n"); USB_LOG_ERR("usb_check_phy mmap fail\n");
} }
pipe_phymode = readl ( base_vir + PIPE_PHY_GRF_PIPE_CON0 ); con0 = readl ( base_vir + PIPE_PHY_GRF_PIPE_CON0 );
USB_LOG_DBG("usb_check_phy PIPE_PHY_GRF_PIPE_CON0=%08X\n", pipe_phymode); con3 = readl ( base_vir + PIPE_PHY_GRF_PIPE_CON3 );
if ( (pipe_phymode & 0x000C) != 0x0004) { USB_LOG_DBG("usb_check_phy PIPE_PHY_GRF_PIPE_CON0=%08X PIPE_PHY_GRF_PIPE_CON3=%08X\n", con0, con3);
USB_LOG_ERR("usb_check_phy PIPE_PHY_GRF_PIPE_CON0=%08X is not USB3 mode\n", pipe_phymode); if ( !( (con0 & 0x000C) == 0x0004 && (con3 & 0x8000) == 0) ) {
USB_LOG_ERR("usb_check_phy PIPE_PHY_GRF_PIPE_CON0=%08X and CON3=%08X is not USB3 mode\n", con0, con3);
} }
} }