rb.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2 of the License, or
  5. * (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * Copyright (C) 2004 IDT Inc.
  13. * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
  14. */
  15. #ifndef __ASM_RC32434_RB_H
  16. #define __ASM_RC32434_RB_H
  17. #include <linux/genhd.h>
  18. #define REGBASE 0x18000000
  19. #define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(REGBASE))
  20. #define UART0BASE 0x58000
  21. #define RST (1 << 15)
  22. #define DEV0BASE 0x010000
  23. #define DEV0MASK 0x010004
  24. #define DEV0C 0x010008
  25. #define DEV0T 0x01000C
  26. #define DEV1BASE 0x010010
  27. #define DEV1MASK 0x010014
  28. #define DEV1C 0x010018
  29. #define DEV1TC 0x01001C
  30. #define DEV2BASE 0x010020
  31. #define DEV2MASK 0x010024
  32. #define DEV2C 0x010028
  33. #define DEV2TC 0x01002C
  34. #define DEV3BASE 0x010030
  35. #define DEV3MASK 0x010034
  36. #define DEV3C 0x010038
  37. #define DEV3TC 0x01003C
  38. #define BTCS 0x010040
  39. #define BTCOMPARE 0x010044
  40. #define GPIOBASE 0x050000
  41. /* Offsets relative to GPIOBASE */
  42. #define GPIOFUNC 0x00
  43. #define GPIOCFG 0x04
  44. #define GPIOD 0x08
  45. #define GPIOILEVEL 0x0C
  46. #define GPIOISTAT 0x10
  47. #define GPIONMIEN 0x14
  48. #define IMASK6 0x38
  49. #define LO_WPX (1 << 0)
  50. #define LO_ALE (1 << 1)
  51. #define LO_CLE (1 << 2)
  52. #define LO_CEX (1 << 3)
  53. #define LO_FOFF (1 << 5)
  54. #define LO_SPICS (1 << 6)
  55. #define LO_ULED (1 << 7)
  56. #define BIT_TO_MASK(x) (1 << x)
  57. struct dev_reg {
  58. u32 base;
  59. u32 mask;
  60. u32 ctl;
  61. u32 timing;
  62. };
  63. struct korina_device {
  64. char *name;
  65. unsigned char mac[6];
  66. struct net_device *dev;
  67. };
  68. struct cf_device {
  69. int gpio_pin;
  70. void *dev;
  71. struct gendisk *gd;
  72. };
  73. struct mpmc_device {
  74. unsigned char state;
  75. spinlock_t lock;
  76. void __iomem *base;
  77. };
  78. extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
  79. extern unsigned char get_latch_u5(void);
  80. #endif /* __ASM_RC32434_RB_H */