vct.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
  3. *
  4. * Copyright (C) 2006 Micronas GmbH
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. #include <asm/io.h>
  22. #include "bcu.h"
  23. #include "dcgu.h"
  24. #include "ebi.h"
  25. #include "scc.h"
  26. #ifdef CONFIG_VCT_PREMIUM
  27. /* Global start address of all memory mapped registers */
  28. #define REG_GLOBAL_START_ADDR 0xbf800000
  29. #define TOP_BASE 0x000c8000
  30. #include "vcth/reg_ebi.h"
  31. #include "vcth/reg_dcgu.h"
  32. #include "vcth/reg_wdt.h"
  33. #include "vcth/reg_gpio.h"
  34. #include "vcth/reg_fwsram.h"
  35. #include "vcth/reg_scc.h"
  36. #include "vcth/reg_usbh.h"
  37. #endif
  38. #ifdef CONFIG_VCT_PLATINUM
  39. /* Global start address of all memory mapped registers */
  40. #define REG_GLOBAL_START_ADDR 0xbf800000
  41. #define TOP_BASE 0x000c8000
  42. #include "vcth2/reg_ebi.h"
  43. #include "vcth/reg_dcgu.h"
  44. #include "vcth/reg_wdt.h"
  45. #include "vcth/reg_gpio.h"
  46. #include "vcth/reg_fwsram.h"
  47. #include "vcth/reg_scc.h"
  48. #include "vcth/reg_usbh.h"
  49. #endif
  50. #ifdef CONFIG_VCT_PLATINUMAVC
  51. /* Global start address of all memory mapped registers */
  52. #define REG_GLOBAL_START_ADDR 0xbdc00000
  53. #define TOP_BASE 0x00050000
  54. #include "vctv/reg_ebi.h"
  55. #include "vctv/reg_dcgu.h"
  56. #include "vctv/reg_wdt.h"
  57. #include "vctv/reg_gpio.h"
  58. #endif
  59. #ifndef _VCT_H
  60. #define _VCT_H
  61. /*
  62. * Defines
  63. */
  64. #define PRID_COMP_LEGACY 0x000000
  65. #define PRID_COMP_MIPS 0x010000
  66. #define PRID_IMP_LX4280 0xc200
  67. #define PRID_IMP_VGC 0x9000
  68. /*
  69. * Prototypes
  70. */
  71. int ebi_initialize(void);
  72. int ebi_init_nor_flash(void);
  73. int ebi_init_onenand(void);
  74. int ebi_init_smc911x(void);
  75. u32 smc911x_reg_read(u32 addr);
  76. void smc911x_reg_write(u32 addr, u32 data);
  77. int top_set_pin(int pin, int func);
  78. void vct_pin_mux_initialize(void);
  79. /*
  80. * static inlines
  81. */
  82. static inline void reg_write(u32 addr, u32 data)
  83. {
  84. __raw_writel(data, addr + REG_GLOBAL_START_ADDR);
  85. }
  86. static inline u32 reg_read(u32 addr)
  87. {
  88. return __raw_readl(addr + REG_GLOBAL_START_ADDR);
  89. }
  90. #endif /* _VCT_H */