Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2003 Eric Biederman |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; version 2 of |
| 9 | * the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 15 | */ |
| 16 | |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 17 | #include <console/console.h> |
| 18 | #include <console/uart.h> |
Kyösti Mälkki | 4076072 | 2014-02-27 19:30:18 +0200 | [diff] [blame] | 19 | #include <console/streams.h> |
Kyösti Mälkki | f9cdb48 | 2014-11-18 13:21:50 +0200 | [diff] [blame] | 20 | #include <device/pci.h> |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 21 | #include <option.h> |
Aaron Durbin | aab1326 | 2015-05-13 13:32:11 -0500 | [diff] [blame] | 22 | #include <rules.h> |
Kyösti Mälkki | c36af7b | 2014-11-18 12:41:16 +0200 | [diff] [blame] | 23 | #include <version.h> |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 24 | |
Kyösti Mälkki | 56ae139 | 2014-02-28 14:37:27 +0200 | [diff] [blame] | 25 | /* While in romstage, console loglevel is built-time constant. */ |
| 26 | static ROMSTAGE_CONST int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; |
| 27 | |
| 28 | int console_log_level(int msg_level) |
| 29 | { |
| 30 | return (console_loglevel >= msg_level); |
| 31 | } |
Kyösti Mälkki | b2d2596 | 2014-01-27 15:09:13 +0200 | [diff] [blame] | 32 | |
Lee Leahy | 049b462 | 2016-07-31 11:53:28 -0700 | [diff] [blame] | 33 | asmlinkage void console_init(void) |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 34 | { |
| 35 | #if !defined(__PRE_RAM__) |
Varad Gautam | 06ef046 | 2015-03-11 09:54:41 +0530 | [diff] [blame] | 36 | console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; |
| 37 | get_option(&console_loglevel, "debug_level"); |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 38 | #endif |
| 39 | |
Kyösti Mälkki | 4076072 | 2014-02-27 19:30:18 +0200 | [diff] [blame] | 40 | #if CONFIG_EARLY_PCI_BRIDGE && !defined(__SMM__) |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 41 | pci_early_bridge_init(); |
| 42 | #endif |
| 43 | |
| 44 | console_hw_init(); |
| 45 | |
Ben Gardner | aa5f5b1 | 2015-11-19 10:48:47 -0600 | [diff] [blame] | 46 | printk(BIOS_INFO, "\n\ncoreboot-%s%s %s " ENV_STRING " starting...\n", |
| 47 | coreboot_version, coreboot_extra_version, coreboot_build); |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 48 | } |