* [PATCH 08/16] ARM: bL_platsmp.c: make sure the GIC interface of a dying CPU is disabled
From: Santosh Shilimkar @ 2013-01-13 4:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.LFD.2.02.1301121134390.6300@xanadu.home>
On Saturday 12 January 2013 10:17 PM, Nicolas Pitre wrote:
> On Sat, 12 Jan 2013, Santosh Shilimkar wrote:
>
>> On Saturday 12 January 2013 12:37 AM, Nicolas Pitre wrote:
>>> On Fri, 11 Jan 2013, Santosh Shilimkar wrote:
>>>
>>>> On Thursday 10 January 2013 05:50 AM, Nicolas Pitre wrote:
>>>>> Otherwise there might be some interrupts or IPIs becoming pending and
>>>>> the
>>>>> CPU will not enter low power mode when doing a WFI. The effect of this
>>>>> is a CPU that loops back into the kernel, go through the first man
>>>>> election, signals itself as alive, and prevent the cluster from being
>>>>> shut down.
>>>>>
>>>>> This could benefit from a better solution.
>>>>>
>>>>> Signed-off-by: Nicolas Pitre <nico@linaro.org>
>>>>> ---
>>>>> arch/arm/common/bL_platsmp.c | 1 +
>>>>> arch/arm/common/gic.c | 6 ++++++
>>>>> arch/arm/include/asm/hardware/gic.h | 2 ++
>>>>> 3 files changed, 9 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm/common/bL_platsmp.c b/arch/arm/common/bL_platsmp.c
>>>>> index 0ae44123bf..6a3b251b97 100644
>>>>> --- a/arch/arm/common/bL_platsmp.c
>>>>> +++ b/arch/arm/common/bL_platsmp.c
>>>>> @@ -68,6 +68,7 @@ static void __ref bL_cpu_die(unsigned int cpu)
>>>>> pcpu = mpidr & 0xff;
>>>>> pcluster = (mpidr >> 8) & 0xff;
>>>>> bL_set_entry_vector(pcpu, pcluster, NULL);
>>>>> + gic_cpu_if_down();
>>>>
>>>> So for a case where CPU still don't power down for some reason even
>>>> after CPU interface is disabled, can not listen to and SGI or PPI.
>>>> Not sure if this happens on big.LITTLE but i have seen one such issue
>>>> on Cortex-A9 based SOC.
>>>
>>> Here the problem was the reverse i.e. a CPU wouldn't go down because
>>> some pending SGIs prevented that.
>>>
>> I understood that part. What I was saying is, with CPU IF disabled and
>> if CPU doesn't enter into the intended low power state and if the wakeup
>> mechanism on that CPU is SGI/SPI, CPU may never wakeup and can lead to
>> dead lock. I have seen this scenario on OMAP especially in CPUidle path.
>
> Obviously, on the CPU idle path, you should not turn off the GIC
> interface as this might lose the ability to wake the CPU up with a
> pending interrupt, if your system is so configured.
>
> Here this is the CPU hot unplug path and we don't want the CPU to be
> awaken at all until we explicitly do something to wake it back up.
>
I see.
> However, in theory, all interrupts should have been migrated away from
> this CPU, so there shouldn't be any need for this. I should revisit the
> test that led me to create this patch.
>
Thats right from hot-plug path and SPI are concerned. But SGI/PPI can
still wakeup CPU and there is no migration as such since they are local
to that
>> It may not be relevant for switcher considering, you almost force CPU to
>> enter to low power state :-)
>
> The switcher doesn't use cpu_die() but calls into bL_cpu_power_down()
> directly.
>
Good to know that.
Regards,
Santosh
^ permalink raw reply
* [PATCH v2] clk: max77686: Remove unnecessary NULL checking for container_of()
From: Mike Turquette @ 2013-01-13 4:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1357984906.6460.2.camel@phoenix>
Quoting Axel Lin (2013-01-12 02:01:46)
> container_of() never returns NULL, thus remove the NULL checking for it.
> Also rename get_max77686_clk() to to_max77686_clk() for better readability.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> v2: remove unrelated change for ~max77686->mask
> drivers/clk/clk-max77686.c | 28 +++++++---------------------
> 1 file changed, 7 insertions(+), 21 deletions(-)
>
This looks good. Taken into clk-next. I appreciate the respin.
Thanks,
Mike
> diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
> index 8944214..90bf59c 100644
> --- a/drivers/clk/clk-max77686.c
> +++ b/drivers/clk/clk-max77686.c
> @@ -44,33 +44,23 @@ struct max77686_clk {
> struct clk_lookup *lookup;
> };
>
> -static struct max77686_clk *get_max77686_clk(struct clk_hw *hw)
> +static struct max77686_clk *to_max77686_clk(struct clk_hw *hw)
> {
> return container_of(hw, struct max77686_clk, hw);
> }
>
> static int max77686_clk_prepare(struct clk_hw *hw)
> {
> - struct max77686_clk *max77686;
> - int ret;
> -
> - max77686 = get_max77686_clk(hw);
> - if (!max77686)
> - return -ENOMEM;
> -
> - ret = regmap_update_bits(max77686->iodev->regmap,
> - MAX77686_REG_32KHZ, max77686->mask, max77686->mask);
> + struct max77686_clk *max77686 = to_max77686_clk(hw);
>
> - return ret;
> + return regmap_update_bits(max77686->iodev->regmap,
> + MAX77686_REG_32KHZ, max77686->mask,
> + max77686->mask);
> }
>
> static void max77686_clk_unprepare(struct clk_hw *hw)
> {
> - struct max77686_clk *max77686;
> -
> - max77686 = get_max77686_clk(hw);
> - if (!max77686)
> - return;
> + struct max77686_clk *max77686 = to_max77686_clk(hw);
>
> regmap_update_bits(max77686->iodev->regmap,
> MAX77686_REG_32KHZ, max77686->mask, ~max77686->mask);
> @@ -78,14 +68,10 @@ static void max77686_clk_unprepare(struct clk_hw *hw)
>
> static int max77686_clk_is_enabled(struct clk_hw *hw)
> {
> - struct max77686_clk *max77686;
> + struct max77686_clk *max77686 = to_max77686_clk(hw);
> int ret;
> u32 val;
>
> - max77686 = get_max77686_clk(hw);
> - if (!max77686)
> - return -ENOMEM;
> -
> ret = regmap_read(max77686->iodev->regmap,
> MAX77686_REG_32KHZ, &val);
>
> --
> 1.7.9.5
^ permalink raw reply
* [PATCH] mmc: vt8500: Remove erroneous __exitp in wmt_mci_driver
From: Tony Prisk @ 2013-01-13 6:19 UTC (permalink / raw)
To: linux-arm-kernel
With the __devinit/__devexit attributes having been removed, this
__exitp attribute causes an unused function warning and should be
removed as well.
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
---
drivers/mmc/host/wmt-sdmmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
index 154f0e8..c6d0015 100644
--- a/drivers/mmc/host/wmt-sdmmc.c
+++ b/drivers/mmc/host/wmt-sdmmc.c
@@ -1012,7 +1012,7 @@ static const struct dev_pm_ops wmt_mci_pm = {
static struct platform_driver wmt_mci_driver = {
.probe = wmt_mci_probe,
- .remove = __exit_p(wmt_mci_remove),
+ .remove = wmt_mci_remove,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/7] clk: add common of_clk_init() function
From: Maxime Ripard @ 2013-01-13 8:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1357282858-2112-1-git-send-email-pgaikwad@nvidia.com>
Hi Prashant,
On 04/01/2013 08:00, Prashant Gaikwad wrote:
> Modify of_clk_init function so that it will determine which
> driver to initialize based on device tree instead of each driver
> registering to it.
>
> Based on a similar patch for drivers/irqchip by Thomas Petazzoni and
> drivers/clocksource by Stephen Warren.
I finally had some time to test your changes on sunxi, and you can add
for patches 1 and 3:
Acked-by: Maxime Ripard <maxime.ripard@anandra.org>
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply
* [PATCH 10/14] PCI: tegra: Move PCIe driver to drivers/pci/host
From: Thierry Reding @ 2013-01-13 9:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201301122112.25772.arnd@arndb.de>
On Sat, Jan 12, 2013 at 09:12:25PM +0000, Arnd Bergmann wrote:
> On Saturday 12 January 2013, Thierry Reding wrote:
> > > I already hinted at that in one of the other subthreads. Having such a
> > > multiplex would also allow the driver to be built as a module. I had
> > > already thought about this when I was working on an earlier version of
> > > these patches. Basically these would be two ops attached to the host
> > > bridge, and the generic arch_setup_msi_irq() could then look that up
> > > given the struct pci_dev that is passed to it and call this new per-
> > > host bridge .setup_msi_irq().
> >
> > struct pci_ops looks like a good place to put these. They'll be
> > available from each struct pci_bus, so should be easy to call from
> > arch_setup_msi_irq().
> >
> > Any objections?
> >
>
> struct pci_ops has a long history of being specifically about
> config space read/write operations, so on the one hand it does
> not feel like the right place to put interrupt specific operations,
> but on the other hand, the name sounds appropriate and I cannot
> think of any other place to put this, so it's fine with me.
>
> The only alternative I can think of is to introduce a new
> structure next to it in struct pci_bus, but that feels a bit
> pointless. Maybe Bjorn has a preference one way or the other.
The name pci_ops is certainly generic enough. Also the comment above the
structure declaration says "Low-level architecture-dependent routines",
which applies to the MSI functions as well.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130113/5c4fb437/attachment.sig>
^ permalink raw reply
* [PATCH 1/2 V4] iio: mxs: Implement support for touchscreen
From: Jonathan Cameron @ 2013-01-13 10:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130113030903.GA27264@core.coreip.homeip.net>
On 01/13/2013 03:09 AM, Dmitry Torokhov wrote:
> On Sat, Jan 12, 2013 at 12:35:07AM +0100, Marek Vasut wrote:
>> This patch implements support for sampling of a touchscreen into
>> the MXS LRADC driver. The LRADC block allows configuring some of
>> it's channels into special mode where they either output the drive
>> voltage or sample it, allowing it to operate a 4-wire or 5-wire
>> resistive touchscreen.
>>
>> In case the touchscreen mode is enabled, the LRADC slot #7 is
>> reserved for touchscreen only, therefore it is not possible to
>> sample 8 LRADC channels at time, but only 7 channels.
>>
>> The touchscreen controller is configured such that the PENDOWN event
>> disables touchscreen interrupts and triggers execution of worker
>> thread, which then polls the touchscreen controller for X, Y and
>> Pressure values. This reduces the overhead of interrupt-driven
>> operation. Upon the PENUP event, the worker thread re-enables the
>> PENDOWN detection interrupt and exits.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
I've added this to the togreg branch of
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
Note it did not directly apply as I'm guessing you have a slightly
out of date tree. Please could you check I didn't mess up the
fixing up of the patch. There was a fair bit of fuzz and the devinit
devexit stuff shouldn't have been in your patch in the first place.
Shawn, do you want to take the board device tree patch or shall
I take that one as well?
Jonathan
>
>> Cc: Fabio Estevam <fabio.estevam@freescale.com>
>> Cc: Jonathan Cameron <jic23@kernel.org>
>> Cc: Shawn Guo <shawn.guo@linaro.org>
>> ---
>> .../bindings/staging/iio/adc/mxs-lradc.txt | 6 +
>> drivers/staging/iio/adc/mxs-lradc.c | 472 +++++++++++++++++++-
>> 2 files changed, 454 insertions(+), 24 deletions(-)
>>
>> V2: - Replace the use_touchscreen* with enum mxs_lradc_ts, which now tracks
>> touchscreen state (OFF, 4-wire, 5-wire)
>> - Add "stop_touchscreen" bit, which indicates the touchscreen is going down
>> and makes the driver not re-enable touchscreen interrupts and start any
>> new touchscreen works.
>> - Make all bitfields "unsigned int" instead of plain "int"
>> - Use switch(plate) in mxs_lradc_ts_sample()
>> - Cancel touchscreen thread in mxs_lradc_ts_close(), do this only after
>> we are sure touchscreen interrupt is off and will never be re-enabled.
>> This avoids serious race condition.
>> - Call input_free_device() if input_register_device() fails to avoid memory
>> leak.
>> - Do not call input_free_device() after input_unregister_device() in
>> mxs_lradc_ts_unregister() to avoid double-free
>>
>> V3: - Replace bitfields with bools
>> - Make sure touchscreen workQ doesn't cause race condition upon closing
>> the input device
>> - Make touchscreen allocation failure fatal
>> - Remove redundant check for lradc->ts_input in mxs_lradc_ts_unregister()
>> - Drop __devinit and __devexit
>>
>> V4: - Do not unconfigure lradc->use_touchscreen in mxs_lradc_ts_register()
>> when the probe fails
>> - Return true/false from mxs_lradc_validate_scan_mask() instead of 1/0
>>
>> diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
>> index 801d58c..4688205 100644
>> --- a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
>> +++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
>> @@ -5,6 +5,12 @@ Required properties:
>> - reg: Address and length of the register set for the device
>> - interrupts: Should contain the LRADC interrupts
>>
>> +Optional properties:
>> +- fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen
>> + to LRADC. Valid value is either 4 or 5. If this
>> + property is not present, then the touchscreen is
>> + disabled.
>> +
>> Examples:
>>
>> lradc at 80050000 {
>> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
>> index 6249957..5a544d4 100644
>> --- a/drivers/staging/iio/adc/mxs-lradc.c
>> +++ b/drivers/staging/iio/adc/mxs-lradc.c
>> @@ -32,6 +32,8 @@
>> #include <linux/stmp_device.h>
>> #include <linux/bitops.h>
>> #include <linux/completion.h>
>> +#include <linux/delay.h>
>> +#include <linux/input.h>
>>
>> #include <mach/mxs.h>
>> #include <mach/common.h>
>> @@ -59,6 +61,21 @@
>> #define LRADC_DELAY_TIMER_PER 200
>> #define LRADC_DELAY_TIMER_LOOP 5
>>
>> +/*
>> + * Once the pen touches the touchscreen, the touchscreen switches from
>> + * IRQ-driven mode to polling mode to prevent interrupt storm. The polling
>> + * is realized by worker thread, which is called every 20 or so milliseconds.
>> + * This gives the touchscreen enough fluence and does not strain the system
>> + * too much.
>> + */
>> +#define LRADC_TS_SAMPLE_DELAY_MS 5
>> +
>> +/*
>> + * The LRADC reads the following amount of samples from each touchscreen
>> + * channel and the driver then computes avarage of these.
>> + */
>> +#define LRADC_TS_SAMPLE_AMOUNT 4
>> +
>> static const char * const mxs_lradc_irq_name[] = {
>> "mxs-lradc-touchscreen",
>> "mxs-lradc-thresh0",
>> @@ -75,6 +92,12 @@ static const char * const mxs_lradc_irq_name[] = {
>> "mxs-lradc-button1",
>> };
>>
>> +enum mxs_lradc_ts {
>> + MXS_LRADC_TOUCHSCREEN_NONE = 0,
>> + MXS_LRADC_TOUCHSCREEN_4WIRE,
>> + MXS_LRADC_TOUCHSCREEN_5WIRE,
>> +};
>> +
>> struct mxs_lradc {
>> struct device *dev;
>> void __iomem *base;
>> @@ -86,21 +109,69 @@ struct mxs_lradc {
>> struct mutex lock;
>>
>> struct completion completion;
>> +
>> + /*
>> + * Touchscreen LRADC channels receives a private slot in the CTRL4
>> + * register, the slot #7. Therefore only 7 slots instead of 8 in the
>> + * CTRL4 register can be mapped to LRADC channels when using the
>> + * touchscreen.
>> + *
>> + * Furthermore, certain LRADC channels are shared between touchscreen
>> + * and/or touch-buttons and generic LRADC block. Therefore when using
>> + * either of these, these channels are not available for the regular
>> + * sampling. The shared channels are as follows:
>> + *
>> + * CH0 -- Touch button #0
>> + * CH1 -- Touch button #1
>> + * CH2 -- Touch screen XPUL
>> + * CH3 -- Touch screen YPLL
>> + * CH4 -- Touch screen XNUL
>> + * CH5 -- Touch screen YNLR
>> + * CH6 -- Touch screen WIPER (5-wire only)
>> + *
>> + * The bitfields below represents which parts of the LRADC block are
>> + * switched into special mode of operation. These channels can not
>> + * be sampled as regular LRADC channels. The driver will refuse any
>> + * attempt to sample these channels.
>> + */
>> +#define CHAN_MASK_TOUCHBUTTON (0x3 << 0)
>> +#define CHAN_MASK_TOUCHSCREEN_4WIRE (0xf << 2)
>> +#define CHAN_MASK_TOUCHSCREEN_5WIRE (0x1f << 2)
>> + enum mxs_lradc_ts use_touchscreen;
>> + bool stop_touchscreen;
>> + bool use_touchbutton;
>> +
>> + struct input_dev *ts_input;
>> + struct work_struct ts_work;
>> };
>>
>> #define LRADC_CTRL0 0x00
>> -#define LRADC_CTRL0_TOUCH_DETECT_ENABLE (1 << 23)
>> -#define LRADC_CTRL0_TOUCH_SCREEN_TYPE (1 << 22)
>> +#define LRADC_CTRL0_TOUCH_DETECT_ENABLE (1 << 23)
>> +#define LRADC_CTRL0_TOUCH_SCREEN_TYPE (1 << 22)
>> +#define LRADC_CTRL0_YNNSW /* YM */ (1 << 21)
>> +#define LRADC_CTRL0_YPNSW /* YP */ (1 << 20)
>> +#define LRADC_CTRL0_YPPSW /* YP */ (1 << 19)
>> +#define LRADC_CTRL0_XNNSW /* XM */ (1 << 18)
>> +#define LRADC_CTRL0_XNPSW /* XM */ (1 << 17)
>> +#define LRADC_CTRL0_XPPSW /* XP */ (1 << 16)
>> +#define LRADC_CTRL0_PLATE_MASK (0x3f << 16)
>>
>> #define LRADC_CTRL1 0x10
>> -#define LRADC_CTRL1_LRADC_IRQ(n) (1 << (n))
>> -#define LRADC_CTRL1_LRADC_IRQ_MASK 0x1fff
>> +#define LRADC_CTRL1_TOUCH_DETECT_IRQ_EN (1 << 24)
>> #define LRADC_CTRL1_LRADC_IRQ_EN(n) (1 << ((n) + 16))
>> #define LRADC_CTRL1_LRADC_IRQ_EN_MASK (0x1fff << 16)
>> +#define LRADC_CTRL1_LRADC_IRQ_EN_OFFSET 16
>> +#define LRADC_CTRL1_TOUCH_DETECT_IRQ (1 << 8)
>> +#define LRADC_CTRL1_LRADC_IRQ(n) (1 << (n))
>> +#define LRADC_CTRL1_LRADC_IRQ_MASK 0x1fff
>> +#define LRADC_CTRL1_LRADC_IRQ_OFFSET 0
>>
>> #define LRADC_CTRL2 0x20
>> #define LRADC_CTRL2_TEMPSENSE_PWD (1 << 15)
>>
>> +#define LRADC_STATUS 0x40
>> +#define LRADC_STATUS_TOUCH_DETECT_RAW (1 << 0)
>> +
>> #define LRADC_CH(n) (0x50 + (0x10 * (n)))
>> #define LRADC_CH_ACCUMULATE (1 << 29)
>> #define LRADC_CH_NUM_SAMPLES_MASK (0x1f << 24)
>> @@ -132,6 +203,7 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
>> {
>> struct mxs_lradc *lradc = iio_priv(iio_dev);
>> int ret;
>> + unsigned long mask;
>>
>> if (m != IIO_CHAN_INFO_RAW)
>> return -EINVAL;
>> @@ -140,6 +212,12 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
>> if (chan->channel > LRADC_MAX_TOTAL_CHANS)
>> return -EINVAL;
>>
>> + /* Validate the channel if it doesn't intersect with reserved chans. */
>> + bitmap_set(&mask, chan->channel, 1);
>> + ret = iio_validate_scan_mask_onehot(iio_dev, &mask);
>> + if (ret)
>> + return -EINVAL;
>> +
>> /*
>> * See if there is no buffered operation in progess. If there is, simply
>> * bail out. This can be improved to support both buffered and raw IO at
>> @@ -161,7 +239,11 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
>> lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>> writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>>
>> - writel(chan->channel, lradc->base + LRADC_CTRL4);
>> + /* Clean the slot's previous content, then set new one. */
>> + writel(LRADC_CTRL4_LRADCSELECT_MASK(0),
>> + lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_CLR);
>> + writel(chan->channel, lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_SET);
>> +
>> writel(0, lradc->base + LRADC_CH(0));
>>
>> /* Enable the IRQ and start sampling the channel. */
>> @@ -195,6 +277,269 @@ static const struct iio_info mxs_lradc_iio_info = {
>> };
>>
>> /*
>> + * Touchscreen handling
>> + */
>> +enum lradc_ts_plate {
>> + LRADC_SAMPLE_X,
>> + LRADC_SAMPLE_Y,
>> + LRADC_SAMPLE_PRESSURE,
>> +};
>> +
>> +static int mxs_lradc_ts_touched(struct mxs_lradc *lradc)
>> +{
>> + uint32_t reg;
>> +
>> + /* Enable touch detection. */
>> + writel(LRADC_CTRL0_PLATE_MASK,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>> + writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>> +
>> + msleep(LRADC_TS_SAMPLE_DELAY_MS);
>> +
>> + reg = readl(lradc->base + LRADC_STATUS);
>> +
>> + return reg & LRADC_STATUS_TOUCH_DETECT_RAW;
>> +}
>> +
>> +static int32_t mxs_lradc_ts_sample(struct mxs_lradc *lradc,
>> + enum lradc_ts_plate plate, int change)
>> +{
>> + unsigned long delay, jiff;
>> + uint32_t reg, ctrl0 = 0, chan = 0;
>> + /* The touchscreen always uses CTRL4 slot #7. */
>> + const uint8_t slot = 7;
>> + uint32_t val;
>> +
>> + /*
>> + * There are three correct configurations of the controller sampling
>> + * the touchscreen, each of these configuration provides different
>> + * information from the touchscreen.
>> + *
>> + * The following table describes the sampling configurations:
>> + * +-------------+-------+-------+-------+
>> + * | Wire \ Axis | X | Y | Z |
>> + * +---------------------+-------+-------+
>> + * | X+ (CH2) | HI | TS | TS |
>> + * +-------------+-------+-------+-------+
>> + * | X- (CH4) | LO | SH | HI |
>> + * +-------------+-------+-------+-------+
>> + * | Y+ (CH3) | SH | HI | HI |
>> + * +-------------+-------+-------+-------+
>> + * | Y- (CH5) | TS | LO | SH |
>> + * +-------------+-------+-------+-------+
>> + *
>> + * HI ... strong '1' ; LO ... strong '0'
>> + * SH ... sample here ; TS ... tri-state
>> + *
>> + * There are a few other ways of obtaining the Z coordinate
>> + * (aka. pressure), but the one in the table seems to be the
>> + * most reliable one.
>> + */
>> + switch (plate) {
>> + case LRADC_SAMPLE_X:
>> + ctrl0 = LRADC_CTRL0_XPPSW | LRADC_CTRL0_XNNSW;
>> + chan = 3;
>> + break;
>> + case LRADC_SAMPLE_Y:
>> + ctrl0 = LRADC_CTRL0_YPPSW | LRADC_CTRL0_YNNSW;
>> + chan = 4;
>> + break;
>> + case LRADC_SAMPLE_PRESSURE:
>> + ctrl0 = LRADC_CTRL0_YPPSW | LRADC_CTRL0_XNNSW;
>> + chan = 5;
>> + break;
>> + }
>> +
>> + if (change) {
>> + writel(LRADC_CTRL0_PLATE_MASK,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>> + writel(ctrl0, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>> +
>> + writel(LRADC_CTRL4_LRADCSELECT_MASK(slot),
>> + lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_CLR);
>> + writel(chan << LRADC_CTRL4_LRADCSELECT_OFFSET(slot),
>> + lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_SET);
>> + }
>> +
>> + writel(0xffffffff, lradc->base + LRADC_CH(slot) + STMP_OFFSET_REG_CLR);
>> + writel(1 << slot, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>> +
>> + delay = jiffies + msecs_to_jiffies(LRADC_TS_SAMPLE_DELAY_MS);
>> + do {
>> + jiff = jiffies;
>> + reg = readl_relaxed(lradc->base + LRADC_CTRL1);
>> + if (reg & LRADC_CTRL1_LRADC_IRQ(slot))
>> + break;
>> + } while (time_before(jiff, delay));
>> +
>> + writel(LRADC_CTRL1_LRADC_IRQ(slot),
>> + lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>> +
>> + if (time_after_eq(jiff, delay))
>> + return -ETIMEDOUT;
>> +
>> + val = readl(lradc->base + LRADC_CH(slot));
>> + val &= LRADC_CH_VALUE_MASK;
>> +
>> + return val;
>> +}
>> +
>> +static int32_t mxs_lradc_ts_sample_filter(struct mxs_lradc *lradc,
>> + enum lradc_ts_plate plate)
>> +{
>> + int32_t val, tot = 0;
>> + int i;
>> +
>> + val = mxs_lradc_ts_sample(lradc, plate, 1);
>> +
>> + /* Delay a bit so the touchscreen is stable. */
>> + mdelay(2);
>> +
>> + for (i = 0; i < LRADC_TS_SAMPLE_AMOUNT; i++) {
>> + val = mxs_lradc_ts_sample(lradc, plate, 0);
>> + tot += val;
>> + }
>> +
>> + return tot / LRADC_TS_SAMPLE_AMOUNT;
>> +}
>> +
>> +static void mxs_lradc_ts_work(struct work_struct *ts_work)
>> +{
>> + struct mxs_lradc *lradc = container_of(ts_work,
>> + struct mxs_lradc, ts_work);
>> + int val_x, val_y, val_p;
>> + bool valid = false;
>> +
>> + while (mxs_lradc_ts_touched(lradc)) {
>> + /* Disable touch detector so we can sample the touchscreen. */
>> + writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>> +
>> + if (likely(valid)) {
>> + input_report_abs(lradc->ts_input, ABS_X, val_x);
>> + input_report_abs(lradc->ts_input, ABS_Y, val_y);
>> + input_report_abs(lradc->ts_input, ABS_PRESSURE, val_p);
>> + input_report_key(lradc->ts_input, BTN_TOUCH, 1);
>> + input_sync(lradc->ts_input);
>> + }
>> +
>> + valid = false;
>> +
>> + val_x = mxs_lradc_ts_sample_filter(lradc, LRADC_SAMPLE_X);
>> + if (val_x < 0)
>> + continue;
>> + val_y = mxs_lradc_ts_sample_filter(lradc, LRADC_SAMPLE_Y);
>> + if (val_y < 0)
>> + continue;
>> + val_p = mxs_lradc_ts_sample_filter(lradc, LRADC_SAMPLE_PRESSURE);
>> + if (val_p < 0)
>> + continue;
>> +
>> + valid = true;
>> + }
>> +
>> + input_report_abs(lradc->ts_input, ABS_PRESSURE, 0);
>> + input_report_key(lradc->ts_input, BTN_TOUCH, 0);
>> + input_sync(lradc->ts_input);
>> +
>> + /* Do not restart the TS IRQ if the driver is shutting down. */
>> + if (lradc->stop_touchscreen)
>> + return;
>> +
>> + /* Restart the touchscreen interrupts. */
>> + writel(LRADC_CTRL1_TOUCH_DETECT_IRQ,
>> + lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>> + writel(LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
>> + lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
>> +}
>> +
>> +static int mxs_lradc_ts_open(struct input_dev *dev)
>> +{
>> + struct mxs_lradc *lradc = input_get_drvdata(dev);
>> +
>> + /* The touchscreen is starting. */
>> + lradc->stop_touchscreen = false;
>> +
>> + /* Enable the touch-detect circuitry. */
>> + writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>> +
>> + /* Enable the touch-detect IRQ. */
>> + writel(LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
>> + lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
>> +
>> + return 0;
>> +}
>> +
>> +static void mxs_lradc_ts_close(struct input_dev *dev)
>> +{
>> + struct mxs_lradc *lradc = input_get_drvdata(dev);
>> +
>> + /* Indicate the touchscreen is stopping. */
>> + lradc->stop_touchscreen = true;
>> + mb();
>> +
>> + /* Wait until touchscreen thread finishes any possible remnants. */
>> + cancel_work_sync(&lradc->ts_work);
>> +
>> + /* Disable touchscreen touch-detect IRQ. */
>> + writel(LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
>> + lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>> +
>> + /* Power-down touchscreen touch-detect circuitry. */
>> + writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>> +}
>> +
>> +static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
>> +{
>> + struct input_dev *input;
>> + struct device *dev = lradc->dev;
>> + int ret;
>> +
>> + if (!lradc->use_touchscreen)
>> + return 0;
>> +
>> + input = input_allocate_device();
>> + if (!input) {
>> + dev_err(dev, "Failed to allocate TS device!\n");
>> + return -ENOMEM;
>> + }
>> +
>> + input->name = DRIVER_NAME;
>> + input->id.bustype = BUS_HOST;
>> + input->dev.parent = dev;
>> + input->open = mxs_lradc_ts_open;
>> + input->close = mxs_lradc_ts_close;
>> +
>> + __set_bit(EV_ABS, input->evbit);
>> + __set_bit(EV_KEY, input->evbit);
>> + __set_bit(BTN_TOUCH, input->keybit);
>> + input_set_abs_params(input, ABS_X, 0, LRADC_CH_VALUE_MASK, 0, 0);
>> + input_set_abs_params(input, ABS_Y, 0, LRADC_CH_VALUE_MASK, 0, 0);
>> + input_set_abs_params(input, ABS_PRESSURE, 0, LRADC_CH_VALUE_MASK, 0, 0);
>> +
>> + lradc->ts_input = input;
>> + input_set_drvdata(input, lradc);
>> + ret = input_register_device(input);
>> + if (ret)
>> + input_free_device(lradc->ts_input);
>> +
>> + return ret;
>> +}
>> +
>> +static void mxs_lradc_ts_unregister(struct mxs_lradc *lradc)
>> +{
>> + if (!lradc->use_touchscreen)
>> + return;
>> +
>> + cancel_work_sync(&lradc->ts_work);
>> +
>> + input_unregister_device(lradc->ts_input);
>> +}
>> +
>> +/*
>> * IRQ Handling
>> */
>> static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
>> @@ -202,14 +547,24 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
>> struct iio_dev *iio = data;
>> struct mxs_lradc *lradc = iio_priv(iio);
>> unsigned long reg = readl(lradc->base + LRADC_CTRL1);
>> + const uint32_t ts_irq_mask =
>> + LRADC_CTRL1_TOUCH_DETECT_IRQ_EN |
>> + LRADC_CTRL1_TOUCH_DETECT_IRQ;
>>
>> if (!(reg & LRADC_CTRL1_LRADC_IRQ_MASK))
>> return IRQ_NONE;
>>
>> /*
>> - * Touchscreen IRQ handling code shall probably have priority
>> - * and therefore shall be placed here.
>> + * Touchscreen IRQ handling code has priority and therefore
>> + * is placed here. In case touchscreen IRQ arrives, disable
>> + * it ASAP
>> */
>> + if (reg & LRADC_CTRL1_TOUCH_DETECT_IRQ) {
>> + writel(ts_irq_mask,
>> + lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>> + if (!lradc->stop_touchscreen)
>> + schedule_work(&lradc->ts_work);
>> + }
>>
>> if (iio_buffer_enabled(iio))
>> iio_trigger_poll(iio->trig, iio_get_time_ns());
>> @@ -306,8 +661,10 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
>> {
>> struct mxs_lradc *lradc = iio_priv(iio);
>> struct iio_buffer *buffer = iio->buffer;
>> - int ret = 0, chan, ofs = 0, enable = 0;
>> - uint32_t ctrl4 = 0;
>> + int ret = 0, chan, ofs = 0;
>> + unsigned long enable = 0;
>> + uint32_t ctrl4_set = 0;
>> + uint32_t ctrl4_clr = 0;
>> uint32_t ctrl1_irq = 0;
>> const uint32_t chan_value = LRADC_CH_ACCUMULATE |
>> ((LRADC_DELAY_TIMER_LOOP - 1) << LRADC_CH_NUM_SAMPLES_OFFSET);
>> @@ -339,17 +696,20 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
>> writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>>
>> for_each_set_bit(chan, buffer->scan_mask, LRADC_MAX_TOTAL_CHANS) {
>> - ctrl4 |= chan << LRADC_CTRL4_LRADCSELECT_OFFSET(ofs);
>> + ctrl4_set |= chan << LRADC_CTRL4_LRADCSELECT_OFFSET(ofs);
>> + ctrl4_clr |= LRADC_CTRL4_LRADCSELECT_MASK(ofs);
>> ctrl1_irq |= LRADC_CTRL1_LRADC_IRQ_EN(ofs);
>> writel(chan_value, lradc->base + LRADC_CH(ofs));
>> - enable |= 1 << ofs;
>> + bitmap_set(&enable, ofs, 1);
>> ofs++;
>> };
>>
>> writel(LRADC_DELAY_TRIGGER_LRADCS_MASK | LRADC_DELAY_KICK,
>> lradc->base + LRADC_DELAY(0) + STMP_OFFSET_REG_CLR);
>>
>> - writel(ctrl4, lradc->base + LRADC_CTRL4);
>> + writel(ctrl4_clr, lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_CLR);
>> + writel(ctrl4_set, lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_SET);
>> +
>> writel(ctrl1_irq, lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
>>
>> writel(enable << LRADC_DELAY_TRIGGER_LRADCS_OFFSET,
>> @@ -384,9 +744,33 @@ static int mxs_lradc_buffer_postdisable(struct iio_dev *iio)
>> static bool mxs_lradc_validate_scan_mask(struct iio_dev *iio,
>> const unsigned long *mask)
>> {
>> - const int mw = bitmap_weight(mask, iio->masklength);
>> -
>> - return mw <= LRADC_MAX_MAPPED_CHANS;
>> + struct mxs_lradc *lradc = iio_priv(iio);
>> + const int len = iio->masklength;
>> + const int map_chans = bitmap_weight(mask, len);
>> + int rsvd_chans = 0;
>> + unsigned long rsvd_mask = 0;
>> +
>> + if (lradc->use_touchbutton)
>> + rsvd_mask |= CHAN_MASK_TOUCHBUTTON;
>> + if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_4WIRE)
>> + rsvd_mask |= CHAN_MASK_TOUCHSCREEN_4WIRE;
>> + if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
>> + rsvd_mask |= CHAN_MASK_TOUCHSCREEN_5WIRE;
>> +
>> + if (lradc->use_touchbutton)
>> + rsvd_chans++;
>> + if (lradc->use_touchscreen)
>> + rsvd_chans++;
>> +
>> + /* Test for attempts to map channels with special mode of operation. */
>> + if (bitmap_intersects(mask, &rsvd_mask, len))
>> + return false;
>> +
>> + /* Test for attempts to map more channels then available slots. */
>> + if (map_chans + rsvd_chans > LRADC_MAX_MAPPED_CHANS)
>> + return false;
>> +
>> + return true;
>> }
>>
>> static const struct iio_buffer_setup_ops mxs_lradc_buffer_ops = {
>> @@ -435,15 +819,29 @@ static const struct iio_chan_spec mxs_lradc_chan_spec[] = {
>>
>> static void mxs_lradc_hw_init(struct mxs_lradc *lradc)
>> {
>> - int i;
>> - const uint32_t cfg =
>> + /* The ADC always uses DELAY CHANNEL 0. */
>> + const uint32_t adc_cfg =
>> + (1 << (LRADC_DELAY_TRIGGER_DELAYS_OFFSET + 0)) |
>> (LRADC_DELAY_TIMER_PER << LRADC_DELAY_DELAY_OFFSET);
>>
>> stmp_reset_block(lradc->base);
>>
>> - for (i = 0; i < LRADC_MAX_DELAY_CHANS; i++)
>> - writel(cfg | (1 << (LRADC_DELAY_TRIGGER_DELAYS_OFFSET + i)),
>> - lradc->base + LRADC_DELAY(i));
>> + /* Configure DELAY CHANNEL 0 for generic ADC sampling. */
>> + writel(adc_cfg, lradc->base + LRADC_DELAY(0));
>> +
>> + /* Disable remaining DELAY CHANNELs */
>> + writel(0, lradc->base + LRADC_DELAY(1));
>> + writel(0, lradc->base + LRADC_DELAY(2));
>> + writel(0, lradc->base + LRADC_DELAY(3));
>> +
>> + /* Configure the touchscreen type */
>> + writel(LRADC_CTRL0_TOUCH_SCREEN_TYPE,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>> +
>> + if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE) {
>> + writel(LRADC_CTRL0_TOUCH_SCREEN_TYPE,
>> + lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>> + }
>>
>> /* Start internal temperature sensing. */
>> writel(0, lradc->base + LRADC_CTRL2);
>> @@ -460,12 +858,14 @@ static void mxs_lradc_hw_stop(struct mxs_lradc *lradc)
>> writel(0, lradc->base + LRADC_DELAY(i));
>> }
>>
>> -static int __devinit mxs_lradc_probe(struct platform_device *pdev)
>> +static int mxs_lradc_probe(struct platform_device *pdev)
>> {
>> struct device *dev = &pdev->dev;
>> + struct device_node *node = dev->of_node;
>> struct mxs_lradc *lradc;
>> struct iio_dev *iio;
>> struct resource *iores;
>> + uint32_t ts_wires = 0;
>> int ret = 0;
>> int i;
>>
>> @@ -487,6 +887,21 @@ static int __devinit mxs_lradc_probe(struct platform_device *pdev)
>> goto err_addr;
>> }
>>
>> + INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work);
>> +
>> + /* Check if touchscreen is enabled in DT. */
>> + ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
>> + &ts_wires);
>> + if (ret)
>> + dev_info(dev, "Touchscreen not enabled.\n");
>> + else if (ts_wires == 4)
>> + lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_4WIRE;
>> + else if (ts_wires == 5)
>> + lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_5WIRE;
>> + else
>> + dev_warn(dev, "Unsupported number of touchscreen wires (%d)\n",
>> + ts_wires);
>> +
>> /* Grab all IRQ sources */
>> for (i = 0; i < 13; i++) {
>> lradc->irq[i] = platform_get_irq(pdev, i);
>> @@ -524,11 +939,16 @@ static int __devinit mxs_lradc_probe(struct platform_device *pdev)
>> if (ret)
>> goto err_trig;
>>
>> + /* Register the touchscreen input device. */
>> + ret = mxs_lradc_ts_register(lradc);
>> + if (ret)
>> + goto err_dev;
>> +
>> /* Register IIO device. */
>> ret = iio_device_register(iio);
>> if (ret) {
>> dev_err(dev, "Failed to register IIO device\n");
>> - goto err_dev;
>> + goto err_ts;
>> }
>>
>> /* Configure the hardware. */
>> @@ -536,6 +956,8 @@ static int __devinit mxs_lradc_probe(struct platform_device *pdev)
>>
>> return 0;
>>
>> +err_ts:
>> + mxs_lradc_ts_unregister(lradc);
>> err_dev:
>> mxs_lradc_trigger_remove(iio);
>> err_trig:
>> @@ -545,11 +967,13 @@ err_addr:
>> return ret;
>> }
>>
>> -static int __devexit mxs_lradc_remove(struct platform_device *pdev)
>> +static int mxs_lradc_remove(struct platform_device *pdev)
>> {
>> struct iio_dev *iio = platform_get_drvdata(pdev);
>> struct mxs_lradc *lradc = iio_priv(iio);
>>
>> + mxs_lradc_ts_unregister(lradc);
>> +
>> mxs_lradc_hw_stop(lradc);
>>
>> iio_device_unregister(iio);
>> @@ -573,7 +997,7 @@ static struct platform_driver mxs_lradc_driver = {
>> .of_match_table = mxs_lradc_dt_ids,
>> },
>> .probe = mxs_lradc_probe,
>> - .remove = __devexit_p(mxs_lradc_remove),
>> + .remove = mxs_lradc_remove,
>> };
>>
>> module_platform_driver(mxs_lradc_driver);
>> --
>> 1.7.10.4
>>
>
^ permalink raw reply
* [PATCH 1/2 V4] iio: mxs: Implement support for touchscreen
From: Shawn Guo @ 2013-01-13 11:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50F2922F.904@kernel.org>
On 13 January 2013 18:53, Jonathan Cameron <jic23@kernel.org> wrote:
> Shawn, do you want to take the board device tree patch or shall
> I take that one as well?
>
I will take it.
Shawn
^ permalink raw reply
* [PATCH] ARM: PXA3xx: program the CSMSADRCFG register
From: Igor Grinberg @ 2013-01-13 11:49 UTC (permalink / raw)
To: linux-arm-kernel
The Chip Select Configuration Register must be programmed to 0x2 in
order to achieve the correct behavior of the Static Memory Controller.
Without this patch devices wired to DFI and accessed through SMC cannot
be accessed after resume from S2.
Do not rely on the boot loader to program the CSMSADRCFG register by
programming it in the kernel smemc module.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: stable at vger.kernel.org
---
arch/arm/mach-pxa/include/mach/smemc.h | 1 +
arch/arm/mach-pxa/smemc.c | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-pxa/include/mach/smemc.h b/arch/arm/mach-pxa/include/mach/smemc.h
index b7de471..b802f28 100644
--- a/arch/arm/mach-pxa/include/mach/smemc.h
+++ b/arch/arm/mach-pxa/include/mach/smemc.h
@@ -37,6 +37,7 @@
#define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */
#define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */
#define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */
+#define CSMSADRCFG (SMEMC_VIRT + 0xA0) /* Chip Select Configuration Register */
/*
* More handy macros for PCMCIA
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
index 7992305..f38aa89 100644
--- a/arch/arm/mach-pxa/smemc.c
+++ b/arch/arm/mach-pxa/smemc.c
@@ -40,6 +40,8 @@ static void pxa3xx_smemc_resume(void)
__raw_writel(csadrcfg[1], CSADRCFG1);
__raw_writel(csadrcfg[2], CSADRCFG2);
__raw_writel(csadrcfg[3], CSADRCFG3);
+ /* CSMSADRCFG wakes up in its default state (0), so we need to set it */
+ __raw_writel(0x2, CSMSADRCFG);
}
static struct syscore_ops smemc_syscore_ops = {
@@ -49,8 +51,19 @@ static struct syscore_ops smemc_syscore_ops = {
static int __init smemc_init(void)
{
- if (cpu_is_pxa3xx())
+ if (cpu_is_pxa3xx()) {
+ /*
+ * The only documentation we have on the
+ * Chip Select Configuration Register (CSMSADRCFG) is that
+ * it must be programmed to 0x2.
+ * Moreover, in the bit definitions, the second bit
+ * (CSMSADRCFG[1]) is called "SETALWAYS".
+ * Other bits are reserved in this register.
+ */
+ __raw_writel(0x2, CSMSADRCFG);
+
register_syscore_ops(&smemc_syscore_ops);
+ }
return 0;
}
--
1.7.3.4
^ permalink raw reply related
* [PATCH 2/2] dma: mv_xor: do not sync the DMA buffer after being deallocated
From: Lubomir Rintel @ 2013-01-13 13:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130104171033.4a244c3d@skate>
On Fri, 2013-01-04 at 17:10 +0100, Thomas Petazzoni wrote:
> Dear Lubomir Rintel,
>
> On Thu, 27 Dec 2012 20:23:48 +0100, Lubomir Rintel wrote:
>
> > dma_sync_single_for_cpu(dma_chan->device->dev, dest_dma,
> > MV_XOR_TEST_SIZE, DMA_FROM_DEVICE);
> > + dma_unmap_single(dma_chan->device->dev, dest_dma, MV_XOR_TEST_SIZE,
> > + DMA_FROM_DEVICE);
>
> I would assume that dma_unmap_single() implies a
> dma_sync_single_for_cpu() since you're unmapping the DMA buffer. So if
> you use dma_unmap_single(), I think you can remove the call to
> dma_sync_single_for_cpu().
Yes, it indeed seems to be the case (comment for arm_dma_unmap_page():
"After this call, reads by the CPU to the buffer are guaranteed to see
whatever the device wrote there.".
> > dma_sync_single_for_cpu(dma_chan->device->dev, dest_dma,
> > PAGE_SIZE, DMA_FROM_DEVICE);
> > + dma_unmap_page(dma_chan->device->dev, dest_dma, PAGE_SIZE,
> > + DMA_FROM_DEVICE);
>
> Ditto.
>
> Also, the mv_xor_memcpy_self_test() function not only dma_map_single()
> the destination buffer, but also the source buffer. So presumably, the
> source buffer should also be dma_unmap_single()'d.
>
> And for the mv_xor_xor_self_test() function, multiple source buffers
> are dma_map_page()'d, so they should all be dma_unmap_page()'d I guess,
> not only the destination buffer.
Those get released by the mv_xor_run_tx_complete_actions() callback.
I will follow up with an updated patch.
Regards,
Lubo
^ permalink raw reply
* [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
From: Vinod Koul @ 2013-01-13 13:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121210222516.GA31546@mail.gnudd.com>
On Mon, Dec 10, 2012 at 11:25:17PM +0100, Davide Ciminaghi wrote:
> On Mon, Dec 10, 2012 at 10:44:09PM +0100, Linus Walleij wrote:
> > On Mon, Dec 10, 2012 at 2:42 PM, Davide Ciminaghi <ciminaghi@gnudd.com> wrote:
> >
> > > From: Alessandro Rubini <rubini@gnudd.com>
> > >
> > > The header is used by drivers/dma/amba-pl08x.c, which can be compiled
> > > under x86, where PL080 exists under a PCI-to-AMBA bridge. This patche
> > > moves it where it can be accessed by other architectures, and fixes
> > > all users.
Applied, Thanks
--
~Vinod
^ permalink raw reply
* [PATCH 1/2 V4] iio: mxs: Implement support for touchscreen
From: Marek Vasut @ 2013-01-13 14:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50F2922F.904@kernel.org>
Dear Jonathan Cameron,
> On 01/13/2013 03:09 AM, Dmitry Torokhov wrote:
> > On Sat, Jan 12, 2013 at 12:35:07AM +0100, Marek Vasut wrote:
> >> This patch implements support for sampling of a touchscreen into
> >> the MXS LRADC driver. The LRADC block allows configuring some of
> >> it's channels into special mode where they either output the drive
> >> voltage or sample it, allowing it to operate a 4-wire or 5-wire
> >> resistive touchscreen.
> >>
> >> In case the touchscreen mode is enabled, the LRADC slot #7 is
> >> reserved for touchscreen only, therefore it is not possible to
> >> sample 8 LRADC channels at time, but only 7 channels.
> >>
> >> The touchscreen controller is configured such that the PENDOWN event
> >> disables touchscreen interrupts and triggers execution of worker
> >> thread, which then polls the touchscreen controller for X, Y and
> >> Pressure values. This reduces the overhead of interrupt-driven
> >> operation. Upon the PENUP event, the worker thread re-enables the
> >> PENDOWN detection interrupt and exits.
> >>
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >
> > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> I've added this to the togreg branch of
> git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
>
> Note it did not directly apply as I'm guessing you have a slightly
> out of date tree.
Ah yes, it was still based off of stable 3.7 .
> Please could you check I didn't mess up the
> fixing up of the patch. There was a fair bit of fuzz and the devinit
> devexit stuff shouldn't have been in your patch in the first place.
Checked just now, looks OK to me, thanks!
> Shawn, do you want to take the board device tree patch or shall
> I take that one as well?
>
> Jonathan
^ permalink raw reply
* [PATCH V2] ARM: imx27: add a clock gate to activate SPLL clock
From: Gwenhael Goavec-Merou @ 2013-01-13 14:15 UTC (permalink / raw)
To: linux-arm-kernel
A clock gate is mandatory to activate SPLL clock needed, at least, for usb.
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
---
V2: - Suppress patch about ehci-mxc.c.
arch/arm/mach-imx/clk-imx27.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 4c1d1e4..4f066d13 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -62,7 +62,7 @@ static const char *clko_sel_clks[] = {
"32k", "usb_div", "dptc",
};
-static const char *ssi_sel_clks[] = { "spll", "mpll", };
+static const char *ssi_sel_clks[] = { "spll_gate", "mpll", };
enum mx27_clks {
dummy, ckih, ckil, mpll, spll, mpll_main2, ahb, ipg, nfc_div, per1_div,
@@ -82,7 +82,7 @@ enum mx27_clks {
csi_ahb_gate, brom_ahb_gate, ata_ahb_gate, wdog_ipg_gate, usb_ipg_gate,
uart6_ipg_gate, uart5_ipg_gate, uart4_ipg_gate, uart3_ipg_gate,
uart2_ipg_gate, uart1_ipg_gate, ckih_div1p5, fpm, mpll_osc_sel,
- mpll_sel, clk_max
+ mpll_sel, spll_gate, clk_max
};
static struct clk *clk[clk_max];
@@ -104,6 +104,7 @@ int __init mx27_clocks_init(unsigned long fref)
ARRAY_SIZE(mpll_sel_clks));
clk[mpll] = imx_clk_pllv1("mpll", "mpll_sel", CCM_MPCTL0);
clk[spll] = imx_clk_pllv1("spll", "ckih", CCM_SPCTL0);
+ clk[spll_gate] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
clk[mpll_main2] = imx_clk_fixed_factor("mpll_main2", "mpll", 2, 3);
if (mx27_revision() >= IMX_CHIP_REVISION_2_0) {
@@ -121,7 +122,7 @@ int __init mx27_clocks_init(unsigned long fref)
clk[per4_div] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6);
clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks));
clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6);
- clk[usb_div] = imx_clk_divider("usb_div", "spll", CCM_CSCR, 28, 3);
+ clk[usb_div] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 28, 3);
clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
--
1.7.12.4
^ permalink raw reply related
* [PATCH] ARM: at91: fix board-rm9200-dt after sys_timer conversion
From: Joachim Eastwood @ 2013-01-13 15:50 UTC (permalink / raw)
To: linux-arm-kernel
After "ARM: delete struct sys_timer" board-rm9200-dt
fails compilation with the following error:
CC arch/arm/mach-at91/board-rm9200-dt.o
arch/arm/mach-at91/board-rm9200-dt.c:50:2: error: unknown field 'timer' specified in initializer
arch/arm/mach-at91/board-rm9200-dt.c:50:13: error: 'at91rm9200_timer' undeclared here (not in a function)
make[1]: *** [arch/arm/mach-at91/board-rm9200-dt.o] Error 1
make: *** [arch/arm/mach-at91] Error 2
This is a fall out from the timer conversion. Fix it by
converting board-rm9200-dt to use new timer init
function as well.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
Hi Stephen,
Feel free to fold this fix into your patch if it's possible.
regards
Joachim Eastwood
arch/arm/mach-at91/board-rm9200-dt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/board-rm9200-dt.c b/arch/arm/mach-at91/board-rm9200-dt.c
index 5f9ce3d..3fcb662 100644
--- a/arch/arm/mach-at91/board-rm9200-dt.c
+++ b/arch/arm/mach-at91/board-rm9200-dt.c
@@ -47,7 +47,7 @@ static const char *at91rm9200_dt_board_compat[] __initdata = {
};
DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
- .timer = &at91rm9200_timer,
+ .init_time = at91rm9200_timer_init,
.map_io = at91_map_io,
.handle_irq = at91_aic_handle_irq,
.init_early = at91rm9200_dt_initialize,
--
1.8.0
^ permalink raw reply related
* [PATCH] ARM: imx: platform-imx-fb: modifies platform device name
From: Gwenhael Goavec-Merou @ 2013-01-13 15:56 UTC (permalink / raw)
To: linux-arm-kernel
From: Gwenhael Goavec-Merou <gwe@trabucayre.com>
Framebuffer platform device is now identified by a device id (imx1-fb or
imx21-fb) instead of by driver name (imx-fb).
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
---
arch/arm/mach-imx/devices/platform-imx-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/devices/platform-imx-fb.c b/arch/arm/mach-imx/devices/platform-imx-fb.c
index 10b0ed3..25a47c6 100644
--- a/arch/arm/mach-imx/devices/platform-imx-fb.c
+++ b/arch/arm/mach-imx/devices/platform-imx-fb.c
@@ -54,7 +54,7 @@ struct platform_device *__init imx_add_imx_fb(
.flags = IORESOURCE_IRQ,
},
};
- return imx_add_platform_device_dmamask("imx-fb", 0,
+ return imx_add_platform_device_dmamask(data->devid, 0,
res, ARRAY_SIZE(res),
pdata, sizeof(*pdata), DMA_BIT_MASK(32));
}
--
1.7.12.4
^ permalink raw reply related
* [PATCH] ARM: imx: imxfb: fix imxfb_info configuration order
From: Gwenhael Goavec-Merou @ 2013-01-13 15:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358092603-13480-1-git-send-email-gwenhael.goavec-merou@armadeus.com>
From: Gwenhael Goavec-Merou <gwe@trabucayre.com>
The devtype field for fbi (struct imxfb_info) must be set after memset call to
avoid some wrong behaviour (pixel size).
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
---
drivers/video/imxfb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index e501dbc..8435c5d 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -729,6 +729,8 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
memset(fbi, 0, sizeof(struct imxfb_info));
+ fbi->devtype = pdev->id_entry->driver_data;
+
strlcpy(info->fix.id, IMX_NAME, sizeof(info->fix.id));
info->fix.type = FB_TYPE_PACKED_PIXELS;
@@ -789,7 +791,6 @@ static int __init imxfb_probe(struct platform_device *pdev)
return -ENOMEM;
fbi = info->par;
- fbi->devtype = pdev->id_entry->driver_data;
if (!fb_mode)
fb_mode = pdata->mode[0].mode.name;
--
1.7.12.4
^ permalink raw reply related
* [PATCH 0/4] AT91RM9200 MMC, SSC and EMAC bindings
From: Joachim Eastwood @ 2013-01-13 16:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1354644659-31385-1-git-send-email-manabian@gmail.com>
On 4 December 2012 19:10, Joachim Eastwood <manabian@gmail.com> wrote:
> These patches create bindings for MMC, SSC and EMAC in the AT91RM9200 devicetree. Patches are based on the pinctrl tree (at91 branch) since that's where the rest of the RM9200 devicetree patches is located.
>
> Patch 1 is a short fix for the RM9200 pins. Forgot to change the pins when I copied the bindings from another SoC.
>
> Patch 2 creates bindings for MMC on RM9200. I have not been able to test the bindings since my board doesn't have MMC.
>
> Patch 3 creates SSC bindings. Clock additions are also needed but these will coming through the ASoC tree. SSC bindings seem to work. I haven't been able to test actual audio though.
>
> Patch 4 creates EMAC bindings. These are tested and are working.
>
>
> I also have bindings for I2c and SPI on RM9200. I'll send patches when Atmel SPI support hits next.
Ping?
Are there any comments on any of the patches in the series?
Is there any specific tree AT91 patches should be based on now?
The at91 tree on github seems a bit out dated and during the last
merge window at91 stuff went via the pinctrl tree.
I have DT patches for my custom RM9200 board but they are a bit
useless without a more complete at91rm9200.dtsi.
regards
Joachim Eastwood
> Joachim Eastwood (4):
> ARM: at91: fix gpios on i2c-gpio for RM9200 DT
> ARM: at91: add MMC bindings to RM9200 DT
> ARM: at91: add SSC bindings to RM9200 DT
> ARM: at91: add EMAC bindings to RM9200 DT
>
> arch/arm/boot/dts/at91rm9200.dtsi | 162 ++++++++++++++++++++++++++++++++++++-
> arch/arm/boot/dts/at91rm9200ek.dts | 5 ++
> arch/arm/mach-at91/at91rm9200.c | 2 +
> 3 files changed, 167 insertions(+), 2 deletions(-)
>
> --
> 1.8.0
>
^ permalink raw reply
* [PATCH] ARM: dove: update dove_defconfig with a few useful options
From: Olof Johansson @ 2013-01-13 17:54 UTC (permalink / raw)
To: linux-arm-kernel
This refreshes the dove_defconfig, and adds:
PRINTK_TIME
DEVTMPFS
EXT4
They're quite useful, and allows booting a cubox ubuntu rootfs on SD card,
since that by default uses ext4.
The rest of the churn is due to options and defaults moving around, no
functional difference.
Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
arch/arm/configs/dove_defconfig | 28 ++++++++--------------------
1 file changed, 8 insertions(+), 20 deletions(-)
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig
index 0b7ee92..3fe8dae 100644
--- a/arch/arm/configs/dove_defconfig
+++ b/arch/arm/configs/dove_defconfig
@@ -1,26 +1,24 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_EXPERT=y
CONFIG_SLAB=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set
+CONFIG_PARTITION_ADVANCED=y
CONFIG_ARCH_DOVE=y
CONFIG_MACH_DOVE_DB=y
CONFIG_MACH_CM_A510=y
CONFIG_MACH_DOVE_DT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
CONFIG_AEABI=y
+CONFIG_HIGHMEM=y
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_HIGHMEM=y
-CONFIG_USE_OF=y
-CONFIG_ATAGS=y
CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT=y
-CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
CONFIG_VFP=y
CONFIG_NET=y
CONFIG_PACKET=y
@@ -32,8 +30,9 @@ CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IPV6 is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
CONFIG_MTD=y
-CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
@@ -57,7 +56,6 @@ CONFIG_ATA=y
CONFIG_SATA_MV=y
CONFIG_NETDEVICES=y
CONFIG_MV643XX_ETH=y
-# CONFIG_NETDEV_10000 is not set
CONFIG_INPUT_POLLDEV=y
# CONFIG_INPUT_MOUSEDEV is not set
CONFIG_INPUT_EVDEV=y
@@ -68,10 +66,7 @@ CONFIG_LEGACY_PTY_COUNT=16
# CONFIG_DEVKMEM is not set
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
-# CONFIG_SERIAL_8250_PCI is not set
CONFIG_SERIAL_8250_RUNTIME_UARTS=2
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_HW_RANDOM is not set
CONFIG_I2C=y
@@ -81,13 +76,11 @@ CONFIG_SPI=y
CONFIG_SPI_ORION=y
# CONFIG_HWMON is not set
CONFIG_USB=y
-CONFIG_USB_DEVICEFS=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_STORAGE=y
CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_IO_ACCESSORS=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_DOVE=y
CONFIG_NEW_LEDS=y
@@ -104,6 +97,7 @@ CONFIG_MV_XOR=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_UDF_FS=m
@@ -112,24 +106,20 @@ CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y
CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y
-CONFIG_PARTITION_ADVANCED=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=y
CONFIG_NLS_UTF8=y
+CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_BUGVERBOSE is not set
CONFIG_DEBUG_INFO=y
-CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_ERRORS=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_PCBC=m
@@ -138,7 +128,6 @@ CONFIG_CRYPTO_MD4=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
-CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_TEA=y
CONFIG_CRYPTO_TWOFISH=y
@@ -147,5 +136,4 @@ CONFIG_CRYPTO_LZO=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRYPTO_DEV_MV_CESA=y
CONFIG_CRC_CCITT=y
-CONFIG_CRC16=y
CONFIG_LIBCRC32C=y
--
1.8.1.192.gc4361b8
^ permalink raw reply related
* Build error on kernel/rcutree.c
From: Fabio Estevam @ 2013-01-13 18:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi Paul,
When building ARM imx_v4_v5_defconfig the following error shows up on
linux-next 20130111:
kernel/rcutree.c:808:2: error: implicit declaration of function
'rcu_jiffies_till_stall_check' [-Werror=implicit-function-declaration]
kernel/rcutree.c:941:6: error: 'rcu_cpu_stall_suppress' undeclared
(first use in this function)
Is this a known issue?
Regards,
Fabio Estevam
^ permalink raw reply
* Build error on kernel/rcutree.c
From: Paul E. McKenney @ 2013-01-13 18:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAOMZO5ASEY6iHQ1UekR88vWZPutsJdiEuGkpsC2Civ6ezi2NGg@mail.gmail.com>
On Sun, Jan 13, 2013 at 04:03:24PM -0200, Fabio Estevam wrote:
> Hi Paul,
>
> When building ARM imx_v4_v5_defconfig the following error shows up on
> linux-next 20130111:
>
> kernel/rcutree.c:808:2: error: implicit declaration of function
> 'rcu_jiffies_till_stall_check' [-Werror=implicit-function-declaration]
> kernel/rcutree.c:941:6: error: 'rcu_cpu_stall_suppress' undeclared
> (first use in this function)
>
> Is this a known issue?
Yes, the fix is in -rcu and should make it to -next soon.
In the meantime, you can work around the problem by avoiding selecting
CONFIG_TREE_PREEMPT_RCU=y on SMP=n builds -- use CONFIG_TINY_PREEMPT_RCU
instead.
Thanx, Paul
^ permalink raw reply
* [PATCH V3] mmc: mmci: Fixup and cleanup code for DMA handling
From: Russell King - ARM Linux @ 2013-01-13 19:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1357570707-28207-1-git-send-email-ulf.hansson@stericsson.com>
On Mon, Jan 07, 2013 at 03:58:27PM +0100, Ulf Hansson wrote:
> @@ -374,19 +415,12 @@ static void mmci_dma_unmap(struct mmci_host *host, struct mmc_data *data)
> * contiguous buffers. On TX, we'll get a FIFO underrun error.
> */
> if (status & MCI_RXDATAAVLBLMASK) {
> - dmaengine_terminate_all(chan);
> - if (!data->error)
> - data->error = -EIO;
> - }
> -
> - if (data->flags & MMC_DATA_WRITE) {
> - dir = DMA_TO_DEVICE;
> - } else {
> - dir = DMA_FROM_DEVICE;
> + data->error = -EIO;
> + mmci_dma_data_error(host);
Please explain the change of behaviour here. Before your change, we _only_
set data->error if the error is not set. Here, we overwrite the error code
no matter what. What is the reasoning for that change?
The reason the code is like it _was_ is so that any bytes remaining in the
FIFO are _only_ reported as an error if there wasn't a preceding error.
That is the behaviour I desired when I wrote this code.
^ permalink raw reply
* [PATCH v2] arm: mvebu: add DTS file for Marvell RD-A370-A1 board
From: Florian Fainelli @ 2013-01-13 19:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130111145629.GB31640@titan.lakedaemon.net>
Le 11/01/2013 15:56, Jason Cooper a ?crit :
> Florian,
>
> On Fri, Jan 11, 2013 at 03:45:04PM +0100, Florian Fainelli wrote:
>> Le 01/09/13 20:56, Florian Fainelli a ?crit :
>>> This patch adds the DTS file to support the Marvell RD-A370-A1
>>> (Reference Design board) also known as RD-88F6710 board. It is almost
>>> entirely similar to the DB-A370 board except that the first Ethernet PHY
>>> is SGMII-wired and the second is a switch which is RGMII-wired.
>>
>> Who is going to take this patch? Since this is a new DTS file there
>> are little chances it breaks anything, could it be taken for an
>> upcoming 3.8-rc?
>
> No, only fixes go in for the current -rc. It'll be included for v3.9, I
> have it in my queue.
Jason, I don't see this patch in the pull request you just sent for 3.9,
should it be? Thanks!
--
Florian
^ permalink raw reply
* [PATCH V2] Add apf51 basic support
From: Laurent Cans @ 2013-01-13 20:08 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Laurent Cans <laurent.cans@gmail.com>
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
---
Differences between v1 and v2
- change board name according project convention
- remove useless compatible properties
- add project copyright
- use device name instead of soc structure for description
- remove nand device
- add an entry for the board on documentation
Documentation/devicetree/bindings/arm/fsl.txt | 4 ++
arch/arm/boot/dts/Makefile | 3 +-
arch/arm/boot/dts/imx51-apf51.dts | 62 +++++++++++++++++++++++++
arch/arm/boot/dts/imx51.dtsi | 30 ++++++++++++
4 files changed, 98 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boot/dts/imx51-apf51.dts
diff --git a/Documentation/devicetree/bindings/arm/fsl.txt b/Documentation/devicetree/bindings/arm/fsl.txt
index f798187..2549252 100644
--- a/Documentation/devicetree/bindings/arm/fsl.txt
+++ b/Documentation/devicetree/bindings/arm/fsl.txt
@@ -13,6 +13,10 @@ i.MX51 Babbage Board
Required root node properties:
- compatible = "fsl,imx51-babbage", "fsl,imx51";
+i.MX51 APF51 Board
+Required root node properties:
+ - compatible = "fsl,imx51-apf51", "fsl,imx51";
+
i.MX53 Automotive Reference Design Board
Required root node properties:
- compatible = "fsl,imx53-ard", "fsl,imx53";
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index e44da40..1acf809 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -79,7 +79,8 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
armada-370-mirabox.dtb \
armada-xp-db.dtb \
armada-xp-openblocks-ax3-4.dtb
-dtb-$(CONFIG_ARCH_MXC) += imx51-babbage.dtb \
+dtb-$(CONFIG_ARCH_MXC) += imx51-apf51.dtb \
+ imx51-babbage.dtb \
imx53-ard.dtb \
imx53-evk.dtb \
imx53-qsb.dtb \
diff --git a/arch/arm/boot/dts/imx51-apf51.dts b/arch/arm/boot/dts/imx51-apf51.dts
new file mode 100644
index 0000000..279dbdb
--- /dev/null
+++ b/arch/arm/boot/dts/imx51-apf51.dts
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2013 Armadeus Systems - <support@armadeus.com>
+ * Copyright 2013 Laurent Cans <laurent.cans@gmail.com>
+ *
+ * Based on mx51-babbage.dts
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx51.dtsi"
+
+/ {
+ model = "Armadeus Systems APF51 module";
+ compatible = "fsl,imx51-apf51", "fsl,imx51";
+
+ memory {
+ reg = <0x90000000 0x20000000>;
+ };
+
+ clocks {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ckih1 {
+ clock-frequency = <0>;
+ };
+
+ osc {
+ clock-frequency = <33554432>;
+ };
+ };
+};
+
+&fec {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_fec_2>;
+ phy-mode = "mii";
+ phy-reset-gpios = <&gpio3 0 0>;
+ phy-reset-duration = <1>;
+ status = "okay";
+};
+
+&nfc {
+ nand-bus-width = <8>;
+ nand-ecc-mode = "hw";
+ nand-on-flash-bbt;
+ status = "okay";
+};
+
+&uart3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart3_2>;
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 1f5d45e..8427279 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -273,6 +273,29 @@
260 0x80000000 /* MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK */
>;
};
+
+ pinctrl_fec_2: fecgrp-2 {
+ fsl,pins = <
+ 589 0x80000000 /* MX51_PAD_DI_GP3__FEC_TX_ER */
+ 592 0x80000000 /* MX51_PAD_DI2_PIN4__FEC_CRS */
+ 594 0x80000000 /* MX51_PAD_DI2_PIN2__FEC_MDC */
+ 596 0x80000000 /* MX51_PAD_DI2_PIN3__FEC_MDIO */
+ 598 0x80000000 /* MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 */
+ 602 0x80000000 /* MX51_PAD_DI_GP4__FEC_RDATA2 */
+ 604 0x80000000 /* MX51_PAD_DISP2_DAT0__FEC_RDATA3 */
+ 609 0x80000000 /* MX51_PAD_DISP2_DAT1__FEC_RX_ER */
+ 618 0x80000000 /* MX51_PAD_DISP2_DAT6__FEC_TDATA1 */
+ 623 0x80000000 /* MX51_PAD_DISP2_DAT7__FEC_TDATA2 */
+ 628 0x80000000 /* MX51_PAD_DISP2_DAT8__FEC_TDATA3 */
+ 634 0x80000000 /* MX51_PAD_DISP2_DAT9__FEC_TX_EN */
+ 639 0x80000000 /* MX51_PAD_DISP2_DAT10__FEC_COL */
+ 644 0x80000000 /* MX51_PAD_DISP2_DAT11__FEC_RX_CLK */
+ 649 0x80000000 /* MX51_PAD_DISP2_DAT12__FEC_RX_DV */
+ 653 0x80000000 /* MX51_PAD_DISP2_DAT13__FEC_TX_CLK */
+ 657 0x80000000 /* MX51_PAD_DISP2_DAT14__FEC_RDATA0 */
+ 662 0x80000000 /* MX51_PAD_DISP2_DAT15__FEC_TDATA0 */
+ >;
+ };
};
ecspi1 {
@@ -409,6 +432,13 @@
49 0x1c5 /* MX51_PAD_EIM_D24__UART3_CTS */
>;
};
+
+ pinctrl_uart3_2: uart3grp-2 {
+ fsl,pins = <
+ 434 0x1c5 /* MX51_PAD_UART3_RXD__UART3_RXD */
+ 430 0x1c5 /* MX51_PAD_UART3_TXD__UART3_TXD */
+ >;
+ };
};
};
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2] arm: mvebu: add DTS file for Marvell RD-A370-A1 board
From: Jason Cooper @ 2013-01-13 20:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50F30DAD.3090105@openwrt.org>
On Sun, Jan 13, 2013 at 08:40:29PM +0100, Florian Fainelli wrote:
> Le 11/01/2013 15:56, Jason Cooper a ?crit :
> >Florian,
> >
> >On Fri, Jan 11, 2013 at 03:45:04PM +0100, Florian Fainelli wrote:
> >>Le 01/09/13 20:56, Florian Fainelli a ?crit :
> >>>This patch adds the DTS file to support the Marvell RD-A370-A1
> >>>(Reference Design board) also known as RD-88F6710 board. It is almost
> >>>entirely similar to the DB-A370 board except that the first Ethernet PHY
> >>>is SGMII-wired and the second is a switch which is RGMII-wired.
> >>
> >>Who is going to take this patch? Since this is a new DTS file there
> >>are little chances it breaks anything, could it be taken for an
> >>upcoming 3.8-rc?
> >
> >No, only fixes go in for the current -rc. It'll be included for v3.9, I
> >have it in my queue.
>
> Jason, I don't see this patch in the pull request you just sent for
> 3.9, should it be? Thanks!
Not yet, I'm working my though the holiday backlog chronologically.
thx,
Jason.
^ permalink raw reply
* [PATCH v2] mmc: mvsdio: Replace IS_ERR_OR_NULL() with IS_ERR()
From: Jason Cooper @ 2013-01-13 20:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1357889273-11553-1-git-send-email-andrew@lunn.ch>
On Fri, Jan 11, 2013 at 08:27:52AM +0100, Andrew Lunn wrote:
> A NULL is a valid clk cookie, so we should not be tested with
> IS_ERR_OR_NULL(). Replace it with IS_ERR().
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>
> This patch depends on Thomas Petazzoni DT patches for mvsdio, which changed
> the order of resource allocation etc.
grrr, I'm seeing fixes depending on features :( Any way to avoid that?
In light of Russell's comments, shall I wait for a v3? All of Thomas'
mvsdio work is now waiting on this. I'd like to get that in as early as
possible.
thx,
Jason.
^ permalink raw reply
* [PATCH v2] mmc: mvsdio: Replace IS_ERR_OR_NULL() with IS_ERR()
From: Andrew Lunn @ 2013-01-13 21:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130113204348.GR13433@titan.lakedaemon.net>
On Sun, Jan 13, 2013 at 03:43:48PM -0500, Jason Cooper wrote:
> On Fri, Jan 11, 2013 at 08:27:52AM +0100, Andrew Lunn wrote:
> > A NULL is a valid clk cookie, so we should not be tested with
> > IS_ERR_OR_NULL(). Replace it with IS_ERR().
> >
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> >
> > This patch depends on Thomas Petazzoni DT patches for mvsdio, which changed
> > the order of resource allocation etc.
>
> grrr, I'm seeing fixes depending on features :( Any way to avoid that?
>
> In light of Russell's comments, shall I wait for a v3? All of Thomas'
> mvsdio work is now waiting on this. I'd like to get that in as early as
> possible.
Well, im guessing doing the fixes first will require changes to Thomas
features.
Did you try putting Russells patch in first? How bad are the
conflicts?
Andrew
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox