From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::241; helo=mail-wm0-x241.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A366F2034D83C for ; Tue, 7 Nov 2017 07:33:56 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id b9so4808871wmh.0 for ; Tue, 07 Nov 2017 07:37:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ynLcyQknjgQ9pILKUdwVxJIZ51IR5UHN+FX00HCwi00=; b=jLmeIQWb+3P/JpIwW/K+uXNnGse1RLMhIhLwREFla3N+61HWbWnkAb4bq6Idmb4/hO BSAKdbnYKjI7irrwmwwfpmJGgBgv63f6dOkvBBn3ugD/e4fnoSWynuWtapTanJFO8oU6 x+kfXh4lBNlJTomP5NedHjmq+fGiyP7ssxgHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ynLcyQknjgQ9pILKUdwVxJIZ51IR5UHN+FX00HCwi00=; b=o262e1LFRzlU7e7mIAHZWCWDBYp2C/hxw6N/lCcXHozYcqjn6yqCuurSY1u264Frff 6uNyn5l3XL/ml07/JUxUmdaSsDZxccUB4pm344siU8gLBMq6T0y1M2zuHb9itFYyHXGj mvmdVpAiMDlWR4jUJQ1hEHsAMbEkUIbUNPN6UN6PfgHpwchr82OU5rsHWNTi3tCbOs04 G6v7hsQkUTM14GaHUqtOVgCeb7kBAqP6YL6nNBoK2ht0r0Q4au1kN/A7+YWywGGZAmVq MQHFgQAHHzYCA9oKLXYhpw5VhxpMMt3/jq/YBW7kzPpvZUoRY7A2lEP5rR8VyTcX8LPP exrw== X-Gm-Message-State: AJaThX4tE5wXzKeUgHWELOc0c4VTh6n1YuRI4pU6JlQ+lSqLvhl0upQi QyarCBwaDee9SajAllY9fR/3yw== X-Google-Smtp-Source: ABhQp+R0jkSYElqI8DBOrWACU1bCTGsyZt2A7eouH9LU//foQ0CZ5KYNmJr771SIsg8ouncIXMfUYg== X-Received: by 10.28.90.85 with SMTP id o82mr1740487wmb.69.1510069074664; Tue, 07 Nov 2017 07:37:54 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id p81sm3224714wrc.61.2017.11.07.07.37.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 07:37:53 -0800 (PST) Date: Tue, 7 Nov 2017 15:37:52 +0000 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, feng.tian@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, ard.biesheuvel@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com, jinghua@marvell.com, jsd@semihalf.com Message-ID: <20171107153751.xz2nb4eeo6ihxso3@bivouac.eciton.net> References: <1509731717-5620-1-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1509731717-5620-1-git-send-email-mw@semihalf.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH v3 1/1] EmbeddedPkg: Implement NorFlashInfoLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 15:33:57 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 03, 2017 at 06:55:17PM +0100, Marcin Wojtas wrote: > The SPI NOR flash drivers which base on ArmPlatformPkg's > NorFlashDxe usually make use of static declarations of the > flash instances with their type and parameters. As a result > it implies hardcoding the exact way of flash handling, not to > mention the code does not look very nice. Much better solution > would be obtaining the flash ID and hence its description > in runtime. > > JEDEC compliant SPI NOR devices allow to obtain their IDs with > READ_ID command (0x9f), which should return the vendor ID byte, > followed by 2 to 4 following device ID bytes. Use this capability > for implementing a NorFlashInfoLib that gives an access to the > NOR flash description data, such as name, page size, sector > (block) size and others, of more than 50 different models. > The new library user should pass an output array from issuing > READ_ID command to the NorFlashGetInfo () routine - if the > match is found, an allocated (optionally for RT) pool with > the flash description copy will be returned. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Marcin Wojtas > > ========================== Please, the separator is --- The below does not belong in the commit message (but should be included below --- for clarity). I would however also like to fold in the following hunk, to enable standalone building: diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc index d7ee6a3018..bc19000e4b 100644 --- a/EmbeddedPkg/EmbeddedPkg.dsc +++ b/EmbeddedPkg/EmbeddedPkg.dsc @@ -282,6 +282,8 @@ [Components.common] EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf + EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf + [Components.ARM] EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf If you are OK with these changes: Reviewed-by: Leif Lindholm (do let me know) / Leif