All of lore.kernel.org
 help / color / mirror / Atom feed
From: york sun <york.sun@nxp.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"morbidrsa@gmail.com" <morbidrsa@gmail.com>,
	"oss@buserror.net" <oss@buserror.net>,
	Stuart Yoder <stuart.yoder@nxp.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Doug Thompson <dougthompson@xmission.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Patch v3 08/11] driver/edac/fsl_ddr: Add support of little endian
Date: Mon, 8 Aug 2016 15:26:46 +0000	[thread overview]
Message-ID: <AM4PR0401MB173223FF1B8BA466A12FD4209A1B0@AM4PR0401MB1732.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 20160808085002.GF20800@nazgul.tnic

On 08/08/2016 01:50 AM, Borislav Petkov wrote:
> On Thu, Aug 04, 2016 at 03:58:33PM -0700, York Sun wrote:
>> Get endianness from device tree. Both big endian and little endian
>> are supported. Default to big endian for backward compatibility to
>> MPC85xx.
>>
>> Signed-off-by: York Sun <york.sun@nxp.com>
>>
>> ---
>> Change log
>>   v3: no change
>>   v2: Separated from "Add support for ARM-based SoCs" patch
>>
>>  .../fsl/ddr.txt}                                   |  6 ++
>>  drivers/edac/fsl_ddr_edac.c                        | 83 ++++++++++++++--------
>>  2 files changed, 58 insertions(+), 31 deletions(-)
>>  rename Documentation/devicetree/bindings/{powerpc/fsl/mem-ctrlr.txt => memory-controllers/fsl/ddr.txt} (74%)
>>
>> diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt b/Documentation/devicetree/bindings/memory-controllers/fsl/ddr.txt
>> similarity index 74%
>> rename from Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt
>> rename to Documentation/devicetree/bindings/memory-controllers/fsl/ddr.txt
>> index f87856f..62623f9 100644
>> --- a/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt
>> +++ b/Documentation/devicetree/bindings/memory-controllers/fsl/ddr.txt
>> @@ -7,6 +7,10 @@ Properties:
>>  		  "fsl,qoriq-memory-controller".
>>  - reg		: Address and size of DDR controller registers
>>  - interrupts	: Error interrupt of DDR controller
>> +- little-endian	: Specifies little-endian access to registers
>> +- big-endian	: Specifies big-endian access to registers
>> +
>> +If both little-endian and big-endian are omitted, big-endian will be used.
>>
>>  Example 1:
>>
>> @@ -14,6 +18,7 @@ Example 1:
>>  		compatible = "fsl,bsc9132-memory-controller";
>>  		reg = <0x2000 0x1000>;
>>  		interrupts = <16 2 1 8>;
>> +		big-endian;
>>  	};
>>
>>
>> @@ -24,4 +29,5 @@ Example 2:
>>  				"fsl,qoriq-memory-controller";
>>  		reg = <0x8000 0x1000>;
>>  		interrupts = <16 2 1 23>;
>> +		big-endian;
>>  	};
>
> This needs an ACK from DT maintainers. They're on CC.
>
>> diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c
>> index 88ecf7d..b1b7924 100644
>> --- a/drivers/edac/fsl_ddr_edac.c
>> +++ b/drivers/edac/fsl_ddr_edac.c
>
> ...
>
>> @@ -470,6 +483,13 @@ int fsl_ddr_mc_err_probe(struct platform_device *op)
>>  	mci->ctl_name = pdata->name;
>>  	mci->dev_name = pdata->name;
>>
>> +	if (of_find_property(op->dev.of_node, "little-endian", NULL))
>> +		little_endian = true;
>> +	else if (of_find_property(op->dev.of_node, "big-endian", NULL))
>> +		little_endian = false;
>> +	else
>> +		little_endian = false;
>
> What happened here?
>
> Considering little_endian is static, this should suffice for its
> initialization:
>
> 	if (of_find_property(op->dev.of_node, "little-endian", NULL))
> 		little_endian = true;
>
>

OK.

