From bbfeb586a6c41e7b70a448fc25014aa0c00ead1d Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 28 Mar 2018 12:31:40 +0200 Subject: mb/cavium/cn8100_sff_evb: Be verbose Print some useful information about the board. Change-Id: I0acac7a29290bc2eb9f4283317165fa0cf1b24e1 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/25449 Reviewed-by: David Hendricks Tested-by: build bot (Jenkins) --- src/mainboard/cavium/cn8100_sff_evb/mainboard.c | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'src/mainboard') diff --git a/src/mainboard/cavium/cn8100_sff_evb/mainboard.c b/src/mainboard/cavium/cn8100_sff_evb/mainboard.c index 1c2c4365d2..135d608cdb 100644 --- a/src/mainboard/cavium/cn8100_sff_evb/mainboard.c +++ b/src/mainboard/cavium/cn8100_sff_evb/mainboard.c @@ -23,6 +23,59 @@ #include #include #include +#include +#include +#include +#include +#include +#include + +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[]; @@ -215,6 +268,8 @@ static void mainboard_enable(struct device *dev) gpio_output(10, 0); udelay(100); gpio_output(10, 1); + + mainboard_print_info(); } struct chip_operations mainboard_ops = { -- cgit v1.2.3