lantiq_soc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it
  3. * under the terms of the GNU General Public License version 2 as published
  4. * by the Free Software Foundation.
  5. *
  6. * Copyright (C) 2010 John Crispin <john@phrozen.org>
  7. */
  8. #ifndef _LTQ_FALCON_H__
  9. #define _LTQ_FALCON_H__
  10. #ifdef CONFIG_SOC_FALCON
  11. #include <linux/pinctrl/pinctrl.h>
  12. #include <lantiq.h>
  13. /* Chip IDs */
  14. #define SOC_ID_FALCON 0x01B8
  15. /* SoC Types */
  16. #define SOC_TYPE_FALCON 0x01
  17. /*
  18. * during early_printk no ioremap possible at this early stage
  19. * let's use KSEG1 instead
  20. */
  21. #define LTQ_ASC0_BASE_ADDR 0x1E100C00
  22. #define LTQ_EARLY_ASC KSEG1ADDR(LTQ_ASC0_BASE_ADDR)
  23. /* WDT */
  24. #define LTQ_RST_CAUSE_WDTRST 0x0002
  25. /* CHIP ID */
  26. #define LTQ_STATUS_BASE_ADDR 0x1E802000
  27. #define FALCON_CHIPID ((u32 *)(KSEG1 + LTQ_STATUS_BASE_ADDR + 0x0c))
  28. #define FALCON_CHIPTYPE ((u32 *)(KSEG1 + LTQ_STATUS_BASE_ADDR + 0x38))
  29. #define FALCON_CHIPCONF ((u32 *)(KSEG1 + LTQ_STATUS_BASE_ADDR + 0x40))
  30. /* SYSCTL - start/stop/restart/configure/... different parts of the Soc */
  31. #define SYSCTL_SYS1 0
  32. #define SYSCTL_SYSETH 1
  33. #define SYSCTL_SYSGPE 2
  34. /* BOOT_SEL - find what boot media we have */
  35. #define BS_FLASH 0x1
  36. #define BS_SPI 0x4
  37. /* global register ranges */
  38. extern __iomem void *ltq_ebu_membase;
  39. extern __iomem void *ltq_sys1_membase;
  40. #define ltq_ebu_w32(x, y) ltq_w32((x), ltq_ebu_membase + (y))
  41. #define ltq_ebu_r32(x) ltq_r32(ltq_ebu_membase + (x))
  42. #define ltq_sys1_w32(x, y) ltq_w32((x), ltq_sys1_membase + (y))
  43. #define ltq_sys1_r32(x) ltq_r32(ltq_sys1_membase + (x))
  44. #define ltq_sys1_w32_mask(clear, set, reg) \
  45. ltq_sys1_w32((ltq_sys1_r32(reg) & ~(clear)) | (set), reg)
  46. /* allow the gpio and pinctrl drivers to talk to eachother */
  47. extern int pinctrl_falcon_get_range_size(int id);
  48. extern void pinctrl_falcon_add_gpio_range(struct pinctrl_gpio_range *range);
  49. /*
  50. * to keep the irq code generic we need to define this to 0 as falcon
  51. * has no EIU/EBU
  52. */
  53. #define LTQ_EBU_PCC_ISTAT 0
  54. #endif /* CONFIG_SOC_FALCON */
  55. #endif /* _LTQ_XWAY_H__ */