349-MIPS-BCM63XX-add-BCM63268-USB-support.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  2. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  3. @@ -1033,11 +1033,18 @@
  4. #define USBH_PRIV_SETUP_6368_REG 0x28
  5. #define USBH_PRIV_SETUP_IOC_SHIFT 4
  6. #define USBH_PRIV_SETUP_IOC_MASK (1 << USBH_PRIV_SETUP_IOC_SHIFT)
  7. +#define USBH_PRIV_SETUP_IPP_SHIFT 5
  8. +#define USBH_PRIV_SETUP_IPP_MASK (1 << USBH_PRIV_SETUP_IPP_SHIFT)
  9. #define USBH_PRIV_SETUP_6318_REG 0x00
  10. +#define USBH_PRIV_PLL_CTRL1_6368_REG 0x18
  11. #define USBH_PRIV_PLL_CTRL1_6318_REG 0x04
  12. -#define USBH_PRIV_PLL_CTRL1_SUSP_EN (1 << 27)
  13. -#define USBH_PRIV_PLL_CTRL1_IDDQ_PWRDN (1 << 31)
  14. +
  15. +#define USBH_PRIV_PLL_CTRL1_6318_SUSP_EN (1 << 27)
  16. +#define USBH_PRIV_PLL_CTRL1_6318_IDDQ_PWRDN (1 << 31)
  17. +#define USBH_PRIV_PLL_CTRL1_63268_IDDQ_PWRDN (1 << 9)
  18. +#define USBH_PRIV_PLL_CTRL1_63268_PWRDN_DELAY (1 << 10)
  19. +
  20. #define USBH_PRIV_SIM_CTRL_6318_REG 0x20
  21. #define USBH_PRIV_SIM_CTRL_LADDR_SEL (1 << 5)
  22. --- a/arch/mips/bcm63xx/Kconfig
  23. +++ b/arch/mips/bcm63xx/Kconfig
  24. @@ -72,6 +72,8 @@ config BCM63XX_CPU_63268
  25. bool "support 63268 CPU"
  26. select SYS_HAS_CPU_BMIPS4350
  27. select HW_HAS_PCI
  28. + select BCM63XX_OHCI
  29. + select BCM63XX_EHCI
  30. endmenu
  31. source "arch/mips/bcm63xx/boards/Kconfig"
  32. --- a/arch/mips/bcm63xx/dev-usb-ehci.c
  33. +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
  34. @@ -82,7 +82,7 @@ static struct platform_device bcm63xx_eh
  35. int __init bcm63xx_ehci_register(void)
  36. {
  37. if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6358() &&
  38. - !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
  39. + !BCMCPU_IS_6362() && !BCMCPU_IS_6368() && !BCMCPU_IS_63268())
  40. return 0;
  41. ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
  42. --- a/arch/mips/bcm63xx/usb-common.c
  43. +++ b/arch/mips/bcm63xx/usb-common.c
  44. @@ -109,9 +109,24 @@ void bcm63xx_usb_priv_ohci_cfg_set(void)
  45. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SETUP_6368_REG);
  46. reg |= USBH_PRIV_SETUP_IOC_MASK;
  47. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6368_REG);
  48. + } else if (BCMCPU_IS_63268()) {
  49. + reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
  50. + reg &= ~USBH_PRIV_SWAP_OHCI_ENDN_MASK;
  51. + reg |= USBH_PRIV_SWAP_OHCI_DATA_MASK;
  52. + bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_6368_REG);
  53. +
  54. + reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SETUP_6368_REG);
  55. + reg |= USBH_PRIV_SETUP_IOC_MASK;
  56. + reg &= ~USBH_PRIV_SETUP_IPP_MASK;
  57. + bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6368_REG);
  58. +
  59. + reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_PLL_CTRL1_6368_REG);
  60. + reg &= ~(USBH_PRIV_PLL_CTRL1_63268_IDDQ_PWRDN |
  61. + USBH_PRIV_PLL_CTRL1_63268_PWRDN_DELAY);
  62. + bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_PLL_CTRL1_6368_REG);
  63. } else if (BCMCPU_IS_6318()) {
  64. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_PLL_CTRL1_6318_REG);
  65. - reg |= USBH_PRIV_PLL_CTRL1_SUSP_EN;
  66. + reg |= USBH_PRIV_PLL_CTRL1_6318_SUSP_EN;
  67. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_PLL_CTRL1_6318_REG);
  68. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6318_REG);
  69. @@ -124,7 +139,7 @@ void bcm63xx_usb_priv_ohci_cfg_set(void)
  70. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6318_REG);
  71. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_PLL_CTRL1_6318_REG);
  72. - reg &= ~USBH_PRIV_PLL_CTRL1_IDDQ_PWRDN;
  73. + reg &= ~USBH_PRIV_PLL_CTRL1_6318_IDDQ_PWRDN;
  74. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_PLL_CTRL1_6318_REG);
  75. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SIM_CTRL_6318_REG);
  76. @@ -165,9 +180,24 @@ void bcm63xx_usb_priv_ehci_cfg_set(void)
  77. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SETUP_6368_REG);
  78. reg |= USBH_PRIV_SETUP_IOC_MASK;
  79. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6368_REG);
  80. + } else if (BCMCPU_IS_63268()) {
  81. + reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
  82. + reg &= ~USBH_PRIV_SWAP_EHCI_ENDN_MASK;
  83. + reg |= USBH_PRIV_SWAP_EHCI_DATA_MASK;
  84. + bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_6368_REG);
  85. +
  86. + reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SETUP_6368_REG);
  87. + reg |= USBH_PRIV_SETUP_IOC_MASK;
  88. + reg &= ~USBH_PRIV_SETUP_IPP_MASK;
  89. + bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6368_REG);
  90. +
  91. + reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_PLL_CTRL1_6368_REG);
  92. + reg &= ~(USBH_PRIV_PLL_CTRL1_63268_IDDQ_PWRDN |
  93. + USBH_PRIV_PLL_CTRL1_63268_PWRDN_DELAY);
  94. + bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_PLL_CTRL1_6368_REG);
  95. } else if (BCMCPU_IS_6318()) {
  96. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_PLL_CTRL1_6318_REG);
  97. - reg |= USBH_PRIV_PLL_CTRL1_SUSP_EN;
  98. + reg |= USBH_PRIV_PLL_CTRL1_6318_SUSP_EN;
  99. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_PLL_CTRL1_6318_REG);
  100. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6318_REG);
  101. @@ -180,7 +210,7 @@ void bcm63xx_usb_priv_ehci_cfg_set(void)
  102. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6318_REG);
  103. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_PLL_CTRL1_6318_REG);
  104. - reg &= ~USBH_PRIV_PLL_CTRL1_IDDQ_PWRDN;
  105. + reg &= ~USBH_PRIV_PLL_CTRL1_6318_IDDQ_PWRDN;
  106. bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_PLL_CTRL1_6318_REG);
  107. reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SIM_CTRL_6318_REG);