From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/5] drivers: memory: Introduce Marvell EBU Device Bus driver
Date: Fri, 5 Apr 2013 15:45:10 -0600 [thread overview]
Message-ID: <20130405214510.GB16221@obsidianresearch.com> (raw)
In-Reply-To: <1365196320-15084-2-git-send-email-ezequiel.garcia@free-electrons.com>
On Fri, Apr 05, 2013 at 06:11:56PM -0300, Ezequiel Garcia wrote:
> +The reg property must specify the chip select as:
> +
> + 0: DEV_BOOTCS
> + 1: DEV_CS0
> + 2: DEV_CS1
> + 3: DEV_CS2
> + 4: DEV_CS3
I look at this and sort of go 'hmm'. These are basically register
offsets into the block starting at 0xd0010400. I don't see any
registers that are shared between targets. It would be simpler to keep
each target as a seperate node and seperate driver instance.
Combining that idea with the suggestion for target-id centric mbus DT
binding:
bootcs at d0010400 {
compatible = "marvell,armada370-devbus";
ranges = <0 MAPDEF_BOOTCS 0x1000>
reg = <MAPDEF_INTERNAL + 0x10400 0x8>; // boot cs register set
devbus,dev-width = <1>;
[..] etc
rom at 0 {
reg = <0 0x1000>
}
}
bus_cs3 at d0010400 {
compatible = "marvell,armada370-devbus";
ranges = <0 MAPDEF_BUS_CS3 0x1000>
reg = <MAPDEF_INTERNAL + 0x10408 0x8>; // cs3 register set
devbus,dev-width = <1>;
[..] etc
device at 0 {
reg = <0 0x1000>
}
}
Which follows the usual DT convention that the parent bus sets up
properties that apply to all children.
This isn't a major point, but give it a think :)
> +static void get_timing_param_ps(struct devbus *devbus,
> + struct device_node *node,
> + const char *name,
> + u32 *ticks)
> +{
> + u32 time_ps;
> +
> + of_property_read_u32(node, name, &time_ps);
> +
> + *ticks = (time_ps + devbus->tick_ps - 1) / devbus->tick_ps;
> +
> + dev_dbg(devbus->dev, "%s: %u ps -> 0x%x\n",
> + name, time_ps, *ticks);
> +}
It looks like there is a problem here, if the properties are not
present then what value will be in time_ps?
The driver should probably fail to load if any timing parameter is
missing from the DT??
> + /*
> + * We probe NOR/NAND with different functions, because
> + * we expect them to have some different parameters.
> + * If this turns out not to be the case, we'll be able
> + * to use any name for the child, and rename to devbus_probe_child().
> + */
This statement seems confusing, all this driver does is set
READ_PARAM_OFFSET/WRITE_PARAM_OFFSET - are there other NAND specific
registers? What NOR/NAND difference do you imagine?
I gave it all a quick look over and it looks broadly OK to me
otherwise.
Regards,
Jason
next prev parent reply other threads:[~2013-04-05 21:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-05 21:11 [PATCH v2 0/5] Device Bus support for Marvell EBU SoC Ezequiel Garcia
2013-04-05 21:11 ` [PATCH v2 1/5] drivers: memory: Introduce Marvell EBU Device Bus driver Ezequiel Garcia
2013-04-05 21:45 ` Jason Gunthorpe [this message]
2013-04-05 22:09 ` Ezequiel Garcia
2013-04-06 13:32 ` Arnd Bergmann
2013-04-05 21:11 ` [PATCH v2 2/5] ARM: mvebu: Add Device Bus support for Armada 370/XP SoC Ezequiel Garcia
2013-04-05 21:11 ` [PATCH v2 3/5] ARM: mvebu: Add support for NOR flash device on Armada XP-GP board Ezequiel Garcia
2013-04-05 21:11 ` [PATCH v2 4/5] ARM: mvebu: Add support for NOR flash device on Openblocks AX3 board Ezequiel Garcia
2013-04-05 21:12 ` [PATCH v2 5/5] ARM: mvebu: Add Device Bus and CFI flash memory support to defconfig Ezequiel Garcia
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=20130405214510.GB16221@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.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