1b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
2b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Copyright (c) 2013-2015 Intel Corporation.
3b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
4b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; This program and the accompanying materials
5b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; are licensed and made available under the terms and conditions of the BSD License
6b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; which accompanies this distribution.  The full text of the license may be found at
7b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; http://opensource.org/licenses/bsd-license.php
8b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
9b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
12b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;------------------------------------------------------------------------------
13b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
14b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Module Name:
15b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
16b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;   Platform.inc
17b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
18b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Abstract:
19b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
20b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;   Quark A0 Platform Specific Definitions
21b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
22b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;------------------------------------------------------------------------------
23b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
24b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyJMP32 MACRO FunctionName
25b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  lea  esp, @F
26b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  jmp  FunctionName
27b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney@@:
28b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyENDM
29b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
30b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyRET32 MACRO
31b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    jmp    esp
32b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyENDM
33b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
34b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
35b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; ROM/SPI/MEMORY Definitions
36b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
37b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyQUARK_DDR3_MEM_BASE_ADDRESS    EQU 000000000h    ; Memory Base Address = 0
38b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyQUARK_MAX_DDR3_MEM_SIZE_BYTES    EQU 080000000h    ; DDR3 Memory Size = 2GB
39b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyQUARK_ESRAM_MEM_SIZE_BYTES    EQU 000080000h    ; eSRAM Memory Size = 512K
40b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyQUARK_STACK_SIZE_BYTES      EQU 008000h      ; Quark stack size = 32K
41b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
42b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
43b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; RTC/CMOS definitions
44b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
45b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyRTC_INDEX      EQU 070h
46b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  NMI_DISABLE  EQU 080h    ; Bit7=1 disables NMI
47b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  NMI_ENABLE  EQU 000h    ; Bit7=0 disables NMI
48b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyRTC_DATA      EQU 071h
49b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
50b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
51b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; PCI Configuration definitions
52b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
53b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyPCI_CFG            EQU 1 SHL 01Fh  ; PCI configuration access mechanism
54b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyPCI_ADDRESS_PORT  EQU 0CF8h
55b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyPCI_DATA_PORT      EQU 0CFCh
56b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
57b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
58b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Quark PCI devices
59b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
60b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyHOST_BRIDGE_PFA        EQU 0000h          ; B0:D0:F0 (Host Bridge)
61b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyILB_PFA          EQU 00F8h          ; B0:D31:F0 (Legacy Block)
62b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
63b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
64b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; ILB PCI Config Registers
65b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
66b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyBDE                              EQU 0D4h        ; BIOS Decode Enable register
67b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  DECODE_ALL_REGIONS_ENABLE      EQU 0FF000000h  ; Decode all BIOS decode ranges
68b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
69b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
70b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
71b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; iLB Reset Register
72b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
73b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyILB_RESET_REG      EQU 0CF9h
74b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  CF9_WARM_RESET    EQU  02h
75b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  CF9_COLD_RESET    EQU  08h
76b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
77b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
78b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Host Bridge PCI Config Registers
79b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
80b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyMESSAGE_BUS_CONTROL_REG                    EQU 0D0h  ; Message Bus Control Register
81b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  SB_OPCODE_FIELD                EQU 018h  ; Bit location of Opcode field
82b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    OPCODE_SIDEBAND_REG_READ    EQU 010h  ; Read opcode
83b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    OPCODE_SIDEBAND_REG_WRITE    EQU 011h  ; Write opcode
84b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    OPCODE_SIDEBAND_ALT_REG_READ  EQU 06h    ; Alternate Read opcode
85b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    OPCODE_SIDEBAND_ALT_REG_WRITE  EQU 07h    ; Alternate Write opcode
86b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    OPCODE_WARM_RESET_REQUEST    EQU 0F4h  ; Reset Warm
87b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    OPCODE_COLD_RESET_REQUEST    EQU 0F5h  ; Reset Cold
88b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  SB_PORT_FIELD                  EQU 010h  ; Bit location of Port ID field
89b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    MEMORY_ARBITER_PORT_ID                EQU 00h
90b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    HOST_BRIDGE_PORT_ID                EQU 03h
91b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    RMU_PORT_ID                EQU 04h
92b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    MEMORY_MANAGER_PORT_ID                EQU 05h
93b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    SOC_UNIT_PORT_ID              EQU  031h
94b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  SB_ADDR_FIELD                  EQU 008h  ; Bit location of Register field
95b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  SB_BE_FIELD                    EQU  004h  ; Bit location of Byte Enables field
96b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    ALL_BYTE_EN                  EQU  00Fh  ; All Byte Enables
97b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyMESSAGE_DATA_REG                      EQU 0D4h  ; Message Data Register
98b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
99b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
100b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Memory Arbiter Config Registers
101b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
102b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyAEC_CTRL_OFFSET    EQU 00h
103b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
104b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
105b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Host Bridge Config Registers
106b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
107b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyHMISC2_OFFSET      EQU 03h
108b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  OR_PM_FIELD      EQU 010h
109b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney    SMI_EN        EQU 1 SHL 13h
110b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
111b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyHMBOUND_OFFSET    EQU 08h
112b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  HMBOUND_ADDRESS  EQU (QUARK_DDR3_MEM_BASE_ADDRESS + QUARK_MAX_DDR3_MEM_SIZE_BYTES + QUARK_ESRAM_MEM_SIZE_BYTES)
113b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  HMBOUND_LOCK  EQU 00000001h
114b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyHECREG_OFFSET    EQU 09h
115b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  EC_BASE      EQU 0E0000000h
116b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  EC_ENABLE    EQU 01h
117b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyHLEGACY_OFFSET    EQU 0Ah
118b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  NMI              EQU 1 SHL 0Eh  ; Pin 14
119b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  SMI              EQU 1 SHL 0Ch  ; Pin 12
120b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  INTR             EQU 1 SHL 0Ah  ; Pin 10
121b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
122b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
123b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
124b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; Memory Manager Config Registers
125b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
126b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyESRAMPGCTRL_BLOCK_OFFSET  EQU 082h
127b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  BLOCK_ENABLE_PG      EQU 010000000h
128b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyBIMRVCTL_OFFSET        EQU 019h
129b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  ENABLE_IMR_INTERRUPT  EQU 080000000h
130b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney
131b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
132b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney; SOC UNIT Debug Registers
133b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney;
134b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyCFGSTICKY_W1_OFFSET          EQU 050h
135b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  FORCE_COLD_RESET      EQU  00000001h
136b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyCFGSTICKY_RW_OFFSET            EQU 051h
137b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  RESET_FOR_ESRAM_LOCK    EQU  00000020h
138b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  RESET_FOR_HMBOUND_LOCK    EQU  00000040h
139b303605e1b7e113b4311daf161c6c3289350447bMichael KinneyCFGNONSTICKY_W1_OFFSET        EQU 052h
140b303605e1b7e113b4311daf161c6c3289350447bMichael Kinney  FORCE_WARM_RESET      EQU  00000001h
141