From 95a6f2b763597cad210e2a063decb504f3d0c17b Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 12 Sep 2019 23:21:12 +0300 Subject: [PATCH] sdram: Support fully burnt ODM fuses --- bootloader/mem/sdram.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootloader/mem/sdram.c b/bootloader/mem/sdram.c index e9a2219..db9637a 100644 --- a/bootloader/mem/sdram.c +++ b/bootloader/mem/sdram.c @@ -39,7 +39,13 @@ static u32 _get_sdram_id() { - return (fuse_read_odm(4) & 0x38) >> 3; + u32 sdram_id = (fuse_read_odm(4) & 0x38) >> 3; + + // Check if id is proper. + if (sdram_id > 7) + sdram_id = 0; + + return sdram_id; } static void _sdram_config(const sdram_params_t *params)