84db58bb425d85a296b4fdbc2f2cddb66501044d
[coreboot.git] / src / mainboard / digitallogic / msm800sev / Config.lb
1 ##
2 ## Compute the location and size of where this firmware image
3 ## (coreboot plus bootloader) will live in the boot rom chip.
4 ##
5 if USE_FALLBACK_IMAGE
6         default ROM_SECTION_SIZE   = FALLBACK_SIZE
7         default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
8 else
9         default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE )
10         default ROM_SECTION_OFFSET = 0
11 end
12
13 ##
14 ## Compute the start location and size size of
15 ## The coreboot bootloader.
16 ##
17 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
18 default PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
19
20 ##
21 ## Compute where this copy of coreboot will start in the boot rom
22 ##
23 default _ROMBASE      = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
24
25 ##
26 ## Compute a range of ROM that can cached to speed up coreboot,
27 ## execution speed.
28 ##
29 ## XIP_ROM_SIZE must be a power of 2.
30 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
31 ##
32 default XIP_ROM_SIZE=65536
33 default XIP_ROM_BASE = ( _ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE )
34
35 ##
36 ## Set all of the defaults for an x86 architecture
37 ##
38
39 arch i386 end
40
41 ##
42 ## Build the objects we have code for in this directory.
43 ##
44
45 driver mainboard.o
46
47 if HAVE_PIRQ_TABLE
48         object irq_tables.o
49 end
50
51 if USE_DCACHE_RAM
52         #compile cache_as_ram.c to auto.inc
53         makerule ./cache_as_ram_auto.inc
54                         depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
55                         action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -S -o $@"
56                         action "perl -e 's/.rodata/.rom.data/g' -pi $@"
57                         action "perl -e 's/.text/.section .rom.text/g' -pi $@"
58         end
59 end
60
61
62
63 ##
64 ## Build our 16 bit and 32 bit coreboot entry code
65 ##
66 mainboardinit cpu/x86/16bit/entry16.inc
67 mainboardinit cpu/x86/32bit/entry32.inc
68 ldscript /cpu/x86/16bit/entry16.lds
69 ldscript /cpu/x86/32bit/entry32.lds
70
71 ##
72 ## Build our reset vector (This is where coreboot is entered)
73 ##
74 if USE_FALLBACK_IMAGE 
75         mainboardinit cpu/x86/16bit/reset16.inc 
76         ldscript /cpu/x86/16bit/reset16.lds 
77 else
78         mainboardinit cpu/x86/32bit/reset32.inc 
79         ldscript /cpu/x86/32bit/reset32.lds 
80 end
81
82 ### Should this be in the northbridge code?
83 mainboardinit arch/i386/lib/cpu_reset.inc
84
85 ##
86 ## Include an id string (For safe flashing)
87 ##
88 mainboardinit arch/i386/lib/id.inc
89 ldscript /arch/i386/lib/id.lds
90
91 ###
92 ### This is the early phase of coreboot startup 
93 ### Things are delicate and we test to see if we should
94 ### failover to another image.
95 ###
96 if USE_FALLBACK_IMAGE
97         ldscript /arch/i386/lib/failover.lds 
98 #       mainboardinit ./failover.inc
99 end
100
101 ###
102 ### O.k. We aren't just an intermediary anymore!
103 ###
104
105 ##
106 ## Setup RAM
107 ##
108 mainboardinit cpu/x86/fpu/enable_fpu.inc
109
110 if USE_DCACHE_RAM
111         mainboardinit cpu/amd/model_lx/cache_as_ram.inc
112         mainboardinit ./cache_as_ram_auto.inc
113 end
114
115 ##
116 ## Include the secondary Configuration files 
117 ##
118 dir /pc80
119 config chip.h
120
121 chip northbridge/amd/lx
122         device pci_domain 0 on 
123                 device pci 1.0 on end
124                 device pci 1.1 on end
125                 chip southbridge/amd/cs5536
126                         # IRQ 12 and 1 unmasked,  Keyboard and Mouse IRQs. OK
127                         # SIRQ Mode = Active(Quiet) mode. Save power....
128                         # Invert mask = IRQ 12 and 1 are active high. Keyboard and Mouse IRQs. OK
129                         # How to get these? Boot linux and do this:
130                         # rdmsr 0x51400025
131                         register "lpc_serirq_enable" = "0x000010da"
132                         # rdmsr 0x5140004e -- polairy is high 16 bits of low 32 bits
133                         register "lpc_serirq_polarity" = "0x0000EF25"
134                         # mode is high 10 bits (determined from code)
135                         register "lpc_serirq_mode" = "1"
136                         # Don't yet know how to find this.
137                         register "enable_gpio_int_route" = "0x0D0C0700"
138                         register "enable_ide_nand_flash" = "0" # 0:ide mode, 1:flash
139                         register "enable_USBP4_device" = "0"    #0: host, 1:device
140                         register "enable_USBP4_overcurrent" = "0" #0:off, xxxx:overcurrent setting CS5536 Data Book (pages 380-381)
141                         register "com1_enable" = "0"
142                         register "com1_address" = "0x3F8"
143                         register "com1_irq" = "4"
144                         register "com2_enable" = "0"
145                         register "com2_address" = "0x2F8"
146                         register "com2_irq" = "3"
147                         register "unwanted_vpci[0]" = "0"       # End of list has a zero
148                                 device pci f.0 on       # ISA Bridge
149                                 chip superio/winbond/w83627hf
150                                         device pnp 2e.0 off #  Floppy
151                                                 io 0x60 = 0x3f0
152                                                 irq 0x70 = 6
153                                                 drq 0x74 = 2
154                                         end
155                                         device pnp 2e.1 off #  Parallel Port
156                                                 io 0x60 = 0x378
157                                                 irq 0x70 = 7
158                                         end
159                                         device pnp 2e.2 on #  Com1
160                                                 io 0x60 = 0x3f8
161                                                 irq 0x70 = 4
162                                         end
163                                         device pnp 2e.3 on #  Com2
164                                                 io 0x60 = 0x2f8
165                                                 irq 0x70 = 3
166                                         end
167                                         device pnp 2e.5 on #  Keyboard
168                                                 io 0x60 = 0x60
169                                                 io 0x62 = 0x64
170                                                 irq 0x70 = 1
171                                                 irq 0x72 = 12
172                                         end
173                                         device pnp 2e.6 off #  CIR
174                                                 io 0x60 = 0x100
175                                         end
176                                         device pnp 2e.7 off #  GAME_MIDI_GIPO1
177                                                 io 0x60 = 0x220
178                                                 io 0x62 = 0x300
179                                                 irq 0x70 = 9
180                                         end                                             
181                                         device pnp 2e.8 off end #  GPIO2
182                                         device pnp 2e.9 off end #  GPIO3
183                                         device pnp 2e.a off end #  ACPI
184                                         device pnp 2e.b on #  HW Monitor
185                                                 io 0x60 = 0x290
186                                                 irq 0x70 = 5
187                                         end
188                                 end
189                         end
190                         device pci f.1 on end   # Flash controller
191                         device pci f.2 on end   # IDE controller
192                                 device pci f.3 on end   # Audio
193                                 device pci f.4 on end   # OHCI
194                         device pci f.5 on end   # EHCI
195                 end
196         end
197
198         # APIC cluster is late CPU init.
199         device apic_cluster 0 on
200                 chip cpu/amd/model_lx
201                         device apic 0 on end
202                 end
203         end
204
205 end
206