ssb_driver_mips.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef LINUX_SSB_MIPSCORE_H_
  3. #define LINUX_SSB_MIPSCORE_H_
  4. #ifdef CONFIG_SSB_DRIVER_MIPS
  5. struct ssb_device;
  6. struct ssb_serial_port {
  7. void *regs;
  8. unsigned long clockspeed;
  9. unsigned int irq;
  10. unsigned int baud_base;
  11. unsigned int reg_shift;
  12. };
  13. struct ssb_pflash {
  14. bool present;
  15. u8 buswidth;
  16. u32 window;
  17. u32 window_size;
  18. };
  19. #ifdef CONFIG_SSB_SFLASH
  20. struct ssb_sflash {
  21. bool present;
  22. u32 window;
  23. u32 blocksize;
  24. u16 numblocks;
  25. u32 size;
  26. void *priv;
  27. };
  28. #endif
  29. struct ssb_mipscore {
  30. struct ssb_device *dev;
  31. int nr_serial_ports;
  32. struct ssb_serial_port serial_ports[4];
  33. struct ssb_pflash pflash;
  34. #ifdef CONFIG_SSB_SFLASH
  35. struct ssb_sflash sflash;
  36. #endif
  37. };
  38. extern void ssb_mipscore_init(struct ssb_mipscore *mcore);
  39. extern u32 ssb_cpu_clock(struct ssb_mipscore *mcore);
  40. extern unsigned int ssb_mips_irq(struct ssb_device *dev);
  41. #else /* CONFIG_SSB_DRIVER_MIPS */
  42. struct ssb_mipscore {
  43. };
  44. static inline
  45. void ssb_mipscore_init(struct ssb_mipscore *mcore)
  46. {
  47. }
  48. static inline unsigned int ssb_mips_irq(struct ssb_device *dev)
  49. {
  50. return 0;
  51. }
  52. #endif /* CONFIG_SSB_DRIVER_MIPS */
  53. #endif /* LINUX_SSB_MIPSCORE_H_ */