Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6014055pxb; Mon, 14 Feb 2022 13:09:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBc2GaoZIP9X6CabqwkFZCq8FUgfiy8wTCY87EA8EvRUoUc+SKZ9Lm1/8k+0R0jWiTHhWT X-Received: by 2002:a17:902:968d:: with SMTP id n13mr663213plp.164.1644872953999; Mon, 14 Feb 2022 13:09:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644872953; cv=none; d=google.com; s=arc-20160816; b=WSm1fAFo8PAWoaSeFmVJIKfkxAwPtwXfenDK7YiWhO6iD8vvvLte1raalLF/Z1tjj3 Ygsf61G9Khsn5JQaw5u4GtyudNNLUWGy2mAqRi+kuMHXvh9q4tNwhqMRWh+QRQ1ogO5K 7VpsLXCPXz4FEAcF+gPQn8egTNvQjssBV7jT5tmbMRlbtf41ae2ESQgW4i530vRl86Wd VPPhO/7BLwuAx3KPYxdT9pIVLHEbzvpOwaYDTwgR6cERB6ogSMpXO2HdPkpTV++YJ8Jz aUL5BAGr9zwuWazxJvC3ZvZC2Q9Mb36KDbWN3MbC84ZuRXS1c1pLayOER92l5jejbyyJ Fc0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X6uj7OxQcgt89b/2LwYd8n2bUYM5JbDWbt6i3KE8fLw=; b=HaekhuhOpg8BBG5tHn2OYfmSpwjKNt0woxF5Dd7wCCw9sP9zAA22OM1gJD9eoRBHHA 7TlXWKr16LQKHjK+xLIT/8KIyEZgQmKlsHZEIi3oXT41NE6KtGyz1GCkGsMD6EfLnAUQ vjRt9omNWBsc9YMM5QRFNrBlyTPQOzkAjtP/819kuPKZXXRGZ+FMvHaw8e51DslMy964 q2OTTTK6JhzGbHuxSO0Zlpvq6M1ZIXMwTpkKicdezzCxjDOe9U25DTLOcJ0IQ9vSExQn gCxcT19HnPEtE07JqPOS9iZMyoxtCKNGQNcaLYz2o2t68yozP/S8pIXTk1Pca1lsMHIX 0fSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OEhdptYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 30si725844pgw.552.2022.02.14.13.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:09:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OEhdptYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 544DD18D22C; Mon, 14 Feb 2022 12:29:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352311AbiBNLqz (ORCPT + 99 others); Mon, 14 Feb 2022 06:46:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352564AbiBNLpV (ORCPT ); Mon, 14 Feb 2022 06:45:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 547FFBC07; Mon, 14 Feb 2022 03:42:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E5D0C61239; Mon, 14 Feb 2022 11:42:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36DB9C340F0; Mon, 14 Feb 2022 11:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644838948; bh=N7rh+XBt1OX/shzAlcZiOlTmzf+JEyhpGWcp2MiIStk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OEhdptYx8JASrx2hZQVjdkyeBJgNEQGTvl5Ly9W8hGH8ryFzfz3UOD65bjMe4AOl4 eHaUJLhWceDn0Tb1NZhuR1SP9+xnLGtDrFh6Z59psqU5xbrgC2VAHoh4968qs7skNx 5hrk1AhMUhghsSpxG6OvbfraRoBpq3UTD7Njo+zr1BDNK/LbmIhkzPavdNhQ/X/+wi +MUued9GxBVl5JsdD9XDlVNOmbGZddaKlxs54ilB2931MZRmBpEDWHhRUTMztyPchE ESEJ/13GNsac93biwiUr8rCTyrNioPAlm1gKkD4x/5PKEtrP0js3cn5EazzFkAFF8v vlh2Hvwe99fOQ== Received: by pali.im (Postfix) id 0CCE7153C; Mon, 14 Feb 2022 12:42:26 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Ray Jui , Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v2 2/2] PCI: iproc: Set all 24 bits of PCI class code Date: Mon, 14 Feb 2022 12:41:09 +0100 Message-Id: <20220214114109.26809-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220214114109.26809-1-pali@kernel.org> References: <20220214114109.26809-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Register 0x43c in its low 24 bits contains PCI class code. Update code to set all 24 bits of PCI class code and not only upper 16 bits of PCI class code. Use a new macro PCI_CLASS_BRIDGE_PCI_NORMAL which represents whole 24 bits of normal PCI bridge class. Signed-off-by: Pali Rohár Acked-by: Roman Bacik Acked-by: Ray Jui --- Roman helped me with this change and confirmed that class code is stored really in bits [23:0] of custom register 0x43c (normally class code is stored in bits [31:8] of pci register 0x08). --- drivers/pci/controller/pcie-iproc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 3df4ab209253..2519201b0e51 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -789,14 +789,13 @@ static int iproc_pcie_check_link(struct iproc_pcie *pcie) return -EFAULT; } - /* force class to PCI_CLASS_BRIDGE_PCI (0x0604) */ + /* force class to PCI_CLASS_BRIDGE_PCI_NORMAL (0x060400) */ #define PCI_BRIDGE_CTRL_REG_OFFSET 0x43c -#define PCI_CLASS_BRIDGE_MASK 0xffff00 -#define PCI_CLASS_BRIDGE_SHIFT 8 +#define PCI_BRIDGE_CTRL_REG_CLASS_MASK 0xffffff iproc_pci_raw_config_read32(pcie, 0, PCI_BRIDGE_CTRL_REG_OFFSET, 4, &class); - class &= ~PCI_CLASS_BRIDGE_MASK; - class |= (PCI_CLASS_BRIDGE_PCI << PCI_CLASS_BRIDGE_SHIFT); + class &= ~PCI_BRIDGE_CTRL_REG_CLASS_MASK; + class |= PCI_CLASS_BRIDGE_PCI_NORMAL; iproc_pci_raw_config_write32(pcie, 0, PCI_BRIDGE_CTRL_REG_OFFSET, 4, class); -- 2.20.1