vct.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
  3. *
  4. * Copyright (C) 2006 Micronas GmbH
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #include <asm/io.h>
  9. #include "bcu.h"
  10. #include "dcgu.h"
  11. #include "ebi.h"
  12. #include "scc.h"
  13. #ifdef CONFIG_VCT_PREMIUM
  14. /* Global start address of all memory mapped registers */
  15. #define REG_GLOBAL_START_ADDR 0xbf800000
  16. #define TOP_BASE 0x000c8000
  17. #include "vcth/reg_ebi.h"
  18. #include "vcth/reg_dcgu.h"
  19. #include "vcth/reg_wdt.h"
  20. #include "vcth/reg_gpio.h"
  21. #include "vcth/reg_fwsram.h"
  22. #include "vcth/reg_scc.h"
  23. #include "vcth/reg_usbh.h"
  24. #endif
  25. #ifdef CONFIG_VCT_PLATINUM
  26. /* Global start address of all memory mapped registers */
  27. #define REG_GLOBAL_START_ADDR 0xbf800000
  28. #define TOP_BASE 0x000c8000
  29. #include "vcth2/reg_ebi.h"
  30. #include "vcth/reg_dcgu.h"
  31. #include "vcth/reg_wdt.h"
  32. #include "vcth/reg_gpio.h"
  33. #include "vcth/reg_fwsram.h"
  34. #include "vcth/reg_scc.h"
  35. #include "vcth/reg_usbh.h"
  36. #endif
  37. #ifdef CONFIG_VCT_PLATINUMAVC
  38. /* Global start address of all memory mapped registers */
  39. #define REG_GLOBAL_START_ADDR 0xbdc00000
  40. #define TOP_BASE 0x00050000
  41. #include "vctv/reg_ebi.h"
  42. #include "vctv/reg_dcgu.h"
  43. #include "vctv/reg_wdt.h"
  44. #include "vctv/reg_gpio.h"
  45. #endif
  46. #ifndef _VCT_H
  47. #define _VCT_H
  48. /*
  49. * Defines
  50. */
  51. #define PRID_COMP_LEGACY 0x000000
  52. #define PRID_COMP_MIPS 0x010000
  53. #define PRID_IMP_LX4280 0xc200
  54. #define PRID_IMP_VGC 0x9000
  55. /*
  56. * Prototypes
  57. */
  58. int ebi_initialize(void);
  59. int ebi_init_nor_flash(void);
  60. int ebi_init_onenand(void);
  61. int ebi_init_smc911x(void);
  62. u32 smc911x_reg_read(u32 addr);
  63. void smc911x_reg_write(u32 addr, u32 data);
  64. int top_set_pin(int pin, int func);
  65. void vct_pin_mux_initialize(void);
  66. /*
  67. * static inlines
  68. */
  69. static inline void reg_write(u32 addr, u32 data)
  70. {
  71. void *reg = (void *)(addr + REG_GLOBAL_START_ADDR);
  72. __raw_writel(data, reg);
  73. }
  74. static inline u32 reg_read(u32 addr)
  75. {
  76. const void *reg = (const void *)(addr + REG_GLOBAL_START_ADDR);
  77. return __raw_readl(reg);
  78. }
  79. #endif /* _VCT_H */