>
>
>>  	res = of_address_to_resource(op->dev.of_node, 0, &r);
>>  	if (res) {
>>  		pr_err("%s: Unable to get resource for MC err regs\n",
>> @@ -492,7 +512,7 @@ int fsl_ddr_mc_err_probe(struct platform_device *op)
>>  		goto err;
>>  	}
>>
>> -	sdram_ctl = in_be32(pdata->mc_vbase + MC_DDR_SDRAM_CFG);
>> +	sdram_ctl = ddr_in32(pdata->mc_vbase + MC_DDR_SDRAM_CFG);
>>  	if (!(sdram_ctl & DSC_ECC_EN)) {
>>  		/* no ECC */
>>  		pr_warn("%s: No ECC DIMMs discovered\n", __func__);
>> @@ -520,11 +540,11 @@ int fsl_ddr_mc_err_probe(struct platform_device *op)
>>
>>  	/* store the original error disable bits */
>>  	orig_ddr_err_disable =
>> -	    in_be32(pdata->mc_vbase + MC_ERR_DISABLE);
>> -	out_be32(pdata->mc_vbase + MC_ERR_DISABLE, 0);
>> +	    ddr_in32(pdata->mc_vbase + MC_ERR_DISABLE);
>> +	ddr_out32(pdata->mc_vbase + MC_ERR_DISABLE, 0);
>>
>>  	/* clear all error bits */
>> -	out_be32(pdata->mc_vbase + MC_ERR_DETECT, ~0);
>> +	ddr_out32(pdata->mc_vbase + MC_ERR_DETECT, ~0);
>>
>>  	if (edac_mc_add_mc_with_groups(mci, fsl_ddr_dev_groups)) {
>>  		edac_dbg(3, "failed edac_mc_add_mc()\n");
>> @@ -532,15 +552,15 @@ int fsl_ddr_mc_err_probe(struct platform_device *op)
>>  	}
>>
>>  	if (edac_op_state == EDAC_OPSTATE_INT) {
>> -		out_be32(pdata->mc_vbase + MC_ERR_INT_EN,
>> -			 DDR_EIE_MBEE | DDR_EIE_SBEE);
>> +		ddr_out32(pdata->mc_vbase + MC_ERR_INT_EN,
>> +			  DDR_EIE_MBEE | DDR_EIE_SBEE);
>>
>>  		/* store the original error management threshold */
>> -		orig_ddr_err_sbe = in_be32(pdata->mc_vbase +
>> +		orig_ddr_err_sbe = ddr_in32(pdata->mc_vbase +
>>  					   MC_ERR_SBE) & 0xff0000;
>>
>>  		/* set threshold to 1 error per interrupt */
>> -		out_be32(pdata->mc_vbase + MC_ERR_SBE, 0x10000);
>> +		ddr_out32(pdata->mc_vbase + MC_ERR_SBE, 0x10000);
>>
>>  		/* register interrupts */
>>  		pdata->irq = irq_of_parse_and_map(op->dev.of_node, 0);
>> @@ -573,6 +593,7 @@ err:
>>  	edac_mc_free(mci);
>>  	return res;
>>  }
>> +EXPORT_SYMBOL_GPL(fsl_ddr_mc_err_probe);
>
> What's that export for?
>

I thought I need to export this symbol so it can be call from a module 
driver. Actually I don't. Will remove.

York

  reply	other threads:[~2016-08-09  0:02 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1470351518-22404-1-git-send-email-york.sun@nxp.com>
2016-08-04 22:58 ` [Patch v3 01/11] arch/powerpc/pci: Fix compiling error for mpc85xx_edac York Sun
2016-08-04 23:36   ` Andrew Donnellan
2016-08-04 23:39     ` york sun
2016-08-04 23:39       ` york sun
2016-08-05  6:58       ` Borislav Petkov
2016-08-05  3:43   ` Michael Ellerman
2016-08-05  4:26     ` york sun
2016-08-05  4:26       ` york sun
2016-08-05  7:01       ` Borislav Petkov
2016-08-05  7:14         ` Johannes Thumshirn
2016-08-08 15:47         ` york sun
2016-08-08 15:47           ` york sun
2016-08-05 20:29     ` york sun
2016-08-05 20:29       ` york sun
2016-08-05 21:09       ` Scott Wood
2016-08-05 21:09         ` Scott Wood
2016-08-05 21:20         ` york sun
2016-08-05 21:20           ` york sun
2016-08-05 21:57           ` Scott Wood
2016-08-05 21:57             ` Scott Wood
2016-08-04 22:58 ` [Patch v3 02/11] arch/microblaze/pci: Drop early_find_capability() York Sun
2016-08-04 22:58 ` [Patch v3 03/11] driver/edac/mpc85xx_edac: Drop setting/clearing RFXE bit in HID1 York Sun
2016-08-08  7:11   ` Borislav Petkov
2016-08-08 15:39     ` york sun
2016-08-09  3:32       ` Borislav Petkov
2016-08-09  4:31         ` york sun
2016-08-09  5:01           ` Borislav Petkov
2016-08-09  5:06             ` york sun
2016-08-09  6:56               ` Borislav Petkov
2016-08-09 15:57                 ` york sun
     [not found]                 ` <275db5cd-09cd-d971-0e43-3b4af060f0e8@nxp.com>
2016-08-09 16:40                   ` york sun
2016-08-09 16:58                     ` Borislav Petkov
2016-08-04 22:58 ` [Patch v3 04/11] driver/edac/mpc85xx_edac: Replace printk with proper pr_* format York Sun
2016-08-04 22:58 ` [Patch v3 05/11] driver/edac/fsl-ddr: Separate FSL DDR EDAC driver from MPC85xx York Sun
2016-08-08  7:36   ` Borislav Petkov
2016-08-08 15:32     ` york sun
2016-08-04 22:58 ` [Patch v3 06/11] driver/edac/fsl_ddr: Rename macros and names York Sun
2016-08-08  7:41   ` Borislav Petkov
2016-08-08 15:31     ` york sun
2016-08-04 22:58 ` [Patch v3 07/11] driver/edac/fsl_ddr: Add DDR4 type York Sun
2016-08-08  8:30   ` Borislav Petkov
2016-08-08 15:30     ` york sun
2016-08-04 22:58 ` [Patch v3 08/11] driver/edac/fsl_ddr: Add support of little endian York Sun
2016-08-04 22:58   ` York Sun
2016-08-08  8:50   ` Borislav Petkov
2016-08-08  8:50     ` Borislav Petkov
2016-08-08 15:26     ` york sun [this message]
2016-08-08 15:39   ` Mark Rutland
2016-08-04 22:58 ` [Patch v3 09/11] driver/edac/fsl_ddr: Fix kernel warning when module is removed York Sun
2016-08-04 22:58 ` [Patch v3 10/11] driver/edac/layerscape_edac: Add Layerscape EDAC support York Sun
2016-08-04 22:58   ` York Sun
2016-08-08  8:57   ` Alexander Stein
2016-08-08  8:57     ` Alexander Stein
2016-08-08 15:16     ` york sun
2016-08-08 15:16       ` york sun
2016-08-08 18:06   ` Marc Zyngier
2016-08-08 18:06     ` Marc Zyngier
2016-08-08 19:56     ` york sun
2016-08-08 19:56       ` york sun
2016-08-09 11:12       ` Will Deacon
2016-08-09 11:12         ` Will Deacon
2016-08-09 15:27         ` york sun
2016-08-09 15:27           ` york sun
2016-08-04 22:58 ` [Patch v3 11/11] arm64: Update device tree for Layerscape SoCs York Sun
2016-08-04 22:58   ` York Sun
2016-08-04 22:58   ` York Sun

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=AM4PR0401MB173223FF1B8BA466A12FD4209A1B0@AM4PR0401MB1732.eurprd04.prod.outlook.com \
    --to=york.sun@nxp.com \
    --cc=bp@alien8.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dougthompson@xmission.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=morbidrsa@gmail.com \
    --cc=oss@buserror.net \
    --cc=robh+dt@kernel.org \
    --cc=stuart.yoder@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.