From 7f6862e5e080a20b3ebe089d3a6e8ea0d9f7bd4e Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 30 Nov 2015 15:15:30 -0800 Subject: [PATCH] Cr50: bootloader: display config bits at boot We support two FPGA images with the same firmware. To meet timing, one image has support for USB but at the cost of reducing the crypto multiplier to 8x8. The other image has full crypto but no USB support. This change displays the FPGA configuration at boot, in addition to the FPGA image version. BUG=b:25350751 BRANCH=none TEST=make buildall, manual Boot it and watch the console. You should see something like this: cr50 bootloader, 20151118_73026@80895, +USB, 8x8 crypto Valid image found at 0x00044000, jumping Change-Id: I0e5de453fcd1714fcbb170bf4364747b1e7ba894 Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/314824 Reviewed-by: Vadim Bendebury --- chip/g/loader/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chip/g/loader/main.c b/chip/g/loader/main.c index 0de3ff616d..afa4d0067a 100644 --- a/chip/g/loader/main.c +++ b/chip/g/loader/main.c @@ -63,9 +63,13 @@ int main(void) { init_trng(); uart_init(); - debug_printf("\n\n%s bootloader, %8u_%u@%u\n", + debug_printf("\n\n%s bootloader, %8u_%u@%u, %sUSB, %s crypto\n", STRINGIFY(BOARD), GREG32(SWDP, BUILD_DATE), - GREG32(SWDP, BUILD_TIME), GREG32(SWDP, P4_LAST_SYNC)); + GREG32(SWDP, BUILD_TIME), GREG32(SWDP, P4_LAST_SYNC), + (GREG32(SWDP, FPGA_CONFIG) & + GC_CONST_SWDP_FPGA_CONFIG_USB_8X8CRYPTO) ? "" : "no ", + (GREG32(SWDP, FPGA_CONFIG) & + GC_CONST_SWDP_FPGA_CONFIG_NOUSB_CRYPTO) ? "full" : "8x8"); unlockFlashForRW(); /* Trying RW A only for now */