blob: 4041b22babc0dabf5b6fa0c2c5927d90982965a2 [file] [log] [blame]
Frank Vibrans63e62b02011-02-14 18:38:14 +00001#
2# This file is part of the coreboot project.
3#
4# Copyright (C) 2011 Advanced Micro Devices, Inc.
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 as published by
8# the Free Software Foundation; version 2 of the License.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010017# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Frank Vibrans63e62b02011-02-14 18:38:14 +000018#
19
Frank Vibrans63e62b02011-02-14 18:38:14 +000020
21# SB800 Platform Files
22
23romstage-y += cfg.c
24romstage-y += early.c
25romstage-y += smbus.c
26
27ramstage-y += cfg.c
28ramstage-y += late.c
29
Martin Rothe899e512012-12-05 16:07:11 -070030ramstage-$(CONFIG_SB800_MANUAL_FAN_CONTROL) += fan.c
31ramstage-$(CONFIG_SB800_IMC_FAN_CONTROL) += fan.c
zbao01bd79f2012-03-23 11:36:08 +080032ramstage-$(CONFIG_HAVE_ACPI_RESUME) += spi.c
Marc Jones76cfcbc2012-05-08 23:22:34 -060033ramstage-$(CONFIG_GENERATE_ACPI_TABLES) += fadt.c
zbao01bd79f2012-03-23 11:36:08 +080034
Zheng Baob01097e2012-12-14 15:58:15 +080035romstage-$(CONFIG_USBDEBUG) += enable_usbdebug.c
36ramstage-$(CONFIG_USBDEBUG) += enable_usbdebug.c
37
Patrick Georgi23f38cd2012-11-16 14:50:32 +010038ramstage-y += smbus.c
39ramstage-y += lpc.c
Frank Vibrans63e62b02011-02-14 18:38:14 +000040
Kerry Shehd4a0e7d2011-10-10 17:17:39 +080041ifeq ($(CONFIG_SB800_SATA_AHCI), y)
42ifdef CONFIG_SB800_AHCI_ROM
43 stripped_ahci_rom_id = $(call strip_quotes,$(CONFIG_AHCI_ROM_ID))
44 cbfs-files-y += pci$(stripped_ahci_rom_id).rom
45 pci$(stripped_ahci_rom_id).rom-file := $(call strip_quotes,$(CONFIG_AHCI_ROM_FILE))
46 pci$(stripped_ahci_rom_id).rom-type := optionrom
47endif
48endif
Frank Vibrans63e62b02011-02-14 18:38:14 +000049
Kerry Shehd4a0e7d2011-10-10 17:17:39 +080050ifeq ($(CONFIG_SB800_SATA_RAID), y)
51 stripped_raid_rom_id = $(call strip_quotes,$(CONFIG_RAID_ROM_ID))
52 cbfs-files-y += pci$(stripped_raid_rom_id).rom
53 pci$(stripped_raid_rom_id).rom-file := $(call strip_quotes,$(CONFIG_RAID_ROM_FILE))
54 pci$(stripped_raid_rom_id).rom-type := optionrom
55
56 cbfs-files-y += raid/misc.bin
57 raid/misc.bin-file := $(call strip_quotes,$(CONFIG_RAID_MISC_ROM_FILE))
Kerry Sheh55437c52011-10-12 11:42:59 +080058 raid/misc.bin-position := $(CONFIG_RAID_MISC_ROM_POSITION)
Kerry Shehd4a0e7d2011-10-10 17:17:39 +080059 raid/misc.bin-type := raw
60endif
Martin Rothe899e512012-12-05 16:07:11 -070061
62ifeq ($(CONFIG_SB800_IMC_FWM), y)
63
64# ROMSIG At ROMBASE + 0x20000:
65# +-----------+---------------+----------------+------------+
66# |0x55AA55AA |EC ROM Address |GEC ROM Address | |
67# +-----------+---------------+----------------+------------+
68# EC ROM should be 64K aligned.
69SB800_FWM_POSITION=$(shell printf %u $(CONFIG_SB800_FWM_POSITION))
70#assume the cbfs header is less than 128 bytes.
71ROMSIG_SIZE=16
72
73SB800_IMC_POSITION_UNALIGN=$(shell echo $(SB800_FWM_POSITION) $(ROMSIG_SIZE) 128 65535 | awk '{print $$1 + $$2 + $$3 + $$4}')
74SB800_IMC_POSITION=$(shell echo $(SB800_IMC_POSITION_UNALIGN) | awk '{print $$1 - $$1 % 65536}')
75
76$(obj)/coreboot_SB800_romsig.bin: \
77 $(call strip_quotes, $(CONFIG_SB800_IMC_FWM_FILE)) \
78 $(obj)/config.h \
79 $(obj)/mainboard/$(MAINBOARDDIR)/static.c
80 echo " SB800 FW $@"
81 for fwm in 1437226410 \
82 $(SB800_IMC_POSITION) \
83 0 \
84 0 ; do \
85 echo $$fwm | LC_ALL=C awk '{printf ("%c%c%c%c", $$1 % 256, int($$1/256) % 256, int($$1/65536) % 256, int($$1/16777216));}'; \
86 done > $@
87
88cbfs-files-y += SB800/fwm
89SB800/fwm-file := $(obj)/coreboot_SB800_romsig.bin
90SB800/fwm-position := $(SB800_FWM_POSITION)
91SB800/fwm-type := raw
92
93cbfs-files-y += SB800/imc
94SB800/imc-file := $(call strip_quotes, $(CONFIG_SB800_IMC_FWM_FILE))
95SB800/imc-position := $(SB800_IMC_POSITION)
96SB800/imc-type := raw
97
98endif