From: khilman@baylibre.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: memory: da8xx-ddrctl: new driver
Date: Thu, 27 Oct 2016 09:55:58 -0700 [thread overview]
Message-ID: <m2insdg28x.fsf@baylibre.com> (raw)
In-Reply-To: <1477503355-2600-2-git-send-email-bgolaszewski@baylibre.com> (Bartosz Golaszewski's message of "Wed, 26 Oct 2016 19:35:54 +0200")
Bartosz Golaszewski <bgolaszewski@baylibre.com> writes:
> Create a new driver for the da8xx DDR2/mDDR controller and implement
> support for writing to the Peripheral Bus Burst Priority Register.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
[...]
> + for (; setting->name; setting++) {
> + knob = da8xx_ddrctl_match_knob(setting);
> + if (!knob) {
> + dev_warn(dev,
> + "no such config option: %s\n", setting->name);
> + continue;
> + }
> +
> + if (knob->reg > (res->end - res->start - sizeof(u32))) {
Why the "- sizeof(u32)"? Shouldn't this just be resource_size(res)?
(c.f. linux/ioport.h)
> + dev_warn(dev,
> + "register offset of '%s' exceeds mapped memory size\n",
> + knob->name);
> + continue;
> + }
> +
> + reg = __raw_readl(ddrctl + knob->reg);
> + reg &= knob->mask;
> + reg |= setting->val << knob->shift;
> +
> + dev_dbg(dev, "writing 0x%08x to %s\n", reg, setting->name);
> +
> + __raw_writel(reg, ddrctl + knob->reg);
Can you use the normal readl/writel here? Or explain why the raw ones
are needed?
> + }
> +
> + return 0;
> +}
> +
Otherwise, looks good to me. With the changes above, feel free to add
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Kevin
WARNING: multiple messages have this Message-ID (diff)
From: Kevin Hilman <khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
Cc: Michael Turquette
<mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Frank Rowand
<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Peter Ujfalusi <peter.ujfalusi-l0cyMroinI0@public.gmane.org>,
Russell King <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
arm-soc
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
linux-drm
<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
linux-devicetree
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>,
Tomi Valkeinen <tomi.valkeinen-l0cyMroinI0@public.gmane.org>,
David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Subject: Re: [PATCH 1/2] ARM: memory: da8xx-ddrctl: new driver
Date: Thu, 27 Oct 2016 09:55:58 -0700 [thread overview]
Message-ID: <m2insdg28x.fsf@baylibre.com> (raw)
In-Reply-To: <1477503355-2600-2-git-send-email-bgolaszewski-rdvid1DuHRBWk0Htik3J/w@public.gmane.org> (Bartosz Golaszewski's message of "Wed, 26 Oct 2016 19:35:54 +0200")
Bartosz Golaszewski <bgolaszewski-rdvid1DuHRBWk0Htik3J/w@public.gmane.org> writes:
> Create a new driver for the da8xx DDR2/mDDR controller and implement
> support for writing to the Peripheral Bus Burst Priority Register.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
[...]
> + for (; setting->name; setting++) {
> + knob = da8xx_ddrctl_match_knob(setting);
> + if (!knob) {
> + dev_warn(dev,
> + "no such config option: %s\n", setting->name);
> + continue;
> + }
> +
> + if (knob->reg > (res->end - res->start - sizeof(u32))) {
Why the "- sizeof(u32)"? Shouldn't this just be resource_size(res)?
(c.f. linux/ioport.h)
> + dev_warn(dev,
> + "register offset of '%s' exceeds mapped memory size\n",
> + knob->name);
> + continue;
> + }
> +
> + reg = __raw_readl(ddrctl + knob->reg);
> + reg &= knob->mask;
> + reg |= setting->val << knob->shift;
> +
> + dev_dbg(dev, "writing 0x%08x to %s\n", reg, setting->name);
> +
> + __raw_writel(reg, ddrctl + knob->reg);
Can you use the normal readl/writel here? Or explain why the raw ones
are needed?
> + }
> +
> + return 0;
> +}
> +
Otherwise, looks good to me. With the changes above, feel free to add
Reviewed-by: Kevin Hilman <khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
Kevin
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Kevin Hilman <khilman@baylibre.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Michael Turquette <mturquette@baylibre.com>,
Sekhar Nori <nsekhar@ti.com>, Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Russell King <linux@armlinux.org.uk>,
LKML <linux-kernel@vger.kernel.org>,
arm-soc <linux-arm-kernel@lists.infradead.org>,
linux-drm <dri-devel@lists.freedesktop.org>,
linux-devicetree <devicetree@vger.kernel.org>,
Jyri Sarha <jsarha@ti.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
David Airlie <airlied@linux.ie>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH 1/2] ARM: memory: da8xx-ddrctl: new driver
Date: Thu, 27 Oct 2016 09:55:58 -0700 [thread overview]
Message-ID: <m2insdg28x.fsf@baylibre.com> (raw)
In-Reply-To: <1477503355-2600-2-git-send-email-bgolaszewski@baylibre.com> (Bartosz Golaszewski's message of "Wed, 26 Oct 2016 19:35:54 +0200")
Bartosz Golaszewski <bgolaszewski@baylibre.com> writes:
> Create a new driver for the da8xx DDR2/mDDR controller and implement
> support for writing to the Peripheral Bus Burst Priority Register.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
[...]
> + for (; setting->name; setting++) {
> + knob = da8xx_ddrctl_match_knob(setting);
> + if (!knob) {
> + dev_warn(dev,
> + "no such config option: %s\n", setting->name);
> + continue;
> + }
> +
> + if (knob->reg > (res->end - res->start - sizeof(u32))) {
Why the "- sizeof(u32)"? Shouldn't this just be resource_size(res)?
(c.f. linux/ioport.h)
> + dev_warn(dev,
> + "register offset of '%s' exceeds mapped memory size\n",
> + knob->name);
> + continue;
> + }
> +
> + reg = __raw_readl(ddrctl + knob->reg);
> + reg &= knob->mask;
> + reg |= setting->val << knob->shift;
> +
> + dev_dbg(dev, "writing 0x%08x to %s\n", reg, setting->name);
> +
> + __raw_writel(reg, ddrctl + knob->reg);
Can you use the normal readl/writel here? Or explain why the raw ones
are needed?
> + }
> +
> + return 0;
> +}
> +
Otherwise, looks good to me. With the changes above, feel free to add
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Kevin
next prev parent reply other threads:[~2016-10-27 16:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 17:35 [PATCH 0/2] ARM: da850: new drivers for better LCDC support Bartosz Golaszewski
2016-10-26 17:35 ` Bartosz Golaszewski
2016-10-26 17:35 ` Bartosz Golaszewski
2016-10-26 17:35 ` [PATCH 1/2] ARM: memory: da8xx-ddrctl: new driver Bartosz Golaszewski
2016-10-26 17:35 ` Bartosz Golaszewski
2016-10-26 17:35 ` Bartosz Golaszewski
2016-10-27 16:55 ` Kevin Hilman [this message]
2016-10-27 16:55 ` Kevin Hilman
2016-10-27 16:55 ` Kevin Hilman
2016-10-31 4:27 ` Rob Herring
2016-10-31 4:27 ` Rob Herring
2016-10-31 4:27 ` Rob Herring
2016-10-26 17:35 ` [PATCH 2/2] ARM: bus: da8xx-mstpri: " Bartosz Golaszewski
2016-10-26 17:35 ` Bartosz Golaszewski
2016-10-31 4:30 ` Rob Herring
2016-10-31 4:30 ` Rob Herring
2016-10-31 9:40 ` Bartosz Golaszewski
2016-10-31 9:40 ` Bartosz Golaszewski
2016-10-31 9:52 ` Sekhar Nori
2016-10-31 9:52 ` Sekhar Nori
2016-10-31 9:52 ` Sekhar Nori
2016-10-31 9:54 ` Bartosz Golaszewski
2016-10-31 9:54 ` Bartosz Golaszewski
2016-10-31 9:54 ` Bartosz Golaszewski
2016-10-31 10:31 ` Sekhar Nori
2016-10-31 10:31 ` Sekhar Nori
2016-10-31 10:31 ` Sekhar Nori
2016-10-31 18:22 ` Kevin Hilman
2016-10-31 18:22 ` Kevin Hilman
2016-10-31 18:22 ` Kevin Hilman
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=m2insdg28x.fsf@baylibre.com \
--to=khilman@baylibre.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 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.