Re: [edk2] [PATCH edk2-platforms v2 05/15] Hisilicon D03/D05: Add capsule upgrade support
On 2018/1/30 21:21, Leif Lindholm wrote: > On Tue, Jan 30, 2018 at 08:48:27PM +0800, Huangming (Mark) wrote: >> >> >> On 2018/1/30 3:58, Leif Lindholm wrote: >>> A few style comments below. >>> >>> On Fri, Jan 26, 2018 at 04:00:40PM +0800, Ming Huang wrote: From: Jason ZhangThis module support updating the boot CPU firmware only. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jason Zhang Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini | 45 +++ Platform/Hisilicon/D03/D03.dsc | 17 ++- Platform/Hisilicon/D03/D03.fdf | 70 +++ Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc | 81 + Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf | 50 Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c | 70 +++ Platform/Hisilicon/D05/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini | 45 +++ Platform/Hisilicon/D05/D05.dsc | 19 ++- Platform/Hisilicon/D05/D05.fdf | 70 +++ Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc | 81 + Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf | 50 Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c | 70 +++ Silicon/Hisilicon/Hisilicon.dsc.inc | 11 +- Silicon/Hisilicon/Hisilicon.fdf.inc | 9 ++ Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.c | 123 Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.inf | 51 16 files changed, 859 insertions(+), 3 deletions(-) >>> diff --git a/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc new file mode 100644 index 000..d9f4a00 --- /dev/null +++ b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc @@ -0,0 +1,81 @@ +/** @file + System Firmware descriptor. + + Copyright (c) 2018, Hisilicon Limited. All rights reserved. + Copyright (c) 2018, Linaro Limited. All rights reserved. + Copyright (c) 2016, Intel Corporation. All rights reserved. + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include +#include +#include + +#define PACKAGE_VERSION 0x +#define PACKAGE_VERSION_STRING L"Unknown" + +#define CURRENT_FIRMWARE_VERSION0x0002 +#define CURRENT_FIRMWARE_VERSION_STRING L"0x0002" +#define LOWEST_SUPPORTED_FIRMWARE_VERSION 0x0001 + +#define IMAGE_IDSIGNATURE_64('H','W','A', 'R', 'M', '_', 'F', 'd') +#define IMAGE_ID_STRING L"ARMPlatformFd" + +// PcdSystemFmpCapsuleImageTypeIdGuid +#define IMAGE_TYPE_ID_GUID { 0x44c850f2, 0x85ff, 0x4be5, { 0xbf, 0x34, 0xa5, 0x95, 0x28, 0xdf, 0x22, 0xd3 } } + +typedef struct { + EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR Descriptor; + // real string data + CHAR16 ImageIdNameStr[sizeof(IMAGE_ID_STRING) / sizeof(CHAR16)]; + CHAR16 VersionNameStr[sizeof(CURRENT_FIRMWARE_VERSION_STRING) / sizeof(CHAR16)]; + CHAR16 PackageVersionNameStr[sizeof(PACKAGE_VERSION_STRING) /
Re: [edk2] [PATCH edk2-platforms v2 05/15] Hisilicon D03/D05: Add capsule upgrade support
On Tue, Jan 30, 2018 at 08:48:27PM +0800, Huangming (Mark) wrote: > > > On 2018/1/30 3:58, Leif Lindholm wrote: > > A few style comments below. > > > > On Fri, Jan 26, 2018 at 04:00:40PM +0800, Ming Huang wrote: > >> From: Jason Zhang> >> > >> This module support updating the boot CPU firmware only. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> Signed-off-by: Jason Zhang > >> Signed-off-by: Ming Huang > >> Signed-off-by: Heyi Guo > >> --- > >> > >> Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > >> | 45 +++ > >> Platform/Hisilicon/D03/D03.dsc > >>| 17 ++- > >> Platform/Hisilicon/D03/D03.fdf > >>| 70 +++ > >> > >> Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > >> | 81 + > >> > >> Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf > >> | 50 > >> > >> Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c > >> | 70 +++ > >> > >> Platform/Hisilicon/D05/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > >> | 45 +++ > >> Platform/Hisilicon/D05/D05.dsc > >>| 19 ++- > >> Platform/Hisilicon/D05/D05.fdf > >>| 70 +++ > >> > >> Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > >> | 81 + > >> > >> Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf > >> | 50 > >> > >> Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c > >> | 70 +++ > >> Silicon/Hisilicon/Hisilicon.dsc.inc > >>| 11 +- > >> Silicon/Hisilicon/Hisilicon.fdf.inc > >>| 9 ++ > >> > >> Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.c > >> | 123 > >> > >> Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.inf > >>| 51 > >> 16 files changed, 859 insertions(+), 3 deletions(-) > >> > > > >> diff --git > >> a/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > >> > >> b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > >> new file mode 100644 > >> index 000..d9f4a00 > >> --- /dev/null > >> +++ > >> b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > >> @@ -0,0 +1,81 @@ > >> +/** @file > >> + System Firmware descriptor. > >> + > >> + Copyright (c) 2018, Hisilicon Limited. All rights reserved. > >> + Copyright (c) 2018, Linaro Limited. All rights reserved. > >> + Copyright (c) 2016, Intel Corporation. All rights reserved. > >> + > >> + This program and the accompanying materials > >> + are licensed and made available under the terms and conditions of the > >> BSD License > >> + which accompanies this distribution. The full text of the license may > >> be found at > >> + http://opensource.org/licenses/bsd-license.php > >> + > >> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > >> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR > >> IMPLIED. > >> + > >> +**/ > >> + > >> +#include > >> +#include > >> +#include > >> + > >> +#define PACKAGE_VERSION 0x > >> +#define PACKAGE_VERSION_STRING L"Unknown" > >> + > >> +#define CURRENT_FIRMWARE_VERSION0x0002 > >> +#define CURRENT_FIRMWARE_VERSION_STRING L"0x0002" > >> +#define LOWEST_SUPPORTED_FIRMWARE_VERSION 0x0001 > >> + > >> +#define IMAGE_IDSIGNATURE_64('H','W','A', > >> 'R', 'M', '_', 'F', 'd') > >> +#define IMAGE_ID_STRING L"ARMPlatformFd" > >> + > >> +// PcdSystemFmpCapsuleImageTypeIdGuid > >> +#define IMAGE_TYPE_ID_GUID { 0x44c850f2, 0x85ff, 0x4be5, > >> { 0xbf, 0x34, 0xa5, 0x95, 0x28, 0xdf, 0x22, 0xd3 } } > >> + > >> +typedef struct { > >> + EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR Descriptor; > >> + // real string data > >> + CHAR16 > >> ImageIdNameStr[sizeof(IMAGE_ID_STRING) / sizeof(CHAR16)]; > >> + CHAR16 > >> VersionNameStr[sizeof(CURRENT_FIRMWARE_VERSION_STRING) / sizeof(CHAR16)]; > >> + CHAR16 > >> PackageVersionNameStr[sizeof(PACKAGE_VERSION_STRING) / sizeof(CHAR16)]; > > > > Use ARRAY_SIZE for
Re: [edk2] [PATCH edk2-platforms v2 05/15] Hisilicon D03/D05: Add capsule upgrade support
On 2018/1/30 3:58, Leif Lindholm wrote: > A few style comments below. > > On Fri, Jan 26, 2018 at 04:00:40PM +0800, Ming Huang wrote: >> From: Jason Zhang>> >> This module support updating the boot CPU firmware only. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Jason Zhang >> Signed-off-by: Ming Huang >> Signed-off-by: Heyi Guo >> --- >> >> Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini >> | 45 +++ >> Platform/Hisilicon/D03/D03.dsc >> | 17 ++- >> Platform/Hisilicon/D03/D03.fdf >> | 70 +++ >> >> Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc >> | 81 + >> >> Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf >> | 50 >> >> Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c >> | 70 +++ >> >> Platform/Hisilicon/D05/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini >> | 45 +++ >> Platform/Hisilicon/D05/D05.dsc >> | 19 ++- >> Platform/Hisilicon/D05/D05.fdf >> | 70 +++ >> >> Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc >> | 81 + >> >> Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf >> | 50 >> >> Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c >> | 70 +++ >> Silicon/Hisilicon/Hisilicon.dsc.inc >> | 11 +- >> Silicon/Hisilicon/Hisilicon.fdf.inc >> | 9 ++ >> >> Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.c >> | 123 >> >> Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.inf >>| 51 >> 16 files changed, 859 insertions(+), 3 deletions(-) >> > >> diff --git >> a/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc >> >> b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc >> new file mode 100644 >> index 000..d9f4a00 >> --- /dev/null >> +++ >> b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc >> @@ -0,0 +1,81 @@ >> +/** @file >> + System Firmware descriptor. >> + >> + Copyright (c) 2018, Hisilicon Limited. All rights reserved. >> + Copyright (c) 2018, Linaro Limited. All rights reserved. >> + Copyright (c) 2016, Intel Corporation. All rights reserved. >> + >> + This program and the accompanying materials >> + are licensed and made available under the terms and conditions of the BSD >> License >> + which accompanies this distribution. The full text of the license may be >> found at >> + http://opensource.org/licenses/bsd-license.php >> + >> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, >> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR >> IMPLIED. >> + >> +**/ >> + >> +#include >> +#include >> +#include >> + >> +#define PACKAGE_VERSION 0x >> +#define PACKAGE_VERSION_STRING L"Unknown" >> + >> +#define CURRENT_FIRMWARE_VERSION0x0002 >> +#define CURRENT_FIRMWARE_VERSION_STRING L"0x0002" >> +#define LOWEST_SUPPORTED_FIRMWARE_VERSION 0x0001 >> + >> +#define IMAGE_IDSIGNATURE_64('H','W','A', 'R', >> 'M', '_', 'F', 'd') >> +#define IMAGE_ID_STRING L"ARMPlatformFd" >> + >> +// PcdSystemFmpCapsuleImageTypeIdGuid >> +#define IMAGE_TYPE_ID_GUID { 0x44c850f2, 0x85ff, 0x4be5, { >> 0xbf, 0x34, 0xa5, 0x95, 0x28, 0xdf, 0x22, 0xd3 } } >> + >> +typedef struct { >> + EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR Descriptor; >> + // real string data >> + CHAR16 >> ImageIdNameStr[sizeof(IMAGE_ID_STRING) / sizeof(CHAR16)]; >> + CHAR16 >> VersionNameStr[sizeof(CURRENT_FIRMWARE_VERSION_STRING) / sizeof(CHAR16)]; >> + CHAR16 >> PackageVersionNameStr[sizeof(PACKAGE_VERSION_STRING) / sizeof(CHAR16)]; > > Use ARRAY_SIZE for the 3 above? > If use ARRAY_SIZE, the three macro must change to array of CHAR16. It is not necessary maybe.The same style is found in SystemFirmwareDescriptor.aslc from other platform,like AMD,Socionext. Thanks, Ming >> +} IMAGE_DESCRIPTOR; >> + >> +IMAGE_DESCRIPTOR mImageDescriptor = >> +{ >> + { >>
Re: [edk2] [PATCH edk2-platforms v2 05/15] Hisilicon D03/D05: Add capsule upgrade support
On 26 January 2018 at 08:00, Ming Huangwrote: > From: Jason Zhang > > This module support updating the boot CPU firmware only. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jason Zhang > Signed-off-by: Ming Huang > Signed-off-by: Heyi Guo This looks good to me know. Provided that you address Leif's additional comments: Reviewed-by: Ard Biesheuvel > --- > > Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > | 45 +++ > Platform/Hisilicon/D03/D03.dsc > | 17 ++- > Platform/Hisilicon/D03/D03.fdf > | 70 +++ > > Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > | 81 + > > Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf > | 50 > > Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c > | 70 +++ > > Platform/Hisilicon/D05/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > | 45 +++ > Platform/Hisilicon/D05/D05.dsc > | 19 ++- > Platform/Hisilicon/D05/D05.fdf > | 70 +++ > > Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > | 81 + > > Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf > | 50 > > Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c > | 70 +++ > Silicon/Hisilicon/Hisilicon.dsc.inc > | 11 +- > Silicon/Hisilicon/Hisilicon.fdf.inc > | 9 ++ > Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.c > | 123 > > Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.inf >| 51 > 16 files changed, 859 insertions(+), 3 deletions(-) > > diff --git > a/Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > > b/Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > new file mode 100644 > index 000..fc834d9 > --- /dev/null > +++ > b/Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > @@ -0,0 +1,45 @@ > +# > +# Copyright (c) 2018, Hisilicon Limited. All rights reserved. > +# Copyright (c) 2018, Linaro Limited. All rights reserved. > +# Copyright (c) 2016, Intel Corporation. All rights reserved. > +# > +# This program and the accompanying materials > +# are licensed and made available under the terms and conditions of the BSD > License > +# which accompanies this distribution. The full text of the license may be > found at > +# http://opensource.org/licenses/bsd-license.php > +# > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR > IMPLIED. > +# > +## > + > +[Head] > +NumOfUpdate = 3 > +NumOfRecovery = 0 > +Update0 = SysFvMain > +Update1 = SysCustom > +Update2 = SysNvRam > + > +[SysFvMain] > +FirmwareType = 0 # 0 - SystemFirmware, 1 - NvRam > +AddressType = 0 # 0 - relative address, 1 - absolute address. > +BaseAddress = 0x# Base address offset on flash > +Length= 0x002D# Length > +ImageOffset = 0x# Image offset of this SystemFirmware image > +FileGuid = 642e4fcf-2df7-4415-8b70-a03909c57b55 # > PcdEdkiiSystemFirmwareFileGuid > + > +[SysCustom] > +FirmwareType = 0 # 0 - SystemFirmware, 1 - NvRam > +AddressType = 0 # 0 - relative address, 1 - absolute address. > +BaseAddress = 0x002F# Base address offset on flash > +Length= 0x0001# Length > +ImageOffset = 0x002F# Image offset of this SystemFirmware image > +FileGuid = 642e4fcf-2df7-4415-8b70-a03909c57b55 # > PcdEdkiiSystemFirmwareFileGuid > + > +[SysNvRam] > +FirmwareType = 1 # 0 - SystemFirmware, 1 - NvRam > +AddressType = 0 # 0 - relative address, 1 - absolute address. > +BaseAddress = 0x002D# Base address offset on flash > +Length= 0x0002# Length > +ImageOffset = 0x002D# Image offset of this SystemFirmware image > +FileGuid = 642e4fcf-2df7-4415-8b70-a03909c57b55 # > PcdEdkiiSystemFirmwareFileGuid > diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc > index e1e3b14..82c8bb4
Re: [edk2] [PATCH edk2-platforms v2 05/15] Hisilicon D03/D05: Add capsule upgrade support
A few style comments below. On Fri, Jan 26, 2018 at 04:00:40PM +0800, Ming Huang wrote: > From: Jason Zhang> > This module support updating the boot CPU firmware only. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jason Zhang > Signed-off-by: Ming Huang > Signed-off-by: Heyi Guo > --- > > Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > | 45 +++ > Platform/Hisilicon/D03/D03.dsc > | 17 ++- > Platform/Hisilicon/D03/D03.fdf > | 70 +++ > > Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > | 81 + > > Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf > | 50 > > Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c > | 70 +++ > > Platform/Hisilicon/D05/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini > | 45 +++ > Platform/Hisilicon/D05/D05.dsc > | 19 ++- > Platform/Hisilicon/D05/D05.fdf > | 70 +++ > > Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > | 81 + > > Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf > | 50 > > Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c > | 70 +++ > Silicon/Hisilicon/Hisilicon.dsc.inc > | 11 +- > Silicon/Hisilicon/Hisilicon.fdf.inc > | 9 ++ > Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.c > | 123 > > Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.inf >| 51 > 16 files changed, 859 insertions(+), 3 deletions(-) > > diff --git > a/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > > b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > new file mode 100644 > index 000..d9f4a00 > --- /dev/null > +++ > b/Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc > @@ -0,0 +1,81 @@ > +/** @file > + System Firmware descriptor. > + > + Copyright (c) 2018, Hisilicon Limited. All rights reserved. > + Copyright (c) 2018, Linaro Limited. All rights reserved. > + Copyright (c) 2016, Intel Corporation. All rights reserved. > + > + This program and the accompanying materials > + are licensed and made available under the terms and conditions of the BSD > License > + which accompanies this distribution. The full text of the license may be > found at > + http://opensource.org/licenses/bsd-license.php > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR > IMPLIED. > + > +**/ > + > +#include > +#include > +#include > + > +#define PACKAGE_VERSION 0x > +#define PACKAGE_VERSION_STRING L"Unknown" > + > +#define CURRENT_FIRMWARE_VERSION0x0002 > +#define CURRENT_FIRMWARE_VERSION_STRING L"0x0002" > +#define LOWEST_SUPPORTED_FIRMWARE_VERSION 0x0001 > + > +#define IMAGE_IDSIGNATURE_64('H','W','A', 'R', > 'M', '_', 'F', 'd') > +#define IMAGE_ID_STRING L"ARMPlatformFd" > + > +// PcdSystemFmpCapsuleImageTypeIdGuid > +#define IMAGE_TYPE_ID_GUID { 0x44c850f2, 0x85ff, 0x4be5, { > 0xbf, 0x34, 0xa5, 0x95, 0x28, 0xdf, 0x22, 0xd3 } } > + > +typedef struct { > + EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR Descriptor; > + // real string data > + CHAR16 > ImageIdNameStr[sizeof(IMAGE_ID_STRING) / sizeof(CHAR16)]; > + CHAR16 > VersionNameStr[sizeof(CURRENT_FIRMWARE_VERSION_STRING) / sizeof(CHAR16)]; > + CHAR16 > PackageVersionNameStr[sizeof(PACKAGE_VERSION_STRING) / sizeof(CHAR16)]; Use ARRAY_SIZE for the 3 above? > +} IMAGE_DESCRIPTOR; > + > +IMAGE_DESCRIPTOR mImageDescriptor = > +{ > + { > +EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR_SIGNATURE, > +sizeof (EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR), > +sizeof (IMAGE_DESCRIPTOR), > +PACKAGE_VERSION, // PackageVersion > +OFFSET_OF (IMAGE_DESCRIPTOR, PackageVersionNameStr), // > PackageVersionName > +1, //
[edk2] [PATCH edk2-platforms v2 05/15] Hisilicon D03/D05: Add capsule upgrade support
From: Jason ZhangThis module support updating the boot CPU firmware only. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jason Zhang Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini | 45 +++ Platform/Hisilicon/D03/D03.dsc | 17 ++- Platform/Hisilicon/D03/D03.fdf | 70 +++ Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc | 81 + Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf | 50 Platform/Hisilicon/D03/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c | 70 +++ Platform/Hisilicon/D05/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini | 45 +++ Platform/Hisilicon/D05/D05.dsc | 19 ++- Platform/Hisilicon/D05/D05.fdf | 70 +++ Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc | 81 + Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf | 50 Platform/Hisilicon/D05/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptorPei.c | 70 +++ Silicon/Hisilicon/Hisilicon.dsc.inc | 11 +- Silicon/Hisilicon/Hisilicon.fdf.inc | 9 ++ Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.c | 123 Silicon/Hisilicon/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.inf | 51 16 files changed, 859 insertions(+), 3 deletions(-) diff --git a/Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini b/Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini new file mode 100644 index 000..fc834d9 --- /dev/null +++ b/Platform/Hisilicon/D03/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini @@ -0,0 +1,45 @@ +# +# Copyright (c) 2018, Hisilicon Limited. All rights reserved. +# Copyright (c) 2018, Linaro Limited. All rights reserved. +# Copyright (c) 2016, Intel Corporation. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +## + +[Head] +NumOfUpdate = 3 +NumOfRecovery = 0 +Update0 = SysFvMain +Update1 = SysCustom +Update2 = SysNvRam + +[SysFvMain] +FirmwareType = 0 # 0 - SystemFirmware, 1 - NvRam +AddressType = 0 # 0 - relative address, 1 - absolute address. +BaseAddress = 0x# Base address offset on flash +Length= 0x002D# Length +ImageOffset = 0x# Image offset of this SystemFirmware image +FileGuid = 642e4fcf-2df7-4415-8b70-a03909c57b55 # PcdEdkiiSystemFirmwareFileGuid + +[SysCustom] +FirmwareType = 0 # 0 - SystemFirmware, 1 - NvRam +AddressType = 0 # 0 - relative address, 1 - absolute address. +BaseAddress = 0x002F# Base address offset on flash +Length= 0x0001# Length +ImageOffset = 0x002F# Image offset of this SystemFirmware image +FileGuid = 642e4fcf-2df7-4415-8b70-a03909c57b55 # PcdEdkiiSystemFirmwareFileGuid + +[SysNvRam] +FirmwareType = 1 # 0 - SystemFirmware, 1 - NvRam +AddressType = 0 # 0 - relative address, 1 - absolute address. +BaseAddress = 0x002D# Base address offset on flash +Length= 0x0002# Length +ImageOffset = 0x002D# Image offset of this SystemFirmware image +FileGuid = 642e4fcf-2df7-4415-8b70-a03909c57b55 # PcdEdkiiSystemFirmwareFileGuid diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc index e1e3b14..82c8bb4 100644 --- a/Platform/Hisilicon/D03/D03.dsc +++ b/Platform/Hisilicon/D03/D03.dsc @@ -65,7 +65,6 @@ OemAddressMapLib|Platform/Hisilicon/D03/Library/OemAddressMap2P/OemAddressMap2PHi1610.inf PlatformSysCtrlLib|Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf - CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf