From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) by mx.groups.io with SMTP id smtpd.web09.10988.1639053043722453422 for ; Thu, 09 Dec 2021 04:30:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z8MAfO72; spf=pass (domain: gmail.com, ip: 209.85.222.43, mailfrom: ch.chandni@gmail.com) Received: by mail-ua1-f43.google.com with SMTP id r15so10453102uao.3 for ; Thu, 09 Dec 2021 04:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=PcmE5SoltrIMh0POaV1XUH6xfuXK3xJWYAJrjzg2zbc=; b=Z8MAfO72hD5+/+lb2pxcHZh7dm1O1N2DVPUW/kWBkcf1AwGrAeDmyPqs0ltudCBKPK 4wZzBYr4Z8dvqXYU4s+R8yrGpVmLzHeQcf/ngA6JFlHgJxZfVcgGwA1PmkoCMo1t6VC+ 5cknUb5lOdbUSKyd86cFsytB1nNKDkffWk7ti9uV+3FXXPXNI+E9bZsbwGW3J1TwCpqB 64dOanThWcXokn3x0u2CxeYW2Rpe1/zcLEOOM0iW2j/waZZCyWQ4j2BYmXtOEGEx8ZTB G+29IHx08olQNqFb5/HkE72v+eDCUTR2UujQjRvKZGjhgpZBojp74ky6QBL99w6sbv72 Xy6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=PcmE5SoltrIMh0POaV1XUH6xfuXK3xJWYAJrjzg2zbc=; b=jHKVMYI2bxBqTC+k04fkvWQdtSHyeDmPC+v2fd3XaiOWo76ZHA92Tat0JdyYFsrxcK vd68cweM1IyDKkDWRF3T3JZ9JJG08HlMPS44zsjq+8JKw8W5EubhZFCqfU8yEJ5pm2rJ utQ8Utl+l8u0FiE2ESXMFqIX28xyQ6xPmEjsvREUtS74mKIGAxbJ8VBG75CIG7HV+9ek PfVA3QYKgtidsviSFkxW8A2ez4d2b6iInic4Xix0QWSbnayiEaHIfThQ/YtCAEsp/PAv zdyov3wzOziIEkgBHRm+N9f02UnKkyNziAJSMFmRuWOrN3NLcocJhPDLzTy/pnASL9Yh cNxg== X-Gm-Message-State: AOAM530Xc9bIWnXle5wJHQEvCRqe4/wQcsvBNz2iRL+yTaGvvi7lqqyb wcu+P07cZvk23Oopdn/McUO/3sDaC292woD0vANFaSOgX8Y= X-Google-Smtp-Source: ABdhPJy3sEUFfKp8NTW6QsWa18QDm/56METMoLv2FRF2bFECMQ1dB4k6Qri9goVeatjnCBsCPMNICNhSOlO18t/70is= X-Received: by 2002:ab0:6f47:: with SMTP id r7mr18814994uat.85.1639053042611; Thu, 09 Dec 2021 04:30:42 -0800 (PST) MIME-Version: 1.0 References: <2d695d9d-eb38-f8d0-d7bd-d77dbe609ec3@arm.com> <8622.1638932156872484301@groups.io> In-Reply-To: <8622.1638932156872484301@groups.io> From: "chandni cherukuri" Date: Thu, 9 Dec 2021 18:00:31 +0530 Message-ID: Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 07/11] Platform/ARM/Morello: Port PCI Express library To: devel@edk2.groups.io, khasim.mohammed@arm.com, Sami Mujawar , Ard Biesheuvel , Leif Lindholm , pierre.gondois@arm.com Content-Type: text/plain; charset="UTF-8" Hi Ard, Leif, Sami, Pierre, For Morello platform, we created two custom libraries based on the below two native libraries: - https://github.com/tianocore/edk2/tree/master/MdePkg/Library/BasePciSegmentLibPci - https://github.com/tianocore/edk2/tree/master/MdePkg/Library/BasePciExpressLib because of the following reasons. 1. In Morello platform, the ECAM region of the two root ports are placed in non-contiguous memory as per the memory map architecture of the Morello platform. The native PCI Express Library expects both the ECAM regions for all the root ports to be contiguous. 2. IORT and kernel currently require each root port to be in a separate segment. You can refer to the code for more details - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/acpi/arm64/iort.c#n307. The native PCI Segment Library supports only a single segment. Because of these reasons, the current patch series adapts the native libraries as follows: The custom PCI Segment Library passes the complete address which is consumed by the custom PCI Express library where based on the Segment number, the base address of the PCI Express is returned. The rationale behind maintaining two separate libraries is that when the software evolves and support for multiple segments is adapted in the native PCI Segment Library the custom library could be removed. Also, we might have other protocols which might try to use the PCI Express library directly. However, there are some other platforms where all the platform specific changes have gone in a single custom PCI library Could you please provide some inputs as to which of two approaches would be better to follow as there is one more platform to follow based on the decision taken? Thanks Chandni On Wed, Dec 8, 2021 at 8:25 AM Khasim Mohammed wrote: > > Hi Sami, Chandni, > > There was a suggestion from Pierre on a similar patch for N1SDP to remove PCIExpressLib.c and move to workarounds to PCISegmentLib.c, > > https://edk2.groups.io/g/devel/message/84165?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Arecentpostdate%2Fsticky%2C%2Ckhasim%2C20%2C2%2C0%2C87257273 > > I think we should discuss this implementation for both N1SDP and Morello as they have similar implementation. > > Regards, > Khasim >