On 17 January 2017 at 00:12, Leif Lindholm leif.lindholm@linaro.org wrote:
On Mon, Jan 16, 2017 at 08:18:20PM +0800, Haojian Zhuang wrote:
Add the skeleton of HiKey platform with generic BDS. Support both 1GB and 2GB DDR RAM HiKey hardware.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang haojian.zhuang@linaro.org
Chips/Hisilicon/Hi6220/Hi6220.dec | 32 ++ Chips/Hisilicon/Hi6220/Include/Hi6220.h | 77 ++++ Platforms/Hisilicon/HiKey/HiKey.dec | 36 ++ Platforms/Hisilicon/HiKey/HiKey.dsc | 472 +++++++++++++++++++++ Platforms/Hisilicon/HiKey/HiKey.fdf | 350 +++++++++++++++ Platforms/Hisilicon/HiKey/Include/ArmPlatform.h | 26 ++ Platforms/Hisilicon/HiKey/Library/HiKeyLib/HiKey.c | 159 +++++++ .../Hisilicon/HiKey/Library/HiKeyLib/HiKeyHelper.S | 49 +++ .../Hisilicon/HiKey/Library/HiKeyLib/HiKeyLib.inf | 51 +++ .../Hisilicon/HiKey/Library/HiKeyLib/HiKeyMem.c | 204 +++++++++ 10 files changed, 1456 insertions(+) create mode 100644 Chips/Hisilicon/Hi6220/Hi6220.dec create mode 100644 Chips/Hisilicon/Hi6220/Include/Hi6220.h create mode 100644 Platforms/Hisilicon/HiKey/HiKey.dec create mode 100644 Platforms/Hisilicon/HiKey/HiKey.dsc create mode 100644 Platforms/Hisilicon/HiKey/HiKey.fdf create mode 100644 Platforms/Hisilicon/HiKey/Include/ArmPlatform.h create mode 100644 Platforms/Hisilicon/HiKey/Library/HiKeyLib/HiKey.c create mode 100644 Platforms/Hisilicon/HiKey/Library/HiKeyLib/HiKeyHelper.S create mode 100644 Platforms/Hisilicon/HiKey/Library/HiKeyLib/HiKeyLib.inf create mode 100644 Platforms/Hisilicon/HiKey/Library/HiKeyLib/HiKeyMem.c
+#define HIKEY_REGION_SIZE(x) (1U << (((x & HIKEY_REGION_SIZE_MASK) >> 8) + 24))
Need () around that x. (Yes, the code as exists will function fine, but any changes to it could cause very non-obvious errors.)
Well, this is the final thing that needs changing, so if you agree, I can fix that up before committing.
Yes, it's fine to help me to fix it. Thanks.
One further question below, though.
- Data = MmioRead32 (MDDRC_AXI_BASE + AXI_REGION_MAP);
OK, so we only needed to check one region? :)
As I tested on both 1GB DDR version and 2GB DDR version board, I only need to check one region. It seems that the origianl code from Hisilicon is wrong.
- MemorySize = HIKEY_REGION_SIZE(Data);
- return MemorySize;
+}
Best Regards Haojian