Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.63 KB | None | 0 0
  1. diff --git a/sys/mips/atheros/apb.c b/sys/mips/atheros/apb.c
  2. index c004741..f4ada18 100644
  3. --- a/sys/mips/atheros/apb.c
  4. +++ b/sys/mips/atheros/apb.c
  5. @@ -345,6 +345,9 @@ apb_intr(void *arg)
  6. continue;
  7. }
  8.  
  9. + /* XXX - AR7240 hack - need to ack every interrupt */
  10. + ATH_WRITE_REG(AR71XX_MISC_INTR_STATUS, reg & ~(1 << irq));
  11. +
  12. /* TODO: frame instead of NULL? */
  13. intr_event_handle(event, NULL);
  14. mips_intrcnt_inc(sc->sc_intr_counter[irq]);
  15. diff --git a/sys/mips/atheros/ar71xx_machdep.c b/sys/mips/atheros/ar71xx_machdep.c
  16. index c8abc74..dd083e1 100644
  17. --- a/sys/mips/atheros/ar71xx_machdep.c
  18. +++ b/sys/mips/atheros/ar71xx_machdep.c
  19. @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
  20. #include <mips/sentry5/s5reg.h>
  21.  
  22. #include "opt_ddb.h"
  23. +#include "opt_athmips.h"
  24.  
  25. #include <sys/param.h>
  26. #include <sys/conf.h>
  27. @@ -147,6 +148,9 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused,
  28. int argc, i, count = 0;
  29. char **argv, **envp, *var;
  30. vm_offset_t kernend;
  31. +#if defined(UBOOT_AR71XX_MACADDRESS) || defined(UBOOT_AR72XX_MACADDRESS)
  32. + char *mac;
  33. +#endif
  34.  
  35. /*
  36. * clear the BSS and SBSS segments, this should be first call in
  37. @@ -254,6 +258,23 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused,
  38. freeenv(var);
  39. }
  40.  
  41. +#if defined(UBOOT_AR71XX_MACADDRESS)
  42. + printf("%s: reading if_arge mac address from 0x1f01fc00\n", __func__);
  43. + /* uboot hack for ar71xx! */
  44. + mac = (char *) MIPS_PHYS_TO_KSEG1(0x1f01fc00);
  45. + for (i = 0; i < 6; i++) {
  46. + ar711_base_mac[i] = mac[i];
  47. + }
  48. +#endif
  49. +#if defined(UBOOT_AR72XX_MACADDRESS)
  50. + printf("%s: reading if_arge mac address from 0x1fff0000\n", __func__);
  51. + /* uboot hack for ar724x! */
  52. + mac = (char *) MIPS_PHYS_TO_KSEG1(0x1fff0000);
  53. + for (i = 0; i < 6; i++) {
  54. + ar711_base_mac[i] = mac[i];
  55. + }
  56. +#endif
  57. +
  58. init_param2(physmem);
  59. mips_cpu_init();
  60. pmap_bootstrap();
  61. diff --git a/sys/mips/atheros/ar724x_chip.c b/sys/mips/atheros/ar724x_chip.c
  62. index 450dd19..136db96 100644
  63. --- a/sys/mips/atheros/ar724x_chip.c
  64. +++ b/sys/mips/atheros/ar724x_chip.c
  65. @@ -126,21 +126,27 @@ ar724x_chip_device_stopped(uint32_t mask)
  66. static void
  67. ar724x_chip_set_pll_ge0(int speed)
  68. {
  69. +
  70. +printf("%s: called\n", __func__);
  71. }
  72.  
  73. static void
  74. ar724x_chip_set_pll_ge1(int speed)
  75. {
  76. +
  77. +printf("%s: called\n", __func__);
  78. }
  79.  
  80. static void
  81. ar724x_chip_ddr_flush_ge0(void)
  82. {
  83. + ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_GE0);
  84. }
  85.  
  86. static void
  87. ar724x_chip_ddr_flush_ge1(void)
  88. {
  89. + ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_GE1);
  90. }
  91.  
  92. static uint32_t
  93. @@ -149,6 +155,29 @@ ar724x_chip_get_eth_pll(unsigned int mac, int speed)
  94. return 0;
  95. }
  96.  
  97. +static void
  98. +ar724x_chip_init_usb_peripheral(void)
  99. +{
  100. +
  101. + printf("%s: FIXME!\n", __func__);
  102. +#if 0
  103. + ar71xx_device_stop(RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY);
  104. + DELAY(1000);
  105. +
  106. + ar71xx_device_start(RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY);
  107. + DELAY(1000);
  108. +
  109. + ATH_WRITE_REG(AR71XX_USB_CTRL_CONFIG,
  110. + USB_CTRL_CONFIG_OHCI_DES_SWAP | USB_CTRL_CONFIG_OHCI_BUF_SWAP |
  111. + USB_CTRL_CONFIG_EHCI_DES_SWAP | USB_CTRL_CONFIG_EHCI_BUF_SWAP);
  112. +
  113. + ATH_WRITE_REG(AR71XX_USB_CTRL_FLADJ,
  114. + (32 << USB_CTRL_FLADJ_HOST_SHIFT) | (3 << USB_CTRL_FLADJ_A5_SHIFT));
  115. +
  116. + DELAY(1000);
  117. +#endif
  118. +}
  119. +
  120. struct ar71xx_cpu_def ar724x_chip_def = {
  121. &ar724x_chip_detect_mem_size,
  122. &ar724x_chip_detect_sys_frequency,
  123. @@ -161,5 +190,5 @@ struct ar71xx_cpu_def ar724x_chip_def = {
  124. &ar724x_chip_ddr_flush_ge1,
  125. &ar724x_chip_get_eth_pll,
  126. NULL, /* ar71xx_chip_irq_flush_ip2 */
  127. - NULL /* ar71xx_chip_init_usb_peripheral */
  128. + &ar724x_chip_init_usb_peripheral,
  129. };
  130. diff --git a/sys/mips/atheros/ar724xreg.h b/sys/mips/atheros/ar724xreg.h
  131. index ec7ef15..ad3fa78 100644
  132. --- a/sys/mips/atheros/ar724xreg.h
  133. +++ b/sys/mips/atheros/ar724xreg.h
  134. @@ -47,6 +47,9 @@
  135.  
  136. #define AR724X_BASE_FREQ 5000000
  137.  
  138. +#define AR724X_DDR_REG_FLUSH_GE0 (AR71XX_DDR_CONFIG + 0x7c)
  139. +#define AR724X_DDR_REG_FLUSH_GE1 (AR71XX_DDR_CONFIG + 0x80)
  140. +
  141. #define AR724X_RESET_REG_RESET_MODULE AR71XX_RST_BLOCK_BASE + 0x1c
  142. #define AR724X_RESET_MODULE_USB_OHCI_DLL (1 << 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement