* [PATCH 2/4] amba-pl022: Add loopback support for the SPI on 5500
2011-03-15 14:41 [PATCH 0/4] Fix ST-Ericsson Ux500 specific PL022 & PL180 amba devices Philippe Langlais
2011-03-15 14:41 ` [PATCH 1/4] amba: add name based matching Philippe Langlais
@ 2011-03-15 14:41 ` Philippe Langlais
2011-03-15 14:41 ` [PATCH 3/4] mmci/pl180: Support for db8500v2. ST-Ericsson modified ARM PrimeCell PL180 block has not got an updated corresponding amba-id, althought the IP block has changed in db8500v2. The change was done to the datactrl register Philippe Langlais
2011-03-15 14:41 ` [PATCH 4/4] ux500: pass name for db5500-spi & db8500v2-sdi devices Philippe Langlais
3 siblings, 0 replies; 10+ messages in thread
From: Philippe Langlais @ 2011-03-15 14:41 UTC (permalink / raw)
To: linux-arm-kernel
From: Prajadevi H <prajadevi.h@stericsson.com>
Add new amba-pl022 vendor for the DB5500 pl023,
as the pl023 on db8500 and db5500 vary.
Signed-off-by: Prajadevi H <prajadevi.h@stericsson.com>
---
drivers/spi/amba-pl022.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index 5c2b092..413eaf0 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -324,6 +324,7 @@ struct vendor_data {
bool unidir;
bool extended_cr;
bool pl023;
+ bool loopback;
};
/**
@@ -1983,7 +1984,7 @@ static int pl022_setup(struct spi_device *spi)
SSP_WRITE_BITS(chip->cr0, clk_freq.scr, SSP_CR0_MASK_SCR, 8);
/* Loopback is available on all versions except PL023 */
- if (!pl022->vendor->pl023) {
+ if (pl022->vendor->loopback) {
if (spi->mode & SPI_LOOP)
tmp = LOOPBACK_ENABLED;
else
@@ -2233,6 +2234,7 @@ static struct vendor_data vendor_arm = {
.unidir = false,
.extended_cr = false,
.pl023 = false,
+ .loopback = true,
};
@@ -2242,6 +2244,7 @@ static struct vendor_data vendor_st = {
.unidir = false,
.extended_cr = true,
.pl023 = false,
+ .loopback = true,
};
static struct vendor_data vendor_st_pl023 = {
@@ -2250,6 +2253,16 @@ static struct vendor_data vendor_st_pl023 = {
.unidir = false,
.extended_cr = true,
.pl023 = true,
+ .loopback = false,
+};
+
+static struct vendor_data vendor_db5500_pl023 = {
+ .fifodepth = 32,
+ .max_bpw = 32,
+ .unidir = false,
+ .extended_cr = true,
+ .pl023 = true,
+ .loopback = true,
};
static struct amba_id pl022_ids[] = {
@@ -2283,6 +2296,12 @@ static struct amba_id pl022_ids[] = {
.mask = 0xffffffff,
.data = &vendor_st_pl023,
},
+ {
+ .id = 0x00080023,
+ .mask = 0xffffffff,
+ .data = &vendor_db5500_pl023,
+ .name = "db5500-spi",
+ },
{ 0, 0 },
};
--
1.7.3.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/4] mmci/pl180: Support for db8500v2. ST-Ericsson modified ARM PrimeCell PL180 block has not got an updated corresponding amba-id, althought the IP block has changed in db8500v2. The change was done to the datactrl register.
2011-03-15 14:41 [PATCH 0/4] Fix ST-Ericsson Ux500 specific PL022 & PL180 amba devices Philippe Langlais
2011-03-15 14:41 ` [PATCH 1/4] amba: add name based matching Philippe Langlais
2011-03-15 14:41 ` [PATCH 2/4] amba-pl022: Add loopback support for the SPI on 5500 Philippe Langlais
@ 2011-03-15 14:41 ` Philippe Langlais
2011-03-15 14:41 ` [PATCH 4/4] ux500: pass name for db5500-spi & db8500v2-sdi devices Philippe Langlais
3 siblings, 0 replies; 10+ messages in thread
From: Philippe Langlais @ 2011-03-15 14:41 UTC (permalink / raw)
To: linux-arm-kernel
From: Philippe Langlais <philippe.langlais@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
---
drivers/mmc/host/mmci.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 1dfd099..0b92c87 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -51,6 +51,7 @@ static unsigned int fmax = 515633;
* is asserted (likewise for RX)
* @sdio: variant supports SDIO
* @st_clkdiv: true if using a ST-specific clock divider algorithm
+ * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register
*/
struct variant_data {
unsigned int clkreg;
@@ -60,6 +61,7 @@ struct variant_data {
unsigned int fifohalfsize;
bool sdio;
bool st_clkdiv;
+ bool blksz_datactrl16;
};
static struct variant_data variant_arm = {
@@ -86,6 +88,17 @@ static struct variant_data variant_ux500 = {
.st_clkdiv = true,
};
+static struct variant_data variant_ux500v2 = {
+ .fifosize = 30 * 4,
+ .fifohalfsize = 8 * 4,
+ .clkreg = MCI_CLK_ENABLE,
+ .clkreg_enable = MCI_ST_UX500_HWFCEN,
+ .datalength_bits = 24,
+ .sdio = true,
+ .st_clkdiv = true,
+ .blksz_datactrl16 = true,
+};
+
/*
* This must be called with host->lock held
*/
@@ -457,7 +470,10 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
blksz_bits = ffs(data->blksz) - 1;
BUG_ON(1 << blksz_bits != data->blksz);
- datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;
+ if (variant->blksz_datactrl16)
+ datactrl = MCI_DPSM_ENABLE | (data->blksz << 16);
+ else
+ datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;
if (data->flags & MMC_DATA_READ)
datactrl |= MCI_DPSM_DIRECTION;
@@ -1289,6 +1305,12 @@ static struct amba_id mmci_ids[] = {
.mask = 0x00ffffff,
.data = &variant_ux500,
},
+ {
+ .id = 0x00480180,
+ .mask = 0x00ffffff,
+ .data = &variant_ux500v2,
+ .name = "db8500v2-sdi",
+ },
{ 0, 0 },
};
--
1.7.3.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/4] ux500: pass name for db5500-spi & db8500v2-sdi devices
2011-03-15 14:41 [PATCH 0/4] Fix ST-Ericsson Ux500 specific PL022 & PL180 amba devices Philippe Langlais
` (2 preceding siblings ...)
2011-03-15 14:41 ` [PATCH 3/4] mmci/pl180: Support for db8500v2. ST-Ericsson modified ARM PrimeCell PL180 block has not got an updated corresponding amba-id, althought the IP block has changed in db8500v2. The change was done to the datactrl register Philippe Langlais
@ 2011-03-15 14:41 ` Philippe Langlais
3 siblings, 0 replies; 10+ messages in thread
From: Philippe Langlais @ 2011-03-15 14:41 UTC (permalink / raw)
To: linux-arm-kernel
From: Philippe Langlais <philippe.langlais@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
---
arch/arm/mach-ux500/devices-common.c | 8 ++++--
arch/arm/mach-ux500/devices-common.h | 31 ++++++++++++++++++--------
arch/arm/mach-ux500/devices-db8500.h | 2 +-
arch/arm/mach-ux500/include/mach/hardware.h | 3 --
4 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c
index 13a4ce0..e0acb75 100644
--- a/arch/arm/mach-ux500/devices-common.c
+++ b/arch/arm/mach-ux500/devices-common.c
@@ -20,8 +20,9 @@
#include "devices-common.h"
struct amba_device *
-dbx500_add_amba_device(const char *name, resource_size_t base,
- int irq, void *pdata, unsigned int periphid)
+dbx500_add_amba_device(const char *init_name, resource_size_t base,
+ int irq, void *pdata, unsigned int periphid,
+ const char *name)
{
struct amba_device *dev;
int ret;
@@ -30,7 +31,7 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
if (!dev)
return ERR_PTR(-ENOMEM);
- dev->dev.init_name = name;
+ dev->dev.init_name = init_name;
dev->res.start = base;
dev->res.end = base + SZ_4K - 1;
@@ -43,6 +44,7 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
dev->irq[1] = NO_IRQ;
dev->periphid = periphid;
+ dev->name = name;
dev->dev.platform_data = pdata;
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
index c719b5a1..cb5739e 100644
--- a/arch/arm/mach-ux500/devices-common.h
+++ b/arch/arm/mach-ux500/devices-common.h
@@ -9,8 +9,9 @@
#define __DEVICES_COMMON_H
extern struct amba_device *
-dbx500_add_amba_device(const char *name, resource_size_t base,
- int irq, void *pdata, unsigned int periphid);
+dbx500_add_amba_device(const char *init_name, resource_size_t base,
+ int irq, void *pdata, unsigned int periphid,
+ const char *name);
extern struct platform_device *
dbx500_add_platform_device_4k1irq(const char *name, int id,
@@ -23,23 +24,33 @@ static inline struct amba_device *
dbx500_add_msp_spi(const char *name, resource_size_t base, int irq,
struct spi_master_cntlr *pdata)
{
- return dbx500_add_amba_device(name, base, irq, pdata, 0);
+ return dbx500_add_amba_device(name, base, irq, pdata, 0, NULL);
}
static inline struct amba_device *
-dbx500_add_spi(const char *name, resource_size_t base, int irq,
- struct spi_master_cntlr *pdata)
+dbx500_add_spi(const char *init_name, resource_size_t base, int irq,
+ struct spi_master_cntlr *pdata)
{
- return dbx500_add_amba_device(name, base, irq, pdata, 0);
+ const char *name = NULL;
+
+ if (cpu_is_u5500())
+ name = "db5500-spi";
+
+ return dbx500_add_amba_device(init_name, base, irq, pdata, 0, name);
}
struct mmci_platform_data;
static inline struct amba_device *
-dbx500_add_sdi(const char *name, resource_size_t base, int irq,
+dbx500_add_sdi(const char *init_name, resource_size_t base, int irq,
struct mmci_platform_data *pdata)
{
- return dbx500_add_amba_device(name, base, irq, pdata, 0);
+ const char *name = NULL;
+
+ if (cpu_is_u8500v2())
+ name = "db8500v2-sdi";
+
+ return dbx500_add_amba_device(init_name, base, irq, pdata, 0, name);
}
struct amba_pl011_data;
@@ -48,7 +59,7 @@ static inline struct amba_device *
dbx500_add_uart(const char *name, resource_size_t base, int irq,
struct amba_pl011_data *pdata)
{
- return dbx500_add_amba_device(name, base, irq, pdata, 0);
+ return dbx500_add_amba_device(name, base, irq, pdata, 0, NULL);
}
struct nmk_i2c_controller;
@@ -74,7 +85,7 @@ dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
static inline struct amba_device *
dbx500_add_rtc(resource_size_t base, int irq)
{
- return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0);
+ return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0, NULL);
}
struct nmk_gpio_platform_data;
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index 9cc6f8f..fdcea73 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -25,7 +25,7 @@ static inline struct amba_device *
db8500_add_ssp(const char *name, resource_size_t base, int irq,
struct pl022_ssp_controller *pdata)
{
- return dbx500_add_amba_device(name, base, irq, pdata, SSP_PER_ID);
+ return dbx500_add_amba_device(name, base, irq, pdata, 0, NULL);
}
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
index bf63f26..d54bb61 100644
--- a/arch/arm/mach-ux500/include/mach/hardware.h
+++ b/arch/arm/mach-ux500/include/mach/hardware.h
@@ -29,9 +29,6 @@
#include <mach/db8500-regs.h>
#include <mach/db5500-regs.h>
-/* ST-Ericsson modified pl022 id */
-#define SSP_PER_ID 0x01080022
-
#ifndef __ASSEMBLY__
#include <mach/id.h>
--
1.7.3.1
^ permalink raw reply related [flat|nested] 10+ messages in thread