summaryrefslogtreecommitdiff
path: root/src/drivers/pc80
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2016-03-11 20:22:28 -0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2016-04-19 18:34:18 +0200
commit86ddd732bd82b84724883b1f1579e18790611fe5 (patch)
treee52c4c88ceb7e14fd415031c56997d8c4054116e /src/drivers/pc80
parent3812597c668b795d4fc85578021e501f2a56f6b9 (diff)
kbuild: Allow drivers to fit src/drivers/[X]/[Y]/ scheme
Reorder drivers to fit src/drivers/[X]/[Y]/ scheme to make them pluggable. Also, fix up the following driver subdirectories by switching to the src/drivers/[X]/[Y]/ scheme as these are hard requirements for the main change: * drivers/intel * drivers/pc80 * drivers/dec Change-Id: I455d3089a317181d5b99bf658df759ec728a5f6b Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/14047 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/drivers/pc80')
-rw-r--r--src/drivers/pc80/pc/Kconfig (renamed from src/drivers/pc80/Kconfig)11
-rw-r--r--src/drivers/pc80/pc/Makefile.inc12
-rw-r--r--src/drivers/pc80/pc/i8254.c (renamed from src/drivers/pc80/i8254.c)0
-rw-r--r--src/drivers/pc80/pc/i8259.c (renamed from src/drivers/pc80/i8259.c)9
-rw-r--r--src/drivers/pc80/pc/isa-dma.c (renamed from src/drivers/pc80/isa-dma.c)0
-rw-r--r--src/drivers/pc80/pc/keyboard.c (renamed from src/drivers/pc80/keyboard.c)10
-rw-r--r--src/drivers/pc80/pc/ps2_controller.asl (renamed from src/drivers/pc80/ps2_controller.asl)0
-rw-r--r--src/drivers/pc80/pc/spkmodem.c (renamed from src/drivers/pc80/spkmodem.c)34
-rw-r--r--src/drivers/pc80/pc/udelay_io.c (renamed from src/drivers/pc80/udelay_io.c)3
-rw-r--r--src/drivers/pc80/rtc/Kconfig4
-rw-r--r--src/drivers/pc80/rtc/Makefile.inc (renamed from src/drivers/pc80/Makefile.inc)16
-rw-r--r--src/drivers/pc80/rtc/mc146818rtc.c (renamed from src/drivers/pc80/mc146818rtc.c)53
-rw-r--r--src/drivers/pc80/rtc/mc146818rtc_early.c (renamed from src/drivers/pc80/mc146818rtc_early.c)5
-rw-r--r--src/drivers/pc80/tpm/Makefile.inc4
-rw-r--r--src/drivers/pc80/vga/Makefile.inc4
15 files changed, 92 insertions, 73 deletions
diff --git a/src/drivers/pc80/Kconfig b/src/drivers/pc80/pc/Kconfig
index 18c626c7cb..c44cf9144d 100644
--- a/src/drivers/pc80/Kconfig
+++ b/src/drivers/pc80/pc/Kconfig
@@ -1,10 +1,10 @@
# Might be removed (alongside with the PS/2 init code) once payloads
# reliably support PS/2 init themselves.
-if PC80_SYSTEM
config DRIVERS_PS2_KEYBOARD
bool "PS/2 keyboard init"
default n
+ depends on PC80_SYSTEM
help
Enable this option to initialize PS/2 keyboards found connected
to the PS/2 port.
@@ -16,12 +16,3 @@ config DRIVERS_PS2_KEYBOARD
If you know you will only use a payload which does not require
this option, then you can say N here to speed up boot time.
Otherwise say Y.
-
-config DRIVERS_MC146818
- bool
- default y if ARCH_X86
- select RTC
-
-source src/drivers/pc80/tpm/Kconfig
-
-endif
diff --git a/src/drivers/pc80/pc/Makefile.inc b/src/drivers/pc80/pc/Makefile.inc
new file mode 100644
index 0000000000..8c348e323e
--- /dev/null
+++ b/src/drivers/pc80/pc/Makefile.inc
@@ -0,0 +1,12 @@
+ifeq ($(CONFIG_ARCH_X86),y)
+
+ramstage-y += isa-dma.c
+ramstage-y += i8254.c
+ramstage-y += i8259.c
+ramstage-$(CONFIG_UDELAY_IO) += udelay_io.c
+romstage-$(CONFIG_UDELAY_IO) += udelay_io.c
+ramstage-y += keyboard.c
+ramstage-$(CONFIG_SPKMODEM) += spkmodem.c
+romstage-$(CONFIG_SPKMODEM) += spkmodem.c
+
+endif
diff --git a/src/drivers/pc80/i8254.c b/src/drivers/pc80/pc/i8254.c
index 5851ec08a0..5851ec08a0 100644
--- a/src/drivers/pc80/i8254.c
+++ b/src/drivers/pc80/pc/i8254.c
diff --git a/src/drivers/pc80/i8259.c b/src/drivers/pc80/pc/i8259.c
index 1cb49b1206..4261d5bec4 100644
--- a/src/drivers/pc80/i8259.c
+++ b/src/drivers/pc80/pc/i8259.c
@@ -29,7 +29,7 @@ u16 pic_read_irq_mask(void)
printk(BIOS_DEBUG, "8259 PIC: OCW1 IRQ Mask: 0x%x\n", mask);
printk(BIOS_SPEW, "\tEnabled IRQs (0 = Unmasked, 1 = Masked off):\n"
"\t\tMaster\t\tSlave\n");
- for(i = 0; i <= 7; i++) {
+ for (i = 0; i <= 7; i++) {
printk(BIOS_SPEW, "\t\tIRQ%X: %x\t\tIRQ%X: %x\n",
i, (mask >> i) & 1, i + 8, (mask >> (i + 8)) & 1);
}
@@ -53,8 +53,8 @@ void pic_write_irq_mask(u16 mask)
*/
void pic_irq_enable(u8 int_num, u8 mask)
{
- pic_write_irq_mask(pic_read_irq_mask() & ~(mask << int_num));
- pic_read_irq_mask();
+ pic_write_irq_mask(pic_read_irq_mask() & ~(mask << int_num));
+ pic_read_irq_mask();
}
void setup_i8259(void)
@@ -124,7 +124,8 @@ void i8259_configure_irq_trigger(int int_num, int is_level_triggered)
outb((u8)(int_bits >> 8), ELCR2);
#ifdef PARANOID_IRQ_TRIGGERS
- /* Try reading back the new values. This seems like an error but is not ... */
+ /* Try reading back the new values. This seems like an error
+ * but it is not. */
if (inb(ELCR1) != (int_bits & 0xff)) {
printk(BIOS_ERR, "%s: lower order bits are wrong: want 0x%x, got 0x%x\n",
__func__, (int_bits & 0xff), inb(ELCR1));
diff --git a/src/drivers/pc80/isa-dma.c b/src/drivers/pc80/pc/isa-dma.c
index b64f125f3a..b64f125f3a 100644
--- a/src/drivers/pc80/isa-dma.c
+++ b/src/drivers/pc80/pc/isa-dma.c
diff --git a/src/drivers/pc80/keyboard.c b/src/drivers/pc80/pc/keyboard.c
index 56b1fce93b..415dbd1d13 100644
--- a/src/drivers/pc80/keyboard.c
+++ b/src/drivers/pc80/pc/keyboard.c
@@ -67,6 +67,7 @@
static int kbc_input_buffer_empty(void)
{
u32 timeout;
+
for (timeout = KBC_TIMEOUT_IN_MS;
timeout && (inb(KBD_STATUS) & KBD_IBF); timeout--)
mdelay(1);
@@ -80,6 +81,7 @@ static int kbc_input_buffer_empty(void)
static int kbc_output_buffer_full(void)
{
u32 timeout;
+
for (timeout = KBC_TIMEOUT_IN_MS;
timeout && ((inb(KBD_STATUS) & KBD_OBF) == 0); timeout--)
mdelay(1);
@@ -93,6 +95,7 @@ static int kbc_output_buffer_full(void)
static int kbc_cleanup_buffers(void)
{
u32 timeout;
+
for (timeout = KBC_TIMEOUT_IN_MS;
timeout && (inb(KBD_STATUS) & (KBD_OBF | KBD_IBF)); timeout--) {
mdelay(1);
@@ -221,8 +224,10 @@ static u8 send_keyboard(u8 command)
* reset */
if (command == 0xFF) {
u8 retries;
+
for (retries = 9; retries && !kbc_output_buffer_full();
- retries--) ;
+ retries--)
+ ;
}
if (!kbc_output_buffer_full()) {
printk(BIOS_ERR,
@@ -288,7 +293,8 @@ uint8_t pc_keyboard_init(uint8_t probe_aux)
}
/* the reset command takes some time, so wait a little longer */
- for (retries = 9; retries && !kbc_output_buffer_full(); retries--) ;
+ for (retries = 9; retries && !kbc_output_buffer_full(); retries--)
+ ;
if (!kbc_output_buffer_full()) {
printk(BIOS_ERR, "Timeout waiting for keyboard after reset.\n");
diff --git a/src/drivers/pc80/ps2_controller.asl b/src/drivers/pc80/pc/ps2_controller.asl
index a4984cfdb9..a4984cfdb9 100644
--- a/src/drivers/pc80/ps2_controller.asl
+++ b/src/drivers/pc80/pc/ps2_controller.asl
diff --git a/src/drivers/pc80/spkmodem.c b/src/drivers/pc80/pc/spkmodem.c
index fe57e620bc..df66f6fa62 100644
--- a/src/drivers/pc80/spkmodem.c
+++ b/src/drivers/pc80/pc/spkmodem.c
@@ -43,7 +43,7 @@ enum {
PIT_CTRL_SELECT_1 = 0x40,
PIT_CTRL_SELECT_2 = 0x80,
- PIT_CTRL_READLOAD_MASK= 0x30,
+ PIT_CTRL_READLOAD_MASK = 0x30,
PIT_CTRL_COUNTER_LATCH = 0x00,
PIT_CTRL_READLOAD_LSB = 0x10,
PIT_CTRL_READLOAD_MSB = 0x20,
@@ -68,28 +68,28 @@ enum {
static void
-make_tone (uint16_t freq_count, unsigned int duration)
+make_tone(uint16_t freq_count, unsigned int duration)
{
- outb (PIT_CTRL_SELECT_2
+ outb(PIT_CTRL_SELECT_2
| PIT_CTRL_READLOAD_WORD
| PIT_CTRL_SQUAREWAVE_GEN
| PIT_CTRL_COUNT_BINARY, PIT_CTRL);
- outb (freq_count & 0xff, PIT_COUNTER_2);
+ outb(freq_count & 0xff, PIT_COUNTER_2);
- outb ((freq_count >> 8) & 0xff, PIT_COUNTER_2);
+ outb((freq_count >> 8) & 0xff, PIT_COUNTER_2);
- outb (inb (PIT_SPEAKER_PORT)
+ outb(inb(PIT_SPEAKER_PORT)
| PIT_SPK_TMR2 | PIT_SPK_DATA,
PIT_SPEAKER_PORT);
for (; duration; duration--) {
unsigned short counter, previous_counter = 0xffff;
+
while (1) {
- counter = inb (PIT_COUNTER_2);
- counter |= ((uint16_t) inb (PIT_COUNTER_2)) << 8;
- if (counter > previous_counter)
- {
+ counter = inb(PIT_COUNTER_2);
+ counter |= ((uint16_t)inb(PIT_COUNTER_2)) << 8;
+ if (counter > previous_counter) {
previous_counter = counter;
break;
}
@@ -102,20 +102,22 @@ void spkmodem_tx_byte(unsigned char c)
{
int i;
- make_tone (SPEAKER_PIT_FREQUENCY / 200, 4);
+ make_tone(SPEAKER_PIT_FREQUENCY / 200, 4);
for (i = 7; i >= 0; i--) {
if ((c >> i) & 1)
- make_tone (SPEAKER_PIT_FREQUENCY / 2000, 20);
+ make_tone(SPEAKER_PIT_FREQUENCY / 2000, 20);
else
- make_tone (SPEAKER_PIT_FREQUENCY / 4000, 40);
- make_tone (SPEAKER_PIT_FREQUENCY / 1000, 10);
+ make_tone(SPEAKER_PIT_FREQUENCY / 4000, 40);
+ make_tone(SPEAKER_PIT_FREQUENCY / 1000, 10);
}
- make_tone (SPEAKER_PIT_FREQUENCY / 200, 0);
+ make_tone(SPEAKER_PIT_FREQUENCY / 200, 0);
}
void spkmodem_init(void)
{
- /* Some cards need time to come online. Output some message to get it started. */
+ /* Some cards need time to come online.
+ * Output some message to get it started.
+ */
spkmodem_tx_byte('S');
spkmodem_tx_byte('P');
spkmodem_tx_byte('K');
diff --git a/src/drivers/pc80/udelay_io.c b/src/drivers/pc80/pc/udelay_io.c
index 1cdc6739c1..3305e4c3a3 100644
--- a/src/drivers/pc80/udelay_io.c
+++ b/src/drivers/pc80/pc/udelay_io.c
@@ -8,6 +8,7 @@ void init_timer(void)
void udelay(unsigned usecs)
{
int i;
- for(i = 0; i < usecs; i++)
+
+ for (i = 0; i < usecs; i++)
inb(0x80);
}
diff --git a/src/drivers/pc80/rtc/Kconfig b/src/drivers/pc80/rtc/Kconfig
new file mode 100644
index 0000000000..350863e99a
--- /dev/null
+++ b/src/drivers/pc80/rtc/Kconfig
@@ -0,0 +1,4 @@
+config DRIVERS_MC146818
+ bool
+ default y if ARCH_X86
+ depends on PC80_SYSTEM
diff --git a/src/drivers/pc80/Makefile.inc b/src/drivers/pc80/rtc/Makefile.inc
index f468318dd5..d3b3344938 100644
--- a/src/drivers/pc80/Makefile.inc
+++ b/src/drivers/pc80/rtc/Makefile.inc
@@ -1,20 +1,10 @@
ifeq ($(CONFIG_ARCH_X86),y)
-romstage-$(CONFIG_DRIVERS_MC146818) += mc146818rtc.c
-ramstage-$(CONFIG_DRIVERS_MC146818) += mc146818rtc.c
-ramstage-y += isa-dma.c
-ramstage-y += i8254.c
-ramstage-y += i8259.c
-romstage-$(CONFIG_UDELAY_IO) += udelay_io.c
-ramstage-$(CONFIG_UDELAY_IO) += udelay_io.c
-ramstage-y += keyboard.c
-ramstage-$(CONFIG_SPKMODEM) += spkmodem.c
-
romstage-$(CONFIG_DRIVERS_MC146818) += mc146818rtc_early.c
+romstage-$(CONFIG_DRIVERS_MC146818) += mc146818rtc.c
-romstage-$(CONFIG_SPKMODEM) += spkmodem.c
-
-subdirs-y += tpm vga
+ramstage-$(CONFIG_DRIVERS_MC146818) += mc146818rtc_early.c
+ramstage-$(CONFIG_DRIVERS_MC146818) += mc146818rtc.c
cbfs-files-$(CONFIG_HAVE_CMOS_DEFAULT) += cmos.default
cmos.default-file = $(CONFIG_CMOS_DEFAULT_FILE):nvramtool
diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c
index 6c39f812b9..35dad3256a 100644
--- a/src/drivers/pc80/mc146818rtc.c
+++ b/src/drivers/pc80/rtc/mc146818rtc.c
@@ -38,11 +38,11 @@
#if (defined(__PRE_RAM__) && \
IS_ENABLED(CONFIG_HAVE_ROMSTAGE_NVRAM_CBFS_SPINLOCK))
- #define LOCK_NVRAM_CBFS_SPINLOCK spin_lock(romstage_nvram_cbfs_lock());
- #define UNLOCK_NVRAM_CBFS_SPINLOCK spin_unlock(romstage_nvram_cbfs_lock());
+ #define LOCK_NVRAM_CBFS_SPINLOCK() spin_lock(romstage_nvram_cbfs_lock())
+ #define UNLOCK_NVRAM_CBFS_SPINLOCK() spin_unlock(romstage_nvram_cbfs_lock())
#else
- #define LOCK_NVRAM_CBFS_SPINLOCK
- #define UNLOCK_NVRAM_CBFS_SPINLOCK
+ #define LOCK_NVRAM_CBFS_SPINLOCK() { }
+ #define UNLOCK_NVRAM_CBFS_SPINLOCK() { }
#endif
static void cmos_reset_date(void)
@@ -63,11 +63,12 @@ static void cmos_reset_date(void)
static int cmos_checksum_valid(int range_start, int range_end, int cks_loc)
{
+ int i;
+ u16 sum, old_sum;
+
if (IS_ENABLED(CONFIG_STATIC_OPTION_TABLE))
return 1;
- int i;
- u16 sum, old_sum;
sum = 0;
for (i = range_start; i <= range_end; i++)
sum += cmos_read(i);
@@ -80,6 +81,7 @@ static void cmos_set_checksum(int range_start, int range_end, int cks_loc)
{
int i;
u16 sum;
+
sum = 0;
for (i = range_start; i <= range_end; i++)
sum += cmos_read(i);
@@ -155,7 +157,7 @@ void cmos_init(bool invalid)
if (IS_ENABLED(CONFIG_USE_OPTION_TABLE)) {
/* See if there is a LB CMOS checksum error */
checksum_invalid = !cmos_checksum_valid(LB_CKS_RANGE_START,
- LB_CKS_RANGE_END,LB_CKS_LOC);
+ LB_CKS_RANGE_END, LB_CKS_LOC);
if (checksum_invalid)
printk(BIOS_DEBUG, "RTC: coreboot checksum invalid\n");
@@ -180,7 +182,7 @@ static enum cb_err get_cmos_value(unsigned long bit, unsigned long length,
void *vret)
{
unsigned char *ret;
- unsigned long byte,byte_bit;
+ unsigned long byte, byte_bit;
unsigned long i;
unsigned char uchar;
@@ -215,7 +217,7 @@ enum cb_err get_option(void *dest, const char *name)
if (!IS_ENABLED(CONFIG_USE_OPTION_TABLE))
return CB_CMOS_OTABLE_DISABLED;
- LOCK_NVRAM_CBFS_SPINLOCK
+ LOCK_NVRAM_CBFS_SPINLOCK();
/* Figure out how long name is */
namelen = strnlen(name, CMOS_MAX_NAME_LENGTH);
@@ -227,12 +229,12 @@ enum cb_err get_option(void *dest, const char *name)
printk(BIOS_ERR, "RTC: cmos_layout.bin could not be found. "
"Options are disabled\n");
- UNLOCK_NVRAM_CBFS_SPINLOCK
+ UNLOCK_NVRAM_CBFS_SPINLOCK();
return CB_CMOS_LAYOUT_NOT_FOUND;
}
- ce = (struct cmos_entries*)((unsigned char *)ct + ct->header_length);
- for(; ce->tag == LB_TAG_OPTION;
- ce = (struct cmos_entries*)((unsigned char *)ce + ce->size)) {
+ ce = (struct cmos_entries *)((unsigned char *)ct + ct->header_length);
+ for (; ce->tag == LB_TAG_OPTION;
+ ce = (struct cmos_entries *)((unsigned char *)ce + ce->size)) {
if (memcmp(ce->name, name, namelen) == 0) {
found = 1;
break;
@@ -240,19 +242,19 @@ enum cb_err get_option(void *dest, const char *name)
}
if (!found) {
printk(BIOS_DEBUG, "WARNING: No CMOS option '%s'.\n", name);
- UNLOCK_NVRAM_CBFS_SPINLOCK
+ UNLOCK_NVRAM_CBFS_SPINLOCK();
return CB_CMOS_OPTION_NOT_FOUND;
}
if (get_cmos_value(ce->bit, ce->length, dest) != CB_SUCCESS) {
- UNLOCK_NVRAM_CBFS_SPINLOCK
+ UNLOCK_NVRAM_CBFS_SPINLOCK();
return CB_CMOS_ACCESS_ERROR;
}
if (!cmos_checksum_valid(LB_CKS_RANGE_START, LB_CKS_RANGE_END, LB_CKS_LOC)) {
- UNLOCK_NVRAM_CBFS_SPINLOCK
+ UNLOCK_NVRAM_CBFS_SPINLOCK();
return CB_CMOS_CHECKSUM_INVALID;
}
- UNLOCK_NVRAM_CBFS_SPINLOCK
+ UNLOCK_NVRAM_CBFS_SPINLOCK();
return CB_SUCCESS;
}
@@ -260,7 +262,7 @@ static enum cb_err set_cmos_value(unsigned long bit, unsigned long length,
void *vret)
{
unsigned char *ret;
- unsigned long byte,byte_bit;
+ unsigned long byte, byte_bit;
unsigned long i;
unsigned char uchar, mask;
unsigned int chksum_update_needed = 0;
@@ -319,9 +321,9 @@ enum cb_err set_option(const char *name, void *value)
"Options are disabled\n");
return CB_CMOS_LAYOUT_NOT_FOUND;
}
- ce = (struct cmos_entries*)((unsigned char *)ct + ct->header_length);
- for(; ce->tag == LB_TAG_OPTION;
- ce = (struct cmos_entries*)((unsigned char *)ce + ce->size)) {
+ ce = (struct cmos_entries *)((unsigned char *)ct + ct->header_length);
+ for (; ce->tag == LB_TAG_OPTION;
+ ce = (struct cmos_entries *)((unsigned char *)ce + ce->size)) {
if (memcmp(ce->name, name, namelen) == 0) {
found = 1;
break;
@@ -338,11 +340,11 @@ enum cb_err set_option(const char *name, void *value)
/* make sure the string is null terminated */
if (set_cmos_value(ce->bit + ce->length - 8, 8, &(u8[]){0})
!= CB_SUCCESS)
- return (CB_CMOS_ACCESS_ERROR);
+ return CB_CMOS_ACCESS_ERROR;
}
if (set_cmos_value(ce->bit, length, value) != CB_SUCCESS)
- return (CB_CMOS_ACCESS_ERROR);
+ return CB_CMOS_ACCESS_ERROR;
return CB_SUCCESS;
}
@@ -352,7 +354,7 @@ enum cb_err set_option(const char *name, void *value)
* hurts some OSes. Even if we don't set USE_OPTION_TABLE, we need
* to make sure the date is valid.
*/
-void cmos_check_update_date()
+void cmos_check_update_date(void)
{
u8 year, century;
@@ -369,7 +371,8 @@ void cmos_check_update_date()
cmos_reset_date();
}
-int rtc_set(const struct rtc_time *time){
+int rtc_set(const struct rtc_time *time)
+{
cmos_write(bin2bcd(time->sec), RTC_CLK_SECOND);
cmos_write(bin2bcd(time->min), RTC_CLK_MINUTE);
cmos_write(bin2bcd(time->hour), RTC_CLK_HOUR);
diff --git a/src/drivers/pc80/mc146818rtc_early.c b/src/drivers/pc80/rtc/mc146818rtc_early.c
index 3ff5d4fb3e..8bebc4229d 100644
--- a/src/drivers/pc80/mc146818rtc_early.c
+++ b/src/drivers/pc80/rtc/mc146818rtc_early.c
@@ -22,11 +22,11 @@ static int cmos_chksum_valid(void)
#if CONFIG_USE_OPTION_TABLE
unsigned char addr;
u16 sum, old_sum;
+
sum = 0;
/* Compute the cmos checksum */
- for(addr = LB_CKS_RANGE_START; addr <= LB_CKS_RANGE_END; addr++) {
+ for (addr = LB_CKS_RANGE_START; addr <= LB_CKS_RANGE_END; addr++)
sum += cmos_read(addr);
- }
/* Read the stored checksum */
old_sum = cmos_read(LB_CKS_LOC) << 8;
@@ -95,6 +95,7 @@ unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def)
{
#if CONFIG_USE_OPTION_TABLE
unsigned byte;
+
byte = cmos_read(start/8);
return (byte >> (start & 7U)) & ((1U << size) - 1U);
#else
diff --git a/src/drivers/pc80/tpm/Makefile.inc b/src/drivers/pc80/tpm/Makefile.inc
index 697842fa03..0068ff19a6 100644
--- a/src/drivers/pc80/tpm/Makefile.inc
+++ b/src/drivers/pc80/tpm/Makefile.inc
@@ -1,4 +1,8 @@
+ifeq ($(CONFIG_ARCH_X86),y)
+
verstage-$(CONFIG_LPC_TPM) += tpm.c
romstage-$(CONFIG_LPC_TPM) += tpm.c
ramstage-$(CONFIG_LPC_TPM) += tpm.c
romstage-$(CONFIG_LPC_TPM) += romstage.c
+
+endif
diff --git a/src/drivers/pc80/vga/Makefile.inc b/src/drivers/pc80/vga/Makefile.inc
index d4b726a388..3e31de1ddf 100644
--- a/src/drivers/pc80/vga/Makefile.inc
+++ b/src/drivers/pc80/vga/Makefile.inc
@@ -1,4 +1,8 @@
+ifeq ($(CONFIG_ARCH_X86),y)
+
ramstage-$(CONFIG_VGA) += vga_io.c
ramstage-$(CONFIG_VGA) += vga_palette.c
ramstage-$(CONFIG_VGA) += vga_font_8x16.c
ramstage-$(CONFIG_VGA) += vga.c
+
+endif