All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-10 13:42 ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

Hi,

this is v4 of a patchset already submitted on Sep 14th
(see https://lkml.org/lkml/2012/9/14/412) and
Nov 23rd (see https://lkml.org/lkml/2012/11/23/272).
Then 1/8 and 3/8 only were resubmitted (as v3) with the following changes:

* The output of git diff --word-diff was added to 1/8 as additional
  information for reviewers (see https://lkml.org/lkml/2012/11/23/415).
* 3/8 was generated with git format-patch -C -M to detect copies and moves
  (see https://lkml.org/lkml/2012/11/23/404).

Changes in v4 are:

* Rebased to next-20121210
* All patches generated with git format-patch -C -M.
* "DMA: PL330: use prefix in reg names to build under x86" : only registers
  names were prefixed (no PL330_ prefix for bitfields), as requested by
  Jassi Brar (see https://lkml.org/lkml/2012/11/24/46). Please note that this
  change was done by myself. I let Alessandro as the patch author, and just
  added my Signed-off-by with a very short explanation of my change. I'm not
  sure I did the right thing because, although my change is a small one from
  a logical point of view, it results in a much smaller patch, so this version
  is actually very different from v3.
* "gpio: pl061 depends on ARM": removed as it has already applied to
  linux-next (see https://lkml.org/lkml/2012/12/1/77)

Acked-by/Reviewed-by situation:

v1:

"DMA: PL330: use prefix in reg names to build under x86"
Acked by Vinod Koul (see https://lkml.org/lkml/2012/9/16/271) and
Linus Walleij (see https://lkml.org/lkml/2012/9/16/93).

"mmc: use the new <linux/sizes.h>"
Acked by David Brown (see https://lkml.org/lkml/2012/9/14/613)

"pl080.h: moved from arm/include/asm/hardware to include/linux/amba/"
Acked by Linus Walleij (see https://lkml.org/lkml/2012/9/16/92).


v2:

"watchdog: sp805_wdt depends on ARM"
Acked by Viresh Kumar (see https://lkml.org/lkml/2012/11/23/296)
Acked by Linus Walleij (see https://lkml.org/lkml/2012/11/28/259).

"mmc: use the new <linux/sizes.h>"
Reviewed by Viresh Kumar (see https://lkml.org/lkml/2012/11/23/328)
Acked by David Brown (see https://lkml.org/lkml/2012/11/26/625)
Acked by Linus Walleij (see https://lkml.org/lkml/2012/12/1/105).

"mmci: replace readsl/writesl with ioread32_rep/iowrite32_rep"
Acked by Linus Walleij (see https://lkml.org/lkml/2012/11/28/266)
Acked by Will Deacon (see https://lkml.org/lkml/2012/12/3/202).

"pl080.h: moved from arm/include/asm/hardware to include/linux/amba/"
Acked by Linus Walleij (see https://lkml.org/lkml/2012/11/28/265).


Alessandro Rubini (6):
  DMA: PL330: use prefix in reg names to build under x86
  pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
  watchdog: sp805_wdt depends on ARM
  mmc: use the new <linux/sizes.h>
  drivers/amba: add support for a PCI bridge
  x86: add CONFIG_ARM_AMBA, selected by STA2X11

Davide Ciminaghi (1):
  mmci: replace readsl/writesl with ioread32_rep/iowrite32_rep

 arch/arm/mach-s3c64xx/dma.c                        |    2 +-
 arch/arm/mach-spear3xx/spear3xx.c                  |    2 +-
 arch/arm/mach-spear6xx/spear6xx.c                  |    2 +-
 arch/x86/Kconfig                                   |    4 +
 drivers/Kconfig                                    |    2 +
 drivers/amba/Kconfig                               |   10 ++
 drivers/amba/Makefile                              |    1 +
 drivers/amba/pci-amba.c                            |   93 +++++++++++++++++
 drivers/dma/amba-pl08x.c                           |    2 +-
 drivers/dma/pl330.c                                |  107 ++++++++++----------
 drivers/mmc/host/mmci.c                            |   10 +-
 drivers/mmc/host/msm_sdcc.c                        |    2 +-
 drivers/mmc/host/mvsdio.c                          |    2 +-
 drivers/mmc/host/mxcmmc.c                          |    2 +-
 drivers/mmc/host/pxamci.c                          |    3 +-
 drivers/watchdog/Kconfig                           |    2 +-
 .../asm/hardware => include/linux/amba}/pl080.h    |    2 +-
 17 files changed, 179 insertions(+), 69 deletions(-)
 create mode 100644 drivers/amba/Kconfig
 create mode 100644 drivers/amba/pci-amba.c
 rename {arch/arm/include/asm/hardware => include/linux/amba}/pl080.h (99%)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-10 13:42 ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

this is v4 of a patchset already submitted on Sep 14th
(see https://lkml.org/lkml/2012/9/14/412) and
Nov 23rd (see https://lkml.org/lkml/2012/11/23/272).
Then 1/8 and 3/8 only were resubmitted (as v3) with the following changes:

* The output of git diff --word-diff was added to 1/8 as additional
  information for reviewers (see https://lkml.org/lkml/2012/11/23/415).
* 3/8 was generated with git format-patch -C -M to detect copies and moves
  (see https://lkml.org/lkml/2012/11/23/404).

Changes in v4 are:

* Rebased to next-20121210
* All patches generated with git format-patch -C -M.
* "DMA: PL330: use prefix in reg names to build under x86" : only registers
  names were prefixed (no PL330_ prefix for bitfields), as requested by
  Jassi Brar (see https://lkml.org/lkml/2012/11/24/46). Please note that this
  change was done by myself. I let Alessandro as the patch author, and just
  added my Signed-off-by with a very short explanation of my change. I'm not
  sure I did the right thing because, although my change is a small one from
  a logical point of view, it results in a much smaller patch, so this version
  is actually very different from v3.
* "gpio: pl061 depends on ARM": removed as it has already applied to
  linux-next (see https://lkml.org/lkml/2012/12/1/77)

Acked-by/Reviewed-by situation:

v1:

"DMA: PL330: use prefix in reg names to build under x86"
Acked by Vinod Koul (see https://lkml.org/lkml/2012/9/16/271) and
Linus Walleij (see https://lkml.org/lkml/2012/9/16/93).

"mmc: use the new <linux/sizes.h>"
Acked by David Brown (see https://lkml.org/lkml/2012/9/14/613)

"pl080.h: moved from arm/include/asm/hardware to include/linux/amba/"
Acked by Linus Walleij (see https://lkml.org/lkml/2012/9/16/92).


v2:

"watchdog: sp805_wdt depends on ARM"
Acked by Viresh Kumar (see https://lkml.org/lkml/2012/11/23/296)
Acked by Linus Walleij (see https://lkml.org/lkml/2012/11/28/259).

"mmc: use the new <linux/sizes.h>"
Reviewed by Viresh Kumar (see https://lkml.org/lkml/2012/11/23/328)
Acked by David Brown (see https://lkml.org/lkml/2012/11/26/625)
Acked by Linus Walleij (see https://lkml.org/lkml/2012/12/1/105).

"mmci: replace readsl/writesl with ioread32_rep/iowrite32_rep"
Acked by Linus Walleij (see https://lkml.org/lkml/2012/11/28/266)
Acked by Will Deacon (see https://lkml.org/lkml/2012/12/3/202).

"pl080.h: moved from arm/include/asm/hardware to include/linux/amba/"
Acked by Linus Walleij (see https://lkml.org/lkml/2012/11/28/265).


Alessandro Rubini (6):
  DMA: PL330: use prefix in reg names to build under x86
  pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
  watchdog: sp805_wdt depends on ARM
  mmc: use the new <linux/sizes.h>
  drivers/amba: add support for a PCI bridge
  x86: add CONFIG_ARM_AMBA, selected by STA2X11

Davide Ciminaghi (1):
  mmci: replace readsl/writesl with ioread32_rep/iowrite32_rep

 arch/arm/mach-s3c64xx/dma.c                        |    2 +-
 arch/arm/mach-spear3xx/spear3xx.c                  |    2 +-
 arch/arm/mach-spear6xx/spear6xx.c                  |    2 +-
 arch/x86/Kconfig                                   |    4 +
 drivers/Kconfig                                    |    2 +
 drivers/amba/Kconfig                               |   10 ++
 drivers/amba/Makefile                              |    1 +
 drivers/amba/pci-amba.c                            |   93 +++++++++++++++++
 drivers/dma/amba-pl08x.c                           |    2 +-
 drivers/dma/pl330.c                                |  107 ++++++++++----------
 drivers/mmc/host/mmci.c                            |   10 +-
 drivers/mmc/host/msm_sdcc.c                        |    2 +-
 drivers/mmc/host/mvsdio.c                          |    2 +-
 drivers/mmc/host/mxcmmc.c                          |    2 +-
 drivers/mmc/host/pxamci.c                          |    3 +-
 drivers/watchdog/Kconfig                           |    2 +-
 .../asm/hardware => include/linux/amba}/pl080.h    |    2 +-
 17 files changed, 179 insertions(+), 69 deletions(-)
 create mode 100644 drivers/amba/Kconfig
 create mode 100644 drivers/amba/pci-amba.c
 rename {arch/arm/include/asm/hardware => include/linux/amba}/pl080.h (99%)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 1/7] DMA: PL330: use prefix in reg names to build under x86
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 13:42   ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

From: Alessandro Rubini <rubini@gnudd.com>

    This driver would not compile if ARM_AMBA is selected under x86,
    because "CS" and "DS" are already defined there.  But AMBA
    is used in the x86 world by a PCI-to-AMBA bridge, to be submitted.

    The patch just adds the "PL330_" prefix to all registers,
    so it can be built by randomconfig after ARM_AMBA appears within x86.
    No other technical changes have been performed.
    The patch was build-tested only.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
[Davide Ciminaghi <ciminaghi@gnudd.com>: only registers prefixed]
Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---

The patch is quite big, but what it actually does is just renaming the pl330
registers. What follows is the output of

git diff --word-diff 6c57c3ff~..6c57c3ff

This format should allow better readability for reviewing.
Note that 'index' and '@@' strings at the beginning of lines
have been escaped by adding a leading '#' to avoid errors while actually
applying the patch.


diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
#index f7edb6f..939eec6 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
#@@ -69,7 +69,7 @@ enum pl330_reqtype {
};

/* Register and Bit field Definitions */
#define [-DS-]{+PL330_DS+}		0x0
#define DS_ST_STOP		0x0
#define DS_ST_EXEC		0x1
#define DS_ST_CMISS		0x2
#@@ -83,33 +83,33 @@ enum pl330_reqtype {
#define DS_ST_FLTCMP		0xe
#define DS_ST_FAULT		0xf

#define [-DPC-]{+PL330_DPC+}		0x4
#define [-INTEN-]{+PL330_INTEN+}		0x20
#define [-ES-]{+PL330_ES+}		0x24
#define [-INTSTATUS-]{+PL330_INTSTATUS+}		0x28
#define [-INTCLR-]{+PL330_INTCLR+}		0x2c
#define [-FSM-]{+PL330_FSM+}		0x30
#define [-FSC-]{+PL330_FSC+}		0x34
#define [-FTM-]{+PL330_FTM+}		0x38

#define _FTC			0x40
#define [-FTC(n)-]{+PL330_FTC(n)+}		(_FTC + (n)*0x4)

#define _CS			0x100
#define [-CS(n)-]{+PL330_CS(n)+}		(_CS + (n)*0x8)
#define CS_CNS			(1 << 21)

#define _CPC			0x104
#define [-CPC(n)-]{+PL330_CPC(n)+}		(_CPC + (n)*0x8)

#define _SA			0x400
#define [-SA(n)-]{+PL330_SA(n)+}		(_SA + (n)*0x20)

#define _DA			0x404
#define [-DA(n)-]{+PL330_DA(n)+}		(_DA + (n)*0x20)

#define _CC			0x408
#define [-CC(n)-]{+PL330_CC(n)+}		(_CC + (n)*0x20)

#define CC_SRCINC		(1 << 0)
#define CC_DSTINC		(1 << 14)
#@@ -130,24 +130,24 @@ enum pl330_reqtype {
#define CC_SWAP_SHFT		28

#define _LC0			0x40c
#define [-LC0(n)-]{+PL330_LC0(n)+}		(_LC0 + (n)*0x20)

#define _LC1			0x410
#define [-LC1(n)-]{+PL330_LC1(n)+}		(_LC1 + (n)*0x20)

#define [-DBGSTATUS-]{+PL330_DBGSTATUS+}		0xd00
#define DBG_BUSY		(1 << 0)

#define [-DBGCMD-]{+PL330_DBGCMD+}		0xd04
#define [-DBGINST0-]{+PL330_DBGINST0+}		0xd08
#define [-DBGINST1-]{+PL330_DBGINST1+}		0xd0c

#define [-CR0-]{+PL330_CR0+}		0xe00
#define [-CR1-]{+PL330_CR1+}		0xe04
#define [-CR2-]{+PL330_CR2+}		0xe08
#define [-CR3-]{+PL330_CR3+}		0xe0c
#define [-CR4-]{+PL330_CR4+}		0xe10
#define [-CRD-]{+PL330_CRD+}		0xe14

#define PERIPH_ID		0xfe0
#define PERIPH_REV_SHIFT	20
#@@ -1016,7 +1016,7 @@ static bool _until_dmac_idle(struct pl330_thread *thrd)

	do {
		/* Until Manager is Idle */
		if (!(readl(regs + [-DBGSTATUS)-]{+PL330_DBGSTATUS)+} & DBG_BUSY))
			break;

		cpu_relax();
#@@ -1039,10 +1039,10 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
		val |= (1 << 0);
		val |= (thrd->id << 8); /* Channel Number */
	}
	writel(val, regs + [-DBGINST0);-]{+PL330_DBGINST0);+}

	val = *((u32 *)&insn[2]);
	writel(val, regs + [-DBGINST1);-]{+PL330_DBGINST1);+}

	/* If timed out due to halted state-machine */
	if (_until_dmac_idle(thrd)) {
#@@ -1051,7 +1051,7 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
	}

	/* Get going */
	writel(0, regs + [-DBGCMD);-]{+PL330_DBGCMD);+}
}

/*
#@@ -1076,9 +1076,9 @@ static inline u32 _state(struct pl330_thread *thrd)
	u32 val;

	if (is_manager(thrd))
		val = readl(regs + [-DS)-]{+PL330_DS)+} & 0xf;
	else
		val = readl(regs + [-CS(thrd->id))-]{+PL330_CS(thrd->id))+} & 0xf;

	switch (val) {
	case DS_ST_STOP:
#@@ -1145,7 +1145,8 @@ static void _stop(struct pl330_thread *thrd)
	_emit_KILL(0, insn);

	/* Stop generating interrupts for SEV */
	writel(readl(regs + [-INTEN)-]{+PL330_INTEN)+} & ~(1 << thrd->ev),
	       regs + [-INTEN);-]{+PL330_INTEN);+}

	_execute_DBGINSN(thrd, insn, is_manager(thrd));
}
#@@ -1184,7 +1185,7 @@ static bool _trigger(struct pl330_thread *thrd)

	if (r->cfg)
		ns = r->cfg->nonsecure ? 1 : 0;
	else if (readl(regs + [-CS(thrd->id))-]{+PL330_CS(thrd->id))+} & CS_CNS)
		ns = 1;
	else
		ns = 0;
#@@ -1200,7 +1201,7 @@ static bool _trigger(struct pl330_thread *thrd)
	_emit_GO(0, insn, &go);

	/* Set to generate interrupts for SEV */
	writel(readl(regs + [-INTEN)-]{+PL330_INTEN)+} | (1 << thrd->ev), regs + [-INTEN);-]{+PL330_INTEN);+}

	/* Only manager can execute GO */
	_execute_DBGINSN(thrd, insn, true);
#@@ -1575,7 +1576,7 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r)

		ccr = _prepare_ccr(r->cfg);
	} else {
		ccr = readl(regs + [-CC(thrd->id));-]{+PL330_CC(thrd->id));+}
	}

	/* If this req doesn't have valid xfer settings */
#@@ -1652,7 +1653,7 @@ static void pl330_dotask(unsigned long data)

			_stop(thrd);

			if (readl(regs + [-FSC)-]{+PL330_FSC)+} & (1 << thrd->id))
				err = PL330_ERR_FAIL;
			else
				err = PL330_ERR_ABORT;
#@@ -1697,13 +1698,13 @@ static int pl330_update(const struct pl330_info *pi)

	spin_lock_irqsave(&pl330->lock, flags);

	val = readl(regs + [-FSM)-]{+PL330_FSM)+} & 0x1;
	if (val)
		pl330->dmac_tbd.reset_mngr = true;
	else
		pl330->dmac_tbd.reset_mngr = false;

	val = readl(regs + [-FSC)-]{+PL330_FSC)+} & ((1 << pi->pcfg.num_chan) - 1);
	pl330->dmac_tbd.reset_chan |= val;
	if (val) {
		int i = 0;
#@@ -1711,8 +1712,8 @@ static int pl330_update(const struct pl330_info *pi)
			if (val & (1 << i)) {
				dev_info(pi->dev,
					"Reset Channel-%d\t CS-%x FTC-%x\n",
						i, readl(regs + [-CS(i)),-]{+PL330_CS(i)),+}
						readl(regs + [-FTC(i)));-]{+PL330_FTC(i)));+}
				_stop(&pl330->channels[i]);
			}
			i++;
#@@ -1720,7 +1721,7 @@ static int pl330_update(const struct pl330_info *pi)
	}

	/* Check which event happened i.e, thread notified */
	val = readl(regs + [-ES);-]{+PL330_ES);+}
	if (pi->pcfg.num_events < 32
			&& val & ~((1 << pi->pcfg.num_events) - 1)) {
		pl330->dmac_tbd.reset_dmac = true;
#@@ -1732,12 +1733,12 @@ static int pl330_update(const struct pl330_info *pi)
	for (ev = 0; ev < pi->pcfg.num_events; ev++) {
		if (val & (1 << ev)) { /* Event occurred */
			struct pl330_thread *thrd;
			u32 inten = readl(regs + [-INTEN);-]{+PL330_INTEN);+}
			int active;

			/* Clear the event */
			if (inten & (1 << ev))
				writel(1 << ev, regs + [-INTCLR);-]{+PL330_INTCLR);+}

			ret = 1;

#@@ -1944,41 +1945,41 @@ static void read_dmac_config(struct pl330_info *pi)
	void __iomem *regs = pi->base;
	u32 val;

	val = readl(regs + [-CRD)-]{+PL330_CRD)+} >> CRD_DATA_WIDTH_SHIFT;
	val &= CRD_DATA_WIDTH_MASK;
	pi->pcfg.data_bus_width = 8 * (1 << val);

	val = readl(regs + [-CRD)-]{+PL330_CRD)+} >> CRD_DATA_BUFF_SHIFT;
	val &= CRD_DATA_BUFF_MASK;
	pi->pcfg.data_buf_dep = val + 1;

	val = readl(regs + [-CR0)-]{+PL330_CR0)+} >> CR0_NUM_CHANS_SHIFT;
	val &= CR0_NUM_CHANS_MASK;
	val += 1;
	pi->pcfg.num_chan = val;

	val = readl(regs + [-CR0);-]{+PL330_CR0);+}
	if (val & CR0_PERIPH_REQ_SET) {
		val = (val >> CR0_NUM_PERIPH_SHIFT) & CR0_NUM_PERIPH_MASK;
		val += 1;
		pi->pcfg.num_peri = val;
		pi->pcfg.peri_ns = readl(regs + [-CR4);-]{+PL330_CR4);+}
	} else {
		pi->pcfg.num_peri = 0;
	}

	val = readl(regs + [-CR0);-]{+PL330_CR0);+}
	if (val & CR0_BOOT_MAN_NS)
		pi->pcfg.mode |= DMAC_MODE_NS;
	else
		pi->pcfg.mode &= ~DMAC_MODE_NS;

	val = readl(regs + [-CR0)-]{+PL330_CR0)+} >> CR0_NUM_EVENTS_SHIFT;
	val &= CR0_NUM_EVENTS_MASK;
	val += 1;
	pi->pcfg.num_events = val;

	pi->pcfg.irq_ns = readl(regs + [-CR3);-]{+PL330_CR3);+}

	pi->pcfg.periph_id = get_id(pi, PERIPH_ID);
	pi->pcfg.pcell_id = get_id(pi, PCELL_ID);

And here's the actual patch:

 drivers/dma/pl330.c |  107 ++++++++++++++++++++++++++-------------------------
 1 file changed, 54 insertions(+), 53 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index f7edb6f..939eec6 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -69,7 +69,7 @@ enum pl330_reqtype {
 };
 
 /* Register and Bit field Definitions */
-#define DS			0x0
+#define PL330_DS		0x0
 #define DS_ST_STOP		0x0
 #define DS_ST_EXEC		0x1
 #define DS_ST_CMISS		0x2
@@ -83,33 +83,33 @@ enum pl330_reqtype {
 #define DS_ST_FLTCMP		0xe
 #define DS_ST_FAULT		0xf
 
-#define DPC			0x4
-#define INTEN			0x20
-#define ES			0x24
-#define INTSTATUS		0x28
-#define INTCLR			0x2c
-#define FSM			0x30
-#define FSC			0x34
-#define FTM			0x38
+#define PL330_DPC		0x4
+#define PL330_INTEN		0x20
+#define PL330_ES		0x24
+#define PL330_INTSTATUS		0x28
+#define PL330_INTCLR		0x2c
+#define PL330_FSM		0x30
+#define PL330_FSC		0x34
+#define PL330_FTM		0x38
 
 #define _FTC			0x40
-#define FTC(n)			(_FTC + (n)*0x4)
+#define PL330_FTC(n)		(_FTC + (n)*0x4)
 
 #define _CS			0x100
-#define CS(n)			(_CS + (n)*0x8)
+#define PL330_CS(n)		(_CS + (n)*0x8)
 #define CS_CNS			(1 << 21)
 
 #define _CPC			0x104
-#define CPC(n)			(_CPC + (n)*0x8)
+#define PL330_CPC(n)		(_CPC + (n)*0x8)
 
 #define _SA			0x400
-#define SA(n)			(_SA + (n)*0x20)
+#define PL330_SA(n)		(_SA + (n)*0x20)
 
 #define _DA			0x404
-#define DA(n)			(_DA + (n)*0x20)
+#define PL330_DA(n)		(_DA + (n)*0x20)
 
 #define _CC			0x408
-#define CC(n)			(_CC + (n)*0x20)
+#define PL330_CC(n)		(_CC + (n)*0x20)
 
 #define CC_SRCINC		(1 << 0)
 #define CC_DSTINC		(1 << 14)
@@ -130,24 +130,24 @@ enum pl330_reqtype {
 #define CC_SWAP_SHFT		28
 
 #define _LC0			0x40c
-#define LC0(n)			(_LC0 + (n)*0x20)
+#define PL330_LC0(n)		(_LC0 + (n)*0x20)
 
 #define _LC1			0x410
-#define LC1(n)			(_LC1 + (n)*0x20)
+#define PL330_LC1(n)		(_LC1 + (n)*0x20)
 
-#define DBGSTATUS		0xd00
+#define PL330_DBGSTATUS		0xd00
 #define DBG_BUSY		(1 << 0)
 
-#define DBGCMD			0xd04
-#define DBGINST0		0xd08
-#define DBGINST1		0xd0c
+#define PL330_DBGCMD		0xd04
+#define PL330_DBGINST0		0xd08
+#define PL330_DBGINST1		0xd0c
 
-#define CR0			0xe00
-#define CR1			0xe04
-#define CR2			0xe08
-#define CR3			0xe0c
-#define CR4			0xe10
-#define CRD			0xe14
+#define PL330_CR0		0xe00
+#define PL330_CR1		0xe04
+#define PL330_CR2		0xe08
+#define PL330_CR3		0xe0c
+#define PL330_CR4		0xe10
+#define PL330_CRD		0xe14
 
 #define PERIPH_ID		0xfe0
 #define PERIPH_REV_SHIFT	20
@@ -1016,7 +1016,7 @@ static bool _until_dmac_idle(struct pl330_thread *thrd)
 
 	do {
 		/* Until Manager is Idle */
-		if (!(readl(regs + DBGSTATUS) & DBG_BUSY))
+		if (!(readl(regs + PL330_DBGSTATUS) & DBG_BUSY))
 			break;
 
 		cpu_relax();
@@ -1039,10 +1039,10 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
 		val |= (1 << 0);
 		val |= (thrd->id << 8); /* Channel Number */
 	}
-	writel(val, regs + DBGINST0);
+	writel(val, regs + PL330_DBGINST0);
 
 	val = *((u32 *)&insn[2]);
-	writel(val, regs + DBGINST1);
+	writel(val, regs + PL330_DBGINST1);
 
 	/* If timed out due to halted state-machine */
 	if (_until_dmac_idle(thrd)) {
@@ -1051,7 +1051,7 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
 	}
 
 	/* Get going */
-	writel(0, regs + DBGCMD);
+	writel(0, regs + PL330_DBGCMD);
 }
 
 /*
@@ -1076,9 +1076,9 @@ static inline u32 _state(struct pl330_thread *thrd)
 	u32 val;
 
 	if (is_manager(thrd))
-		val = readl(regs + DS) & 0xf;
+		val = readl(regs + PL330_DS) & 0xf;
 	else
-		val = readl(regs + CS(thrd->id)) & 0xf;
+		val = readl(regs + PL330_CS(thrd->id)) & 0xf;
 
 	switch (val) {
 	case DS_ST_STOP:
@@ -1145,7 +1145,8 @@ static void _stop(struct pl330_thread *thrd)
 	_emit_KILL(0, insn);
 
 	/* Stop generating interrupts for SEV */
-	writel(readl(regs + INTEN) & ~(1 << thrd->ev), regs + INTEN);
+	writel(readl(regs + PL330_INTEN) & ~(1 << thrd->ev),
+	       regs + PL330_INTEN);
 
 	_execute_DBGINSN(thrd, insn, is_manager(thrd));
 }
@@ -1184,7 +1185,7 @@ static bool _trigger(struct pl330_thread *thrd)
 
 	if (r->cfg)
 		ns = r->cfg->nonsecure ? 1 : 0;
-	else if (readl(regs + CS(thrd->id)) & CS_CNS)
+	else if (readl(regs + PL330_CS(thrd->id)) & CS_CNS)
 		ns = 1;
 	else
 		ns = 0;
@@ -1200,7 +1201,7 @@ static bool _trigger(struct pl330_thread *thrd)
 	_emit_GO(0, insn, &go);
 
 	/* Set to generate interrupts for SEV */
-	writel(readl(regs + INTEN) | (1 << thrd->ev), regs + INTEN);
+	writel(readl(regs + PL330_INTEN) | (1 << thrd->ev), regs + PL330_INTEN);
 
 	/* Only manager can execute GO */
 	_execute_DBGINSN(thrd, insn, true);
@@ -1575,7 +1576,7 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r)
 
 		ccr = _prepare_ccr(r->cfg);
 	} else {
-		ccr = readl(regs + CC(thrd->id));
+		ccr = readl(regs + PL330_CC(thrd->id));
 	}
 
 	/* If this req doesn't have valid xfer settings */
@@ -1652,7 +1653,7 @@ static void pl330_dotask(unsigned long data)
 
 			_stop(thrd);
 
-			if (readl(regs + FSC) & (1 << thrd->id))
+			if (readl(regs + PL330_FSC) & (1 << thrd->id))
 				err = PL330_ERR_FAIL;
 			else
 				err = PL330_ERR_ABORT;
@@ -1697,13 +1698,13 @@ static int pl330_update(const struct pl330_info *pi)
 
 	spin_lock_irqsave(&pl330->lock, flags);
 
-	val = readl(regs + FSM) & 0x1;
+	val = readl(regs + PL330_FSM) & 0x1;
 	if (val)
 		pl330->dmac_tbd.reset_mngr = true;
 	else
 		pl330->dmac_tbd.reset_mngr = false;
 
-	val = readl(regs + FSC) & ((1 << pi->pcfg.num_chan) - 1);
+	val = readl(regs + PL330_FSC) & ((1 << pi->pcfg.num_chan) - 1);
 	pl330->dmac_tbd.reset_chan |= val;
 	if (val) {
 		int i = 0;
@@ -1711,8 +1712,8 @@ static int pl330_update(const struct pl330_info *pi)
 			if (val & (1 << i)) {
 				dev_info(pi->dev,
 					"Reset Channel-%d\t CS-%x FTC-%x\n",
-						i, readl(regs + CS(i)),
-						readl(regs + FTC(i)));
+						i, readl(regs + PL330_CS(i)),
+						readl(regs + PL330_FTC(i)));
 				_stop(&pl330->channels[i]);
 			}
 			i++;
@@ -1720,7 +1721,7 @@ static int pl330_update(const struct pl330_info *pi)
 	}
 
 	/* Check which event happened i.e, thread notified */
-	val = readl(regs + ES);
+	val = readl(regs + PL330_ES);
 	if (pi->pcfg.num_events < 32
 			&& val & ~((1 << pi->pcfg.num_events) - 1)) {
 		pl330->dmac_tbd.reset_dmac = true;
@@ -1732,12 +1733,12 @@ static int pl330_update(const struct pl330_info *pi)
 	for (ev = 0; ev < pi->pcfg.num_events; ev++) {
 		if (val & (1 << ev)) { /* Event occurred */
 			struct pl330_thread *thrd;
-			u32 inten = readl(regs + INTEN);
+			u32 inten = readl(regs + PL330_INTEN);
 			int active;
 
 			/* Clear the event */
 			if (inten & (1 << ev))
-				writel(1 << ev, regs + INTCLR);
+				writel(1 << ev, regs + PL330_INTCLR);
 
 			ret = 1;
 
@@ -1944,41 +1945,41 @@ static void read_dmac_config(struct pl330_info *pi)
 	void __iomem *regs = pi->base;
 	u32 val;
 
-	val = readl(regs + CRD) >> CRD_DATA_WIDTH_SHIFT;
+	val = readl(regs + PL330_CRD) >> CRD_DATA_WIDTH_SHIFT;
 	val &= CRD_DATA_WIDTH_MASK;
 	pi->pcfg.data_bus_width = 8 * (1 << val);
 
-	val = readl(regs + CRD) >> CRD_DATA_BUFF_SHIFT;
+	val = readl(regs + PL330_CRD) >> CRD_DATA_BUFF_SHIFT;
 	val &= CRD_DATA_BUFF_MASK;
 	pi->pcfg.data_buf_dep = val + 1;
 
-	val = readl(regs + CR0) >> CR0_NUM_CHANS_SHIFT;
+	val = readl(regs + PL330_CR0) >> CR0_NUM_CHANS_SHIFT;
 	val &= CR0_NUM_CHANS_MASK;
 	val += 1;
 	pi->pcfg.num_chan = val;
 
-	val = readl(regs + CR0);
+	val = readl(regs + PL330_CR0);
 	if (val & CR0_PERIPH_REQ_SET) {
 		val = (val >> CR0_NUM_PERIPH_SHIFT) & CR0_NUM_PERIPH_MASK;
 		val += 1;
 		pi->pcfg.num_peri = val;
-		pi->pcfg.peri_ns = readl(regs + CR4);
+		pi->pcfg.peri_ns = readl(regs + PL330_CR4);
 	} else {
 		pi->pcfg.num_peri = 0;
 	}
 
-	val = readl(regs + CR0);
+	val = readl(regs + PL330_CR0);
 	if (val & CR0_BOOT_MAN_NS)
 		pi->pcfg.mode |= DMAC_MODE_NS;
 	else
 		pi->pcfg.mode &= ~DMAC_MODE_NS;
 
-	val = readl(regs + CR0) >> CR0_NUM_EVENTS_SHIFT;
+	val = readl(regs + PL330_CR0) >> CR0_NUM_EVENTS_SHIFT;
 	val &= CR0_NUM_EVENTS_MASK;
 	val += 1;
 	pi->pcfg.num_events = val;
 
-	pi->pcfg.irq_ns = readl(regs + CR3);
+	pi->pcfg.irq_ns = readl(regs + PL330_CR3);
 
 	pi->pcfg.periph_id = get_id(pi, PERIPH_ID);
 	pi->pcfg.pcell_id = get_id(pi, PCELL_ID);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 1/7] DMA: PL330: use prefix in reg names to build under x86
@ 2012-12-10 13:42   ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alessandro Rubini <rubini@gnudd.com>

    This driver would not compile if ARM_AMBA is selected under x86,
    because "CS" and "DS" are already defined there.  But AMBA
    is used in the x86 world by a PCI-to-AMBA bridge, to be submitted.

    The patch just adds the "PL330_" prefix to all registers,
    so it can be built by randomconfig after ARM_AMBA appears within x86.
    No other technical changes have been performed.
    The patch was build-tested only.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
[Davide Ciminaghi <ciminaghi@gnudd.com>: only registers prefixed]
Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---

The patch is quite big, but what it actually does is just renaming the pl330
registers. What follows is the output of

git diff --word-diff 6c57c3ff~..6c57c3ff

This format should allow better readability for reviewing.
Note that 'index' and '@@' strings at the beginning of lines
have been escaped by adding a leading '#' to avoid errors while actually
applying the patch.


diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
#index f7edb6f..939eec6 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
#@@ -69,7 +69,7 @@ enum pl330_reqtype {
};

/* Register and Bit field Definitions */
#define [-DS-]{+PL330_DS+}		0x0
#define DS_ST_STOP		0x0
#define DS_ST_EXEC		0x1
#define DS_ST_CMISS		0x2
#@@ -83,33 +83,33 @@ enum pl330_reqtype {
#define DS_ST_FLTCMP		0xe
#define DS_ST_FAULT		0xf

#define [-DPC-]{+PL330_DPC+}		0x4
#define [-INTEN-]{+PL330_INTEN+}		0x20
#define [-ES-]{+PL330_ES+}		0x24
#define [-INTSTATUS-]{+PL330_INTSTATUS+}		0x28
#define [-INTCLR-]{+PL330_INTCLR+}		0x2c
#define [-FSM-]{+PL330_FSM+}		0x30
#define [-FSC-]{+PL330_FSC+}		0x34
#define [-FTM-]{+PL330_FTM+}		0x38

#define _FTC			0x40
#define [-FTC(n)-]{+PL330_FTC(n)+}		(_FTC + (n)*0x4)

#define _CS			0x100
#define [-CS(n)-]{+PL330_CS(n)+}		(_CS + (n)*0x8)
#define CS_CNS			(1 << 21)

#define _CPC			0x104
#define [-CPC(n)-]{+PL330_CPC(n)+}		(_CPC + (n)*0x8)

#define _SA			0x400
#define [-SA(n)-]{+PL330_SA(n)+}		(_SA + (n)*0x20)

#define _DA			0x404
#define [-DA(n)-]{+PL330_DA(n)+}		(_DA + (n)*0x20)

#define _CC			0x408
#define [-CC(n)-]{+PL330_CC(n)+}		(_CC + (n)*0x20)

#define CC_SRCINC		(1 << 0)
#define CC_DSTINC		(1 << 14)
#@@ -130,24 +130,24 @@ enum pl330_reqtype {
#define CC_SWAP_SHFT		28

#define _LC0			0x40c
#define [-LC0(n)-]{+PL330_LC0(n)+}		(_LC0 + (n)*0x20)

#define _LC1			0x410
#define [-LC1(n)-]{+PL330_LC1(n)+}		(_LC1 + (n)*0x20)

#define [-DBGSTATUS-]{+PL330_DBGSTATUS+}		0xd00
#define DBG_BUSY		(1 << 0)

#define [-DBGCMD-]{+PL330_DBGCMD+}		0xd04
#define [-DBGINST0-]{+PL330_DBGINST0+}		0xd08
#define [-DBGINST1-]{+PL330_DBGINST1+}		0xd0c

#define [-CR0-]{+PL330_CR0+}		0xe00
#define [-CR1-]{+PL330_CR1+}		0xe04
#define [-CR2-]{+PL330_CR2+}		0xe08
#define [-CR3-]{+PL330_CR3+}		0xe0c
#define [-CR4-]{+PL330_CR4+}		0xe10
#define [-CRD-]{+PL330_CRD+}		0xe14

#define PERIPH_ID		0xfe0
#define PERIPH_REV_SHIFT	20
#@@ -1016,7 +1016,7 @@ static bool _until_dmac_idle(struct pl330_thread *thrd)

	do {
		/* Until Manager is Idle */
		if (!(readl(regs + [-DBGSTATUS)-]{+PL330_DBGSTATUS)+} & DBG_BUSY))
			break;

		cpu_relax();
#@@ -1039,10 +1039,10 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
		val |= (1 << 0);
		val |= (thrd->id << 8); /* Channel Number */
	}
	writel(val, regs + [-DBGINST0);-]{+PL330_DBGINST0);+}

	val = *((u32 *)&insn[2]);
	writel(val, regs + [-DBGINST1);-]{+PL330_DBGINST1);+}

	/* If timed out due to halted state-machine */
	if (_until_dmac_idle(thrd)) {
#@@ -1051,7 +1051,7 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
	}

	/* Get going */
	writel(0, regs + [-DBGCMD);-]{+PL330_DBGCMD);+}
}

/*
#@@ -1076,9 +1076,9 @@ static inline u32 _state(struct pl330_thread *thrd)
	u32 val;

	if (is_manager(thrd))
		val = readl(regs + [-DS)-]{+PL330_DS)+} & 0xf;
	else
		val = readl(regs + [-CS(thrd->id))-]{+PL330_CS(thrd->id))+} & 0xf;

	switch (val) {
	case DS_ST_STOP:
#@@ -1145,7 +1145,8 @@ static void _stop(struct pl330_thread *thrd)
	_emit_KILL(0, insn);

	/* Stop generating interrupts for SEV */
	writel(readl(regs + [-INTEN)-]{+PL330_INTEN)+} & ~(1 << thrd->ev),
	       regs + [-INTEN);-]{+PL330_INTEN);+}

	_execute_DBGINSN(thrd, insn, is_manager(thrd));
}
#@@ -1184,7 +1185,7 @@ static bool _trigger(struct pl330_thread *thrd)

	if (r->cfg)
		ns = r->cfg->nonsecure ? 1 : 0;
	else if (readl(regs + [-CS(thrd->id))-]{+PL330_CS(thrd->id))+} & CS_CNS)
		ns = 1;
	else
		ns = 0;
#@@ -1200,7 +1201,7 @@ static bool _trigger(struct pl330_thread *thrd)
	_emit_GO(0, insn, &go);

	/* Set to generate interrupts for SEV */
	writel(readl(regs + [-INTEN)-]{+PL330_INTEN)+} | (1 << thrd->ev), regs + [-INTEN);-]{+PL330_INTEN);+}

	/* Only manager can execute GO */
	_execute_DBGINSN(thrd, insn, true);
#@@ -1575,7 +1576,7 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r)

		ccr = _prepare_ccr(r->cfg);
	} else {
		ccr = readl(regs + [-CC(thrd->id));-]{+PL330_CC(thrd->id));+}
	}

	/* If this req doesn't have valid xfer settings */
#@@ -1652,7 +1653,7 @@ static void pl330_dotask(unsigned long data)

			_stop(thrd);

			if (readl(regs + [-FSC)-]{+PL330_FSC)+} & (1 << thrd->id))
				err = PL330_ERR_FAIL;
			else
				err = PL330_ERR_ABORT;
#@@ -1697,13 +1698,13 @@ static int pl330_update(const struct pl330_info *pi)

	spin_lock_irqsave(&pl330->lock, flags);

	val = readl(regs + [-FSM)-]{+PL330_FSM)+} & 0x1;
	if (val)
		pl330->dmac_tbd.reset_mngr = true;
	else
		pl330->dmac_tbd.reset_mngr = false;

	val = readl(regs + [-FSC)-]{+PL330_FSC)+} & ((1 << pi->pcfg.num_chan) - 1);
	pl330->dmac_tbd.reset_chan |= val;
	if (val) {
		int i = 0;
#@@ -1711,8 +1712,8 @@ static int pl330_update(const struct pl330_info *pi)
			if (val & (1 << i)) {
				dev_info(pi->dev,
					"Reset Channel-%d\t CS-%x FTC-%x\n",
						i, readl(regs + [-CS(i)),-]{+PL330_CS(i)),+}
						readl(regs + [-FTC(i)));-]{+PL330_FTC(i)));+}
				_stop(&pl330->channels[i]);
			}
			i++;
#@@ -1720,7 +1721,7 @@ static int pl330_update(const struct pl330_info *pi)
	}

	/* Check which event happened i.e, thread notified */
	val = readl(regs + [-ES);-]{+PL330_ES);+}
	if (pi->pcfg.num_events < 32
			&& val & ~((1 << pi->pcfg.num_events) - 1)) {
		pl330->dmac_tbd.reset_dmac = true;
#@@ -1732,12 +1733,12 @@ static int pl330_update(const struct pl330_info *pi)
	for (ev = 0; ev < pi->pcfg.num_events; ev++) {
		if (val & (1 << ev)) { /* Event occurred */
			struct pl330_thread *thrd;
			u32 inten = readl(regs + [-INTEN);-]{+PL330_INTEN);+}
			int active;

			/* Clear the event */
			if (inten & (1 << ev))
				writel(1 << ev, regs + [-INTCLR);-]{+PL330_INTCLR);+}

			ret = 1;

#@@ -1944,41 +1945,41 @@ static void read_dmac_config(struct pl330_info *pi)
	void __iomem *regs = pi->base;
	u32 val;

	val = readl(regs + [-CRD)-]{+PL330_CRD)+} >> CRD_DATA_WIDTH_SHIFT;
	val &= CRD_DATA_WIDTH_MASK;
	pi->pcfg.data_bus_width = 8 * (1 << val);

	val = readl(regs + [-CRD)-]{+PL330_CRD)+} >> CRD_DATA_BUFF_SHIFT;
	val &= CRD_DATA_BUFF_MASK;
	pi->pcfg.data_buf_dep = val + 1;

	val = readl(regs + [-CR0)-]{+PL330_CR0)+} >> CR0_NUM_CHANS_SHIFT;
	val &= CR0_NUM_CHANS_MASK;
	val += 1;
	pi->pcfg.num_chan = val;

	val = readl(regs + [-CR0);-]{+PL330_CR0);+}
	if (val & CR0_PERIPH_REQ_SET) {
		val = (val >> CR0_NUM_PERIPH_SHIFT) & CR0_NUM_PERIPH_MASK;
		val += 1;
		pi->pcfg.num_peri = val;
		pi->pcfg.peri_ns = readl(regs + [-CR4);-]{+PL330_CR4);+}
	} else {
		pi->pcfg.num_peri = 0;
	}

	val = readl(regs + [-CR0);-]{+PL330_CR0);+}
	if (val & CR0_BOOT_MAN_NS)
		pi->pcfg.mode |= DMAC_MODE_NS;
	else
		pi->pcfg.mode &= ~DMAC_MODE_NS;

	val = readl(regs + [-CR0)-]{+PL330_CR0)+} >> CR0_NUM_EVENTS_SHIFT;
	val &= CR0_NUM_EVENTS_MASK;
	val += 1;
	pi->pcfg.num_events = val;

	pi->pcfg.irq_ns = readl(regs + [-CR3);-]{+PL330_CR3);+}

	pi->pcfg.periph_id = get_id(pi, PERIPH_ID);
	pi->pcfg.pcell_id = get_id(pi, PCELL_ID);

And here's the actual patch:

 drivers/dma/pl330.c |  107 ++++++++++++++++++++++++++-------------------------
 1 file changed, 54 insertions(+), 53 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index f7edb6f..939eec6 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -69,7 +69,7 @@ enum pl330_reqtype {
 };
 
 /* Register and Bit field Definitions */
-#define DS			0x0
+#define PL330_DS		0x0
 #define DS_ST_STOP		0x0
 #define DS_ST_EXEC		0x1
 #define DS_ST_CMISS		0x2
@@ -83,33 +83,33 @@ enum pl330_reqtype {
 #define DS_ST_FLTCMP		0xe
 #define DS_ST_FAULT		0xf
 
-#define DPC			0x4
-#define INTEN			0x20
-#define ES			0x24
-#define INTSTATUS		0x28
-#define INTCLR			0x2c
-#define FSM			0x30
-#define FSC			0x34
-#define FTM			0x38
+#define PL330_DPC		0x4
+#define PL330_INTEN		0x20
+#define PL330_ES		0x24
+#define PL330_INTSTATUS		0x28
+#define PL330_INTCLR		0x2c
+#define PL330_FSM		0x30
+#define PL330_FSC		0x34
+#define PL330_FTM		0x38
 
 #define _FTC			0x40
-#define FTC(n)			(_FTC + (n)*0x4)
+#define PL330_FTC(n)		(_FTC + (n)*0x4)
 
 #define _CS			0x100
-#define CS(n)			(_CS + (n)*0x8)
+#define PL330_CS(n)		(_CS + (n)*0x8)
 #define CS_CNS			(1 << 21)
 
 #define _CPC			0x104
-#define CPC(n)			(_CPC + (n)*0x8)
+#define PL330_CPC(n)		(_CPC + (n)*0x8)
 
 #define _SA			0x400
-#define SA(n)			(_SA + (n)*0x20)
+#define PL330_SA(n)		(_SA + (n)*0x20)
 
 #define _DA			0x404
-#define DA(n)			(_DA + (n)*0x20)
+#define PL330_DA(n)		(_DA + (n)*0x20)
 
 #define _CC			0x408
-#define CC(n)			(_CC + (n)*0x20)
+#define PL330_CC(n)		(_CC + (n)*0x20)
 
 #define CC_SRCINC		(1 << 0)
 #define CC_DSTINC		(1 << 14)
@@ -130,24 +130,24 @@ enum pl330_reqtype {
 #define CC_SWAP_SHFT		28
 
 #define _LC0			0x40c
-#define LC0(n)			(_LC0 + (n)*0x20)
+#define PL330_LC0(n)		(_LC0 + (n)*0x20)
 
 #define _LC1			0x410
-#define LC1(n)			(_LC1 + (n)*0x20)
+#define PL330_LC1(n)		(_LC1 + (n)*0x20)
 
-#define DBGSTATUS		0xd00
+#define PL330_DBGSTATUS		0xd00
 #define DBG_BUSY		(1 << 0)
 
-#define DBGCMD			0xd04
-#define DBGINST0		0xd08
-#define DBGINST1		0xd0c
+#define PL330_DBGCMD		0xd04
+#define PL330_DBGINST0		0xd08
+#define PL330_DBGINST1		0xd0c
 
-#define CR0			0xe00
-#define CR1			0xe04
-#define CR2			0xe08
-#define CR3			0xe0c
-#define CR4			0xe10
-#define CRD			0xe14
+#define PL330_CR0		0xe00
+#define PL330_CR1		0xe04
+#define PL330_CR2		0xe08
+#define PL330_CR3		0xe0c
+#define PL330_CR4		0xe10
+#define PL330_CRD		0xe14
 
 #define PERIPH_ID		0xfe0
 #define PERIPH_REV_SHIFT	20
@@ -1016,7 +1016,7 @@ static bool _until_dmac_idle(struct pl330_thread *thrd)
 
 	do {
 		/* Until Manager is Idle */
-		if (!(readl(regs + DBGSTATUS) & DBG_BUSY))
+		if (!(readl(regs + PL330_DBGSTATUS) & DBG_BUSY))
 			break;
 
 		cpu_relax();
@@ -1039,10 +1039,10 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
 		val |= (1 << 0);
 		val |= (thrd->id << 8); /* Channel Number */
 	}
-	writel(val, regs + DBGINST0);
+	writel(val, regs + PL330_DBGINST0);
 
 	val = *((u32 *)&insn[2]);
-	writel(val, regs + DBGINST1);
+	writel(val, regs + PL330_DBGINST1);
 
 	/* If timed out due to halted state-machine */
 	if (_until_dmac_idle(thrd)) {
@@ -1051,7 +1051,7 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
 	}
 
 	/* Get going */
-	writel(0, regs + DBGCMD);
+	writel(0, regs + PL330_DBGCMD);
 }
 
 /*
@@ -1076,9 +1076,9 @@ static inline u32 _state(struct pl330_thread *thrd)
 	u32 val;
 
 	if (is_manager(thrd))
-		val = readl(regs + DS) & 0xf;
+		val = readl(regs + PL330_DS) & 0xf;
 	else
-		val = readl(regs + CS(thrd->id)) & 0xf;
+		val = readl(regs + PL330_CS(thrd->id)) & 0xf;
 
 	switch (val) {
 	case DS_ST_STOP:
@@ -1145,7 +1145,8 @@ static void _stop(struct pl330_thread *thrd)
 	_emit_KILL(0, insn);
 
 	/* Stop generating interrupts for SEV */
-	writel(readl(regs + INTEN) & ~(1 << thrd->ev), regs + INTEN);
+	writel(readl(regs + PL330_INTEN) & ~(1 << thrd->ev),
+	       regs + PL330_INTEN);
 
 	_execute_DBGINSN(thrd, insn, is_manager(thrd));
 }
@@ -1184,7 +1185,7 @@ static bool _trigger(struct pl330_thread *thrd)
 
 	if (r->cfg)
 		ns = r->cfg->nonsecure ? 1 : 0;
-	else if (readl(regs + CS(thrd->id)) & CS_CNS)
+	else if (readl(regs + PL330_CS(thrd->id)) & CS_CNS)
 		ns = 1;
 	else
 		ns = 0;
@@ -1200,7 +1201,7 @@ static bool _trigger(struct pl330_thread *thrd)
 	_emit_GO(0, insn, &go);
 
 	/* Set to generate interrupts for SEV */
-	writel(readl(regs + INTEN) | (1 << thrd->ev), regs + INTEN);
+	writel(readl(regs + PL330_INTEN) | (1 << thrd->ev), regs + PL330_INTEN);
 
 	/* Only manager can execute GO */
 	_execute_DBGINSN(thrd, insn, true);
@@ -1575,7 +1576,7 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r)
 
 		ccr = _prepare_ccr(r->cfg);
 	} else {
-		ccr = readl(regs + CC(thrd->id));
+		ccr = readl(regs + PL330_CC(thrd->id));
 	}
 
 	/* If this req doesn't have valid xfer settings */
@@ -1652,7 +1653,7 @@ static void pl330_dotask(unsigned long data)
 
 			_stop(thrd);
 
-			if (readl(regs + FSC) & (1 << thrd->id))
+			if (readl(regs + PL330_FSC) & (1 << thrd->id))
 				err = PL330_ERR_FAIL;
 			else
 				err = PL330_ERR_ABORT;
@@ -1697,13 +1698,13 @@ static int pl330_update(const struct pl330_info *pi)
 
 	spin_lock_irqsave(&pl330->lock, flags);
 
-	val = readl(regs + FSM) & 0x1;
+	val = readl(regs + PL330_FSM) & 0x1;
 	if (val)
 		pl330->dmac_tbd.reset_mngr = true;
 	else
 		pl330->dmac_tbd.reset_mngr = false;
 
-	val = readl(regs + FSC) & ((1 << pi->pcfg.num_chan) - 1);
+	val = readl(regs + PL330_FSC) & ((1 << pi->pcfg.num_chan) - 1);
 	pl330->dmac_tbd.reset_chan |= val;
 	if (val) {
 		int i = 0;
@@ -1711,8 +1712,8 @@ static int pl330_update(const struct pl330_info *pi)
 			if (val & (1 << i)) {
 				dev_info(pi->dev,
 					"Reset Channel-%d\t CS-%x FTC-%x\n",
-						i, readl(regs + CS(i)),
-						readl(regs + FTC(i)));
+						i, readl(regs + PL330_CS(i)),
+						readl(regs + PL330_FTC(i)));
 				_stop(&pl330->channels[i]);
 			}
 			i++;
@@ -1720,7 +1721,7 @@ static int pl330_update(const struct pl330_info *pi)
 	}
 
 	/* Check which event happened i.e, thread notified */
-	val = readl(regs + ES);
+	val = readl(regs + PL330_ES);
 	if (pi->pcfg.num_events < 32
 			&& val & ~((1 << pi->pcfg.num_events) - 1)) {
 		pl330->dmac_tbd.reset_dmac = true;
@@ -1732,12 +1733,12 @@ static int pl330_update(const struct pl330_info *pi)
 	for (ev = 0; ev < pi->pcfg.num_events; ev++) {
 		if (val & (1 << ev)) { /* Event occurred */
 			struct pl330_thread *thrd;
-			u32 inten = readl(regs + INTEN);
+			u32 inten = readl(regs + PL330_INTEN);
 			int active;
 
 			/* Clear the event */
 			if (inten & (1 << ev))
-				writel(1 << ev, regs + INTCLR);
+				writel(1 << ev, regs + PL330_INTCLR);
 
 			ret = 1;
 
@@ -1944,41 +1945,41 @@ static void read_dmac_config(struct pl330_info *pi)
 	void __iomem *regs = pi->base;
 	u32 val;
 
-	val = readl(regs + CRD) >> CRD_DATA_WIDTH_SHIFT;
+	val = readl(regs + PL330_CRD) >> CRD_DATA_WIDTH_SHIFT;
 	val &= CRD_DATA_WIDTH_MASK;
 	pi->pcfg.data_bus_width = 8 * (1 << val);
 
-	val = readl(regs + CRD) >> CRD_DATA_BUFF_SHIFT;
+	val = readl(regs + PL330_CRD) >> CRD_DATA_BUFF_SHIFT;
 	val &= CRD_DATA_BUFF_MASK;
 	pi->pcfg.data_buf_dep = val + 1;
 
-	val = readl(regs + CR0) >> CR0_NUM_CHANS_SHIFT;
+	val = readl(regs + PL330_CR0) >> CR0_NUM_CHANS_SHIFT;
 	val &= CR0_NUM_CHANS_MASK;
 	val += 1;
 	pi->pcfg.num_chan = val;
 
-	val = readl(regs + CR0);
+	val = readl(regs + PL330_CR0);
 	if (val & CR0_PERIPH_REQ_SET) {
 		val = (val >> CR0_NUM_PERIPH_SHIFT) & CR0_NUM_PERIPH_MASK;
 		val += 1;
 		pi->pcfg.num_peri = val;
-		pi->pcfg.peri_ns = readl(regs + CR4);
+		pi->pcfg.peri_ns = readl(regs + PL330_CR4);
 	} else {
 		pi->pcfg.num_peri = 0;
 	}
 
-	val = readl(regs + CR0);
+	val = readl(regs + PL330_CR0);
 	if (val & CR0_BOOT_MAN_NS)
 		pi->pcfg.mode |= DMAC_MODE_NS;
 	else
 		pi->pcfg.mode &= ~DMAC_MODE_NS;
 
-	val = readl(regs + CR0) >> CR0_NUM_EVENTS_SHIFT;
+	val = readl(regs + PL330_CR0) >> CR0_NUM_EVENTS_SHIFT;
 	val &= CR0_NUM_EVENTS_MASK;
 	val += 1;
 	pi->pcfg.num_events = val;
 
-	pi->pcfg.irq_ns = readl(regs + CR3);
+	pi->pcfg.irq_ns = readl(regs + PL330_CR3);
 
 	pi->pcfg.periph_id = get_id(pi, PERIPH_ID);
 	pi->pcfg.pcell_id = get_id(pi, PCELL_ID);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 13:42   ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

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.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
---
 arch/arm/mach-s3c64xx/dma.c                                   |    2 +-
 arch/arm/mach-spear3xx/spear3xx.c                             |    2 +-
 arch/arm/mach-spear6xx/spear6xx.c                             |    2 +-
 drivers/dma/amba-pl08x.c                                      |    2 +-
 {arch/arm/include/asm/hardware => include/linux/amba}/pl080.h |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename {arch/arm/include/asm/hardware => include/linux/amba}/pl080.h (99%)

diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index f2a7a17..a77f521 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/amba/pl080.h>
 
 #include <mach/dma.h>
 #include <mach/map.h>
@@ -30,7 +31,6 @@
 
 #include <mach/regs-sys.h>
 
-#include <asm/hardware/pl080.h>
 
 /* dma channel state information */
 
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index 38fe95d..88be9a3 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -16,9 +16,9 @@
 #include <linux/amba/pl022.h>
 #include <linux/amba/pl08x.h>
 #include <linux/irqchip/spear-shirq.h>
+#include <linux/amba/pl080.h>
 #include <linux/of_irq.h>
 #include <linux/io.h>
-#include <asm/hardware/pl080.h>
 #include <asm/hardware/vic.h>
 #include <plat/pl080.h>
 #include <mach/generic.h>
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index 5a5a52d..8ce65a2 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -20,7 +20,7 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/pl080.h>
+#include <linux/amba/pl080.h>
 #include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 6eb6a5c..8bad254 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -83,7 +83,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include <asm/hardware/pl080.h>
+#include <linux/amba/pl080.h>
 
 #include "dmaengine.h"
 #include "virt-dma.h"
diff --git a/arch/arm/include/asm/hardware/pl080.h b/include/linux/amba/pl080.h
similarity index 99%
rename from arch/arm/include/asm/hardware/pl080.h
rename to include/linux/amba/pl080.h
index 4eea210..3e7b62f 100644
--- a/arch/arm/include/asm/hardware/pl080.h
+++ b/include/linux/amba/pl080.h
@@ -1,4 +1,4 @@
-/* arch/arm/include/asm/hardware/pl080.h
+/* include/linux/amba/pl080.h
  *
  * Copyright 2008 Openmoko, Inc.
  * Copyright 2008 Simtec Electronics
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
@ 2012-12-10 13:42   ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
---
 arch/arm/mach-s3c64xx/dma.c                                   |    2 +-
 arch/arm/mach-spear3xx/spear3xx.c                             |    2 +-
 arch/arm/mach-spear6xx/spear6xx.c                             |    2 +-
 drivers/dma/amba-pl08x.c                                      |    2 +-
 {arch/arm/include/asm/hardware => include/linux/amba}/pl080.h |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename {arch/arm/include/asm/hardware => include/linux/amba}/pl080.h (99%)

diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index f2a7a17..a77f521 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/amba/pl080.h>
 
 #include <mach/dma.h>
 #include <mach/map.h>
@@ -30,7 +31,6 @@
 
 #include <mach/regs-sys.h>
 
-#include <asm/hardware/pl080.h>
 
 /* dma channel state information */
 
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index 38fe95d..88be9a3 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -16,9 +16,9 @@
 #include <linux/amba/pl022.h>
 #include <linux/amba/pl08x.h>
 #include <linux/irqchip/spear-shirq.h>
+#include <linux/amba/pl080.h>
 #include <linux/of_irq.h>
 #include <linux/io.h>
-#include <asm/hardware/pl080.h>
 #include <asm/hardware/vic.h>
 #include <plat/pl080.h>
 #include <mach/generic.h>
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index 5a5a52d..8ce65a2 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -20,7 +20,7 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/pl080.h>
+#include <linux/amba/pl080.h>
 #include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 6eb6a5c..8bad254 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -83,7 +83,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
-#include <asm/hardware/pl080.h>
+#include <linux/amba/pl080.h>
 
 #include "dmaengine.h"
 #include "virt-dma.h"
diff --git a/arch/arm/include/asm/hardware/pl080.h b/include/linux/amba/pl080.h
similarity index 99%
rename from arch/arm/include/asm/hardware/pl080.h
rename to include/linux/amba/pl080.h
index 4eea210..3e7b62f 100644
--- a/arch/arm/include/asm/hardware/pl080.h
+++ b/include/linux/amba/pl080.h
@@ -1,4 +1,4 @@
-/* arch/arm/include/asm/hardware/pl080.h
+/* include/linux/amba/pl080.h
  *
  * Copyright 2008 Openmoko, Inc.
  * Copyright 2008 Simtec Electronics
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 3/7] watchdog: sp805_wdt depends on ARM
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 13:42   ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

From: Alessandro Rubini <rubini@gnudd.com>

The SP805 driver is only used by the Spear machines, and uses
writel_relaxed, which is not available on all architectures.

The dependency from CONFIG_ARM avoids compilation problems under
randomconfig when CONFIG_ARM_AMBA is enabled for x86 builds.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---
 drivers/watchdog/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index ad1bb93..c76fc07 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -98,7 +98,7 @@ config WM8350_WATCHDOG
 
 config ARM_SP805_WATCHDOG
 	tristate "ARM SP805 Watchdog"
-	depends on ARM_AMBA
+	depends on ARM && ARM_AMBA
 	select WATCHDOG_CORE
 	help
 	  ARM Primecell SP805 Watchdog timer. This will reboot your system when
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 3/7] watchdog: sp805_wdt depends on ARM
@ 2012-12-10 13:42   ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alessandro Rubini <rubini@gnudd.com>

The SP805 driver is only used by the Spear machines, and uses
writel_relaxed, which is not available on all architectures.

The dependency from CONFIG_ARM avoids compilation problems under
randomconfig when CONFIG_ARM_AMBA is enabled for x86 builds.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---
 drivers/watchdog/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index ad1bb93..c76fc07 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -98,7 +98,7 @@ config WM8350_WATCHDOG
 
 config ARM_SP805_WATCHDOG
 	tristate "ARM SP805 Watchdog"
-	depends on ARM_AMBA
+	depends on ARM && ARM_AMBA
 	select WATCHDOG_CORE
 	help
 	  ARM Primecell SP805 Watchdog timer. This will reboot your system when
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 4/7] mmci: replace readsl/writesl with ioread32_rep/iowrite32_rep
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 13:42   ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

Not all the architectures have readsl/writesl,
use the more portable ioread32_rep/iowrite32_rep functions instead.

Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---
 drivers/mmc/host/mmci.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index aa04b42..1507723 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -863,14 +863,14 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
 		if (unlikely(count & 0x3)) {
 			if (count < 4) {
 				unsigned char buf[4];
-				readsl(base + MMCIFIFO, buf, 1);
+				ioread32_rep(base + MMCIFIFO, buf, 1);
 				memcpy(ptr, buf, count);
 			} else {
-				readsl(base + MMCIFIFO, ptr, count >> 2);
+				ioread32_rep(base + MMCIFIFO, ptr, count >> 2);
 				count &= ~0x3;
 			}
 		} else {
-			readsl(base + MMCIFIFO, ptr, count >> 2);
+			ioread32_rep(base + MMCIFIFO, ptr, count >> 2);
 		}
 
 		ptr += count;
@@ -907,7 +907,7 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem
 		 * byte become a 32bit write, 7 bytes will be two
 		 * 32bit writes etc.
 		 */
-		writesl(base + MMCIFIFO, ptr, (count + 3) >> 2);
+		iowrite32_rep(base + MMCIFIFO, ptr, (count + 3) >> 2);
 
 		ptr += count;
 		remain -= count;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 4/7] mmci: replace readsl/writesl with ioread32_rep/iowrite32_rep
@ 2012-12-10 13:42   ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

Not all the architectures have readsl/writesl,
use the more portable ioread32_rep/iowrite32_rep functions instead.

Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---
 drivers/mmc/host/mmci.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index aa04b42..1507723 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -863,14 +863,14 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
 		if (unlikely(count & 0x3)) {
 			if (count < 4) {
 				unsigned char buf[4];
-				readsl(base + MMCIFIFO, buf, 1);
+				ioread32_rep(base + MMCIFIFO, buf, 1);
 				memcpy(ptr, buf, count);
 			} else {
-				readsl(base + MMCIFIFO, ptr, count >> 2);
+				ioread32_rep(base + MMCIFIFO, ptr, count >> 2);
 				count &= ~0x3;
 			}
 		} else {
-			readsl(base + MMCIFIFO, ptr, count >> 2);
+			ioread32_rep(base + MMCIFIFO, ptr, count >> 2);
 		}
 
 		ptr += count;
@@ -907,7 +907,7 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem
 		 * byte become a 32bit write, 7 bytes will be two
 		 * 32bit writes etc.
 		 */
-		writesl(base + MMCIFIFO, ptr, (count + 3) >> 2);
+		iowrite32_rep(base + MMCIFIFO, ptr, (count + 3) >> 2);
 
 		ptr += count;
 		remain -= count;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 5/7] mmc: use the new <linux/sizes.h>
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 13:42   ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

From: Alessandro Rubini <rubini@gnudd.com>

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
---
 drivers/mmc/host/mmci.c     |    2 +-
 drivers/mmc/host/msm_sdcc.c |    2 +-
 drivers/mmc/host/mvsdio.c   |    2 +-
 drivers/mmc/host/mxcmmc.c   |    2 +-
 drivers/mmc/host/pxamci.c   |    3 +--
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 1507723..81891dd 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -34,10 +34,10 @@
 #include <linux/pm_runtime.h>
 #include <linux/types.h>
 #include <linux/pinctrl/consumer.h>
+#include <linux/sizes.h>
 
 #include <asm/div64.h>
 #include <asm/io.h>
-#include <asm/sizes.h>
 
 #include "mmci.h"
 
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 7c0af0e..aa61b79 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -37,10 +37,10 @@
 #include <linux/memory.h>
 #include <linux/gfp.h>
 #include <linux/gpio.h>
+#include <linux/sizes.h>
 
 #include <asm/cacheflush.h>
 #include <asm/div64.h>
-#include <asm/sizes.h>
 
 #include <linux/platform_data/mmc-msm_sdcc.h>
 #include <mach/msm_iomap.h>
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index de4c20b..e313cd9 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -22,8 +22,8 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
+#include <linux/sizes.h>
 
-#include <asm/sizes.h>
 #include <asm/unaligned.h>
 #include <linux/platform_data/mmc-mvsdio.h>
 
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index a72936e..8ce7e73 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -34,10 +34,10 @@
 #include <linux/regulator/consumer.h>
 #include <linux/dmaengine.h>
 #include <linux/types.h>
+#include <linux/sizes.h>
 
 #include <asm/dma.h>
 #include <asm/irq.h>
-#include <asm/sizes.h>
 #include <linux/platform_data/mmc-mxcmmc.h>
 
 #include <linux/platform_data/dma-imx.h>
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 2b2f65a..6fa54a9 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -33,8 +33,7 @@
 #include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/of_device.h>
-
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 
 #include <mach/hardware.h>
 #include <mach/dma.h>
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 5/7] mmc: use the new <linux/sizes.h>
@ 2012-12-10 13:42   ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alessandro Rubini <rubini@gnudd.com>

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
---
 drivers/mmc/host/mmci.c     |    2 +-
 drivers/mmc/host/msm_sdcc.c |    2 +-
 drivers/mmc/host/mvsdio.c   |    2 +-
 drivers/mmc/host/mxcmmc.c   |    2 +-
 drivers/mmc/host/pxamci.c   |    3 +--
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 1507723..81891dd 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -34,10 +34,10 @@
 #include <linux/pm_runtime.h>
 #include <linux/types.h>
 #include <linux/pinctrl/consumer.h>
+#include <linux/sizes.h>
 
 #include <asm/div64.h>
 #include <asm/io.h>
-#include <asm/sizes.h>
 
 #include "mmci.h"
 
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 7c0af0e..aa61b79 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -37,10 +37,10 @@
 #include <linux/memory.h>
 #include <linux/gfp.h>
 #include <linux/gpio.h>
+#include <linux/sizes.h>
 
 #include <asm/cacheflush.h>
 #include <asm/div64.h>
-#include <asm/sizes.h>
 
 #include <linux/platform_data/mmc-msm_sdcc.h>
 #include <mach/msm_iomap.h>
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index de4c20b..e313cd9 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -22,8 +22,8 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
+#include <linux/sizes.h>
 
-#include <asm/sizes.h>
 #include <asm/unaligned.h>
 #include <linux/platform_data/mmc-mvsdio.h>
 
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index a72936e..8ce7e73 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -34,10 +34,10 @@
 #include <linux/regulator/consumer.h>
 #include <linux/dmaengine.h>
 #include <linux/types.h>
+#include <linux/sizes.h>
 
 #include <asm/dma.h>
 #include <asm/irq.h>
-#include <asm/sizes.h>
 #include <linux/platform_data/mmc-mxcmmc.h>
 
 #include <linux/platform_data/dma-imx.h>
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 2b2f65a..6fa54a9 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -33,8 +33,7 @@
 #include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/of_device.h>
-
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 
 #include <mach/hardware.h>
 #include <mach/dma.h>
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 6/7] drivers/amba: add support for a PCI bridge
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 13:42   ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

From: Alessandro Rubini <rubini@gnudd.com>

This is a PCI driver that registers AMBA devices for the range of
supported devices.  It is currently used by STA2X11, which exports
AMBA peripherals under PCIe.  The original AMBA drivers work with no
changes or minimal ones.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alan Cox <alan@linux.intel.com>
---
 drivers/Kconfig         |    2 +
 drivers/amba/Kconfig    |   10 +++++
 drivers/amba/Makefile   |    1 +
 drivers/amba/pci-amba.c |   93 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 106 insertions(+)
 create mode 100644 drivers/amba/Kconfig
 create mode 100644 drivers/amba/pci-amba.c

diff --git a/drivers/Kconfig b/drivers/Kconfig
index f5fb072..06838d5 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -158,4 +158,6 @@ source "drivers/irqchip/Kconfig"
 
 source "drivers/ipack/Kconfig"
 
+source "drivers/amba/Kconfig"
+
 endmenu
diff --git a/drivers/amba/Kconfig b/drivers/amba/Kconfig
new file mode 100644
index 0000000..b5b5aca
--- /dev/null
+++ b/drivers/amba/Kconfig
@@ -0,0 +1,10 @@
+
+config PCI_AMBA
+	tristate "PCI-to-AMBA bridge"
+	depends on ARM_AMBA && PCI
+	---help---
+	  This compiles a PCI driver that registers AMBA devices, so
+	  the respective AMBA driver can be used unchanged if you have
+	  a PCI to amba bridge. This is required for STA2X11 support.
+
+	  If uncertain, choose N.
diff --git a/drivers/amba/Makefile b/drivers/amba/Makefile
index 66e81c2..d30e947 100644
--- a/drivers/amba/Makefile
+++ b/drivers/amba/Makefile
@@ -1,2 +1,3 @@
 obj-$(CONFIG_ARM_AMBA)		+= bus.o
+obj-$(CONFIG_PCI_AMBA)		+= pci-amba.o
 obj-$(CONFIG_TEGRA_AHB)		+= tegra-ahb.o
diff --git a/drivers/amba/pci-amba.c b/drivers/amba/pci-amba.c
new file mode 100644
index 0000000..0b0a240
--- /dev/null
+++ b/drivers/amba/pci-amba.c
@@ -0,0 +1,93 @@
+/*
+ * Support for AMBA devices (both APB and AHB) behind a PCI bridge
+ * Copyright 2012 ST Microelectronics (Alessandro Rubini)
+ * GNU GPL version 2.
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/amba/bus.h>
+#include <linux/pci.h>
+#include <linux/pci_ids.h>
+#include <linux/slab.h>
+#include <linux/irq.h>
+#include <linux/sizes.h>
+
+static int __devinit pci_amba_probe(struct pci_dev *pdev,
+				     const struct pci_device_id *id)
+{
+	struct amba_device *adev;
+	char *name;
+	int ret;
+
+	pci_enable_msi(pdev);
+	ret = pci_enable_device(pdev);
+	if (ret)
+		return ret;
+
+	/* Create a name: each of them must be different */
+	name = devm_kzalloc(&pdev->dev, strlen(dev_name(&pdev->dev)) + 6,
+		GFP_KERNEL);
+	sprintf(name, "amba-%s", dev_name(&pdev->dev));
+
+	/* Simply build an amba device and register it */
+	adev = amba_device_alloc(name,  pdev->resource[0].start, SZ_4K);
+	if (!adev)
+		return -ENOMEM;
+	adev->irq[0] = pdev->irq;
+
+	/* This bridge can host both APB and AHB devices, so set master */
+	pci_set_master(pdev);
+	if (pdev->vendor == PCI_VENDOR_ID_STMICRO) {
+		/* Under sta2x11, DMA is there but limited to 512M */
+		adev->dma_mask = SZ_512M - 1;
+		adev->dev.coherent_dma_mask = SZ_512M - 1;
+	}
+
+	adev->dev.platform_data = pdev->dev.platform_data;
+	pci_set_drvdata(pdev, adev);
+
+	return amba_device_add(adev, &pdev->resource[0]);
+};
+
+static void __devexit pci_amba_remove(struct pci_dev *pdev)
+{
+	struct amba_device *adev = pci_get_drvdata(pdev);
+	amba_device_unregister(adev);
+	pci_disable_msi(pdev);
+}
+
+static DEFINE_PCI_DEVICE_TABLE(pci_amba_table) = {
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_UART_HWFC)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_UART_NO_HWFC)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SOC_DMA)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_I2C)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SPI_HS)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SDIO_EMMC)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SDIO)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_DMA)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_MSPS)},
+	{0,}
+};
+
+static struct pci_driver pci_amba_driver = {
+	.name		= "pci-amba",
+	.id_table	= pci_amba_table,
+	.probe		= pci_amba_probe,
+	.remove		= __devexit_p(pci_amba_remove),
+};
+
+static int __init pci_amba_init(void)
+{
+	return pci_register_driver(&pci_amba_driver);
+}
+
+static void __exit pci_amba_exit(void)
+{
+	pci_unregister_driver(&pci_amba_driver);
+}
+
+module_init(pci_amba_init);
+module_exit(pci_amba_exit);
+
+MODULE_LICENSE("GPL");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 6/7] drivers/amba: add support for a PCI bridge
@ 2012-12-10 13:42   ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alessandro Rubini <rubini@gnudd.com>

This is a PCI driver that registers AMBA devices for the range of
supported devices.  It is currently used by STA2X11, which exports
AMBA peripherals under PCIe.  The original AMBA drivers work with no
changes or minimal ones.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alan Cox <alan@linux.intel.com>
---
 drivers/Kconfig         |    2 +
 drivers/amba/Kconfig    |   10 +++++
 drivers/amba/Makefile   |    1 +
 drivers/amba/pci-amba.c |   93 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 106 insertions(+)
 create mode 100644 drivers/amba/Kconfig
 create mode 100644 drivers/amba/pci-amba.c

diff --git a/drivers/Kconfig b/drivers/Kconfig
index f5fb072..06838d5 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -158,4 +158,6 @@ source "drivers/irqchip/Kconfig"
 
 source "drivers/ipack/Kconfig"
 
+source "drivers/amba/Kconfig"
+
 endmenu
diff --git a/drivers/amba/Kconfig b/drivers/amba/Kconfig
new file mode 100644
index 0000000..b5b5aca
--- /dev/null
+++ b/drivers/amba/Kconfig
@@ -0,0 +1,10 @@
+
+config PCI_AMBA
+	tristate "PCI-to-AMBA bridge"
+	depends on ARM_AMBA && PCI
+	---help---
+	  This compiles a PCI driver that registers AMBA devices, so
+	  the respective AMBA driver can be used unchanged if you have
+	  a PCI to amba bridge. This is required for STA2X11 support.
+
+	  If uncertain, choose N.
diff --git a/drivers/amba/Makefile b/drivers/amba/Makefile
index 66e81c2..d30e947 100644
--- a/drivers/amba/Makefile
+++ b/drivers/amba/Makefile
@@ -1,2 +1,3 @@
 obj-$(CONFIG_ARM_AMBA)		+= bus.o
+obj-$(CONFIG_PCI_AMBA)		+= pci-amba.o
 obj-$(CONFIG_TEGRA_AHB)		+= tegra-ahb.o
diff --git a/drivers/amba/pci-amba.c b/drivers/amba/pci-amba.c
new file mode 100644
index 0000000..0b0a240
--- /dev/null
+++ b/drivers/amba/pci-amba.c
@@ -0,0 +1,93 @@
+/*
+ * Support for AMBA devices (both APB and AHB) behind a PCI bridge
+ * Copyright 2012 ST Microelectronics (Alessandro Rubini)
+ * GNU GPL version 2.
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/amba/bus.h>
+#include <linux/pci.h>
+#include <linux/pci_ids.h>
+#include <linux/slab.h>
+#include <linux/irq.h>
+#include <linux/sizes.h>
+
+static int __devinit pci_amba_probe(struct pci_dev *pdev,
+				     const struct pci_device_id *id)
+{
+	struct amba_device *adev;
+	char *name;
+	int ret;
+
+	pci_enable_msi(pdev);
+	ret = pci_enable_device(pdev);
+	if (ret)
+		return ret;
+
+	/* Create a name: each of them must be different */
+	name = devm_kzalloc(&pdev->dev, strlen(dev_name(&pdev->dev)) + 6,
+		GFP_KERNEL);
+	sprintf(name, "amba-%s", dev_name(&pdev->dev));
+
+	/* Simply build an amba device and register it */
+	adev = amba_device_alloc(name,  pdev->resource[0].start, SZ_4K);
+	if (!adev)
+		return -ENOMEM;
+	adev->irq[0] = pdev->irq;
+
+	/* This bridge can host both APB and AHB devices, so set master */
+	pci_set_master(pdev);
+	if (pdev->vendor == PCI_VENDOR_ID_STMICRO) {
+		/* Under sta2x11, DMA is there but limited to 512M */
+		adev->dma_mask = SZ_512M - 1;
+		adev->dev.coherent_dma_mask = SZ_512M - 1;
+	}
+
+	adev->dev.platform_data = pdev->dev.platform_data;
+	pci_set_drvdata(pdev, adev);
+
+	return amba_device_add(adev, &pdev->resource[0]);
+};
+
+static void __devexit pci_amba_remove(struct pci_dev *pdev)
+{
+	struct amba_device *adev = pci_get_drvdata(pdev);
+	amba_device_unregister(adev);
+	pci_disable_msi(pdev);
+}
+
+static DEFINE_PCI_DEVICE_TABLE(pci_amba_table) = {
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_UART_HWFC)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_UART_NO_HWFC)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SOC_DMA)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_I2C)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SPI_HS)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SDIO_EMMC)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_SDIO)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_DMA)},
+	{PCI_VDEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_AUDIO_ROUTER_MSPS)},
+	{0,}
+};
+
+static struct pci_driver pci_amba_driver = {
+	.name		= "pci-amba",
+	.id_table	= pci_amba_table,
+	.probe		= pci_amba_probe,
+	.remove		= __devexit_p(pci_amba_remove),
+};
+
+static int __init pci_amba_init(void)
+{
+	return pci_register_driver(&pci_amba_driver);
+}
+
+static void __exit pci_amba_exit(void)
+{
+	pci_unregister_driver(&pci_amba_driver);
+}
+
+module_init(pci_amba_init);
+module_exit(pci_amba_exit);
+
+MODULE_LICENSE("GPL");
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 7/7] x86: add CONFIG_ARM_AMBA, selected by STA2X11
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 13:42   ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar
  Cc: linux-kernel, linux-arm-kernel, giancarlo.asnaghi

From: Alessandro Rubini <rubini@gnudd.com>

The sta2x11 I/O Hub is a bridge from PCIe to AMBA. It reuses a number
of amba drivers and needs to activate core bus support.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
---
 arch/x86/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5f67642..0659e7b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -521,6 +521,7 @@ config STA2X11
 	select SWIOTLB
 	select MFD_STA2X11
 	select ARCH_REQUIRE_GPIOLIB
+	select ARM_AMBA
 	default n
 	---help---
 	  This adds support for boards based on the STA2X11 IO-Hub,
@@ -2237,6 +2238,9 @@ config GEOS
 
 endif # X86_32
 
+config ARM_AMBA
+        bool
+
 config AMD_NB
 	def_bool y
 	depends on CPU_SUP_AMD && PCI
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 55+ messages in thread

* [PATCH v4 7/7] x86: add CONFIG_ARM_AMBA, selected by STA2X11
@ 2012-12-10 13:42   ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 13:42 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alessandro Rubini <rubini@gnudd.com>

The sta2x11 I/O Hub is a bridge from PCIe to AMBA. It reuses a number
of amba drivers and needs to activate core bus support.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
---
 arch/x86/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5f67642..0659e7b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -521,6 +521,7 @@ config STA2X11
 	select SWIOTLB
 	select MFD_STA2X11
 	select ARCH_REQUIRE_GPIOLIB
+	select ARM_AMBA
 	default n
 	---help---
 	  This adds support for boards based on the STA2X11 IO-Hub,
@@ -2237,6 +2238,9 @@ config GEOS
 
 endif # X86_32
 
+config ARM_AMBA
+        bool
+
 config AMD_NB
 	def_bool y
 	depends on CPU_SUP_AMD && PCI
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
  2012-12-10 13:42   ` Davide Ciminaghi
@ 2012-12-10 21:44     ` Linus Walleij
  -1 siblings, 0 replies; 55+ messages in thread
From: Linus Walleij @ 2012-12-10 21:44 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, rubini, wim, cjb, davidb, nico,
	ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

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.
>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>

Didn't I already ACK this?
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Pls ask Vinod to merge this.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
@ 2012-12-10 21:44     ` Linus Walleij
  0 siblings, 0 replies; 55+ messages in thread
From: Linus Walleij @ 2012-12-10 21:44 UTC (permalink / raw)
  To: linux-arm-kernel

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.
>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>

Didn't I already ACK this?
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Pls ask Vinod to merge this.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-10 22:15   ` David Brown
  -1 siblings, 0 replies; 55+ messages in thread
From: David Brown @ 2012-12-10 22:15 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb, nico,
	ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

On Mon, Dec 10, 2012 at 02:42:29PM +0100, Davide Ciminaghi wrote:
> Acked-by/Reviewed-by situation:
> 
> v1:
> 
> "mmc: use the new <linux/sizes.h>"
> Acked by David Brown (see https://lkml.org/lkml/2012/9/14/613)

The change doesn't look substantially different, you can keep my Ack
for it.

David

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-10 22:15   ` David Brown
  0 siblings, 0 replies; 55+ messages in thread
From: David Brown @ 2012-12-10 22:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 10, 2012 at 02:42:29PM +0100, Davide Ciminaghi wrote:
> Acked-by/Reviewed-by situation:
> 
> v1:
> 
> "mmc: use the new <linux/sizes.h>"
> Acked by David Brown (see https://lkml.org/lkml/2012/9/14/613)

The change doesn't look substantially different, you can keep my Ack
for it.

David

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
  2012-12-10 21:44     ` Linus Walleij
@ 2012-12-10 22:25       ` Davide Ciminaghi
  -1 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 22:25 UTC (permalink / raw)
  To: Linus Walleij
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, rubini, wim, cjb, davidb, nico,
	ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

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.
> >
> > Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> > Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> 
> Didn't I already ACK this?
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
yes, sorry. You ack was listed in the cover letter.

 
> Pls ask Vinod to merge this.
> 
ok.

Thanks and regards
Davide

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
@ 2012-12-10 22:25       ` Davide Ciminaghi
  0 siblings, 0 replies; 55+ messages in thread
From: Davide Ciminaghi @ 2012-12-10 22:25 UTC (permalink / raw)
  To: linux-arm-kernel

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.
> >
> > Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> > Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> 
> Didn't I already ACK this?
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
yes, sorry. You ack was listed in the cover letter.

 
> Pls ask Vinod to merge this.
> 
ok.

Thanks and regards
Davide

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 1/7] DMA: PL330: use prefix in reg names to build under x86
  2012-12-10 13:42   ` Davide Ciminaghi
@ 2012-12-11  4:25     ` Jassi Brar
  -1 siblings, 0 replies; 55+ messages in thread
From: Jassi Brar @ 2012-12-11  4:25 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: will.deacon, linux, tglx, mingo, hpa, djbw, vinod.koul,
	grant.likely, linus.walleij, rubini, wim, cjb, davidb, nico,
	ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

On 10 December 2012 19:12, Davide Ciminaghi <ciminaghi@gnudd.com> wrote:
> From: Alessandro Rubini <rubini@gnudd.com>
>
>     This driver would not compile if ARM_AMBA is selected under x86,
>     because "CS" and "DS" are already defined there.  But AMBA
>     is used in the x86 world by a PCI-to-AMBA bridge, to be submitted.
>
>     The patch just adds the "PL330_" prefix to all registers,
>     so it can be built by randomconfig after ARM_AMBA appears within x86.
>     No other technical changes have been performed.
>     The patch was build-tested only.
>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> [Davide Ciminaghi <ciminaghi@gnudd.com>: only registers prefixed]
> Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
> ---

 Acked-by: Jassi Brar <jassisinghbrar@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 1/7] DMA: PL330: use prefix in reg names to build under x86
@ 2012-12-11  4:25     ` Jassi Brar
  0 siblings, 0 replies; 55+ messages in thread
From: Jassi Brar @ 2012-12-11  4:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 10 December 2012 19:12, Davide Ciminaghi <ciminaghi@gnudd.com> wrote:
> From: Alessandro Rubini <rubini@gnudd.com>
>
>     This driver would not compile if ARM_AMBA is selected under x86,
>     because "CS" and "DS" are already defined there.  But AMBA
>     is used in the x86 world by a PCI-to-AMBA bridge, to be submitted.
>
>     The patch just adds the "PL330_" prefix to all registers,
>     so it can be built by randomconfig after ARM_AMBA appears within x86.
>     No other technical changes have been performed.
>     The patch was build-tested only.
>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> [Davide Ciminaghi <ciminaghi@gnudd.com>: only registers prefixed]
> Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
> ---

 Acked-by: Jassi Brar <jassisinghbrar@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 3/7] watchdog: sp805_wdt depends on ARM
  2012-12-10 13:42   ` Davide Ciminaghi
  (?)
@ 2012-12-12 21:21   ` Wim Van Sebroeck
  2012-12-12 22:20       ` Grant Likely
  -1 siblings, 1 reply; 55+ messages in thread
From: Wim Van Sebroeck @ 2012-12-12 21:21 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, hpa, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, cjb, davidb,
	nico, ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

Hi Davide

> From: Alessandro Rubini <rubini@gnudd.com>
> 
> The SP805 driver is only used by the Spear machines, and uses
> writel_relaxed, which is not available on all architectures.
> 
> The dependency from CONFIG_ARM avoids compilation problems under
> randomconfig when CONFIG_ARM_AMBA is enabled for x86 builds.
> 
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

Kind regards,
Wim.


^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 3/7] watchdog: sp805_wdt depends on ARM
  2012-12-12 21:21   ` Wim Van Sebroeck
@ 2012-12-12 22:20       ` Grant Likely
  0 siblings, 0 replies; 55+ messages in thread
From: Grant Likely @ 2012-12-12 22:20 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Davide Ciminaghi, Jaswinder Singh, Will Deacon,
	Russell King - ARM Linux, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, Dan Williams, Koul, Vinod, Linus Walleij, rubini,
	Chris Ball, David Brown, Nicolas Pitre, Ben Dooks, Viresh Kumar,
	rajeev-dlh.kumar, Linux Kernel Mailing List, linux-arm-kernel,
	giancarlo.asnaghi

On Wed, Dec 12, 2012 at 9:21 PM, Wim Van Sebroeck <wim@iguana.be> wrote:
> Hi Davide
>
>> From: Alessandro Rubini <rubini@gnudd.com>
>>
>> The SP805 driver is only used by the Spear machines, and uses
>> writel_relaxed, which is not available on all architectures.
>>
>> The dependency from CONFIG_ARM avoids compilation problems under
>> randomconfig when CONFIG_ARM_AMBA is enabled for x86 builds.
>>
>> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
>> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
>> Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
>
> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

Point of order. Adding Signed-off-by is only appropriate if you have
actually "handled" a patch (ie. either applied it to your own git tree
or you are reposting it). If you're merely stating that you're okay
with the patch then "Acked-by" is what you should use.

Signed-off-by is more properly about asserting that you received the
patch under licensing terms compatible with the current. See
Developer's Certificate of Origin in Documentation/SubmittingPatches
for details.

g.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 3/7] watchdog: sp805_wdt depends on ARM
@ 2012-12-12 22:20       ` Grant Likely
  0 siblings, 0 replies; 55+ messages in thread
From: Grant Likely @ 2012-12-12 22:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 12, 2012 at 9:21 PM, Wim Van Sebroeck <wim@iguana.be> wrote:
> Hi Davide
>
>> From: Alessandro Rubini <rubini@gnudd.com>
>>
>> The SP805 driver is only used by the Spear machines, and uses
>> writel_relaxed, which is not available on all architectures.
>>
>> The dependency from CONFIG_ARM avoids compilation problems under
>> randomconfig when CONFIG_ARM_AMBA is enabled for x86 builds.
>>
>> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
>> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
>> Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
>
> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

Point of order. Adding Signed-off-by is only appropriate if you have
actually "handled" a patch (ie. either applied it to your own git tree
or you are reposting it). If you're merely stating that you're okay
with the patch then "Acked-by" is what you should use.

Signed-off-by is more properly about asserting that you received the
patch under licensing terms compatible with the current. See
Developer's Certificate of Origin in Documentation/SubmittingPatches
for details.

g.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-13  0:37   ` H. Peter Anvin
  -1 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  0:37 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar,
	linux-kernel, linux-arm-kernel, giancarlo.asnaghi

OK, so I'm not 100% sure how to best handle this patchset.  I can carry 
it in the x86 tree with the appropriate ACKs... which could lead to ugly 
merge conflicts, or we can ask the respective driver authors to take 
their bits... but that gives a sequencing problem (the core patchset 
depends on a bunch of outside trees in order to be tested.)

Either way it is a late pull for 3.8 at best... however, the risk seems 
low so *maybe* that is acceptable.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-13  0:37   ` H. Peter Anvin
  0 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  0:37 UTC (permalink / raw)
  To: linux-arm-kernel

OK, so I'm not 100% sure how to best handle this patchset.  I can carry 
it in the x86 tree with the appropriate ACKs... which could lead to ugly 
merge conflicts, or we can ask the respective driver authors to take 
their bits... but that gives a sequencing problem (the core patchset 
depends on a bunch of outside trees in order to be tested.)

Either way it is a late pull for 3.8 at best... however, the risk seems 
low so *maybe* that is acceptable.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 7/7] x86: add CONFIG_ARM_AMBA, selected by STA2X11
  2012-12-10 13:42   ` Davide Ciminaghi
@ 2012-12-13  0:48     ` H. Peter Anvin
  -1 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  0:48 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar,
	linux-kernel, linux-arm-kernel, giancarlo.asnaghi

On 12/10/2012 05:42 AM, Davide Ciminaghi wrote:
> From: Alessandro Rubini <rubini@gnudd.com>
>
> The sta2x11 I/O Hub is a bridge from PCIe to AMBA. It reuses a number
> of amba drivers and needs to activate core bus support.
>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> ---
>   arch/x86/Kconfig |    4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5f67642..0659e7b 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -521,6 +521,7 @@ config STA2X11
>   	select SWIOTLB
>   	select MFD_STA2X11
>   	select ARCH_REQUIRE_GPIOLIB
> +	select ARM_AMBA
>   	default n
>   	---help---
>   	  This adds support for boards based on the STA2X11 IO-Hub,
> @@ -2237,6 +2238,9 @@ config GEOS
>
>   endif # X86_32
>
> +config ARM_AMBA
> +        bool
> +
>   config AMD_NB
>   	def_bool y
>   	depends on CPU_SUP_AMD && PCI
>

I would be happier if instead we made this match PCI and made this a 
depends on, but I'm not sure if it is worth holding up the patchset over.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 7/7] x86: add CONFIG_ARM_AMBA, selected by STA2X11
@ 2012-12-13  0:48     ` H. Peter Anvin
  0 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  0:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/10/2012 05:42 AM, Davide Ciminaghi wrote:
> From: Alessandro Rubini <rubini@gnudd.com>
>
> The sta2x11 I/O Hub is a bridge from PCIe to AMBA. It reuses a number
> of amba drivers and needs to activate core bus support.
>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
> ---
>   arch/x86/Kconfig |    4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5f67642..0659e7b 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -521,6 +521,7 @@ config STA2X11
>   	select SWIOTLB
>   	select MFD_STA2X11
>   	select ARCH_REQUIRE_GPIOLIB
> +	select ARM_AMBA
>   	default n
>   	---help---
>   	  This adds support for boards based on the STA2X11 IO-Hub,
> @@ -2237,6 +2238,9 @@ config GEOS
>
>   endif # X86_32
>
> +config ARM_AMBA
> +        bool
> +
>   config AMD_NB
>   	def_bool y
>   	depends on CPU_SUP_AMD && PCI
>

I would be happier if instead we made this match PCI and made this a 
depends on, but I'm not sure if it is worth holding up the patchset over.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-13  0:37   ` H. Peter Anvin
@ 2012-12-13  1:10     ` Grant Likely
  -1 siblings, 0 replies; 55+ messages in thread
From: Grant Likely @ 2012-12-13  1:10 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Davide Ciminaghi, Jaswinder Singh, Will Deacon,
	Russell King - ARM Linux, Thomas Gleixner, Ingo Molnar,
	Dan Williams, Koul, Vinod, Linus Walleij, rubini,
	Wim Van Sebroeck, Chris Ball, David Brown, Nicolas Pitre,
	Ben Dooks, Viresh Kumar, rajeev-dlh.kumar,
	Linux Kernel Mailing List, linux-arm-kernel, giancarlo.asnaghi

On Thu, Dec 13, 2012 at 12:37 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> OK, so I'm not 100% sure how to best handle this patchset.  I can carry it
> in the x86 tree with the appropriate ACKs... which could lead to ugly merge
> conflicts, or we can ask the respective driver authors to take their bits...
> but that gives a sequencing problem (the core patchset depends on a bunch of
> outside trees in order to be tested.)
>
> Either way it is a late pull for 3.8 at best... however, the risk seems low
> so *maybe* that is acceptable.

I'd put the whole series into a separate branch by itself and any
subsystems with problematic conflicts can merge it into their trees
also. I'm fine with putting it in the x86 tree for v3.9. I don't think
there is any huge rush on it.

g.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-13  1:10     ` Grant Likely
  0 siblings, 0 replies; 55+ messages in thread
From: Grant Likely @ 2012-12-13  1:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 13, 2012 at 12:37 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> OK, so I'm not 100% sure how to best handle this patchset.  I can carry it
> in the x86 tree with the appropriate ACKs... which could lead to ugly merge
> conflicts, or we can ask the respective driver authors to take their bits...
> but that gives a sequencing problem (the core patchset depends on a bunch of
> outside trees in order to be tested.)
>
> Either way it is a late pull for 3.8 at best... however, the risk seems low
> so *maybe* that is acceptable.

I'd put the whole series into a separate branch by itself and any
subsystems with problematic conflicts can merge it into their trees
also. I'm fine with putting it in the x86 tree for v3.9. I don't think
there is any huge rush on it.

g.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-13  1:10     ` Grant Likely
@ 2012-12-13  1:16       ` H. Peter Anvin
  -1 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  1:16 UTC (permalink / raw)
  To: Grant Likely
  Cc: Davide Ciminaghi, Jaswinder Singh, Will Deacon,
	Russell King - ARM Linux, Thomas Gleixner, Ingo Molnar,
	Dan Williams, Koul, Vinod, Linus Walleij, rubini,
	Wim Van Sebroeck, Chris Ball, David Brown, Nicolas Pitre,
	Ben Dooks, Viresh Kumar, rajeev-dlh.kumar,
	Linux Kernel Mailing List, linux-arm-kernel, giancarlo.asnaghi

On 12/12/2012 05:10 PM, Grant Likely wrote:
> On Thu, Dec 13, 2012 at 12:37 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>> OK, so I'm not 100% sure how to best handle this patchset.  I can carry it
>> in the x86 tree with the appropriate ACKs... which could lead to ugly merge
>> conflicts, or we can ask the respective driver authors to take their bits...
>> but that gives a sequencing problem (the core patchset depends on a bunch of
>> outside trees in order to be tested.)
>>
>> Either way it is a late pull for 3.8 at best... however, the risk seems low
>> so *maybe* that is acceptable.
> 
> I'd put the whole series into a separate branch by itself and any
> subsystems with problematic conflicts can merge it into their trees
> also. I'm fine with putting it in the x86 tree for v3.9. I don't think
> there is any huge rush on it.
> 

That was pretty much my preferred option.  I'll put it into tip:x86/amba.

	-hpa



^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-13  1:16       ` H. Peter Anvin
  0 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  1:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/12/2012 05:10 PM, Grant Likely wrote:
> On Thu, Dec 13, 2012 at 12:37 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>> OK, so I'm not 100% sure how to best handle this patchset.  I can carry it
>> in the x86 tree with the appropriate ACKs... which could lead to ugly merge
>> conflicts, or we can ask the respective driver authors to take their bits...
>> but that gives a sequencing problem (the core patchset depends on a bunch of
>> outside trees in order to be tested.)
>>
>> Either way it is a late pull for 3.8 at best... however, the risk seems low
>> so *maybe* that is acceptable.
> 
> I'd put the whole series into a separate branch by itself and any
> subsystems with problematic conflicts can merge it into their trees
> also. I'm fine with putting it in the x86 tree for v3.9. I don't think
> there is any huge rush on it.
> 

That was pretty much my preferred option.  I'll put it into tip:x86/amba.

	-hpa

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-10 13:42 ` Davide Ciminaghi
@ 2012-12-13  2:02   ` H. Peter Anvin
  -1 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  2:02 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar,
	linux-kernel, linux-arm-kernel, giancarlo.asnaghi

Hmm... with this patchset on top of v3.7 I still get a bunch of warnings 
and errors.

More details when the build completes (if it does.)  I might still push 
out the branch to let Fengguang's test robot take it for a spin.

	-hpa	

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-13  2:02   ` H. Peter Anvin
  0 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  2:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hmm... with this patchset on top of v3.7 I still get a bunch of warnings 
and errors.

More details when the build completes (if it does.)  I might still push 
out the branch to let Fengguang's test robot take it for a spin.

	-hpa	

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-13  2:02   ` H. Peter Anvin
@ 2012-12-13  2:16     ` H. Peter Anvin
  -1 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  2:16 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: jaswinder.singh, will.deacon, linux, tglx, mingo, djbw,
	vinod.koul, grant.likely, linus.walleij, rubini, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar,
	linux-kernel, linux-arm-kernel, giancarlo.asnaghi

On 12/12/2012 06:02 PM, H. Peter Anvin wrote:
> Hmm... with this patchset on top of v3.7 I still get a bunch of warnings
> and errors.
>
> More details when the build completes (if it does.)  I might still push
> out the branch to let Fengguang's test robot take it for a spin.
>

Build failure:

o.i386-allconfig/make.log:make[4]: *** [drivers/gpio/gpio-pl061.o] Error 1
o.i386-allconfig/make.log:make[3]: *** [drivers/gpio] Error 2

Warnings:

/home/hpa/kernel/tip.x86-amba/drivers/dma/amba-pl08x.c:848:3: warning: 
format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has 
type ‘dma_addr_t’ [-Wformat]
/home/hpa/kernel/tip.x86-amba/drivers/dma/amba-pl08x.c:848:3: warning: 
format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has 
type ‘dma_addr_t’ [-Wformat]
/home/hpa/kernel/tip.x86-amba/arch/x86/pci/sta2x11-fixup.c:186:2: 
warning: initialization from incompatible pointer type [enabled by default]
/home/hpa/kernel/tip.x86-amba/arch/x86/pci/sta2x11-fixup.c:186:2: 
warning: (near initialization for ‘sta2x11_dma_ops.free’) [enabled by 
default]
/home/hpa/kernel/tip.x86-amba/drivers/extcon/extcon-max77693.c:355:10: 
warning: ‘adclow’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
/home/hpa/kernel/tip.x86-amba/drivers/extcon/extcon-max77693.c:355:10: 
warning: ‘adc1k’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
/home/hpa/kernel/tip.x86-amba/drivers/extcon/extcon-max77693.c:355:10: 
warning: ‘adc’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-13  2:16     ` H. Peter Anvin
  0 siblings, 0 replies; 55+ messages in thread
From: H. Peter Anvin @ 2012-12-13  2:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/12/2012 06:02 PM, H. Peter Anvin wrote:
> Hmm... with this patchset on top of v3.7 I still get a bunch of warnings
> and errors.
>
> More details when the build completes (if it does.)  I might still push
> out the branch to let Fengguang's test robot take it for a spin.
>

Build failure:

o.i386-allconfig/make.log:make[4]: *** [drivers/gpio/gpio-pl061.o] Error 1
o.i386-allconfig/make.log:make[3]: *** [drivers/gpio] Error 2

Warnings:

/home/hpa/kernel/tip.x86-amba/drivers/dma/amba-pl08x.c:848:3: warning: 
format ?%x? expects argument of type ?unsigned int?, but argument 4 has 
type ?dma_addr_t? [-Wformat]
/home/hpa/kernel/tip.x86-amba/drivers/dma/amba-pl08x.c:848:3: warning: 
format ?%x? expects argument of type ?unsigned int?, but argument 7 has 
type ?dma_addr_t? [-Wformat]
/home/hpa/kernel/tip.x86-amba/arch/x86/pci/sta2x11-fixup.c:186:2: 
warning: initialization from incompatible pointer type [enabled by default]
/home/hpa/kernel/tip.x86-amba/arch/x86/pci/sta2x11-fixup.c:186:2: 
warning: (near initialization for ?sta2x11_dma_ops.free?) [enabled by 
default]
/home/hpa/kernel/tip.x86-amba/drivers/extcon/extcon-max77693.c:355:10: 
warning: ?adclow? may be used uninitialized in this function 
[-Wmaybe-uninitialized]
/home/hpa/kernel/tip.x86-amba/drivers/extcon/extcon-max77693.c:355:10: 
warning: ?adc1k? may be used uninitialized in this function 
[-Wmaybe-uninitialized]
/home/hpa/kernel/tip.x86-amba/drivers/extcon/extcon-max77693.c:355:10: 
warning: ?adc? may be used uninitialized in this function 
[-Wmaybe-uninitialized]

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-13  2:02   ` H. Peter Anvin
@ 2012-12-13 18:14     ` Alessandro Rubini
  -1 siblings, 0 replies; 55+ messages in thread
From: Alessandro Rubini @ 2012-12-13 18:14 UTC (permalink / raw)
  To: hpa
  Cc: ciminaghi, jaswinder.singh, will.deacon, linux, tglx, mingo,
	djbw, vinod.koul, grant.likely, linus.walleij, wim, cjb, davidb,
	nico, ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

Hello.

> Build failure:
> 
> o.i386-allconfig/make.log:make[4]: *** [drivers/gpio/gpio-pl061.o] Error 1
> o.i386-allconfig/make.log:make[3]: *** [drivers/gpio] Error 2

This happens because the pl061 is not in this checkout.

I also got a message from the "kbuild test robot", which results from
the same kind of problem.

I'll check the details later, identifying the missing patches and whether
there are remaining warnings.

> /home/hpa/kernel/tip.x86-amba/arch/x86/pci/sta2x11-fixup.c:186:2: 
> warning: initialization from incompatible pointer type [enabled by default]

This is a long-standing problem, but with not practical effects. I
proposed a pair of different fixes quite some months ago. I'll respin
the problem tomorrow.

/alessandro

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2012-12-13 18:14     ` Alessandro Rubini
  0 siblings, 0 replies; 55+ messages in thread
From: Alessandro Rubini @ 2012-12-13 18:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

> Build failure:
> 
> o.i386-allconfig/make.log:make[4]: *** [drivers/gpio/gpio-pl061.o] Error 1
> o.i386-allconfig/make.log:make[3]: *** [drivers/gpio] Error 2

This happens because the pl061 is not in this checkout.

I also got a message from the "kbuild test robot", which results from
the same kind of problem.

I'll check the details later, identifying the missing patches and whether
there are remaining warnings.

> /home/hpa/kernel/tip.x86-amba/arch/x86/pci/sta2x11-fixup.c:186:2: 
> warning: initialization from incompatible pointer type [enabled by default]

This is a long-standing problem, but with not practical effects. I
proposed a pair of different fixes quite some months ago. I'll respin
the problem tomorrow.

/alessandro

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
  2012-12-10 22:25       ` Davide Ciminaghi
@ 2013-01-13 13:25         ` Vinod Koul
  -1 siblings, 0 replies; 55+ messages in thread
From: Vinod Koul @ 2013-01-13 13:25 UTC (permalink / raw)
  To: Davide Ciminaghi
  Cc: Linus Walleij, jaswinder.singh, will.deacon, linux, tglx, mingo,
	hpa, djbw, grant.likely, rubini, wim, cjb, davidb, nico,
	ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

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	[flat|nested] 55+ messages in thread

* [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/
@ 2013-01-13 13:25         ` Vinod Koul
  0 siblings, 0 replies; 55+ messages in thread
From: Vinod Koul @ 2013-01-13 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

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	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-13 18:14     ` Alessandro Rubini
@ 2013-05-05 12:36       ` Borislav Petkov
  -1 siblings, 0 replies; 55+ messages in thread
From: Borislav Petkov @ 2013-05-05 12:36 UTC (permalink / raw)
  To: Alessandro Rubini
  Cc: hpa, ciminaghi, jaswinder.singh, will.deacon, linux, tglx, mingo,
	djbw, vinod.koul, grant.likely, linus.walleij, wim, cjb, davidb,
	nico, ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

On Thu, Dec 13, 2012 at 07:14:49PM +0100, Alessandro Rubini wrote:
> This is a long-standing problem, but with not practical effects. I
> proposed a pair of different fixes quite some months ago. I'll respin
> the problem tomorrow.

Did this got fixed in some tree in the meantime? Because I still see it on
current Linus + tip/master:

arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ‘sta2x11_dma_ops.free’) [enabled by default]

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2013-05-05 12:36       ` Borislav Petkov
  0 siblings, 0 replies; 55+ messages in thread
From: Borislav Petkov @ 2013-05-05 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 13, 2012 at 07:14:49PM +0100, Alessandro Rubini wrote:
> This is a long-standing problem, but with not practical effects. I
> proposed a pair of different fixes quite some months ago. I'll respin
> the problem tomorrow.

Did this got fixed in some tree in the meantime? Because I still see it on
current Linus + tip/master:

arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ?sta2x11_dma_ops.free?) [enabled by default]

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2012-12-13 18:14     ` Alessandro Rubini
@ 2013-05-05 20:24       ` Alessandro Rubini
  -1 siblings, 0 replies; 55+ messages in thread
From: Alessandro Rubini @ 2013-05-05 20:24 UTC (permalink / raw)
  To: bp
  Cc: hpa, ciminaghi, jaswinder.singh, will.deacon, linux, tglx, mingo,
	djbw, vinod.koul, grant.likely, linus.walleij, wim, cjb, davidb,
	nico, ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

> Did this got fixed in some tree in the meantime? Because I still see it on
> current Linus + tip/master:
> 
> arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
> arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ‘sta2x11_dma_ops.free’) [enabled by default]

Last time I sent the patch was on Feb 22nd:

   The .free field of struct dma_map_ops features a prototype that is
   different from what lib/swiotlb.c offers. The new "attrs" argument in
   dma_ops.free is missing from the generic implementation.

   This removes the build warning by providing a function that just calls
   swiotlb_free_coherent() without passing "attrs", like others do.

I got no reply.

This is the link:

    http://lkml.org/lkml/2013/2/22/111

It is in patchwork here:

    https://patchwork.kernel.org/patch/2175551/

/alessandro

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2013-05-05 20:24       ` Alessandro Rubini
  0 siblings, 0 replies; 55+ messages in thread
From: Alessandro Rubini @ 2013-05-05 20:24 UTC (permalink / raw)
  To: linux-arm-kernel

> Did this got fixed in some tree in the meantime? Because I still see it on
> current Linus + tip/master:
> 
> arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
> arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ???sta2x11_dma_ops.free???) [enabled by default]

Last time I sent the patch was on Feb 22nd:

   The .free field of struct dma_map_ops features a prototype that is
   different from what lib/swiotlb.c offers. The new "attrs" argument in
   dma_ops.free is missing from the generic implementation.

   This removes the build warning by providing a function that just calls
   swiotlb_free_coherent() without passing "attrs", like others do.

I got no reply.

This is the link:

    http://lkml.org/lkml/2013/2/22/111

It is in patchwork here:

    https://patchwork.kernel.org/patch/2175551/

/alessandro

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2013-05-05 20:24       ` Alessandro Rubini
@ 2013-05-05 20:39         ` Borislav Petkov
  -1 siblings, 0 replies; 55+ messages in thread
From: Borislav Petkov @ 2013-05-05 20:39 UTC (permalink / raw)
  To: Alessandro Rubini
  Cc: hpa, ciminaghi, jaswinder.singh, will.deacon, linux, tglx, mingo,
	djbw, vinod.koul, grant.likely, linus.walleij, wim, cjb, davidb,
	nico, ben-linux, viresh.linux, rajeev-dlh.kumar, linux-kernel,
	linux-arm-kernel, giancarlo.asnaghi

On Sun, May 05, 2013 at 10:24:22PM +0200, Alessandro Rubini wrote:
> > Did this got fixed in some tree in the meantime? Because I still see it on
> > current Linus + tip/master:
> > 
> > arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
> > arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ‘sta2x11_dma_ops.free’) [enabled by default]
> 
> Last time I sent the patch was on Feb 22nd:
> 
>    The .free field of struct dma_map_ops features a prototype that is
>    different from what lib/swiotlb.c offers. The new "attrs" argument in
>    dma_ops.free is missing from the generic implementation.
> 
>    This removes the build warning by providing a function that just calls
>    swiotlb_free_coherent() without passing "attrs", like others do.
> 
> I got no reply.

It probably fell through the cracks...

> This is the link:
> 
>     http://lkml.org/lkml/2013/2/22/111
> 
> It is in patchwork here:
> 
>     https://patchwork.kernel.org/patch/2175551/

Ingo, hpa, can you guys pick it up?

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2013-05-05 20:39         ` Borislav Petkov
  0 siblings, 0 replies; 55+ messages in thread
