From nobody Mon Feb 9 02:28:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+68211+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68211+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1606968172377432.617184735823; Wed, 2 Dec 2020 20:02:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2NbvYY1788612x7Cgp8rQerd; Wed, 02 Dec 2020 20:02:52 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web09.5313.1606968165915697120 for ; Wed, 02 Dec 2020 20:02:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WeIHloFDl441dZYi8N3Y5m6sjIoHp8Yh5xZimzwAlhaCKrZ6sXBOGG+OkgSOqrbTtlsQmyPkpoFMlj1Jfd5PPT/xSl0mT5LquCYrrpoG3uQRy952a4K+J26FIjBCKjmVzLhVBvKvPJ73QzdrAfJjJ5qha2PDbPDoxs3xg0imKcQ0hiAFB/bfRcaMjtR08lAneRXuIrralvQiHoURsSstO7Sb7nQBjVownvZXP53Bf6FRvhJT8k+GG3wQcw5gnha3wdDkSGJ3PWcy9X+Pdn6jXGTnUdCyzxwuhPuOpPyEo/LUKi0SRCxMdAtg4lGOeIGLqeu06n45rKOWwBkVsoKmXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WtrIOqxfOudhneGI6uFIrXSwqMgBHXEfFzQ3tDc/3/E=; b=DE1W67BQs7qe7Sm4bHXg4AaTJ7TBWu9wgKsuubpSsOxhYXR/GNLDBwEu6r4JHMNtf5BM+1odNsw7q/VUfbvElcSdoaa6tJZtYyRrvWwf/mQr2oNyFmSx938j9x2qQMmkinHb96z6dwZjHE/RUh+t5MJSjKmjOyYvSz74c+hwhm1A24b0aT06nQrvaIo+3Wkklgc+YtQG8God7YTYzOEpUTe/b3pP1fcirjZ0rFiuvHUlKw/cP1Wj7sqjjkI7fypj4zgS3Pv4LlDF+dFvnP5XIi2YLP4/2abg6UtEb0eylcQkp8QNGopNC9IgJe9pCCsF4rV/uV3LqbKq+oJ5v7TV3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none X-Received: from DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) by DM5PR01MB2540.prod.exchangelabs.com (2603:10b6:3:3b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.18; Thu, 3 Dec 2020 04:02:45 +0000 X-Received: from DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076]) by DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076%5]) with mapi id 15.20.3611.034; Thu, 3 Dec 2020 04:02:45 +0000 From: "Nhi Pham via groups.io" To: devel@edk2.groups.io Cc: patches@amperecomputing.com, Phong Vo , Leif Lindholm , Michael D Kinney , Ard Biesheuvel , Nate DeSimone Subject: [edk2-devel] [edk2-platforms][PATCH 1/3] Platform/Ampere: Add Readme.md Date: Thu, 3 Dec 2020 11:04:00 +0700 Message-Id: <20201203040402.1361-2-nhi@os.amperecomputing.com> In-Reply-To: <20201203040402.1361-1-nhi@os.amperecomputing.com> References: <20201203040402.1361-1-nhi@os.amperecomputing.com> X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK2PR0302CA0007.apcprd03.prod.outlook.com (2603:1096:202::17) To DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from sw004.amperecomputing.com (118.69.219.201) by HK2PR0302CA0007.apcprd03.prod.outlook.com (2603:1096:202::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.8 via Frontend Transport; Thu, 3 Dec 2020 04:02:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: beacf99f-5165-4d7c-ba28-08d897404a14 X-MS-TrafficTypeDiagnostic: DM5PR01MB2540: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: NvPdWvhIvbXWfv2rLIMtqWhnDjqzMSxik2DmvKQl9gxoBk1u+tbgN6HF4mpSbw1okUc792noSQrS3lf9c/tA0n4ZmR3CanIEKNqTfs5LaOdJQNrMsJb5jw9JwUmmT2NsTdEDCVjXyXJ7rQChDSXR6eLhZGexSaJqAGTXN5Zkgl9Yipp/BcIjkMc5gRRwQ4gSgIu0CET9Ivy4HpdTFAs/urkrqqK4vHdSnc/8CuCzA/nY795tMbCXXDrhO2jrqQD0yxaRRghL+qRbe6E7yzJpGJWq84yM7ygVlCYS9xdXCqqC3ABejD/kqhMILAW42x0X8bqdj6jFhIXUarC+uKKcHIwt+30/thxv88sGeMpapDk803sH3OkPoRJWVou+qd6R2XaxarzCsvzNtHneCy/3Vw== X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?guCFNFkNc49AyuI124zJJdI8nERiHqUAkgvM/KDe9alVOMA/yCXCOTv25ufW?= =?us-ascii?Q?DbEKTgIC6x/3/icom7TQx3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XszB080?= =?us-ascii?Q?jz7sU1yrujvQta9LGSmvG8+BSwrUymdGe+M7X5wa/AqI7qQzitdb6yfGUdhA?= =?us-ascii?Q?3Tfs?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: beacf99f-5165-4d7c-ba28-08d897404a14 X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5849.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2020 04:02:45.2986 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UntUqrJOIbpohJRODz86bJ63oDpxQDGVSebv+pGMbxmnCgCJdl/Z6GNxsuTUSz3JVpsy5BzTq0Vnk93vvfYBKDBNhUtsHgPeg3W/2eQoZN4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR01MB2540 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com X-Gm-Message-State: TzKJifBUj2kFYnMBfQVwuDVUx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1606968172; bh=dOqzCgwQLQ9+WDGeCYHC5CIlWf46p2KXRDrYF+zmwIU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=FuoXRAuMV2cGD3iScVfPz7jDdp/Zf7eF9aFkMhll8DPKx3Ndjf+F7xiinQ9OHNHxb1J MEHLxYPCo1mqDt9lU4tDxJ0nT3MMpULpM9q3X7TgLIhsUWxTx8GE3yTlglovRc4T4WMxi hhgdZwNSJnk2B4v9vQcWig4fVHlFA3Hgc4k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Phong Vo Add initial version of Readme.md for Ampere platform Cc: Leif Lindholm Cc: Michael D Kinney Cc: Ard Biesheuvel Cc: Nate DeSimone Signed-off-by: Phong Vo --- Platform/Ampere/Readme.md | 167 ++++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/Platform/Ampere/Readme.md b/Platform/Ampere/Readme.md new file mode 100644 index 000000000000..c93b35a62e84 --- /dev/null +++ b/Platform/Ampere/Readme.md @@ -0,0 +1,167 @@ +# Overview + +This document provides the guideline to build UEFI firmware for Ampere Com= puting's arm64 reference platforms. + +Platform code is located under Platform/Ampere/{Platform Name}Pkg. + +Silicon code is located under Silicon/Ampere/Ampere{SoC Name}Pkg. + +# How to build (Linux Environment) + +## Build machines + +The build instructions provided in this document are supported on the foll= owing operating systems: + +- Ubuntu 18.04 (x86) +- CentOS 8.2 (x86) + +However, it does not mean this guideline is not applicable for other Ubunt= u/CentOS versions, +or other Linux distributions. You may, at your own risk, try it on other L= inux distributions +if all steps below are performed correctly. + +## Essential development tools + +The following is the list of tools needed for development: `bison, build-e= ssential, bzip2, default-jre, flex +gawk, gpg, libc6:i386, libgcc1:i386, openssl, libssl-dev, m4, make, python= , python3-distutils, tar, uuid-dev wget` + +They can be installed using standard OS distro's `apt-get` (for Ubuntu) or= `yum` (for CentOS). + +## Toolchain + +### GCC for aarch64 + +Ampere provides GCC toolchains +[aarch64-ampere-linux-gnu](https://cdn.amperecomputing.com/tools/compilers= /cross/8.3.0/ampere-8.3.0-20191025-dynamic-nosysroot-crosstools.tar.xz) + +Linaro provides GCC toolchains for +[aarch64-linux-gnu](https://releases.linaro.org/components/toolchain/binar= ies/latest/aarch64-linux-gnu/) + +Throughout this document, Ampere toolchain is assumed to be installed at l= ocation /opt/toolchain/. + +When cross compiling, it is necessary to provide the appropriate compilati= on prefix depending on +whether Ampere toolchain or Linaro toolchain is used. + +Target architecture | Cross compilation prefix +--------------------|------------------------- +AARCH64 | aarch64-linux-gnu- (Linaro toolchain) +AARCH64 | aarch64-ampere-linux-gnu- (Ampere toolchain) + +### Intel ASL+ Optimizing Compiler/Disassembler + +Download and install the ISAL compiler as follows: + +```bash +$ wget https://acpica.org/sites/acpica/files/acpica-unix2-20200110.tar.gz +$ tar xzf acpica-unix2-20200110.tar.gz +$ cd acpica-unix2-20200110 +$ make && sudo make install +$ iasl -v +``` + +## Obtaining source code + +1. Create a new folder (directory) on your local development machine +for use as your workspace. This example uses `/work/git/tianocore`, modify= as +appropriate for your needs. + + ```bash + $ export WORKSPACE=3D/work/git/tianocore + $ mkdir -p $WORKSPACE + $ cd $WORKSPACE + ``` + +2. Into that folder, clone: + + ```bash + $ git clone --recurse-submodules https://github.com/AmpereComputing/edk= 2.git + $ git clone --recurse-submodules https://github.com/AmpereComputing/edk= 2-platforms.git + ``` + +Set up a PACKAGES_PATH to point to the locations of these three repositori= es: +`$ export PACKAGES_PATH=3D$PWD/edk2:$PWD/edk2-platforms` + +## Manual building + +### Additional environment setup + +```bash +$ export CROSS_COMPILER_PATH=3D/opt/toolchain/ampere-8.3.0-20191025-dynami= c-nosysroot/bin +$ export PATH=3D${CROSS_COMPILER_PATH}:${PATH} +$ export CROSS_COMPILE=3Daarch64-ampere-linux-gnu- +$ export GCC5_AARCH64_PREFIX=3D${CROSS_COMPILE} +``` + +1. Set up the build environment (this will modify your environment variabl= es) + + `$ . edk2/edksetup.sh` + + (This step _depends_ on **WORKSPACE** being set as per above.) + +2. Build BaseTools + + `make -C edk2/BaseTools` + + (BaseTools can currently not be built in parallel, so do not specify an= y `-j` + option, either on the command line or in a **MAKEFLAGS** environment + variable.) + +### Build options + +There are a number of options that can (or must) be specified at the point= of +building. Their default values are set in `edk2/Conf/target.txt`. If we are +working only on a single platform, it makes sense to just update this file. + +target.txt option | command line | Description +------------------|--------------|------------ +ACTIVE_PLATFORM | `-p` | Description file (.dsc) of platform +TARGET | `-b` | One of DEBUG, RELEASE or NOOPT. +TARGET_ARCH | `-a` | Architecture to build for. In our case,= use AARCH64. +TOOL_CHAIN_TAG | `-t` | Toolchain profile to use for building. = In our case, use GCC5. + +There is also MAX_CONCURRENT_THREAD_NUMBER (`-n`), roughly equivalent to +`make -j`. + +When specified on command line, `-b` can be repeated multiple times in ord= er to +build multiple targets sequentially. + +After a successful build, the resulting images can be found in +`Build/{Platform Name}/{TARGET}_{TOOL_CHAIN_TAG}/FV`. + +For example, +`Build/Jade/RELEASE_GCC5/FV` + +### Build a platform + +The main build process _can_ run in parallel - so figure out how many thre= ads we +have available. + +```bash +$ getconf _NPROCESSORS_ONLN +8 +``` + +Set up the build to use a little more than that: + +```bash +$ NUM_CPUS=3D$((`getconf _NPROCESSORS_ONLN` + 2)) +``` + +Now build the UEFI image: + +```bash +$ cd edk2-platforms && build -a AARCH64 -t GCC5 -b RELEASE -D SECURE_BOOT_= ENABLE -p Platform/Ampere/JadePkg/Jade.dsc +``` + +(Note that the description file gets resolved by the build command through +searching in all locations specified in **PACKAGES_PATH**.) + +## Additional build tools + +Ampere provides additional tools and documentation for automating the manu= al process described above, +and for building a final Tianocore UEFI image that can be flashed on the t= arget system. + +To use these tools, clone the following to the **WORKSPACE** location: + +```bash +$ git clone https://github.com/AmpereComputing/edk2-ampere-tools.git +``` --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#68211): https://edk2.groups.io/g/devel/message/68211 Mute This Topic: https://groups.io/mt/78678099/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-