vct.h 2.0 KB

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