bcsr.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (C) 2009 Freescale Semiconductor, Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #include <common.h>
  23. #include <asm/io.h>
  24. #include "bcsr.h"
  25. void enable_8569mds_flash_write()
  26. {
  27. setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP);
  28. }
  29. void disable_8569mds_flash_write()
  30. {
  31. clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 17), BCSR17_FLASH_nWP);
  32. }
  33. void enable_8569mds_qe_uec()
  34. {
  35. #if defined(CONFIG_SYS_UCC_RGMII_MODE)
  36. setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7),
  37. BCSR7_UCC1_GETH_EN | BCSR7_UCC1_RGMII_EN);
  38. setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 8),
  39. BCSR8_UCC2_GETH_EN | BCSR8_UCC2_RGMII_EN);
  40. setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9),
  41. BCSR9_UCC3_GETH_EN | BCSR9_UCC3_RGMII_EN);
  42. setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 10),
  43. BCSR10_UCC4_GETH_EN | BCSR10_UCC4_RGMII_EN);
  44. #elif defined(CONFIG_SYS_UCC_RMII_MODE)
  45. /* Set UCC1-4 working at RMII mode */
  46. clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7),
  47. BCSR7_UCC1_GETH_EN | BCSR7_UCC1_RGMII_EN);
  48. clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 8),
  49. BCSR8_UCC2_GETH_EN | BCSR8_UCC2_RGMII_EN);
  50. clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9),
  51. BCSR9_UCC3_GETH_EN | BCSR9_UCC3_RGMII_EN);
  52. clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 10),
  53. BCSR10_UCC4_GETH_EN | BCSR10_UCC4_RGMII_EN);
  54. setbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 9), BCSR9_UCC3_RMII_EN);
  55. #endif
  56. }
  57. void disable_8569mds_brd_eeprom_write_protect()
  58. {
  59. clrbits_8((u8 *)(CONFIG_SYS_BCSR_BASE + 7), BCSR7_BRD_WRT_PROTECT);
  60. }