From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web12.1038.1574880272000942246 for ; Wed, 27 Nov 2019 10:44:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=aV3Ep4PN; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f65.google.com with SMTP id j42so2074960wrj.12 for ; Wed, 27 Nov 2019 10:44:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BcCDN4xO0VBy/WoP/RKWjYP1aMWwRYjrlaHtptmehCM=; b=aV3Ep4PN20pJXko3D88iN4ffvB99LHTI4bFmk0/9+07jIFlukaSIE1B0GN+DlxJwGz bc5DtGkHZBERhX2LLCKGOdyjAtvugwOKWX4VbKuuRvcUTFgV5tocxmEQI90SJPvo9kck TZOUaz2X4j5snaZVGltRxeTtNO8MCYB8bSMOiAtq3AQSbLdEmyjZCKhJNHTAizuJgeL1 paUF1rVQhEbpSByVCfJUlGod1Z2c5huSj4eylG7mzdJlRgqsbWtHU2YyMWslN4VOC/kM oiBiozZM7Ct6cU9JQ6kpY9udWHa4zl+pHza/RCdo5nyNoIjKq6vXDPC/phfhnthz7tEM nWeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BcCDN4xO0VBy/WoP/RKWjYP1aMWwRYjrlaHtptmehCM=; b=rW6We1/TrBcS3wnRAiZ/6dBRZVirAba1E1LdgTRbiUkq9Pirlt5CRBD2opbQacX3OG x5GZnA9wOXjfqQaCsTThHZ5hIBELLLBSGqKevUsgrhlmBIRyZUOHaxOz8+GBXY7t4TgL Yx18qZOzp45h9qymcqXKLrVVdJvb6Dd6c3kEZ1xSTRNXmyLo+lNGK9b7WdwSX8Yxvd5T VvwRxvSkcSEclsS/xeI71B/PE5SgBIHeIaui06WyH2/14fQ9yFyAfh4vzekhDzpTTiZ5 3AKtDNu12YICbU5jNp8wJ9HDxytxnrZ75vRF3dJkR1700PBH6kOHtuAj77LxB4w8MBNs jl5Q== X-Gm-Message-State: APjAAAUZmE22IqlK143y8Yi95vsuwc6861hN1dQB7NE4s+TRUflUWI2W 0X/osWMMnQJtTkQ1wC5+rKnMAaruGcY= X-Google-Smtp-Source: APXvYqwR0v2b7UvXYQERUDzesaCmNhYK1uFFLVtf6LFZ2ycx6GTUtjrmgmOs6NyT5K3X7D8NWDsReg== X-Received: by 2002:a5d:5345:: with SMTP id t5mr6727606wrv.0.1574880270331; Wed, 27 Nov 2019 10:44:30 -0800 (PST) Return-Path: Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr. [109.210.65.247]) by smtp.gmail.com with ESMTPSA id f67sm7947741wme.16.2019.11.27.10.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 10:44:29 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, Ard Biesheuvel Subject: [PATCH edk2-platforms v2 2/8] Platform/Overdrive: clean up stream ID descriptions in DT Date: Wed, 27 Nov 2019 19:44:33 +0100 Message-Id: <20191127184439.16793-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191127184439.16793-1-ard.biesheuvel@linaro.org> References: <20191127184439.16793-1-ard.biesheuvel@linaro.org> Align the DT description of the SMMU topology and stream IDs with the actual routing of the SoC. As with the preceding IORT change, this is mostly a cleanup exercise, but it does actually fix an issue with the CCP crypto accelerator on B1 silicon. Since the CCP shares its SMMU with the second SATA controller, which is only enabled on B1 silicon, we can drop the logic that disables this SMMU on B0 silicon or on platforms that do not expose any SATA ports on the second controller (such as the Cello). Signed-off-by: Ard Biesheuvel Acked-by: Leif Lindholm --- Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts | 23 +++++++++++++++----- Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 6 +---- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts index 1ba0d403eaf0..1d8a6caafd82 100644 --- a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts +++ b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts @@ -86,7 +86,7 @@ */ <0 332 4>, <0 332 4>; - #iommu-cells = <2>; + #iommu-cells = <1>; dma-coherent; }; @@ -99,7 +99,7 @@ */ <0 331 4>, <0 331 4>; - #iommu-cells = <2>; + #iommu-cells = <1>; dma-coherent; }; @@ -109,7 +109,12 @@ interrupts = <0x0 0x163 0x4>; clocks = <&sata_clk>; dma-coherent; - iommus = <&sata0_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <&sata0_smmu 0x0a>, + <&sata0_smmu 0x0b>, + <&sata0_smmu 0x0e>, + <&sata0_smmu 0x0f>, + <&sata0_smmu 0x1a>, + <&sata0_smmu 0x1e>; }; sata@e0d00000 { @@ -119,7 +124,9 @@ interrupts = <0x0 0x162 0x4>; clocks = <&sata_clk>; dma-coherent; - iommus = <&sata1_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <&sata1_smmu 0x0e>, + <&sata1_smmu 0x0f>, + <&sata1_smmu 0x1e>; }; i2c@e1000000 { @@ -233,6 +240,10 @@ interrupts = <0x0 0x3 0x4>; dma-coherent; amd,zlib-support = <0x1>; + iommus = <&sata1_smmu 0x00>, + <&sata1_smmu 0x02>, + <&sata1_smmu 0x40>, + <&sata1_smmu 0x42>; }; pcie: pcie@f0000000 { @@ -409,7 +420,7 @@ phy-handle = <&xgmac0_phy>; phy-mode = "xgmii"; dma-coherent; - iommus = <&xgmac0_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <&xgmac0_smmu 0x00 0x17>; /* 0-7, 16-23 */ }; xgmac@e0900000 { @@ -428,7 +439,7 @@ phy-handle = <&xgmac1_phy>; phy-mode = "xgmii"; dma-coherent; - iommus = <&xgmac1_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <&xgmac1_smmu 0x00 0x17>; /* 0-7, 16-23 */ }; }; diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c index c84c1a81c3ec..261b5f59c8df 100644 --- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c +++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c @@ -212,8 +212,6 @@ DisableSmmu ( Node = fdt_path_offset (Fdt, SmmuNodeName); if (Node <= 0) { - DEBUG ((DEBUG_WARN, "%a: Failed to find path %s: %a\n", - __FUNCTION__, SmmuNodeName, fdt_strerror (Node))); return; } @@ -251,9 +249,7 @@ SetSocIdStatus ( if (!PcdGetBool (PcdEnableSmmus)) { DisableSmmu (Fdt, "iommu-map", "/smb/smmu@e0a00000", "/smb/pcie@f0000000"); DisableSmmu (Fdt, "iommus", "/smb/smmu@e0200000", "/smb/sata@e0300000"); - } - - if (!PcdGetBool (PcdEnableSmmus) || !IsRevB1 || FixedPcdGet8 (PcdSata1PortCount) == 0) { + DisableSmmu (Fdt, "iommus", "/smb/smmu@e0c00000", "/smb/ccp@e0100000"); DisableSmmu (Fdt, "iommus", "/smb/smmu@e0c00000", "/smb/sata@e0d00000"); } -- 2.17.1