From nobody Wed Oct 8 07:40:06 2025 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 394F72405E4; Mon, 30 Jun 2025 22:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322291; cv=none; b=XcvoyUdUJ9M6o1ysFXHQdiRRvafiq3caSTnJtdOpRZP0DYg+VGeIbyFXLdmOT+eN1l47Nslyrey3gWWhWxJwWanBM20tBW2cWet4ZHO4vNfCdX6N71JCEWVMRqnpscpH+mxk8lp3ni4jKYeBLqViWs3pvsLLQbg2L9M8nV1NPzA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322291; c=relaxed/simple; bh=tpbE2FvztANs2/izJnOECYoMP2X5oOScRQHxOIydI1k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hnVjcNs2pDysak1n56S1pv6xccd3cAlvRlYaUFvNR3KBroEMXeBF+t98EVOy9VAqWwo428+aYKDJZO3L72fsuuCTziHCRyQCtLgU8pSP67HxGbr+5yMRgAU1lAaIE6zoVyvl0ye3i7zCeW80yHgqXNhanjYe/Uxf+n3PC0bR+mg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PyeLxk1v; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PyeLxk1v" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-7d3862646eeso175614985a.2; Mon, 30 Jun 2025 15:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751322288; x=1751927088; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mt5O7/7JEumjsAyKxjvlFipcH+4/5yB2S8im+OQhNPo=; b=PyeLxk1vgtq/Cgnn/Va5BHp3GDmEIuulZTRNm1rxHvG9sJQG25yzFUC8Mu438kGrv6 Ch6hzliMHQ3S9n4WMo2kajUcsQYlx7twedv8UvvZLaDg5sOiVVRxYM61njuw0sF2nPSB NqdK5ZmoVjJXWPDv0pwNvAmLEqJdq1HilRhm+2uCp1De5ZouACTqxFYQrcqyjAZ6Kqhg pSBGayfnOhHqFwlvo+YMjJRY/UhssrCkKbYP/LaTf8OB/srIA9CFBRdgAAtgriuhD3sb zb06qR+6GXfQ8JbakEFyArSk0yYfyc6ocO8BRP3GI/2M6QJDAUTf/pQuO/1TmrR3O07o Nu2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751322288; x=1751927088; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mt5O7/7JEumjsAyKxjvlFipcH+4/5yB2S8im+OQhNPo=; b=hLYvjA5tsB2HhokHH9knGYAd8yDwzv0CalwtVBoapYXTTNtgNlUkqd5mHPLGXre/lQ 9zvYR1qO0gTnNJOxZ8HfkFiWjkLC+MobVFMX+drJzeX/KOow8KtBkJKb43bR+QoGN5UR /M5OipyHPQcnRJJSvqdvnhBo6CZcuR2bHKG5bVfhoiP80chlOKbKdjNPNrxQ+YWaLmxz B4cmmvMT68jQ0ciKX2Y3ZHK/qMGl/1J1sfTslRJIrK5l8pXW39EbsSji0nwXFooNn2dq iDByG0sOLhieyGIV1XpX2dP5MfaF8BYBRc9OxASNsuVjdEt/ZOio1fmsDzG3+lPco2RE aLng== X-Forwarded-Encrypted: i=1; AJvYcCU8j0IRSXRoMudbLA97iKMN6MFk9hfaUbhrMHgBM5jfTrm/8fNh9Rh7C1wwjVmbhv/sflch0tqqqlF5@vger.kernel.org, AJvYcCUTiB1v4XhwvyIY0lqZL0wt5TuqiwzQG8Z2BPWraNGfaYAKmX3BvksWjF+Mb8PyTU0X6s0zsj9fCtCO7/w=@vger.kernel.org X-Gm-Message-State: AOJu0Yyl30SOaSq7krOImPqBfPbe8b3QZWUvdARUk05+rbQsg7euB+ky SxuY7tiDHrXqWUFf1qqMI7kPPkxEPDQzQ+izYNzk4KaCMiMnyyssoIHM X-Gm-Gg: ASbGnctcm4dH6Z3uhIrKurA2U5zxB/Rfk0Mmaaf3llUxE5Xl7rwuC11cQvwTScWG/zo 9B4E/gHzCnchie1Wv36oNRCES7+1OM8E0TnBOp5aVVAvt72sX1vgpmUK5nMeQB/piC4bsFKbHhx iuW1roTnm0m4blSVS0Ykpu5r9eIjt3NpzZJ5ZNquuK88aLzLMF3g6tZa/4QSu9sWKk5aFNkV3t4 Zrj5uNinjpK/lSkFtKbIFJ4EubgBTLzZMPBBndJhOUGE5SSYivWnZpmuUtzbEIwzudkanzqSk66 l2UR0X0YRjVBpHViwIY4BmCBgMe4ZwMKaswF/4k/OEJVxiaV2iMKelEkYKos X-Google-Smtp-Source: AGHT+IFUqrOXjfYEVAQuIKqn7jRlx2LNxzCAAikqGM3kK5YAvZQ2+cNm+QG1BrH5IDF/weDY7NvNPg== X-Received: by 2002:a05:620a:a496:b0:7d4:48be:8336 with SMTP id af79cd13be357-7d448be8340mr1636722185a.19.1751322287979; Mon, 30 Jun 2025 15:24:47 -0700 (PDT) Received: from geday ([2804:7f2:800b:4851::dead:c001]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6fd771d9c00sm74673266d6.48.2025.06.30.15.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jun 2025 15:24:47 -0700 (PDT) Date: Mon, 30 Jun 2025 19:24:41 -0300 From: Geraldo Nascimento To: linux-rockchip@lists.infradead.org Cc: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , Rick wertenbroek , Neil Armstrong , Valmantas Paliksa , linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v9 1/4] PCI: rockchip: Use standard PCIe defines Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Current code uses custom-defined register offsets and bitfields for standard PCIe registers. Change to using standard PCIe defines. Since we are now using standard PCIe defines, drop unused custom-defined ones, which are now referenced from offset at added Capabilities Register. Suggested-By: Bjorn Helgaas Signed-off-by: Geraldo Nascimento --- drivers/pci/controller/pcie-rockchip-ep.c | 4 +- drivers/pci/controller/pcie-rockchip-host.c | 44 ++++++++++----------- drivers/pci/controller/pcie-rockchip.h | 12 +----- 3 files changed, 25 insertions(+), 35 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/contro= ller/pcie-rockchip-ep.c index 55416b8311dd..300cd85fa035 100644 --- a/drivers/pci/controller/pcie-rockchip-ep.c +++ b/drivers/pci/controller/pcie-rockchip-ep.c @@ -518,9 +518,9 @@ static void rockchip_pcie_ep_retrain_link(struct rockch= ip_pcie *rockchip) { u32 status; =20 - status =3D rockchip_pcie_read(rockchip, PCIE_EP_CONFIG_LCS); + status =3D rockchip_pcie_read(rockchip, PCIE_EP_CONFIG_BASE + PCI_EXP_LNK= CTL); status |=3D PCI_EXP_LNKCTL_RL; - rockchip_pcie_write(rockchip, status, PCIE_EP_CONFIG_LCS); + rockchip_pcie_write(rockchip, status, PCIE_EP_CONFIG_BASE + PCI_EXP_LNKCT= L); } =20 static bool rockchip_pcie_ep_link_up(struct rockchip_pcie *rockchip) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/cont= roller/pcie-rockchip-host.c index b9e7a8710cf0..65653218b9ab 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -40,18 +40,18 @@ static void rockchip_pcie_enable_bw_int(struct rockchip= _pcie *rockchip) { u32 status; =20 - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCT= L); status |=3D (PCI_EXP_LNKCTL_LBMIE | PCI_EXP_LNKCTL_LABIE); - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL); } =20 static void rockchip_pcie_clr_bw_int(struct rockchip_pcie *rockchip) { u32 status; =20 - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCT= L); status |=3D (PCI_EXP_LNKSTA_LBMS | PCI_EXP_LNKSTA_LABS) << 16; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL); } =20 static void rockchip_pcie_update_txcredit_mui(struct rockchip_pcie *rockch= ip) @@ -269,7 +269,7 @@ static void rockchip_pcie_set_power_limit(struct rockch= ip_pcie *rockchip) scale =3D 3; /* 0.001x */ curr =3D curr / 1000; /* convert to mA */ power =3D (curr * 3300) / 1000; /* milliwatt */ - while (power > PCIE_RC_CONFIG_DCR_CSPL_LIMIT) { + while (power > FIELD_MAX(PCI_EXP_DEVCAP_PWR_VAL)) { if (!scale) { dev_warn(rockchip->dev, "invalid power supply\n"); return; @@ -278,10 +278,10 @@ static void rockchip_pcie_set_power_limit(struct rock= chip_pcie *rockchip) power =3D power / 10; } =20 - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_DCR); - status |=3D (power << PCIE_RC_CONFIG_DCR_CSPL_SHIFT) | - (scale << PCIE_RC_CONFIG_DCR_CPLS_SHIFT); - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_DCR); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_DEVCA= P); + status |=3D FIELD_PREP(PCI_EXP_DEVCAP_PWR_VAL, power); + status |=3D FIELD_PREP(PCI_EXP_DEVCAP_PWR_SCL, scale); + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_DEVCAP); } =20 /** @@ -309,14 +309,14 @@ static int rockchip_pcie_host_init_port(struct rockch= ip_pcie *rockchip) rockchip_pcie_set_power_limit(rockchip); =20 /* Set RC's clock architecture as common clock */ - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCT= L); status |=3D PCI_EXP_LNKSTA_SLC << 16; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL); =20 /* Set RC's RCB to 128 */ - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCT= L); status |=3D PCI_EXP_LNKCTL_RCB; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL); =20 /* Enable Gen1 training */ rockchip_pcie_write(rockchip, PCIE_CLIENT_LINK_TRAIN_ENABLE, @@ -341,9 +341,9 @@ static int rockchip_pcie_host_init_port(struct rockchip= _pcie *rockchip) * Enable retrain for gen2. This should be configured only after * gen1 finished. */ - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKC= TL); status |=3D PCI_EXP_LNKCTL_RL; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL= ); =20 err =3D readl_poll_timeout(rockchip->apb_base + PCIE_CORE_CTRL, status, PCIE_LINK_IS_GEN2(status), 20, @@ -380,15 +380,15 @@ static int rockchip_pcie_host_init_port(struct rockch= ip_pcie *rockchip) =20 /* Clear L0s from RC's link cap */ if (of_property_read_bool(dev->of_node, "aspm-no-l0s")) { - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LINK_CAP); - status &=3D ~PCIE_RC_CONFIG_LINK_CAP_L0S; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LINK_CAP); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKC= AP); + status &=3D ~PCI_EXP_LNKCAP_ASPM_L0S; + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCAP= ); } =20 - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_DCSR); - status &=3D ~PCIE_RC_CONFIG_DCSR_MPS_MASK; - status |=3D PCIE_RC_CONFIG_DCSR_MPS_256; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_DCSR); + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_DEVCT= L); + status &=3D ~PCI_EXP_DEVCTL_PAYLOAD; + status |=3D PCI_EXP_DEVCTL_PAYLOAD_256B; + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_DEVCTL); =20 return 0; err_power_off_phy: diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controlle= r/pcie-rockchip.h index 5864a20323f2..f5cbf3c9d2d9 100644 --- a/drivers/pci/controller/pcie-rockchip.h +++ b/drivers/pci/controller/pcie-rockchip.h @@ -155,17 +155,7 @@ #define PCIE_EP_CONFIG_DID_VID (PCIE_EP_CONFIG_BASE + 0x00) #define PCIE_EP_CONFIG_LCS (PCIE_EP_CONFIG_BASE + 0xd0) #define PCIE_RC_CONFIG_RID_CCR (PCIE_RC_CONFIG_BASE + 0x08) -#define PCIE_RC_CONFIG_DCR (PCIE_RC_CONFIG_BASE + 0xc4) -#define PCIE_RC_CONFIG_DCR_CSPL_SHIFT 18 -#define PCIE_RC_CONFIG_DCR_CSPL_LIMIT 0xff -#define PCIE_RC_CONFIG_DCR_CPLS_SHIFT 26 -#define PCIE_RC_CONFIG_DCSR (PCIE_RC_CONFIG_BASE + 0xc8) -#define PCIE_RC_CONFIG_DCSR_MPS_MASK GENMASK(7, 5) -#define PCIE_RC_CONFIG_DCSR_MPS_256 (0x1 << 5) -#define PCIE_RC_CONFIG_LINK_CAP (PCIE_RC_CONFIG_BASE + 0xcc) -#define PCIE_RC_CONFIG_LINK_CAP_L0S BIT(10) -#define PCIE_RC_CONFIG_LCS (PCIE_RC_CONFIG_BASE + 0xd0) -#define PCIE_EP_CONFIG_LCS (PCIE_EP_CONFIG_BASE + 0xd0) +#define PCIE_RC_CONFIG_CR (PCIE_RC_CONFIG_BASE + 0xc0) #define PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2 (PCIE_RC_CONFIG_BASE + 0x90c) #define PCIE_RC_CONFIG_THP_CAP (PCIE_RC_CONFIG_BASE + 0x274) #define PCIE_RC_CONFIG_THP_CAP_NEXT_MASK GENMASK(31, 20) --=20 2.49.0 From nobody Wed Oct 8 07:40:06 2025 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C9B12405E4; Mon, 30 Jun 2025 22:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322308; cv=none; b=KtlEWOkZhcr+j6UTtuvoilhmpb7mkiHtmTKYpbRESf/OZeg8HLJNJYAIebcFTpZjBUCs8l1p1lBKDsxAFwpo607fp4HXczdln/e53e336PyRFnEYKS4cM9l36mpZim8J9NTwVs+ZmpVQ4dIqwk4fhS8HL7aYWzzxvi2ZRX9TT40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322308; c=relaxed/simple; bh=TMyeQZWAOAuTwvIXse5kaD0KDoeWmnfqoNhsSOfoCv0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UM09I9ioDFX62NhpPoYMj6abPYrOfN36+Xdad9F4aSdRtNqFGONhHP1xM3mSxPjkEjWq7UWjqhB7481uqZlQJkaRUD46spKFDEv25iSnxxBUppn5+4DEnlEIOtkNbNivyI8SQMM+KGI8ZJKhJBiGEZZP9eueTSwCOlFV3xiX3Ko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Bh9hMiAx; arc=none smtp.client-ip=209.85.160.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Bh9hMiAx" Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-4a4323fe8caso16869211cf.2; Mon, 30 Jun 2025 15:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751322305; x=1751927105; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rtc4GJjYIzCc3h+Hv3COhOArvofrVT3IhU2L5CEaYbA=; b=Bh9hMiAx75fR5CZ+I2aTVMiWLqcjZ2WnQiwAOtyr6TRXmLBwsGr33sATxgI6kDCMCq BmHw+iMc+u+b4W7+CLZVDCTSwHfBEuz4iOy08MvgXEFbAefcNUFbzrxpNH0si0Uf4prE bbs9a+rPKqE272shl9YmvaAc6t7ju+S9K0Jy3KNH04a4YylwQBUl8tE5cQMYDsxSU5aC Ltj62fkTamUBXr2H5IJH7IobKD3tQcvpAuereE5KHkLFnnvcTWNq7zzy9Nzy5yleK+0z SASfH/RU+6fNjxkZNHZuzo/Y/0CsV8or6EIEsGrAp+6ByTkR95UDvHirlNQQCN0Hz61V O4aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751322305; x=1751927105; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rtc4GJjYIzCc3h+Hv3COhOArvofrVT3IhU2L5CEaYbA=; b=rpzkaww9mNjiqoLZj8lszap5pJrBv+tN8qo6RNJpFKKDmBeJ4yt8VCusCzu9UKfVtL XI/NxAhxg1ZuK663KduFe3dzxBNNLUQLx6klSx8fFKbT4T5bvgnrZPPVXoW1lSEo/sXF wiBppreIqS+GlBdmryAhWbr7Ga5XL5d6UahITfMIBCqfWa7vwltqAuM0MCiK//VgaZSv hTGqcer+TpQx6H74rMd0/nwKqBXalRgyFmlCHXdqMy4zkfnaz2sdd9d9blFlXQIGY7t3 9dFhgh/9sF8Cn4pjfBvyVba2e8tdf7lMabZStgKyux7/2zbDC9+6E35/3r93YBD6gKW0 vvBQ== X-Forwarded-Encrypted: i=1; AJvYcCUssZyVJXq1ROoCLlCpc9b44LvRxluJbnx5YWUDU9v4WNsbPtR/Y61ewW8todPUWpYnE1GiVPsz2GgE@vger.kernel.org, AJvYcCXqF5vJGtIJCDEquKGxIy5GiL8wyAWlPqgOxMUOzYwP9Kauf9SgUlZsWxlWSWBfVxaIFVbuJQ09/JyVZyE=@vger.kernel.org X-Gm-Message-State: AOJu0YwBgVTai33oc+PbdxfsrjZwfRBgq8CwciCk5OAg+o9R7D6iRLtD N2Si7ay95xcrvZYRK+jFLRBNtMIG9T5GemWLMlewe2iv6AEdV1N7Eu72 X-Gm-Gg: ASbGnct+bGzvaD/naKdrmSQOZmNyTEHapPnhUExCQWJ5ggkoSwjIX/WXt1aSrA/0Lfb QEWvokQeAKE3YH4A0oF/7Or69UwUuETRjtw6ERzyludS3XmoP5izytDRJMiqqUuMBePPEl+P/tB ARFghSt747jdPHN+T9MEACowTU8j3ygxl4ZsA5sKV5cqquKcaRnxeYHoDNO7SxpNVDlnhrmNqP+ u3a100uig6q/esN/0j2YjLY6KS10sHNibKsSeNT91koHTLD5vgwDNS1i+S4LTi4AyOzVr2qXR4H oghbkkFJ0a3TOogK5iZIksINV06zhwjxnsMBvHUPV3fKm6bDZdOHss00Ehl/ X-Google-Smtp-Source: AGHT+IG9h1D4l6+m606c2ZMkubhW0PPh4r8jC2GsVBPvZvgF1tRRF5vtygFfuvF9SKUIZpKpOhqztw== X-Received: by 2002:a05:622a:144b:b0:4a1:630b:e12b with SMTP id d75a77b69052e-4a7fc939ddfmr221177041cf.0.1751322304620; Mon, 30 Jun 2025 15:25:04 -0700 (PDT) Received: from geday ([2804:7f2:800b:4851::dead:c001]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4a7fc138d7esm67054191cf.21.2025.06.30.15.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jun 2025 15:25:04 -0700 (PDT) Date: Mon, 30 Jun 2025 19:24:57 -0300 From: Geraldo Nascimento To: linux-rockchip@lists.infradead.org Cc: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , Rick wertenbroek , Neil Armstrong , Valmantas Paliksa , linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v9 2/4] PCI: rockchip: Set Target Link Speed before retraining Message-ID: <0afa6bc47b7f50e2e81b0b47d51c66feb0fb565f.1751322015.git.geraldogabriel@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Current code may fail 5.0GT/s retraining if Target Link Speed is set to 2.5 GT/s in Link Control and Status Register 2. Set it to 5.0 GT/s accordingly. Tested-by: Robin Murphy Signed-off-by: Geraldo Nascimento --- drivers/pci/controller/pcie-rockchip-host.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/cont= roller/pcie-rockchip-host.c index 65653218b9ab..25890f6c0e17 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -341,6 +341,10 @@ static int rockchip_pcie_host_init_port(struct rockchi= p_pcie *rockchip) * Enable retrain for gen2. This should be configured only after * gen1 finished. */ + status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKC= TL2); + status &=3D ~PCI_EXP_LNKCTL2_TLS; + status |=3D PCI_EXP_LNKCTL2_TLS_5_0GT; + rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL= 2);=09 status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKC= TL); status |=3D PCI_EXP_LNKCTL_RL; rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL= ); --=20 2.49.0 From nobody Wed Oct 8 07:40:06 2025 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1391E241671; Mon, 30 Jun 2025 22:25:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322323; cv=none; b=j73eW6YK9Xf0hX/kvzNGVM0vBF72MhtbynX4tKazEar2U2L3+PVVDdR7vgDlS6hSGj2pZtU04I5+yAd6ys0zzGCacOBTskWMQuAKK0qmPWKa8adHEAYY9Ey7AVwxvDszjCjVDjJLqSEixt0shX6eKFvfuTzZAjY7k5/LeiJC5Ns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322323; c=relaxed/simple; bh=9cifePYFORyZXvU9WP3F5RFx+O1sVrMcujhTklc9lOM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aCUgItqRXRAuD235YAw4FEg821c/iUVJksn0n21sFhyUFQCYFuoFjtJxXjBVRm75Etmx+IY3T/b55qJd/NuF1SEDilMKVsLBU0E1nCde981j6QgsBm7Z5QQLIudAhz2hYiyvBU72G6/nnC8NyJBQXaf6W5iza6n3x78NoaeNvTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ipxm7Qxe; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ipxm7Qxe" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-7d3f5796755so467395885a.1; Mon, 30 Jun 2025 15:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751322321; x=1751927121; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BB+BO3+Ju9SCf7b/TLt6zXjibbwRGCyTQVjEHxQIl60=; b=ipxm7Qxeiq01HAu4Q6bPOy6395K916CkVkLLrmnDX1kdKz3kqQll9B6fdlzU5f5G27 r10DoTf7H0mMZz0FsqTQlg3v4WS15TWLWBw+k05tILbwCcwlVBJsZHPsvfJ6fX1XQn8i Ifk3LpLNwPL5NV1/ziHbhaUN65fwy8BFPIa8lsKCFE6mtO0DwQMSATrjeIbAbNCptvcj 6FQiGWc0/y10STQ06EILCQPhzcsl3M62i/ez7yWD1ov5ZRFG9a84Al8vSrKpUEhHO63k syfvLxSgBiQb4bSInQKBNG2UfUNBJ38rjcwhGyAGSZZzdOwoTnRfsj7HEuYRMEPI8sS3 2jlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751322321; x=1751927121; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BB+BO3+Ju9SCf7b/TLt6zXjibbwRGCyTQVjEHxQIl60=; b=pdckAzfYNT0RMt+Q+COn3tcRb68slyjx+Gv/Rk41Slorf4ZxLtppECvKr3r9RcC5aN BWvwHzM+7TnyDd1M2QnUZelfRgfJxoz5jVcvLYsEP9Cs6jzVi/R17akenyTZFov3aM+3 j3IDCYx6UKDVb0QkbRADhhNkHnQ3BZNKOFtua0vc7DPE9cube8NkFI+QJm+ua4KCymnS ad0eo585h8TxZEhR+iwqzFOAXRmcjshgopAIXPi0AMRyz8seqsN0eE5DqdCB1dLfEWj0 Lrx6d8mrQFKVgqs1RxNr+2Zb3OUuUyFZQa9b/8Xm6k6ds2+IpKhltC3lgGHvCTdtrOZQ 1gLA== X-Forwarded-Encrypted: i=1; AJvYcCWRLZ/ePci9MNvmq9IgdQB6wDcapurZUQ1FvU8A9hQsjQ6FjV+kl9BGWcmfaqfAnNSd/vckl61FaQnKRDc=@vger.kernel.org, AJvYcCXw0sy6LfuKdy6jIr4tok9JXr/iSo0zpgJIBO3hhzasI9D9C30DP567i1uKIgWrmgZYDlio0PF42/6G@vger.kernel.org X-Gm-Message-State: AOJu0Yxt523/tJw0Qp1ffOGrDsNY3CqxWOH2gc/dLhUNZ+e/2XtcL68j x8/9wKiDHuDUTj4MdAOj/nRez1DYBXzhrVx9JEeeN5EXIcNGUYUKbuNw X-Gm-Gg: ASbGnctn3gl9XYf84EfEoXj4sLigvnNJIhg0sfewbl3RoLSC2dDkio1b12ykp/D2tiB VrkgpYJ90QmMw1MwK5sB/OlpkD5s9EboIDhxLC+VXlp08UxvYoAkDvSqjS7ut/cNb4olG4rKqLN lB9t5JaFb76z8gUmxRjQfFVb0p1F/JGwNzVu+xu/n+HCEVL+WJFAxUhjaVu7x5kJ9pV4ns998EB drovyZNTEWKroPGzW2vEgKK2S13E9WBdhCCu5yN/ZLOnX7lRHxpuRCsmIm0lKllh2svHcOq7P2J jcuBuTdNKtaN+FTgjTUO5KjpNcqIcccfgl63LgeO1LAfMF5Dzg== X-Google-Smtp-Source: AGHT+IFTRrEGCx789ysocz2vuPu09+VjUsb7fSHj7n8oVet+ThKIVJeolTpBlxxkV1sBDbYfdguHzQ== X-Received: by 2002:a05:620a:27c6:b0:7c5:3c0a:ab7e with SMTP id af79cd13be357-7d443909f4amr2207841185a.5.1751322320919; Mon, 30 Jun 2025 15:25:20 -0700 (PDT) Received: from geday ([2804:7f2:800b:4851::dead:c001]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d44323bba2sm672602885a.109.2025.06.30.15.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jun 2025 15:25:20 -0700 (PDT) Date: Mon, 30 Jun 2025 19:25:14 -0300 From: Geraldo Nascimento To: linux-rockchip@lists.infradead.org Cc: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , Rick wertenbroek , Neil Armstrong , Valmantas Paliksa , linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v9 3/4] phy: rockchip-pcie: Enable all four lanes if required Message-ID: <16b610aab34e069fd31d9f57260c10df2a968f80.1751322015.git.geraldogabriel@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Valmantas Paliksa Current code enables only Lane 0 because pwr_cnt will be incremented on first call to the function. Let's reorder the enablement code to enable all 4 lanes through GRF. Reviewed-by: Neil Armstrong Reviewed-by: Robin Murphy Signed-off-by: Valmantas Paliksa Signed-off-by: Geraldo Nascimento --- drivers/phy/rockchip/phy-rockchip-pcie.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchi= p/phy-rockchip-pcie.c index bd44af36c67a..f22ffb41cdc2 100644 --- a/drivers/phy/rockchip/phy-rockchip-pcie.c +++ b/drivers/phy/rockchip/phy-rockchip-pcie.c @@ -160,6 +160,12 @@ static int rockchip_pcie_phy_power_on(struct phy *phy) =20 guard(mutex)(&rk_phy->pcie_mutex); =20 + regmap_write(rk_phy->reg_base, + rk_phy->phy_data->pcie_laneoff, + HIWORD_UPDATE(!PHY_LANE_IDLE_OFF, + PHY_LANE_IDLE_MASK, + PHY_LANE_IDLE_A_SHIFT + inst->index)); + if (rk_phy->pwr_cnt++) { return 0; } @@ -176,12 +182,6 @@ static int rockchip_pcie_phy_power_on(struct phy *phy) PHY_CFG_ADDR_MASK, PHY_CFG_ADDR_SHIFT)); =20 - regmap_write(rk_phy->reg_base, - rk_phy->phy_data->pcie_laneoff, - HIWORD_UPDATE(!PHY_LANE_IDLE_OFF, - PHY_LANE_IDLE_MASK, - PHY_LANE_IDLE_A_SHIFT + inst->index)); - /* * No documented timeout value for phy operation below, * so we make it large enough here. And we use loop-break --=20 2.49.0 From nobody Wed Oct 8 07:40:06 2025 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B57D023ABB3; Mon, 30 Jun 2025 22:25:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322339; cv=none; b=NM+SKOwQcrKA8ghH7rBQFL4Es97TMw267Qq9YDiKHrUTZ+OsO4Q8aIJqoHlWamyEJUoGO5RZmRPHU6kPXAOn1TSGYljEnf2yORBxyJzWIQOtHop7jihGmoTwPIPt4pCDyQRULHfhoih4t2qtJTqcwE17H8iMVPCahDX5eXcAAlk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751322339; c=relaxed/simple; bh=CNxK0279ukfbz74d9Orf//2RsynVo3ZY3ta36YHi0ZM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P3X6nYrh6pRiORxo08u+xtE8d8woqVc2z+JLsHg49VS/Vu8QdkZeMIruB7m69gDxtba9qd7aD8qna9c1c9iLF7UbUNIFLBuai1uoBIS8SPgwaxIiHlc3csaqn+ivxfoOayUJ2kuBdkmuWXNZJRSFYUjJ8CGsuBk8qbl867ITyqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c6QB3IW5; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c6QB3IW5" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6facc3b9559so36372536d6.0; Mon, 30 Jun 2025 15:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751322335; x=1751927135; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rMkTHKD3jio2hpq8BtE0DToF1CwksemxWLN6Z8dMYEk=; b=c6QB3IW507XREmHj3sjfMGKKrRxndyqXRf1JS8IewcDA/DjlZZtn+k088KefDiyUn7 O1TxIPKZQgwsWuT3/JhwV3xyGzSXbYjgQKv+P2IXxVEgifZ3dPzdCJDRoI4QBindIk+O DEVxQGe8PDvBUYdKUL/uwTn0/vX/RlaTB4ARQ2gWF3ZN9HZx+eRq4uiOTnlnRnB1+zc8 xt+zp03GIhLj8aRRNWZITEJnpBi71OwZjflFq+BcCB1lE1FCcXO+HnPAlfMHPSZ6Q8dW QMRqPwi+nBFZkSgmJlZimYycCG9eP02ftkhjBOd1MuyTXvLWsZos6dNT7wJmXOFN8p1X Ztlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751322335; x=1751927135; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rMkTHKD3jio2hpq8BtE0DToF1CwksemxWLN6Z8dMYEk=; b=pS5ORAhvp4o2lDdXOLQ09DFmnbCOvu91dxsxKNdthEC+fMvJ/BAnJ2eEOdEFcvpYK2 7R7N1HbKno+24VPy+AMb2EFhaWPrKetyoyyUxpDMsrxCr7GbifyBiXPPYZlVflwG4j8z 4DtcBzp0dMFEhBSay6w0AABdN/ak4nWkiE16DsobP9Ujp0a1WcUt+zuq7tawjb7XWzmR EyrCTuR2p2Y1vGjGZkKeG4GXC4+6yFaPU1QK+Fuh3sU5XbkGb+h6zEHGVoElvhxLhl74 fMoHkmEliAD5DFVYzVsCGcfNgHD0lP1Mupxf47KA5Yt2ijd05JyamwYkHWRIO9YOP0I4 HI7g== X-Forwarded-Encrypted: i=1; AJvYcCW9TxMPrPDENEQfJsX40jEu6L/ZDFmZGaEqmHo0kFauD6HcBODREXrjBMMbm4Auzrv6UM4PpWW64g8RbPs=@vger.kernel.org, AJvYcCXwtLACxkDIhVJtNOa6ZD7b4CXsCemhlh2dIEjpexc07fQF0unKT1BRJ07BymvvdW85deI/WEzwu9ui@vger.kernel.org X-Gm-Message-State: AOJu0YzxeOu6gi2r+ZviTUUbXxBg51qo0/2SmzLlQI8fXsz6o9zbaX23 usU00ld+nwmnamlmHXzlRbFT5SRVQbNCDv36+odgyIPCYtikt75xqhaz X-Gm-Gg: ASbGnctzDG2B9aAGJW1ZWXRIKewWboL4UlPVA1VEVbzN2RyHBxAgYkI16cJ9RiSKRUN okIOhTNESv5ORP1ozrG0erJYFrPpObnNPiRdx4p1Qix//841UpTUz3uGFDzBxiIdkdxFFTjTTEX 26TFm8cErOQjOGj5JGwK4RzlroXYX75NjLGTry8FlZ1xc5SYSwn8HmpiMmHBzmk0VGWytAicACJ 2YnRcbH7D5filx+lGULrihImX6ZEmN414LbUQGqIzW0c4M5K0yp0g8xaYmPbp+TAbIBXkskvo43 XIqEblzd1gHnUyqoitsNcjj8LHW5+vZuUn17aWuWyGOWazWJkQ== X-Google-Smtp-Source: AGHT+IE4iPMoQHELkr+tznv/l/wb/8KLRUH+p7JvVVca5CKnURWz4GeCY3XtHhceEVufm737DrAHNQ== X-Received: by 2002:ad4:5ba5:0:b0:6fb:5249:59fe with SMTP id 6a1803df08f44-6ffed7a5653mr221531976d6.2.1751322335383; Mon, 30 Jun 2025 15:25:35 -0700 (PDT) Received: from geday ([2804:7f2:800b:4851::dead:c001]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6fd772e349dsm74788696d6.68.2025.06.30.15.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jun 2025 15:25:34 -0700 (PDT) Date: Mon, 30 Jun 2025 19:25:28 -0300 From: Geraldo Nascimento To: linux-rockchip@lists.infradead.org Cc: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , Rick wertenbroek , Neil Armstrong , Valmantas Paliksa , linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v9 4/4] phy: rockchip-pcie: Properly disable TEST_WRITE strobe signal Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" pcie_conf is used to touch TEST_WRITE strobe signal. This signal should be enabled, a little time waited, and then disabled. Current code clearly was copy-pasted and never disables the strobe signal. Adjust the define. While at it, remove PHY_CFG_RD_MASK which has been unused since 64cdc0360811 ("phy: rockchip-pcie: remove unused phy_rd_cfg function"). Reviewed-by: Neil Armstrong Signed-off-by: Geraldo Nascimento --- drivers/phy/rockchip/phy-rockchip-pcie.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchi= p/phy-rockchip-pcie.c index f22ffb41cdc2..4e2dfd01adf2 100644 --- a/drivers/phy/rockchip/phy-rockchip-pcie.c +++ b/drivers/phy/rockchip/phy-rockchip-pcie.c @@ -30,9 +30,8 @@ #define PHY_CFG_ADDR_SHIFT 1 #define PHY_CFG_DATA_MASK 0xf #define PHY_CFG_ADDR_MASK 0x3f -#define PHY_CFG_RD_MASK 0x3ff #define PHY_CFG_WR_ENABLE 1 -#define PHY_CFG_WR_DISABLE 1 +#define PHY_CFG_WR_DISABLE 0 #define PHY_CFG_WR_SHIFT 0 #define PHY_CFG_WR_MASK 1 #define PHY_CFG_PLL_LOCK 0x10 --=20 2.49.0