2014년 3월 14일 금요일

USB host reboot 명령으로 리셋 시 에러 발생


http://cafe.naver.com/embeddedcrazyboys
http://www.mangoboard.com/

Subject : USB host reboot 명령으로 리셋 시 에러 발생


Description:
리셋키로 리부팅 시 정상동작하나, reboot 명령으로 리부팅 시 오류 발생


분석결과 및 조치:
2.6.35 커널에서는 문제가 없다. S5PV210 CPU를 사용하는
커널 버전 3.0.8에서만 문제가 발생함.

로그 메시지
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
CRZ:s5p_usb_phy_init:type=1, host_phy_initialized=0
CRZ:s5p_usb_phy_init:readl(S5P_USB_PHY_CONTROL)=0x3
s5p-ohci s5p-ohci: s5p OHCI
s5p-ohci s5p-ohci: new USB bus registered, assigned bus number 2
s5p-ohci s5p-ohci: irq 87, io mem 0xec300000
s5p-ohci s5p-ohci: init err (00000000 0000)
ohci_hcd: can't start s5p-ohci
s5p-ohci s5p-ohci: startup error -75
s5p-ohci s5p-ohci: USB bus 2 deregistered
s5p-ohci s5p-ohci: Failed to add USB HCD
s5p-ohci: probe of s5p-ohci failed with error -75
Initializing USB Mass Storage driver...


원인은
int s5p_usb_phy_init(struct platform_device *pdev, int type) 함수에서
아래 코드에서 S5P_USB_PHY_CONTROL 레지스터 값이 3이라서 PHY를 다시 리셋하지 않아서 발생함.
             if (type == S5P_USB_PHY_HOST) {
                           MANGO_DBG("readl(S5P_USB_PHY_CONTROL)=0x%x\n",readl(S5P_USB_PHY_CONTROL));
                           if (readl(S5P_USB_PHY_CONTROL) & (0x1<<1))
                   return -1;


수정 조치

int s5p_usb_phy_init(struct platform_device *pdev, int type)
함수 아래 코드 적용

#if 1//crazyboys 2014140315 reboot usb host error patch
           if (type == S5P_USB_PHY_HOST) {

                      __raw_writel(__raw_readl(S3C_USBOTG_PHYPWR) | (0x1<<7)|(0x1<<6),
                                 S3C_USBOTG_PHYPWR);
                  __raw_writel(__raw_readl(S5P_USB_PHY_CONTROL) & ~(1<<1),
                                   S5P_USB_PHY_CONTROL);
           }
#endif
             if (type == S5P_USB_PHY_HOST) {
                           MANGO_DBG("readl(S5P_USB_PHY_CONTROL)=0x%x\n",readl(S5P_USB_PHY_CONTROL));
                           if (readl(S5P_USB_PHY_CONTROL) & (0x1<<1))
                   return -1;


댓글 없음:

댓글 쓰기