mb/cavium/cn8100_sff_evb: Be verbose

Print some useful information about the board.

Change-Id: I0acac7a29290bc2eb9f4283317165fa0cf1b24e1
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25449
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph 2018-03-28 12:31:40 +02:00 committed by Patrick Rudolph
parent d0dcf877e4
commit bbfeb586a6
1 changed files with 55 additions and 0 deletions

View File

@ -23,6 +23,59 @@
#include <soc/gpio.h> #include <soc/gpio.h>
#include <delay.h> #include <delay.h>
#include <soc/uart.h> #include <soc/uart.h>
#include <console/console.h>
#include <soc/clock.h>
#include <soc/gpio.h>
#include <soc/timer.h>
#include <soc/cpu.h>
#include <soc/sdram.h>
static void mainboard_print_info(void)
{
printk(BIOS_INFO, "MB: trusted boot : %s\n",
gpio_strap_value(10) ? "yes" : "no");
const size_t boot_method = gpio_strap_value(0) |
(gpio_strap_value(1) << 1) |
(gpio_strap_value(2) << 2) |
(gpio_strap_value(3) << 3);
printk(BIOS_INFO, "MB: boot method : ");
switch (boot_method) {
case 0x2:
case 0x3:
printk(BIOS_INFO, "EMMC\n");
break;
case 0x5:
case 0x6:
printk(BIOS_INFO, "SPI\n");
break;
case 0x8:
printk(BIOS_INFO, "REMOTE\n");
break;
case 0xc:
case 0xd:
printk(BIOS_INFO, "PCIe\n");
break;
default:
printk(BIOS_INFO, "unknown\n");
}
printk(BIOS_INFO, "MB: REFclk : %llu MHz\n",
thunderx_get_ref_clock() / 1000000ULL);
printk(BIOS_INFO, "MB: IOclk : %llu MHz\n",
thunderx_get_io_clock() / 1000000ULL);
printk(BIOS_INFO, "MB: COREclk : %llu MHz\n",
thunderx_get_core_clock() / 1000000ULL);
printk(BIOS_INFO, "MB: #CPU cores : %zu\n",
cpu_get_num_cores());
printk(BIOS_INFO, "MB: RAM : %zu MiB\n",
sdram_size_mb());
}
extern const struct bdk_devicetree_key_value devtree[]; extern const struct bdk_devicetree_key_value devtree[];
@ -215,6 +268,8 @@ static void mainboard_enable(struct device *dev)
gpio_output(10, 0); gpio_output(10, 0);
udelay(100); udelay(100);
gpio_output(10, 1); gpio_output(10, 1);
mainboard_print_info();
} }
struct chip_operations mainboard_ops = { struct chip_operations mainboard_ops = {