linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: "Cédric Le Goater" <clg@kaod.org>, linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Joel Stanley <joel@jms.id.au>
Subject: Re: [PATCH v3 1/5] mtd: spi-nor: add memory controllers for the Aspeed AST2500 SoC
Date: Sat, 10 Dec 2016 20:08:08 +0100	[thread overview]
Message-ID: <2b51e3b8-5d02-c045-63c6-fcb0c9f8f460@gmail.com> (raw)
In-Reply-To: <f0ad683a-0989-e1ae-b33b-9746260ffa0e@kaod.org>

On 12/10/2016 06:34 PM, Cédric Le Goater wrote:
> Hello, 

Hi!

> On 12/10/2016 05:01 AM, Marek Vasut wrote:
>> On 12/09/2016 05:49 PM, Cédric Le Goater wrote:
>>
>> [...]
>>
>>
>>> +static int aspeed_smc_read_from_ahb(void *buf, const void __iomem *src,
>>> +				    size_t len)
>>> +{
>>> +	if (IS_ALIGNED((u32)src, sizeof(u32)) &&
>>> +	    IS_ALIGNED((u32)buf, sizeof(u32)) &&
>>> +	    IS_ALIGNED(len, sizeof(u32))) {
>>
>> Did you try compiling this on any 64bit system ?
> 
> I cross compile the kernel on a 64bit host and then upload on the
> target. What kind of problem are you forseeing ? 

Something about the pointer being clipped to 4 bytes, I'd rather use
uintptr_t cast instead of u32 . I don't think it matters for this check,
but just to be extra precise ...

>>
>>> +		while (len > 3) {
>>> +			*(u32 *)buf = readl(src);


[...]

>>> +/*
>>> + * Segment Address Registers. Start and end addresses are encoded
>>> + * using 8MB units
>>> + */
>>> +#define SEGMENT_ADDR_REG0		0x30
>>> +#define SEGMENT_ADDR_START(_r)		((((_r) >> 16) & 0xFF) << 23)
>>
>> is that ((r) & 0xff0000) << 7 ?
>>
>>> +#define SEGMENT_ADDR_END(_r)		((((_r) >> 24) & 0xFF) << 23)
>>
>> ((r) & 0xff000000) >> 1 ?
> 
> yes. 
> 
> I rather keep the initial macros though, which I found easier to 
> understand.
> 
> The Segment Register uses a 8MB unit to encode the start address
> and the end address of the mapping window of a flash SPI slave :
> 
>         | byte 1 | byte 2 | byte 3 | byte 4 |
>         +--------+--------+--------+--------+
>         |  end   |  start |   0    |   0    |

Then the above should be in the comment , it's a good explanation :)

Thanks!

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2016-12-10 19:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 16:49 [PATCH v3 0/5] Static memory controllers for the Aspeed SoC Cédric Le Goater
2016-12-09 16:49 ` [PATCH v3 1/5] mtd: spi-nor: add memory controllers for the Aspeed AST2500 SoC Cédric Le Goater
2016-12-10  4:01   ` Marek Vasut
2016-12-10 17:34     ` Cédric Le Goater
2016-12-10 19:08       ` Marek Vasut [this message]
2016-12-12  0:05   ` Joel Stanley
2016-12-12  5:02   ` Joel Stanley
2016-12-12  9:57     ` Cédric Le Goater
2016-12-09 16:49 ` [PATCH v3 2/5] mtd: aspeed: add memory controllers for the Aspeed AST2400 SoC Cédric Le Goater
2016-12-10  4:03   ` Marek Vasut
2016-12-10 17:18     ` Cédric Le Goater
2016-12-10 17:30       ` Marek Vasut
2016-12-12  0:10   ` Joel Stanley
2016-12-09 16:49 ` [PATCH v3 3/5] mtd: aspeed: used a label property Cédric Le Goater
2016-12-10  4:03   ` Marek Vasut
2016-12-10 17:16     ` Cédric Le Goater
2016-12-11 23:46   ` Joel Stanley
2016-12-12  2:27     ` Marek Vasut
2016-12-12  9:18       ` Cédric Le Goater
2016-12-09 16:49 ` [PATCH v3 4/5] mtd: spi-nor: bindings for the Aspeed memory controllers Cédric Le Goater
2016-12-12  0:13   ` Joel Stanley
2016-12-09 16:49 ` [PATCH v3 5/5] mtd: spi-nor: add a label property to jedec,spi-nor Cédric Le Goater
2016-12-11 23:47   ` [PATCH v3 5/5] mtd: spi-nor: add a label property to jedec, spi-nor Joel Stanley

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=2b51e3b8-5d02-c045-63c6-fcb0c9f8f460@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=clg@kaod.org \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=joel@jms.id.au \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).