Home | History | Annotate | Download | only in bootstub
      1 /* define bootstub constrains here, like memory map etc.
      2  */
      3 
      4 #ifndef _BOOT_STUB_HEAD
      5 #define _BOOT_STUB_HEAD
      6 
      7 #define CPUID_MASK		0xffff0
      8 #define PENWELL_FAMILY		0x20670
      9 #define CLOVERVIEW_FAMILY	0x30650
     10 #define VALLEYVIEW2_FAMILY	0x30670
     11 #define TANGIER_FAMILY		0x406A0
     12 #define ANNIEDALE_FAMILY	0x506A0
     13 
     14 #define MID_CPU_CHIP_LINCROFT	1
     15 #define MID_CPU_CHIP_PENWELL	2
     16 #define MID_CPU_CHIP_CLOVERVIEW 3
     17 #define MID_CPU_CHIP_VALLEYVIEW2 4
     18 #define MID_CPU_CHIP_TANGIER	5
     19 #define MID_CPU_CHIP_ANNIEDALE	6
     20 #define MID_CPU_CHIP_OTHER		0xFF
     21 
     22 #define BASE_ADDRESS		0x01100000
     23 
     24 #define CMDLINE_OFFSET		BASE_ADDRESS
     25 #define BZIMAGE_SIZE_OFFSET	(CMDLINE_OFFSET + CMDLINE_SIZE)
     26 #define INITRD_SIZE_OFFSET	(BZIMAGE_SIZE_OFFSET + 4)
     27 #define SPI_UART_SUPPRESSION	(INITRD_SIZE_OFFSET + 4)
     28 #define AOSP_HEADER_ADDRESS     0x10007800
     29 
     30 #define SPI_TYPE		(SPI_UART_SUPPRESSION + 4) /*0:SPI0  1:SPI1*/
     31 #define SPI_0		0
     32 #define SPI_1		1
     33 #define SPI_2		2
     34 
     35 #define FLAGS_RESERVED_0	(SPI_TYPE + 4)
     36 #define FLAGS_RESERVED_1	(FLAGS_RESERVED_0 + 4)
     37 #define VXE_FW_SIZE_OFFSET		(FLAGS_RESERVED_1 + 4)
     38 #define SEC_PLAT_SVCS_SIZE_OFFSET	(VXE_FW_SIZE_OFFSET + 4)
     39 #define XEN_SIZE_OFFSET		(SEC_PLAT_SVCS_SIZE_OFFSET + 4)
     40 
     41 #define BOOTSTUB_OFFSET		(BASE_ADDRESS + 0x1000)
     42 #define STACK_OFFSET		0x10f00000
     43 #define BZIMAGE_OFFSET		(BASE_ADDRESS + 0x3000)
     44 
     45 #define SETUP_HEADER_OFFSET (BZIMAGE_OFFSET + 0x1F1)
     46 #define SETUP_HEADER_SIZE (0x0202 + *(unsigned char*)(0x0201+BZIMAGE_OFFSET))
     47 #define BOOT_PARAMS_OFFSET 0x8000
     48 #define BOOT_CMDLINE_OFFSET 0x10000
     49 #define SETUP_SIGNATURE 0x5a5aaa55
     50 
     51 #define GDT_ENTRY_BOOT_CS       2
     52 #define __BOOT_CS               (GDT_ENTRY_BOOT_CS * 8)
     53 
     54 #define GDT_ENTRY_BOOT_DS       (GDT_ENTRY_BOOT_CS + 1)
     55 #define __BOOT_DS               (GDT_ENTRY_BOOT_DS * 8)
     56 
     57 #ifdef __ASSEMBLY__
     58 #define GDT_ENTRY(flags, base, limit)			\
     59 	((((base)  & 0xff000000) << (56-24)) |	\
     60 	 (((flags) & 0x0000f0ff) << 40) |	\
     61 	 (((limit) & 0x000f0000) << (48-16)) |	\
     62 	 (((base)  & 0x00ffffff) << 16) |	\
     63 	 (((limit) & 0x0000ffff)))
     64 #else
     65 #define GDT_ENTRY(flags, base, limit)           \
     66         (((u64)(base & 0xff000000) << 32) |     \
     67          ((u64)flags << 40) |                   \
     68          ((u64)(limit & 0x00ff0000) << 32) |    \
     69          ((u64)(base & 0x00ffffff) << 16) |     \
     70          ((u64)(limit & 0x0000ffff)))
     71 int get_e820_by_bios(void *e820_buf);
     72 int mid_identify_cpu(void);
     73 void bs_printk(const char *str);
     74 #endif
     75 
     76 #endif
     77