arch.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * arch/arm/include/asm/mach/arch.h
  3. *
  4. * Copyright (C) 2000 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/types.h>
  11. #ifndef __ASSEMBLY__
  12. #include <linux/reboot.h>
  13. struct tag;
  14. struct pt_regs;
  15. struct smp_operations;
  16. #ifdef CONFIG_SMP
  17. #define smp_ops(ops) (&(ops))
  18. #define smp_init_ops(ops) (&(ops))
  19. #else
  20. #define smp_ops(ops) (struct smp_operations *)NULL
  21. #define smp_init_ops(ops) (bool (*)(void))NULL
  22. #endif
  23. struct machine_desc {
  24. unsigned int nr; /* architecture number */
  25. const char *name; /* architecture name */
  26. unsigned long atag_offset; /* tagged list (relative) */
  27. const char *const *dt_compat; /* array of device tree
  28. * 'compatible' strings */
  29. unsigned int nr_irqs; /* number of IRQs */
  30. #ifdef CONFIG_ZONE_DMA
  31. phys_addr_t dma_zone_size; /* size of DMA-able area */
  32. #endif
  33. unsigned int video_start; /* start of video RAM */
  34. unsigned int video_end; /* end of video RAM */
  35. unsigned char reserve_lp0 :1; /* never has lp0 */
  36. unsigned char reserve_lp1 :1; /* never has lp1 */
  37. unsigned char reserve_lp2 :1; /* never has lp2 */
  38. enum reboot_mode reboot_mode; /* default restart mode */
  39. unsigned l2c_aux_val; /* L2 cache aux value */
  40. unsigned l2c_aux_mask; /* L2 cache aux mask */
  41. void (*l2c_write_sec)(unsigned long, unsigned);
  42. const struct smp_operations *smp; /* SMP operations */
  43. bool (*smp_init)(void);
  44. void (*fixup)(struct tag *, char **);
  45. void (*dt_fixup)(void);
  46. long long (*pv_fixup)(void);
  47. void (*reserve)(void);/* reserve mem blocks */
  48. void (*map_io)(void);/* IO mapping function */
  49. void (*init_early)(void);
  50. void (*init_irq)(void);
  51. void (*init_time)(void);
  52. void (*init_machine)(void);
  53. void (*init_late)(void);
  54. #ifdef CONFIG_MULTI_IRQ_HANDLER
  55. void (*handle_irq)(struct pt_regs *);
  56. #endif
  57. void (*restart)(enum reboot_mode, const char *);
  58. };
  59. /*
  60. * Current machine - only accessible during boot.
  61. */
  62. extern const struct machine_desc *machine_desc;
  63. /*
  64. * Machine type table - also only accessible during boot
  65. */
  66. extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
  67. #define for_each_machine_desc(p) \
  68. for (p = __arch_info_begin; p < __arch_info_end; p++)
  69. /*
  70. * Set of macros to define architecture features. This is built into
  71. * a table by the linker.
  72. */
  73. #define MACHINE_START(_type,_name) \
  74. static const struct machine_desc __mach_desc_##_type \
  75. __used \
  76. __attribute__((__section__(".arch.info.init"))) = { \
  77. .nr = MACH_TYPE_##_type, \
  78. .name = _name,
  79. #define MACHINE_END \
  80. };
  81. #define DT_MACHINE_START(_name, _namestr) \
  82. static const struct machine_desc __mach_desc_##_name \
  83. __used \
  84. __attribute__((__section__(".arch.info.init"))) = { \
  85. .nr = ~0, \
  86. .name = _namestr,
  87. #endif