From: Michael Ellerman <mpe@ellerman.id.au>
To: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>,
linux-edac@vger.kernel.org
Cc: git@amd.com, devicetree@vger.kernel.org,
sai.krishna.potthuri@amd.com, krzysztof.kozlowski@linaro.org,
robh+dt@kernel.org, conor+dt@kernel.org, bp@alien8.de,
tony.luck@intel.com, james.morse@arm.com, mchehab@kernel.org,
rric@kernel.org, michal.simek@amd.com
Subject: Re: [PATCH v9 2/2] EDAC/versal: Add a Xilinx Versal memory controller driver
Date: Mon, 13 Nov 2023 15:54:23 +1100 [thread overview]
Message-ID: <875y268d8g.fsf@mail.lhotse> (raw)
In-Reply-To: <20231005101242.14621-3-shubhrajyoti.datta@amd.com>
Shubhrajyoti Datta <shubhrajyoti.datta@amd.com> writes:
> Add a EDAC driver for the RAS capabilities on the Xilinx integrated DDR
> Memory Controllers (DDRMCs) which support both DDR4 and LPDDR4/4X memory
> interfaces. It has four programmable NoC interface ports and is designed
> to handle multiple streams of traffic.The driver
> reports correctable and uncorrectable errors , and also creates
> debugfs entries for error injection.
...
> diff --git a/drivers/edac/versal_edac.c b/drivers/edac/versal_edac.c
> new file mode 100644
> index 000000000000..5ce2e9585a00
> --- /dev/null
> +++ b/drivers/edac/versal_edac.c
...
> +#define XDDR_REG_CONFIG0_NUM_CHANS_MASK BIT(17)
...
> +static int mc_probe(struct platform_device *pdev)
> +{
> + void __iomem *ddrmc_baseaddr, *ddrmc_noc_baseaddr;
> + struct edac_mc_layer layers[2];
> + struct mem_ctl_info *mci;
> + u8 num_chans, num_csrows;
> + struct edac_priv *priv;
> + u32 edac_mc_id, regval;
> + int rc;
> +
...
> +
> + regval = readl(ddrmc_baseaddr + XDDR_REG_CONFIG0_OFFSET);
> + num_chans = FIELD_PREP(XDDR_REG_CONFIG0_NUM_CHANS_MASK, regval);
Shouldn't this be FIELD_GET?
Otherwise it's shifting regval into BIT(17), and then assigning that to a u8.
> + num_chans++;
> +
> + num_csrows = FIELD_PREP(XDDR_REG_CONFIG0_NUM_RANKS_MASK, regval);
And here too?
> + num_csrows *= 2;
> + if (!num_csrows)
> + num_csrows = 1;
cheers
next prev parent reply other threads:[~2023-11-13 4:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 10:12 [PATCH v9 0/2] edac: xilinx: Added EDAC support for Xilinx DDR controller Shubhrajyoti Datta
2023-10-05 10:12 ` [PATCH v9 1/2] dt-bindings: memory-controllers: Add support for Xilinx Versal EDAC for DDRMC Shubhrajyoti Datta
2023-10-05 10:12 ` [PATCH v9 2/2] EDAC/versal: Add a Xilinx Versal memory controller driver Shubhrajyoti Datta
2023-11-13 4:54 ` Michael Ellerman [this message]
2023-10-05 14:29 ` [PATCH v9 0/2] edac: xilinx: Added EDAC support for Xilinx DDR controller Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875y268d8g.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=bp@alien8.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=git@amd.com \
--cc=james.morse@arm.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-edac@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=michal.simek@amd.com \
--cc=robh+dt@kernel.org \
--cc=rric@kernel.org \
--cc=sai.krishna.potthuri@amd.com \
--cc=shubhrajyoti.datta@amd.com \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox