From a897ea13f7a801e6baba8d4985f459042712244c Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Wed, 8 Oct 2008 09:02:11 -0600 Subject: [PATCH 1/5] powerpc/mpc5200: fix build warnings on mpc52xx_psc_spi driver The register definitions have been changed for the mpc5200 PSC ports to cover some of the changes in the mpc5200b. One change is that the ccr register is now a u32 instead of a u16. However, for the purposes of this driver we want to continue to use 16 bit access to avoid changing the existing (working) behaviour. This patch allows the driver to continue to do 16 bit accesses without the compiler complaining about it. Signed-off-by: Grant Likely --- drivers/spi/mpc52xx_psc_spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 25eda71f4bf4..cdb3d3191719 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c @@ -108,13 +108,13 @@ static void mpc52xx_psc_spi_activate_cs(struct spi_device *spi) * Because psc->ccr is defined as 16bit register instead of 32bit * just set the lower byte of BitClkDiv */ - ccr = in_be16(&psc->ccr); + ccr = in_be16((u16 __iomem *)&psc->ccr); ccr &= 0xFF00; if (cs->speed_hz) ccr |= (MCLK / cs->speed_hz - 1) & 0xFF; else /* by default SPI Clk 1MHz */ ccr |= (MCLK / 1000000 - 1) & 0xFF; - out_be16(&psc->ccr, ccr); + out_be16((u16 __iomem *)&psc->ccr, ccr); mps->bits_per_word = cs->bits_per_word; if (mps->activate_cs) @@ -347,7 +347,7 @@ static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps) /* Configure 8bit codec mode as a SPI master and use EOF flags */ /* SICR_SIM_CODEC8|SICR_GENCLK|SICR_SPI|SICR_MSTR|SICR_USEEOF */ out_be32(&psc->sicr, 0x0180C800); - out_be16(&psc->ccr, 0x070F); /* by default SPI Clk 1MHz */ + out_be16((u16 __iomem *)&psc->ccr, 0x070F); /* default SPI Clk 1MHz */ /* Set 2ms DTL delay */ out_8(&psc->ctur, 0x00); From f43c32efacd82bb1427c3247c636e23ece6b8fc9 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 8 Oct 2008 11:36:21 -0600 Subject: [PATCH 2/5] powerpc/mpc5200: trivial printk-fixes in mpc52xx_common - one printk was missing a loglevel - remove double space while we are here Signed-off-by: Wolfram Sang Signed-off-by: Grant Likely --- arch/powerpc/platforms/52xx/mpc52xx_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c index 4d5fd1dbd400..044b4e6e8743 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c @@ -90,7 +90,7 @@ mpc5200_setup_xlb_arbiter(void) of_node_put(np); if (!xlb) { printk(KERN_ERR __FILE__ ": " - "Error mapping XLB in mpc52xx_setup_cpu(). " + "Error mapping XLB in mpc52xx_setup_cpu(). " "Expect some abnormal behavior\n"); return; } @@ -216,7 +216,8 @@ mpc52xx_restart(char *cmd) out_be32(&mpc52xx_wdt->count, 0x000000ff); out_be32(&mpc52xx_wdt->mode, 0x00009004); } else - printk("mpc52xx_restart: Can't access wdt. " + printk(KERN_ERR __FILE__ ": " + "mpc52xx_restart: Can't access wdt. " "Restart impossible, system halted.\n"); while (1); From 618b26d52843c0f85b8eb143cf2695d7f6fd072d Mon Sep 17 00:00:00 2001 From: Wolfgang Grandegger Date: Wed, 8 Oct 2008 11:36:42 -0600 Subject: [PATCH 3/5] i2c-mpc: suppress I2C device probing This patch suppresses I2C device probing by clearing the class field of the "struct i2c_adapter" for the MPC I2C bus adapters. Some board configurations which rely on probing must be fixed up by adding a proper I2C device node to the DTS file, like the TQM85xx modules. Signed-off-by: Wolfgang Grandegger Signed-off-by: Grant Likely --- drivers/i2c/busses/i2c-mpc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 27443f073bc9..a9a45fcc8544 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -312,7 +312,6 @@ static struct i2c_adapter mpc_ops = { .name = "MPC adapter", .id = I2C_HW_MPC107, .algo = &mpc_algo, - .class = I2C_CLASS_HWMON | I2C_CLASS_SPD, .timeout = 1, }; From e92350463891a20960e858ef6137aa456e616175 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Wed, 8 Oct 2008 11:36:57 -0600 Subject: [PATCH 4/5] powerpc/mpc5200: Silence warnings in arch/powerpc/platforms/52xx/mpc52xx_pci.c Explicitly cast resource fields to unsigned long long, and match format specifier. Signed-off-by: Tony Breeds Signed-off-by: Grant Likely --- arch/powerpc/platforms/52xx/mpc52xx_pci.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c index 5a382bb15f62..b49a18527661 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c @@ -265,8 +265,11 @@ mpc52xx_pci_setup(struct pci_controller *hose, /* Memory windows */ res = &hose->mem_resources[0]; if (res->flags) { - pr_debug("mem_resource[0] = {.start=%x, .end=%x, .flags=%lx}\n", - res->start, res->end, res->flags); + pr_debug("mem_resource[0] = " + "{.start=%llx, .end=%llx, .flags=%llx}\n", + (unsigned long long)res->start, + (unsigned long long)res->end, + (unsigned long long)res->flags); out_be32(&pci_regs->iw0btar, MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, res->end - res->start + 1)); @@ -297,9 +300,11 @@ mpc52xx_pci_setup(struct pci_controller *hose, printk(KERN_ERR "%s: Didn't find IO resources\n", __FILE__); return; } - pr_debug(".io_resource={.start=%x,.end=%x,.flags=%lx} " + pr_debug(".io_resource={.start=%llx,.end=%llx,.flags=%llx} " ".io_base_phys=0x%p\n", - res->start, res->end, res->flags, (void*)hose->io_base_phys); + (unsigned long long)res->start, + (unsigned long long)res->end, + (unsigned long long)res->flags, (void*)hose->io_base_phys); out_be32(&pci_regs->iw2btar, MPC52xx_PCI_IWBTAR_TRANSLATION(hose->io_base_phys, res->start, From 4c3ed7d61bd474380e0d3e1eb0da164942f7c84e Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Tue, 23 Sep 2008 14:12:19 +0400 Subject: [PATCH 5/5] OF: add fsl,mcu-mpc8349emitx to the exception list of/base.c matches on the first (most specific) entries, which isn't quite practical but it was discussed[1] that this won't change. The bindings specifies verbose information for the devices, but it doesn't fit in the I2C ID's 20 characters limit. The limit won't change[2], and the bindings won't change either as they're correct. So we have to put an exception for the MPC8349E-mITX-compatible MCUs. [1] http://www.mail-archive.com/linuxppc-dev@ozlabs.org/msg21196.html [2] http://www.nabble.com/-PATCH-1-2--i2c:-expand-I2C's-id.name-to-23-characters-td19577063.html Signed-off-by: Anton Vorontsov Signed-off-by: Grant Likely --- drivers/of/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index ad8ac1a8af28..a7264644003f 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -410,7 +410,7 @@ struct of_modalias_table { char *modalias; }; static struct of_modalias_table of_modalias_table[] = { - /* Empty for now; add entries as needed */ + { "fsl,mcu-mpc8349emitx", "mcu-mpc8349emitx" }, }; /**