Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  arch/arm/include/asm/mach/arch.h
0004  *
0005  *  Copyright (C) 2000 Russell King
0006  */
0007 
0008 #include <linux/types.h>
0009 
0010 #ifndef __ASSEMBLY__
0011 #include <linux/reboot.h>
0012 
0013 struct tag;
0014 struct pt_regs;
0015 struct smp_operations;
0016 #ifdef CONFIG_SMP
0017 #define smp_ops(ops) (&(ops))
0018 #define smp_init_ops(ops) (&(ops))
0019 #else
0020 #define smp_ops(ops) (struct smp_operations *)NULL
0021 #define smp_init_ops(ops) (bool (*)(void))NULL
0022 #endif
0023 
0024 struct machine_desc {
0025     unsigned int        nr;     /* architecture number  */
0026     const char      *name;      /* architecture name    */
0027     unsigned long       atag_offset;    /* tagged list (relative) */
0028     const char *const   *dt_compat; /* array of device tree
0029                          * 'compatible' strings */
0030 
0031     unsigned int        nr_irqs;    /* number of IRQs */
0032 
0033 #ifdef CONFIG_ZONE_DMA
0034     phys_addr_t     dma_zone_size;  /* size of DMA-able area */
0035 #endif
0036 
0037     unsigned int        video_start;    /* start of video RAM   */
0038     unsigned int        video_end;  /* end of video RAM */
0039 
0040     unsigned char       reserve_lp0 :1; /* never has lp0    */
0041     unsigned char       reserve_lp1 :1; /* never has lp1    */
0042     unsigned char       reserve_lp2 :1; /* never has lp2    */
0043     enum reboot_mode    reboot_mode;    /* default restart mode */
0044     unsigned        l2c_aux_val;    /* L2 cache aux value   */
0045     unsigned        l2c_aux_mask;   /* L2 cache aux mask    */
0046     void            (*l2c_write_sec)(unsigned long, unsigned);
0047     const struct smp_operations *smp;   /* SMP operations   */
0048     bool            (*smp_init)(void);
0049     void            (*fixup)(struct tag *, char **);
0050     void            (*dt_fixup)(void);
0051     long long       (*pv_fixup)(void);
0052     void            (*reserve)(void);/* reserve mem blocks  */
0053     void            (*map_io)(void);/* IO mapping function  */
0054     void            (*init_early)(void);
0055     void            (*init_irq)(void);
0056     void            (*init_time)(void);
0057     void            (*init_machine)(void);
0058     void            (*init_late)(void);
0059     void            (*handle_irq)(struct pt_regs *);
0060     void            (*restart)(enum reboot_mode, const char *);
0061 };
0062 
0063 /*
0064  * Current machine - only accessible during boot.
0065  */
0066 extern const struct machine_desc *machine_desc;
0067 
0068 /*
0069  * Machine type table - also only accessible during boot
0070  */
0071 extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
0072 #define for_each_machine_desc(p)            \
0073     for (p = __arch_info_begin; p < __arch_info_end; p++)
0074 
0075 /*
0076  * Set of macros to define architecture features.  This is built into
0077  * a table by the linker.
0078  */
0079 #define MACHINE_START(_type,_name)          \
0080 static const struct machine_desc __mach_desc_##_type    \
0081  __used                         \
0082  __section(".arch.info.init") = {           \
0083     .nr     = MACH_TYPE_##_type,        \
0084     .name       = _name,
0085 
0086 #define MACHINE_END             \
0087 };
0088 
0089 #define DT_MACHINE_START(_name, _namestr)       \
0090 static const struct machine_desc __mach_desc_##_name    \
0091  __used                         \
0092  __section(".arch.info.init") = {           \
0093     .nr     = ~0,               \
0094     .name       = _namestr,
0095 
0096 #endif