From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web12.10911.1578502820446319941 for ; Wed, 08 Jan 2020 09:00:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=u9EbyO5x; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.67, mailfrom: pete@akeo.ie) Received: by mail-wr1-f67.google.com with SMTP id q6so4139677wro.9 for ; Wed, 08 Jan 2020 09:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YtUslleYFj4TCci1RRVaqbwaAAJSsTkrP8m/WFYTBBQ=; b=u9EbyO5xJDMsIJcrbLh1VENnOZruhrjDJpY3EGsfn8/+pg1ZJFsNZFhyoPHE7Rpihr /uo4/Q7IbwQtcg7kjHhvcFhmDqazBrwFMWjPIgM9PbkYa8Y46aGom5urKOQsqXIu61Pa AIKjveS04XwQszqxTgGBOMm55f5rjACFrkakn/DAoOL8Ztdo084UhZ7YhdIHcVvgI+aM /EUxF8b5JMZ/btkaqVVq31st9QzpAVgQPPTaNoWGKoL/cchgiOZ5LSkD2jAzM9UVjZZc gfFmmCC2nOuDaanz6ubL4zOEcBmdqLyyNYGuoxlFVxDsFeZwq4H0/AG7YlsxjyhuT9cI AAkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YtUslleYFj4TCci1RRVaqbwaAAJSsTkrP8m/WFYTBBQ=; b=i25HxXR+EYMjJDZC+ka9pGIBmxARtH0w09VcwFJjqsQG6lGqFKv8UNCLbxD6X8oLEo xVdAI2210La4gYyc0RP/akWppcundo49442yrplyE0zfFGI++pqjzLMvE41yhDOJiqLy TNFEsSryVCXzB84nOI8Jq4c3a00Ob0f3cc+FiUVEQGJ4aFH7Uj7x6ckH1YkzhGKvTP+u 4+b7svkFmT2kj059of4Cp/BKlGlNF9GVPRhydOmUaVbxQeKCjUght69/ZtO3wD10265m z55rY7BKReqlHVcw1n+sBPHNqzuUndzonSWidd5WIsNWhTDSjSClsS1syegfq+PMlQDO jYaQ== X-Gm-Message-State: APjAAAVVeBAKFPXzZ8p3YnbaiOikfoxsUrLt6VgWH2z1w8avbYCNdo6U GWNhr6I/T8vZlTnMnU4AaVC8o5A9FOo= X-Google-Smtp-Source: APXvYqwM0rrPeuo2p734TWDdqEUYjmXJ7RhNlE8Y6IhIvpvbpc9fC5crvAFdaSkbRfElZC3WESGklQ== X-Received: by 2002:a05:6000:11c3:: with SMTP id i3mr5635049wrx.244.1578502818834; Wed, 08 Jan 2020 09:00:18 -0800 (PST) Return-Path: Received: from localhost.localdomain ([84.203.81.176]) by smtp.gmail.com with ESMTPSA id i16sm4786496wmb.36.2020.01.08.09.00.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2020 09:00:18 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, philmd@redhat.com Subject: [edk2-platforms][PATCH 2/2] Platform/RPi/RPiFirmwareDxe: Fix serial number population for RPi4 Date: Wed, 8 Jan 2020 17:00:04 +0000 Message-Id: <20200108170004.6680-3-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200108170004.6680-1-pete@akeo.ie> References: <20200108170004.6680-1-pete@akeo.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some (all?) Raspbery Pi 4 platforms report 0x0000000010000000 as their board serial when queried through the VideoCore mailbox. Fix this by using the MAC address then. Signed-off-by: Pete Batard --- Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c index dd61ef089ca7..75826fdc0e53 100644 --- a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c +++ b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c @@ -394,8 +394,9 @@ RpiFirmwareGetSerial ( } *Serial = Cmd->TagBody.Serial; - // Some platforms return 0 for serial. For those, try to use the MAC address. - if (*Serial == 0) { + // Some platforms return 0 or 0x0000000010000000 for serial. + // For those, try to use the MAC address. + if ((*Serial == 0) || ((*Serial & 0xFFFFFFFF0FFFFFFFULL) == 0)) { Status = RpiFirmwareGetMacAddress ((UINT8*) Serial); // Convert to a more user-friendly value *Serial = SwapBytes64 (*Serial << 16); -- 2.21.0.windows.1