aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-05 16:44:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-05 16:44:27 -0400
commit9f800363bb0ea459e15bef0928a72c88d374e489 (patch)
tree13a6b4165d3e2ba18e88e5103437f74e84e0838d /arch/arm/mach-ixp4xx
parent2d1eb87ae1e6f3999e77989fd2f831b134270787 (diff)
parentcb46a256a78225817945cd52068d61d5126c236e (diff)
Merge tag 'fixes-non-critical-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC non-critical bug fixes from Arnd Bergmann: "Lots of isolated bug fixes that were not found to be important enough to be submitted before the merge window or backported into stable kernels. The vast majority of these came out of Arnd's randconfig testing and just prevents running into build-time bugs in configurations that we do not care about in practice" * tag 'fixes-non-critical-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (75 commits) ARM: at91: fix a typo ARM: moxart: fix CPU selection ARM: tegra: fix board DT pinmux setup ARM: nspire: Fix compiler warning IXP4xx: Fix DMA masks. Revert "ARM: ixp4xx: Make dma_set_coherent_mask common, correct implementation" IXP4xx: Fix Goramo Multilink GPIO conversion. Revert "ARM: ixp4xx: fix gpio rework" ARM: tegra: make debug_ll code build for ARMv6 ARM: sunxi: fix build for THUMB2_KERNEL ARM: exynos: add missing include of linux/module.h ARM: exynos: fix l2x0 saved regs handling ARM: samsung: select CRC32 for SAMSUNG_PM_CHECK ARM: samsung: select ATAGS where necessary ARM: samsung: fix SAMSUNG_PM_DEBUG Kconfig logic ARM: samsung: allow serial driver to be disabled ARM: s5pv210: enable IDE support in MACH_TORBRECK ARM: s5p64x0: fix building with only one soc type ARM: s3c64xx: select power domains only when used ARM: s3c64xx: MACH_SMDK6400 needs HSMMC1 ...
Diffstat (limited to 'arch/arm/mach-ixp4xx')
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c39
-rw-r--r--arch/arm/mach-ixp4xx/common.c61
-rw-r--r--arch/arm/mach-ixp4xx/goramo_mlr.c43
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/io.h3
-rw-r--r--arch/arm/mach-ixp4xx/omixp-setup.c2
5 files changed, 84 insertions, 64 deletions
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 200970d56f6d..4977296f0c78 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -315,33 +315,6 @@ static int abort_handler(unsigned long addr, unsigned int fsr, struct pt_regs *r
315 return 0; 315 return 0;
316} 316}
317 317
318
319static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
320{
321 return (dma_addr + size) >= SZ_64M;
322}
323
324/*
325 * Setup DMA mask to 64MB on PCI devices. Ignore all other devices.
326 */
327static int ixp4xx_pci_platform_notify(struct device *dev)
328{
329 if (dev_is_pci(dev)) {
330 *dev->dma_mask = SZ_64M - 1;
331 dev->coherent_dma_mask = SZ_64M - 1;
332 dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
333 }
334 return 0;
335}
336
337static int ixp4xx_pci_platform_notify_remove(struct device *dev)
338{
339 if (dev_is_pci(dev))
340 dmabounce_unregister_dev(dev);
341
342 return 0;
343}
344
345void __init ixp4xx_pci_preinit(void) 318void __init ixp4xx_pci_preinit(void)
346{ 319{
347 unsigned long cpuid = read_cpuid_id(); 320 unsigned long cpuid = read_cpuid_id();
@@ -475,20 +448,8 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
475 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); 448 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset);
476 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); 449 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
477 450
478 platform_notify = ixp4xx_pci_platform_notify;
479 platform_notify_remove = ixp4xx_pci_platform_notify_remove;
480
481 return 1; 451 return 1;
482} 452}
483 453
484int dma_set_coherent_mask(struct device *dev, u64 mask)
485{
486 if (mask >= SZ_64M - 1)
487 return 0;
488
489 return -EIO;
490}
491
492EXPORT_SYMBOL(ixp4xx_pci_read); 454EXPORT_SYMBOL(ixp4xx_pci_read);
493EXPORT_SYMBOL(ixp4xx_pci_write); 455EXPORT_SYMBOL(ixp4xx_pci_write);
494EXPORT_SYMBOL(dma_set_coherent_mask);
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index a465f27bc263..be882c95bd36 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -30,8 +30,8 @@
30#include <linux/export.h> 30#include <linux/export.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/cpu.h> 32#include <linux/cpu.h>
33#include <linux/pci.h>
33#include <linux/sched_clock.h> 34#include <linux/sched_clock.h>
34
35#include <mach/udc.h> 35#include <mach/udc.h>
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37#include <mach/io.h> 37#include <mach/io.h>
@@ -40,7 +40,6 @@
40#include <asm/page.h> 40#include <asm/page.h>
41#include <asm/irq.h> 41#include <asm/irq.h>
42#include <asm/system_misc.h> 42#include <asm/system_misc.h>
43
44#include <asm/mach/map.h> 43#include <asm/mach/map.h>
45#include <asm/mach/irq.h> 44#include <asm/mach/irq.h>
46#include <asm/mach/time.h> 45#include <asm/mach/time.h>
@@ -578,6 +577,54 @@ void ixp4xx_restart(enum reboot_mode mode, const char *cmd)
578 } 577 }
579} 578}
580 579
580#ifdef CONFIG_PCI
581static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
582{
583 return (dma_addr + size) > SZ_64M;
584}
585
586static int ixp4xx_platform_notify_remove(struct device *dev)
587{
588 if (dev_is_pci(dev))
589 dmabounce_unregister_dev(dev);
590
591 return 0;
592}
593#endif
594
595/*
596 * Setup DMA mask to 64MB on PCI devices and 4 GB on all other things.
597 */
598static int ixp4xx_platform_notify(struct device *dev)
599{
600 dev->dma_mask = &dev->coherent_dma_mask;
601
602#ifdef CONFIG_PCI
603 if (dev_is_pci(dev)) {
604 dev->coherent_dma_mask = DMA_BIT_MASK(28); /* 64 MB */
605 dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
606 return 0;
607 }
608#endif
609
610 dev->coherent_dma_mask = DMA_BIT_MASK(32);
611 return 0;
612}
613
614int dma_set_coherent_mask(struct device *dev, u64 mask)
615{
616 if (dev_is_pci(dev))
617 mask &= DMA_BIT_MASK(28); /* 64 MB */
618
619 if ((mask & DMA_BIT_MASK(28)) == DMA_BIT_MASK(28)) {
620 dev->coherent_dma_mask = mask;
621 return 0;
622 }
623
624 return -EIO; /* device wanted sub-64MB mask */
625}
626EXPORT_SYMBOL(dma_set_coherent_mask);
627
581#ifdef CONFIG_IXP4XX_INDIRECT_PCI 628#ifdef CONFIG_IXP4XX_INDIRECT_PCI
582/* 629/*
583 * In the case of using indirect PCI, we simply return the actual PCI 630 * In the case of using indirect PCI, we simply return the actual PCI
@@ -600,12 +647,16 @@ static void ixp4xx_iounmap(void __iomem *addr)
600 if (!is_pci_memory((__force u32)addr)) 647 if (!is_pci_memory((__force u32)addr))
601 __iounmap(addr); 648 __iounmap(addr);
602} 649}
650#endif
603 651
604void __init ixp4xx_init_early(void) 652void __init ixp4xx_init_early(void)
605{ 653{
654 platform_notify = ixp4xx_platform_notify;
655#ifdef CONFIG_PCI
656 platform_notify_remove = ixp4xx_platform_notify_remove;
657#endif
658#ifdef CONFIG_IXP4XX_INDIRECT_PCI
606 arch_ioremap_caller = ixp4xx_ioremap_caller; 659 arch_ioremap_caller = ixp4xx_ioremap_caller;
607 arch_iounmap = ixp4xx_iounmap; 660 arch_iounmap = ixp4xx_iounmap;
608}
609#else
610void __init ixp4xx_init_early(void) {}
611#endif 661#endif
662}
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c
index e54ff491c105..80bd9d6d04de 100644
--- a/arch/arm/mach-ixp4xx/goramo_mlr.c
+++ b/arch/arm/mach-ixp4xx/goramo_mlr.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/delay.h> 6#include <linux/delay.h>
7#include <linux/gpio.h>
7#include <linux/hdlc.h> 8#include <linux/hdlc.h>
8#include <linux/i2c-gpio.h> 9#include <linux/i2c-gpio.h>
9#include <linux/io.h> 10#include <linux/io.h>
@@ -79,19 +80,19 @@ static u8 control_value;
79 80
80static void set_scl(u8 value) 81static void set_scl(u8 value)
81{ 82{
82 gpio_line_set(GPIO_SCL, !!value); 83 gpio_set_value(GPIO_SCL, !!value);
83 udelay(3); 84 udelay(3);
84} 85}
85 86
86static void set_sda(u8 value) 87static void set_sda(u8 value)
87{ 88{
88 gpio_line_set(GPIO_SDA, !!value); 89 gpio_set_value(GPIO_SDA, !!value);
89 udelay(3); 90 udelay(3);
90} 91}
91 92
92static void set_str(u8 value) 93static void set_str(u8 value)
93{ 94{
94 gpio_line_set(GPIO_STR, !!value); 95 gpio_set_value(GPIO_STR, !!value);
95 udelay(3); 96 udelay(3);
96} 97}
97 98
@@ -108,8 +109,8 @@ static void output_control(void)
108{ 109{
109 int i; 110 int i;
110 111
111 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT); 112 gpio_direction_output(GPIO_SCL, 1);
112 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT); 113 gpio_direction_output(GPIO_SDA, 1);
113 114
114 for (i = 0; i < 8; i++) { 115 for (i = 0; i < 8; i++) {
115 set_scl(0); 116 set_scl(0);
@@ -151,8 +152,8 @@ static int hss_set_clock(int port, unsigned int clock_type)
151 152
152static irqreturn_t hss_dcd_irq(int irq, void *pdev) 153static irqreturn_t hss_dcd_irq(int irq, void *pdev)
153{ 154{
154 int i, port = (irq == IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N)); 155 int port = (irq == IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N));
155 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 156 int i = gpio_get_value(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N);
156 set_carrier_cb_tab[port](pdev, !i); 157 set_carrier_cb_tab[port](pdev, !i);
157 return IRQ_HANDLED; 158 return IRQ_HANDLED;
158} 159}
@@ -168,7 +169,7 @@ static int hss_open(int port, void *pdev,
168 else 169 else
169 irq = IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N); 170 irq = IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N);
170 171
171 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 172 i = gpio_get_value(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N);
172 set_carrier_cb(pdev, !i); 173 set_carrier_cb(pdev, !i);
173 174
174 set_carrier_cb_tab[!!port] = set_carrier_cb; 175 set_carrier_cb_tab[!!port] = set_carrier_cb;
@@ -181,7 +182,7 @@ static int hss_open(int port, void *pdev,
181 182
182 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0); 183 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0);
183 output_control(); 184 output_control();
184 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0); 185 gpio_set_value(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0);
185 return 0; 186 return 0;
186} 187}
187 188
@@ -193,7 +194,7 @@ static void hss_close(int port, void *pdev)
193 194
194 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1); 195 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1);
195 output_control(); 196 output_control();
196 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1); 197 gpio_set_value(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1);
197} 198}
198 199
199 200
@@ -413,13 +414,21 @@ static void __init gmlr_init(void)
413 if (hw_bits & CFG_HW_HAS_EEPROM) 414 if (hw_bits & CFG_HW_HAS_EEPROM)
414 device_tab[devices++] = &device_i2c; /* max index 6 */ 415 device_tab[devices++] = &device_i2c; /* max index 6 */
415 416
416 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT); 417 gpio_request(GPIO_SCL, "SCL/clock");
417 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT); 418 gpio_request(GPIO_SDA, "SDA/data");
418 gpio_line_config(GPIO_STR, IXP4XX_GPIO_OUT); 419 gpio_request(GPIO_STR, "strobe");
419 gpio_line_config(GPIO_HSS0_RTS_N, IXP4XX_GPIO_OUT); 420 gpio_request(GPIO_HSS0_RTS_N, "HSS0 RTS");
420 gpio_line_config(GPIO_HSS1_RTS_N, IXP4XX_GPIO_OUT); 421 gpio_request(GPIO_HSS1_RTS_N, "HSS1 RTS");
421 gpio_line_config(GPIO_HSS0_DCD_N, IXP4XX_GPIO_IN); 422 gpio_request(GPIO_HSS0_DCD_N, "HSS0 DCD");
422 gpio_line_config(GPIO_HSS1_DCD_N, IXP4XX_GPIO_IN); 423 gpio_request(GPIO_HSS1_DCD_N, "HSS1 DCD");
424
425 gpio_direction_output(GPIO_SCL, 1);
426 gpio_direction_output(GPIO_SDA, 1);
427 gpio_direction_output(GPIO_STR, 0);
428 gpio_direction_output(GPIO_HSS0_RTS_N, 1);
429 gpio_direction_output(GPIO_HSS1_RTS_N, 1);
430 gpio_direction_input(GPIO_HSS0_DCD_N);
431 gpio_direction_input(GPIO_HSS1_DCD_N);
423 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH); 432 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH);
424 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH); 433 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH);
425 434
diff --git a/arch/arm/mach-ixp4xx/include/mach/io.h b/arch/arm/mach-ixp4xx/include/mach/io.h
index 5cf30d1b78d2..559c69a47731 100644
--- a/arch/arm/mach-ixp4xx/include/mach/io.h
+++ b/arch/arm/mach-ixp4xx/include/mach/io.h
@@ -48,9 +48,10 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
48 * fallback to the default. 48 * fallback to the default.
49 */ 49 */
50 50
51extern unsigned long pcibios_min_mem;
51static inline int is_pci_memory(u32 addr) 52static inline int is_pci_memory(u32 addr)
52{ 53{
53 return (addr >= PCIBIOS_MIN_MEM) && (addr <= 0x4FFFFFFF); 54 return (addr >= pcibios_min_mem) && (addr <= 0x4FFFFFFF);
54} 55}
55 56
56#define writeb(v, p) __indirect_writeb(v, p) 57#define writeb(v, p) __indirect_writeb(v, p)
diff --git a/arch/arm/mach-ixp4xx/omixp-setup.c b/arch/arm/mach-ixp4xx/omixp-setup.c
index 75ef03dc9964..2d494b454376 100644
--- a/arch/arm/mach-ixp4xx/omixp-setup.c
+++ b/arch/arm/mach-ixp4xx/omixp-setup.c
@@ -17,9 +17,7 @@
17#include <linux/serial_8250.h> 17#include <linux/serial_8250.h>
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20#ifdef CONFIG_LEDS_CLASS
21#include <linux/leds.h> 20#include <linux/leds.h>
22#endif
23 21
24#include <asm/setup.h> 22#include <asm/setup.h>
25#include <asm/memory.h> 23#include <asm/memory.h>