From: Borislav Petkov @ 2013-05-05 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 05, 2013 at 10:24:22PM +0200, Alessandro Rubini wrote:
> > Did this got fixed in some tree in the meantime? Because I still see it on
> > current Linus + tip/master:
> > 
> > arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
> > arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ???sta2x11_dma_ops.free???) [enabled by default]
> 
> Last time I sent the patch was on Feb 22nd:
> 
>    The .free field of struct dma_map_ops features a prototype that is
>    different from what lib/swiotlb.c offers. The new "attrs" argument in
>    dma_ops.free is missing from the generic implementation.
> 
>    This removes the build warning by providing a function that just calls
>    swiotlb_free_coherent() without passing "attrs", like others do.
> 
> I got no reply.

It probably fell through the cracks...

> This is the link:
> 
>     http://lkml.org/lkml/2013/2/22/111
> 
> It is in patchwork here:
> 
>     https://patchwork.kernel.org/patch/2175551/

Ingo, hpa, can you guys pick it up?

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2013-05-05 20:39         ` Borislav Petkov
@ 2013-05-06  9:41           ` Ingo Molnar
  -1 siblings, 0 replies; 55+ messages in thread
From: Ingo Molnar @ 2013-05-06  9:41 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Alessandro Rubini, hpa, ciminaghi, jaswinder.singh, will.deacon,
	linux, tglx, mingo, djbw, vinod.koul, grant.likely,
	linus.walleij, wim, cjb, davidb, nico, ben-linux, viresh.linux,
	rajeev-dlh.kumar, linux-kernel, linux-arm-kernel,
	giancarlo.asnaghi


* Borislav Petkov <bp@alien8.de> wrote:

> On Sun, May 05, 2013 at 10:24:22PM +0200, Alessandro Rubini wrote:
> > > Did this got fixed in some tree in the meantime? Because I still see it on
> > > current Linus + tip/master:
> > > 
> > > arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
> > > arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ??????sta2x11_dma_ops.free??????) [enabled by default]
> > 
> > Last time I sent the patch was on Feb 22nd:
> > 
> >    The .free field of struct dma_map_ops features a prototype that is
> >    different from what lib/swiotlb.c offers. The new "attrs" argument in
> >    dma_ops.free is missing from the generic implementation.
> > 
> >    This removes the build warning by providing a function that just calls
> >    swiotlb_free_coherent() without passing "attrs", like others do.
> > 
> > I got no reply.
> 
> It probably fell through the cracks...
> 
> > This is the link:
> > 
> >     http://lkml.org/lkml/2013/2/22/111
> > 
> > It is in patchwork here:
> > 
> >     https://patchwork.kernel.org/patch/2175551/
> 
> Ingo, hpa, can you guys pick it up?

A lot happened meanwhile - patches got acked, applied - so I expected a 
resend of the patches that are still pending, with all acks in place in 
the patches (not in the cover letter), and against Linus's latest tree.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2013-05-06  9:41           ` Ingo Molnar
  0 siblings, 0 replies; 55+ messages in thread
From: Ingo Molnar @ 2013-05-06  9:41 UTC (permalink / raw)
  To: linux-arm-kernel


* Borislav Petkov <bp@alien8.de> wrote:

> On Sun, May 05, 2013 at 10:24:22PM +0200, Alessandro Rubini wrote:
> > > Did this got fixed in some tree in the meantime? Because I still see it on
> > > current Linus + tip/master:
> > > 
> > > arch/x86/pci/sta2x11-fixup.c:186:2: warning: initialization from incompatible pointer type [enabled by default]
> > > arch/x86/pci/sta2x11-fixup.c:186:2: warning: (near initialization for ??????sta2x11_dma_ops.free??????) [enabled by default]
> > 
> > Last time I sent the patch was on Feb 22nd:
> > 
> >    The .free field of struct dma_map_ops features a prototype that is
> >    different from what lib/swiotlb.c offers. The new "attrs" argument in
> >    dma_ops.free is missing from the generic implementation.
> > 
> >    This removes the build warning by providing a function that just calls
> >    swiotlb_free_coherent() without passing "attrs", like others do.
> > 
> > I got no reply.
> 
> It probably fell through the cracks...
> 
> > This is the link:
> > 
> >     http://lkml.org/lkml/2013/2/22/111
> > 
> > It is in patchwork here:
> > 
> >     https://patchwork.kernel.org/patch/2175551/
> 
> Ingo, hpa, can you guys pick it up?

A lot happened meanwhile - patches got acked, applied - so I expected a 
resend of the patches that are still pending, with all acks in place in 
the patches (not in the cover letter), and against Linus's latest tree.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2013-05-05 20:39         ` Borislav Petkov
@ 2013-05-06  9:54           ` Alessandro Rubini
  -1 siblings, 0 replies; 55+ messages in thread
From: Alessandro Rubini @ 2013-05-06  9:54 UTC (permalink / raw)
  To: mingo
  Cc: bp, hpa, ciminaghi, jaswinder.singh, will.deacon, linux, tglx,
	mingo, djbw, vinod.koul, grant.likely, linus.walleij, wim, cjb,
	davidb, nico, ben-linux, viresh.linux, rajeev-dlh.kumar,
	linux-kernel, linux-arm-kernel, giancarlo.asnaghi

All-To: mingo@kernel.org,bp@alien8.de,hpa@zytor.com,ciminaghi@gnudd.com,jaswinder.singh@linaro.org,will.deacon@arm.com,linux@arm.linux.org.uk,tglx@linutronix.de,mingo@redhat.com,djbw@fb.com,vinod.koul@intel.com,grant.likely@secretlab.ca,linus.walleij@linaro.org,wim@iguana.be,cjb@laptop.org,davidb@codeaurora.org,nico@fluxnic.net,ben-linux@fluff.org,viresh.linux@gmail.com,rajeev-dlh.kumar@st.com,linux-kernel@vger.kernel.org,linux-arm-kernel@lists.infradead.org,giancarlo.asnaghi@st.com Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
> From: Ingo Molnar <mingo@kernel.org>
> To: Borislav Petkov <bp@alien8.de>
> Cc: Alessandro Rubini <rubini@gnudd.com>, hpa@zytor.com, ciminaghi@gnudd.com,         jaswinder.singh@linaro.org, will.deacon@arm.com,         linux@arm.linux.org.uk, tglx@linutronix.de, mingo@redhat.com,         djbw@fb.com, vinod.koul@intel.com, grant.likely@secretlab.ca,         linus.walleij@linaro.org, wim@iguana.be, cjb@laptop.org,         davidb@codeaurora.org, nico@fluxnic.net, ben-linux@fluff.org,         viresh.linux@gmail.com, rajeev-dlh.kumar@st.com,         linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,         giancarlo.asnaghi@st.com
> Subject: Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
> Date: Mon, 6 May 2013 11:41:54 +0200

> A lot happened meanwhile - patches got acked, applied - so I expected a 
> resend of the patches that are still pending, with all acks in place in 
> the patches (not in the cover letter), and against Linus's latest tree.

Ok, I'll resend this AMBA/PCI set.  But this warning we are discussing
about is unrelated and I sent it by itself in february.  Anyways, I'll
add it to the patch-set I'm going to send most likely tomorrow.

thanks
/alessndro

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2013-05-06  9:54           ` Alessandro Rubini
  0 siblings, 0 replies; 55+ messages in thread
From: Alessandro Rubini @ 2013-05-06  9:54 UTC (permalink / raw)
  To: linux-arm-kernel

All-To: mingo at kernel.org,bp at alien8.de,hpa at zytor.com,ciminaghi at gnudd.com,jaswinder.singh at linaro.org,will.deacon at arm.com,linux at arm.linux.org.uk,tglx at linutronix.de,mingo at redhat.com,djbw at fb.com,vinod.koul at intel.com,grant.likely at secretlab.ca,linus.walleij at linaro.org,wim at iguana.be,cjb at laptop.org,davidb at codeaurora.org,nico at fluxnic.net,ben-linux at fluff.org,viresh.linux at gmail.com,rajeev-dlh.kumar at st.com,linux-kernel at vger.kernel.org,linux-arm-kernel at lists.infradead.org,giancarlo.asnaghi at st.com Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
> From: Ingo Molnar <mingo@kernel.org>
> To: Borislav Petkov <bp@alien8.de>
> Cc: Alessandro Rubini <rubini@gnudd.com>, hpa at zytor.com, ciminaghi at gnudd.com,         jaswinder.singh at linaro.org, will.deacon at arm.com,         linux at arm.linux.org.uk, tglx at linutronix.de, mingo at redhat.com,         djbw at fb.com, vinod.koul at intel.com, grant.likely at secretlab.ca,         linus.walleij at linaro.org, wim at iguana.be, cjb at laptop.org,         davidb at codeaurora.org, nico at fluxnic.net, ben-linux at fluff.org,         viresh.linux at gmail.com, rajeev-dlh.kumar at st.com,         linux-kernel at vger.kernel.org, linux-arm-kernel at lists.infradead.org,         giancarlo.asnaghi at st.com
> Subject: Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
> Date: Mon, 6 May 2013 11:41:54 +0200

> A lot happened meanwhile - patches got acked, applied - so I expected a 
> resend of the patches that are still pending, with all acks in place in 
> the patches (not in the cover letter), and against Linus's latest tree.

Ok, I'll resend this AMBA/PCI set.  But this warning we are discussing
about is unrelated and I sent it by itself in february.  Anyways, I'll
add it to the patch-set I'm going to send most likely tomorrow.

thanks
/alessndro

^ permalink raw reply	[flat|nested] 55+ messages in thread

* Re: [PATCH v4 0/7] enable support for AMBA drivers under x86
  2013-05-06  9:41           ` Ingo Molnar
@ 2013-05-06 10:11             ` Borislav Petkov
  -1 siblings, 0 replies; 55+ messages in thread
From: Borislav Petkov @ 2013-05-06 10:11 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Alessandro Rubini, hpa, ciminaghi, jaswinder.singh, will.deacon,
	linux, tglx, mingo, djbw, vinod.koul, grant.likely,
	linus.walleij, wim, cjb, davidb, nico, ben-linux, viresh.linux,
	rajeev-dlh.kumar, linux-kernel, linux-arm-kernel,
	giancarlo.asnaghi

On Mon, May 06, 2013 at 11:41:54AM +0200, Ingo Molnar wrote:
> A lot happened meanwhile - patches got acked, applied - so I expected
> a resend of the patches that are still pending, with all acks in place
> in the patches (not in the cover letter), and against Linus's latest
> tree.

That one above was a single submission anyway and it could go in now
since it fixes a build issue. I don't know about the rest of the set
though.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 55+ messages in thread

* [PATCH v4 0/7] enable support for AMBA drivers under x86
@ 2013-05-06 10:11             ` Borislav Petkov
  0 siblings, 0 replies; 55+ messages in thread
From: Borislav Petkov @ 2013-05-06 10:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 06, 2013 at 11:41:54AM +0200, Ingo Molnar wrote:
> A lot happened meanwhile - patches got acked, applied - so I expected
> a resend of the patches that are still pending, with all acks in place
> in the patches (not in the cover letter), and against Linus's latest
> tree.

That one above was a single submission anyway and it could go in now
since it fixes a build issue. I don't know about the rest of the set
though.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2013-05-06 10:11 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-10 13:42 [PATCH v4 0/7] enable support for AMBA drivers under x86 Davide Ciminaghi
2012-12-10 13:42 ` Davide Ciminaghi
2012-12-10 13:42 ` [PATCH v4 1/7] DMA: PL330: use prefix in reg names to build " Davide Ciminaghi
2012-12-10 13:42   ` Davide Ciminaghi
2012-12-11  4:25   ` Jassi Brar
2012-12-11  4:25     ` Jassi Brar
2012-12-10 13:42 ` [PATCH v4 2/7] pl080.h: moved from arm/include/asm/hardware to include/linux/amba/ Davide Ciminaghi
2012-12-10 13:42   ` Davide Ciminaghi
2012-12-10 21:44   ` Linus Walleij
2012-12-10 21:44     ` Linus Walleij
2012-12-10 22:25     ` Davide Ciminaghi
2012-12-10 22:25       ` Davide Ciminaghi
2013-01-13 13:25       ` Vinod Koul
2013-01-13 13:25         ` Vinod Koul
2012-12-10 13:42 ` [PATCH v4 3/7] watchdog: sp805_wdt depends on ARM Davide Ciminaghi
2012-12-10 13:42   ` Davide Ciminaghi
2012-12-12 21:21   ` Wim Van Sebroeck
2012-12-12 22:20     ` Grant Likely
2012-12-12 22:20       ` Grant Likely
2012-12-10 13:42 ` [PATCH v4 4/7] mmci: replace readsl/writesl with ioread32_rep/iowrite32_rep Davide Ciminaghi
2012-12-10 13:42   ` Davide Ciminaghi
2012-12-10 13:42 ` [PATCH v4 5/7] mmc: use the new <linux/sizes.h> Davide Ciminaghi
2012-12-10 13:42   ` Davide Ciminaghi
2012-12-10 13:42 ` [PATCH v4 6/7] drivers/amba: add support for a PCI bridge Davide Ciminaghi
2012-12-10 13:42   ` Davide Ciminaghi
2012-12-10 13:42 ` [PATCH v4 7/7] x86: add CONFIG_ARM_AMBA, selected by STA2X11 Davide Ciminaghi
2012-12-10 13:42   ` Davide Ciminaghi
2012-12-13  0:48   ` H. Peter Anvin
2012-12-13  0:48     ` H. Peter Anvin
2012-12-10 22:15 ` [PATCH v4 0/7] enable support for AMBA drivers under x86 David Brown
2012-12-10 22:15   ` David Brown
2012-12-13  0:37 ` H. Peter Anvin
2012-12-13  0:37   ` H. Peter Anvin
2012-12-13  1:10   ` Grant Likely
2012-12-13  1:10     ` Grant Likely
2012-12-13  1:16     ` H. Peter Anvin
2012-12-13  1:16       ` H. Peter Anvin
2012-12-13  2:02 ` H. Peter Anvin
2012-12-13  2:02   ` H. Peter Anvin
2012-12-13  2:16   ` H. Peter Anvin
2012-12-13  2:16     ` H. Peter Anvin
2012-12-13 18:14   ` Alessandro Rubini
2012-12-13 18:14     ` Alessandro Rubini
2013-05-05 12:36     ` Borislav Petkov
2013-05-05 12:36       ` Borislav Petkov
2013-05-05 20:24     ` Alessandro Rubini
2013-05-05 20:24       ` Alessandro Rubini
2013-05-05 20:39       ` Borislav Petkov
2013-05-05 20:39         ` Borislav Petkov
2013-05-06  9:41         ` Ingo Molnar
2013-05-06  9:41           ` Ingo Molnar
2013-05-06 10:11           ` Borislav Petkov
2013-05-06 10:11             ` Borislav Petkov
2013-05-06  9:54         ` Alessandro Rubini
2013-05-06  9:54           ` Alessandro Rubini

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.