From d75de08727018659cd7e060cf0018eaf53e49aaf Mon Sep 17 00:00:00 2001 From: Maxime Bizon Date: Fri, 27 Mar 2009 18:42:19 +0100 Subject: [ARM] Kirkwood: invalidate L2 cache before enabling it I get random oopses on my Kirkwood board at startup when L2 cache is enabled. FYI I'm using Marvell uboot version 3.4.16 Each boot produces the same oops, but anything that changes the kernel size (even only changing initramfs) makes the oops different. I noticed that nothing invalidates the L2 cache before enabling it, doing so fixes my problem. Signed-off-by: Maxime Bizon Signed-off-by: Nicolas Pitre diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index d6dd838..1afed50 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c @@ -115,6 +115,10 @@ static inline void l2_inv_pa_range(unsigned long start, unsigned long end) raw_local_irq_restore(flags); } +static inline void l2_inv_all(void) +{ + __asm__("mcr p15, 1, %0, c15, c11, 0" : : "r" (0)); +} /* * Linux primitives. @@ -321,6 +325,7 @@ static void __init enable_l2(void) d = flush_and_disable_dcache(); i = invalidate_and_disable_icache(); + l2_inv_all(); write_extra_features(u | 0x00400000); if (i) enable_icache(); -- cgit v0.10.2 From f000328ac10f23f4841b83ddc60eceb3ba0ac176 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 27 Mar 2009 14:22:26 -0400 Subject: [ARM] Kirkwood: small L2 code cleanup Strictly speaking, a MCR instruction does not produce any output. Signed-off-by: Nicolas Pitre diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index 1afed50..6e77c04 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c @@ -258,9 +258,7 @@ static void __init enable_dcache(void) static void __init __invalidate_icache(void) { - int dummy; - - __asm__ __volatile__("mcr p15, 0, %0, c7, c5, 0" : "=r" (dummy)); + __asm__("mcr p15, 0, %0, c7, c5, 0" : : "r" (0)); } static int __init invalidate_and_disable_icache(void) -- cgit v0.10.2 From 8f6aef924d6d83f67e74ca5edc98957867c50ce9 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 29 Mar 2009 17:14:45 +0100 Subject: [ARM] arch_reset() now takes a second parameter Add it to the new platforms. Signed-off-by: Russell King diff --git a/arch/arm/mach-gemini/include/mach/system.h b/arch/arm/mach-gemini/include/mach/system.h index bbbd727..4d9c1f8 100644 --- a/arch/arm/mach-gemini/include/mach/system.h +++ b/arch/arm/mach-gemini/include/mach/system.h @@ -28,7 +28,7 @@ static inline void arch_idle(void) cpu_do_idle(); } -static inline void arch_reset(char mode) +static inline void arch_reset(char mode, const char *cmd) { __raw_writel(RESET_GLOBAL | RESET_CPU1, IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET); diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h index 001edfe..4f5b0e0 100644 --- a/arch/arm/mach-mmp/include/mach/system.h +++ b/arch/arm/mach-mmp/include/mach/system.h @@ -14,7 +14,7 @@ static inline void arch_idle(void) cpu_do_idle(); } -static inline void arch_reset(char mode) +static inline void arch_reset(char mode, const char *cmd) { cpu_reset(0); } -- cgit v0.10.2 From ad19d8d90c7a84c35f4e27e95d41a049efdbdf17 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 30 Mar 2009 22:58:31 +0100 Subject: [ARM] 5436/1: ARM: OMAP: Fix compile for rx51 This fixes a compile error caused by a mismerge while rebasing the patch: linux-2.6/arch/arm/mach-omap2/board-rx51-peripherals.c:354: undefined reference to `twl4030_mmc_init' Looks like I need to also update my build scripts, just grepping for error: in the logs is not obviously enough.. Signed-off-by: Tony Lindgren Signed-off-by: Russell King diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index a2c3fcc..c49d9bf 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -47,6 +47,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ board-rx51-peripherals.o \ + mmc-twl4030.o + # Platform specific device init code ifeq ($(CONFIG_USB_MUSB_SOC),y) obj-y += usb-musb.o -- cgit v0.10.2 From 01a24d2b9309676ec2e7069cd19f5b1c4a1505e0 Mon Sep 17 00:00:00 2001 From: Paulius Zaleckas Date: Tue, 31 Mar 2009 13:55:44 +0100 Subject: [ARM] 5437/1: Add documentation for "nohlt" kernel parameter As per discussion in: http://marc.info/?l=linux-arm-kernel&m=123633652517391&w=2 Signed-off-by: Paulius Zaleckas Acked-by: Paul Mundt Signed-off-by: Russell King diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index be3bde5..73fa52c 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1513,7 +1513,9 @@ and is between 256 and 4096 characters. It is defined in the file noclflush [BUGS=X86] Don't use the CLFLUSH instruction - nohlt [BUGS=ARM,SH] + nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or + wfi(ARM) instruction doesn't work correctly and not to + use it. This is also useful when using JTAG debugger. no-hlt [BUGS=X86-32] Tells the kernel that the hlt instruction doesn't work correctly and not to -- cgit v0.10.2 From fe68e68f6a379d317a87ae24de050a65b11ea1fb Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Wed, 1 Apr 2009 13:53:48 +0100 Subject: [ARM] 5439/1: Do not clear bit 10 of DFSR during abort handling on ARMv6 Because of an ARM1136 erratum (326103), the current v6_early_abort function needs to set the correct FSR[11] value which determines whether the data abort was caused by a read or write. For legacy reasons (bit 10 not handled by software), bit 10 was also cleared masking out imprecise aborts on ARMv6 CPUs. This patch removes the clearing of bit 10 of FSR. Signed-off-by: Catalin Marinas Signed-off-by: Russell King diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 94077fb..6f7e709 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S @@ -29,10 +29,10 @@ ENTRY(v6_early_abort) mrc p15, 0, r1, c5, c0, 0 @ get FSR mrc p15, 0, r0, c6, c0, 0 @ get FAR /* - * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR. + * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103). * The test below covers all the write situations, including Java bytecodes */ - bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR + bic r1, r1, #1 << 11 @ clear bit 11 of FSR tst r3, #PSR_J_BIT @ Java? movne pc, lr do_thumb_abort -- cgit v0.10.2 From f2255be8126e86142901c61dd482c1c2a5ffdda7 Mon Sep 17 00:00:00 2001 From: "George G. Davis" Date: Wed, 1 Apr 2009 20:27:18 +0100 Subject: [ARM] 5440/1: Fix VFP state corruption due to preemption during VFP exceptions We've observed that ARM VFP state can be corrupted during VFP exception handling when PREEMPT is enabled. The exact conditions are difficult to reproduce but appear to occur during VFP exception handling when a task causes a VFP exception which is handled via VFP_bounce and is then preempted by yet another task which in turn causes yet another VFP exception. Since the VFP_bounce code is not preempt safe, VFP state then becomes corrupt. In order to prevent preemption from occuring while handling a VFP exception, this patch disables preemption while handling VFP exceptions. Signed-off-by: George G. Davis Acked-by: Catalin Marinas Signed-off-by: Russell King diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S index ba592a9..a2bed62 100644 --- a/arch/arm/vfp/entry.S +++ b/arch/arm/vfp/entry.S @@ -15,13 +15,16 @@ * r10 = thread_info structure * lr = failure return */ -#include -#include -#include -#include +#include #include +#include "../kernel/entry-header.S" ENTRY(do_vfp) +#ifdef CONFIG_PREEMPT + ldr r4, [r10, #TI_PREEMPT] @ get preempt count + add r11, r4, #1 @ increment it + str r11, [r10, #TI_PREEMPT] +#endif enable_irq ldr r4, .LCvfp ldr r11, [r10, #TI_CPU] @ CPU number @@ -30,6 +33,12 @@ ENTRY(do_vfp) ENDPROC(do_vfp) ENTRY(vfp_null_entry) +#ifdef CONFIG_PREEMPT + get_thread_info r10 + ldr r4, [r10, #TI_PREEMPT] @ get preempt count + sub r11, r4, #1 @ decrement it + str r11, [r10, #TI_PREEMPT] +#endif mov pc, lr ENDPROC(vfp_null_entry) @@ -41,6 +50,12 @@ ENDPROC(vfp_null_entry) __INIT ENTRY(vfp_testing_entry) +#ifdef CONFIG_PREEMPT + get_thread_info r10 + ldr r4, [r10, #TI_PREEMPT] @ get preempt count + sub r11, r4, #1 @ decrement it + str r11, [r10, #TI_PREEMPT] +#endif ldr r0, VFP_arch_address str r5, [r0] @ known non-zero value mov pc, r9 @ we have handled the fault diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index a5a4e57..83c4e38 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S @@ -137,6 +137,12 @@ check_for_exception: VFPFMXR FPEXC, r1 @ restore FPEXC last sub r2, r2, #4 str r2, [sp, #S_PC] @ retry the instruction +#ifdef CONFIG_PREEMPT + get_thread_info r10 + ldr r4, [r10, #TI_PREEMPT] @ get preempt count + sub r11, r4, #1 @ decrement it + str r11, [r10, #TI_PREEMPT] +#endif mov pc, r9 @ we think we have handled things @@ -155,6 +161,12 @@ look_for_VFP_exceptions: @ not recognised by VFP DBGSTR "not VFP" +#ifdef CONFIG_PREEMPT + get_thread_info r10 + ldr r4, [r10, #TI_PREEMPT] @ get preempt count + sub r11, r4, #1 @ decrement it + str r11, [r10, #TI_PREEMPT] +#endif mov pc, lr process_exception: diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 75457b3..01599c4 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c @@ -266,7 +266,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) * on VFP subarch 1. */ vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs); - return; + goto exit; } /* @@ -297,7 +297,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. */ if (fpexc ^ (FPEXC_EX | FPEXC_FP2V)) - return; + goto exit; /* * The barrier() here prevents fpinst2 being read @@ -310,6 +310,8 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs); if (exceptions) vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs); + exit: + preempt_enable(); } static void vfp_enable(void *unused) -- cgit v0.10.2 From 7f96b1caac43b34b325ee4acf61ce57d7214409c Mon Sep 17 00:00:00 2001 From: Ryan Mallon Date: Wed, 1 Apr 2009 20:33:30 +0100 Subject: [ARM] 5441/1: Use pr_err on error paths in at91 pm Change pr_debug to pr_err on error paths in the AT91 power management code. All of the errors will result in the cpu not going into the suspend state. This patch makes it possible to identify problems with suspend when power management debugging is not enabled. Signed-off-by: Ryan Mallon Acked-by: Andrew Victor Signed-off-by: Russell King diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 7ac812d..e26c4fe 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -198,17 +198,17 @@ static int at91_pm_verify_clocks(void) /* USB must not be using PLLB */ if (cpu_is_at91rm9200()) { if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) { - pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); + pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); return 0; } } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) { if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { - pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); + pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); return 0; } } else if (cpu_is_at91cap9()) { if ((scsr & AT91CAP9_PMC_UHP) != 0) { - pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); + pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); return 0; } } @@ -223,7 +223,7 @@ static int at91_pm_verify_clocks(void) css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; if (css != AT91_PMC_CSS_SLOW) { - pr_debug("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); + pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); return 0; } } -- cgit v0.10.2 From 91c39dcb7365ed1ff34ee9b3541304da5c942696 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Thu, 2 Apr 2009 10:21:29 +0100 Subject: [ARM] 5442/1: pxa/cm-x255: fix reverse RDY gpios in PCMCIA driver fix reverse RDY gpios in PCMCIA driver Signed-off-by: Mike Rapoport Signed-off-by: Russell King diff --git a/drivers/pcmcia/pxa2xx_cm_x255.c b/drivers/pcmcia/pxa2xx_cm_x255.c index 4ed64d8..5143a76 100644 --- a/drivers/pcmcia/pxa2xx_cm_x255.c +++ b/drivers/pcmcia/pxa2xx_cm_x255.c @@ -63,7 +63,7 @@ static void cmx255_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { int cd = skt->nr ? GPIO_PCMCIA_S1_CD_VALID : GPIO_PCMCIA_S0_CD_VALID; - int rdy = skt->nr ? GPIO_PCMCIA_S0_RDYINT : GPIO_PCMCIA_S1_RDYINT; + int rdy = skt->nr ? GPIO_PCMCIA_S1_RDYINT : GPIO_PCMCIA_S0_RDYINT; state->detect = !gpio_get_value(cd); state->ready = !!gpio_get_value(rdy); -- cgit v0.10.2 From 9d681f3a1b27fdfc17ea251cf8d5f627dab34670 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Thu, 2 Apr 2009 15:28:58 +0100 Subject: [ARM] 5444/1: ARM: Realview: Fix event-device multiplicators in localtimer.c Set the "mult" to finite value in the local_timer_setup in case of CONFIG_LOCAL_TIMERS not enabled. Othewise this throws warning in the boot log because of detect zero event-device multiplicators. This can cause division-by-zero crashes. Signed-off-by: Santosh Shilimkar Signed-off-by: Russell King diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c index 67d6d9c..d0d39ad 100644 --- a/arch/arm/mach-realview/localtimer.c +++ b/arch/arm/mach-realview/localtimer.c @@ -191,6 +191,7 @@ void __cpuinit local_timer_setup(void) clk->name = "dummy_timer"; clk->features = CLOCK_EVT_FEAT_DUMMY; clk->rating = 200; + clk->mult = 1; clk->set_mode = dummy_timer_set_mode; clk->broadcast = smp_timer_broadcast; clk->cpumask = cpumask_of(cpu); -- cgit v0.10.2 From 4353318ed5fe95debb8a80f289ebf1c03244cf9c Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Tue, 20 Jan 2009 13:22:29 +0000 Subject: arm: convert pcm037 platform to use smsc911x Updated to also specify SMSC911X_FORCE_INTERNAL_PHY, as the external phy detection hardware strap is incorrectly pulled high on this platform. Signed-off-by: Steve Glendinning Acked-by: Sascha Hauer Tested-by: Sascha Hauer diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c index 5fce022..c3648ef 100644 --- a/arch/arm/mach-mx3/pcm037.c +++ b/arch/arm/mach-mx3/pcm037.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -70,7 +70,7 @@ static struct imxuart_platform_data uart_pdata = { .flags = IMXUART_HAVE_RTSCTS, }; -static struct resource smc911x_resources[] = { +static struct resource smsc911x_resources[] = { [0] = { .start = CS1_BASE_ADDR + 0x300, .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1, @@ -79,22 +79,25 @@ static struct resource smc911x_resources[] = { [1] = { .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), - .flags = IORESOURCE_IRQ, + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, }, }; -static struct smc911x_platdata smc911x_info = { - .flags = SMC911X_USE_32BIT, - .irq_flags = IRQF_SHARED | IRQF_TRIGGER_LOW, +static struct smsc911x_platform_config smsc911x_info = { + .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY | + SMSC911X_SAVE_MAC_ADDRESS, + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, + .phy_interface = PHY_INTERFACE_MODE_MII, }; static struct platform_device pcm037_eth = { - .name = "smc911x", + .name = "smsc911x", .id = -1, - .num_resources = ARRAY_SIZE(smc911x_resources), - .resource = smc911x_resources, + .num_resources = ARRAY_SIZE(smsc911x_resources), + .resource = smsc911x_resources, .dev = { - .platform_data = &smc911x_info, + .platform_data = &smsc911x_info, }, }; -- cgit v0.10.2 From c5142e84f3a39c6396ce2ddde01b1e420a67464a Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Tue, 20 Jan 2009 13:23:30 +0000 Subject: arm: convert realview platform to use smsc911x Signed-off-by: Steve Glendinning diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index d676668..9ab947c 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -128,14 +128,15 @@ int realview_flash_register(struct resource *res, u32 num) return platform_device_register(&realview_flash_device); } -static struct smc911x_platdata realview_smc911x_platdata = { - .flags = SMC911X_USE_32BIT, - .irq_flags = IRQF_SHARED, - .irq_polarity = 1, +static struct smsc911x_platform_config smsc911x_config = { + .flags = SMSC911X_USE_32BIT, + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, + .phy_interface = PHY_INTERFACE_MODE_MII, }; static struct platform_device realview_eth_device = { - .name = "smc911x", + .name = "smsc911x", .id = 0, .num_resources = 2, }; @@ -145,8 +146,8 @@ int realview_eth_register(const char *name, struct resource *res) if (name) realview_eth_device.name = name; realview_eth_device.resource = res; - if (strcmp(realview_eth_device.name, "smc911x") == 0) - realview_eth_device.dev.platform_data = &realview_smc911x_platdata; + if (strcmp(realview_eth_device.name, "smsc911x") == 0) + realview_eth_device.dev.platform_data = &smsc911x_config; return platform_device_register(&realview_eth_device); } -- cgit v0.10.2 From 1c0e147eb6d7037957b5c53a96b82c40b75787c2 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Fri, 23 Jan 2009 17:09:13 +0000 Subject: arm: convert omap ldp platform to use smsc911x from 2.6.29, smc911x isn't maintained anymore. A new driver, smsc911x, will replace it. so convert omap_ldp to use smsc911x driver. Signed-off-by: Stanley.Miao Signed-off-by: Steve Glendinning diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index e096f77..da57b0f 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -41,12 +42,12 @@ #include "mmc-twl4030.h" -#define LDP_SMC911X_CS 1 -#define LDP_SMC911X_GPIO 152 +#define LDP_SMSC911X_CS 1 +#define LDP_SMSC911X_GPIO 152 #define DEBUG_BASE 0x08000000 #define LDP_ETHR_START DEBUG_BASE -static struct resource ldp_smc911x_resources[] = { +static struct resource ldp_smsc911x_resources[] = { [0] = { .start = LDP_ETHR_START, .end = LDP_ETHR_START + SZ_4K, @@ -59,40 +60,50 @@ static struct resource ldp_smc911x_resources[] = { }, }; -static struct platform_device ldp_smc911x_device = { - .name = "smc911x", +static struct smsc911x_platform_config ldp_smsc911x_config = { + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, + .flags = SMSC911X_USE_32BIT, + .phy_interface = PHY_INTERFACE_MODE_MII, +}; + +static struct platform_device ldp_smsc911x_device = { + .name = "smsc911x", .id = -1, - .num_resources = ARRAY_SIZE(ldp_smc911x_resources), - .resource = ldp_smc911x_resources, + .num_resources = ARRAY_SIZE(ldp_smsc911x_resources), + .resource = ldp_smsc911x_resources, + .dev = { + .platform_data = &ldp_smsc911x_config, + }, }; static struct platform_device *ldp_devices[] __initdata = { - &ldp_smc911x_device, + &ldp_smsc911x_device, }; -static inline void __init ldp_init_smc911x(void) +static inline void __init ldp_init_smsc911x(void) { int eth_cs; unsigned long cs_mem_base; int eth_gpio = 0; - eth_cs = LDP_SMC911X_CS; + eth_cs = LDP_SMSC911X_CS; if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { - printk(KERN_ERR "Failed to request GPMC mem for smc911x\n"); + printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n"); return; } - ldp_smc911x_resources[0].start = cs_mem_base + 0x0; - ldp_smc911x_resources[0].end = cs_mem_base + 0xff; + ldp_smsc911x_resources[0].start = cs_mem_base + 0x0; + ldp_smsc911x_resources[0].end = cs_mem_base + 0xff; udelay(100); - eth_gpio = LDP_SMC911X_GPIO; + eth_gpio = LDP_SMSC911X_GPIO; - ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); + ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); - if (gpio_request(eth_gpio, "smc911x irq") < 0) { - printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", + if (gpio_request(eth_gpio, "smsc911x irq") < 0) { + printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", eth_gpio); return; } @@ -104,7 +115,7 @@ static void __init omap_ldp_init_irq(void) omap2_init_common_hw(NULL); omap_init_irq(); omap_gpio_init(); - ldp_init_smc911x(); + ldp_init_smsc911x(); } static struct omap_uart_config ldp_uart_config __initdata = { -- cgit v0.10.2 From 96b6938ad94c980e72261c7645722a84e5a295eb Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Tue, 20 Jan 2009 13:22:48 +0000 Subject: arm: update pcm037 defconfig to use smsc911x Signed-off-by: Steve Glendinning Acked-by: Sascha Hauer Tested-by: Sascha Hauer diff --git a/arch/arm/configs/pcm037_defconfig b/arch/arm/configs/pcm037_defconfig index 6274745..6e37c77 100644 --- a/arch/arm/configs/pcm037_defconfig +++ b/arch/arm/configs/pcm037_defconfig @@ -465,12 +465,33 @@ CONFIG_NETDEVICES=y # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_VETH is not set -# CONFIG_PHYLIB is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +CONFIG_SMSC_PHY=y +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_AX88796 is not set CONFIG_SMC91X=y # CONFIG_DM9000 is not set +# CONFIG_SMC911X is not set +CONFIG_SMSC911X=y # CONFIG_IBM_NEW_EMAC_ZMII is not set # CONFIG_IBM_NEW_EMAC_RGMII is not set # CONFIG_IBM_NEW_EMAC_TAH is not set -- cgit v0.10.2 From f61eafb3a5441b16c90e100c2cd743be7932fdc9 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Tue, 20 Jan 2009 13:23:38 +0000 Subject: arm: update realview defconfigs to use smsc911x Signed-off-by: Steve Glendinning diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig index cd29824..21db4b3 100644 --- a/arch/arm/configs/realview-smp_defconfig +++ b/arch/arm/configs/realview-smp_defconfig @@ -496,13 +496,33 @@ CONFIG_NETDEVICES=y # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_VETH is not set -# CONFIG_PHYLIB is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +CONFIG_SMSC_PHY=y +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_AX88796 is not set CONFIG_SMC91X=y # CONFIG_DM9000 is not set -CONFIG_SMC911X=y +# CONFIG_SMC911X is not set +CONFIG_SMSC911X=y # CONFIG_IBM_NEW_EMAC_ZMII is not set # CONFIG_IBM_NEW_EMAC_RGMII is not set # CONFIG_IBM_NEW_EMAC_TAH is not set diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig index 7e253f5..9a75c30 100644 --- a/arch/arm/configs/realview_defconfig +++ b/arch/arm/configs/realview_defconfig @@ -490,13 +490,33 @@ CONFIG_NETDEVICES=y # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_VETH is not set -# CONFIG_PHYLIB is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +CONFIG_SMSC_PHY=y +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_AX88796 is not set CONFIG_SMC91X=y # CONFIG_DM9000 is not set -CONFIG_SMC911X=y +# CONFIG_SMC911X is not set +CONFIG_SMSC911X=y # CONFIG_IBM_NEW_EMAC_ZMII is not set # CONFIG_IBM_NEW_EMAC_RGMII is not set # CONFIG_IBM_NEW_EMAC_TAH is not set -- cgit v0.10.2 From 162e8a415f4e6900f1f157c4a2ad68147b0a899c Mon Sep 17 00:00:00 2001 From: "Stanley.Miao" Date: Tue, 20 Jan 2009 17:06:10 +0000 Subject: arm: update omap_ldp defconfig to use smsc911x Signed-off-by: Stanley.Miao diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig index aa9d34f..679a4a3 100644 --- a/arch/arm/configs/omap_ldp_defconfig +++ b/arch/arm/configs/omap_ldp_defconfig @@ -474,14 +474,34 @@ CONFIG_NETDEVICES=y # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_VETH is not set -# CONFIG_PHYLIB is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +CONFIG_SMSC_PHY=y +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_AX88796 is not set # CONFIG_SMC91X is not set # CONFIG_DM9000 is not set # CONFIG_ENC28J60 is not set -CONFIG_SMC911X=y +# CONFIG_SMC911X is not set +CONFIG_SMSC911X=y # CONFIG_IBM_NEW_EMAC_ZMII is not set # CONFIG_IBM_NEW_EMAC_RGMII is not set # CONFIG_IBM_NEW_EMAC_TAH is not set -- cgit v0.10.2 From 172ef275444efa12d834fb9d1b1acdac92db47f7 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Mon, 2 Feb 2009 06:27:49 +0000 Subject: ARM: Add SMSC911X support to Overo platform (V2) Gumstix will soon be shipping a variant of their Summit board that includes an SMSC LAN9221 ethernet interface. This patch provides support via the smsc911x driver when enabled in kernel config. The Overo defconfig is not updated since the LAN9221 is an option not present on all systems. Signed-off-by: Steve Sakoman Signed-off-by: Tony Lindgren Acked-by: Steve Glendinning diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index b3f6e9d..b1f23be 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -57,6 +57,9 @@ #define GPMC_CS0_BASE 0x60 #define GPMC_CS_SIZE 0x30 +#define OVERO_SMSC911X_CS 5 +#define OVERO_SMSC911X_GPIO 176 + #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) @@ -116,6 +119,67 @@ static void __init overo_ads7846_init(void) static inline void __init overo_ads7846_init(void) { return; } #endif +#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) + +#include + +static struct resource overo_smsc911x_resources[] = { + { + .name = "smsc911x-memory", + .flags = IORESOURCE_MEM, + }, + { + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, + }, +}; + +static struct smsc911x_platform_config overo_smsc911x_config = { + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, + .flags = SMSC911X_USE_32BIT , + .phy_interface = PHY_INTERFACE_MODE_MII, +}; + +static struct platform_device overo_smsc911x_device = { + .name = "smsc911x", + .id = -1, + .num_resources = ARRAY_SIZE(overo_smsc911x_resources), + .resource = &overo_smsc911x_resources, + .dev = { + .platform_data = &overo_smsc911x_config, + }, +}; + +static inline void __init overo_init_smsc911x(void) +{ + unsigned long cs_mem_base; + + if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { + printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); + return; + } + + overo_smsc911x_resources[0].start = cs_mem_base + 0x0; + overo_smsc911x_resources[0].end = cs_mem_base + 0xff; + + if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) && + (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) { + gpio_export(OVERO_SMSC911X_GPIO, 0); + } else { + printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n"); + return; + } + + overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); + overo_smsc911x_resources[1].end = 0; + + platform_device_register(&overo_smsc911x_device); +} + +#else +static inline void __init overo_init_smsc911x(void) { return; } +#endif + static struct mtd_partition overo_nand_partitions[] = { { .name = "xloader", @@ -290,6 +354,7 @@ static void __init overo_init(void) overo_flash_init(); usb_musb_init(); overo_ads7846_init(); + overo_init_smsc911x(); if ((gpio_request(OVERO_GPIO_W2W_NRESET, "OVERO_GPIO_W2W_NRESET") == 0) && -- cgit v0.10.2 From 67a52bb90b515c2a96ec51a3571bcd70a2fadb50 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 2 Apr 2009 23:23:43 +0100 Subject: [ARM] fix build-breaking 7a192ec commit The commit: platform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver' contains this: -static int __exit pxa2xx_flash_remove(struct device *dev) +static int __exit pxa2xx_flash_remove(struct platform_device *dev) ... - .remove = __exit_p(pxa2xx_flash_remove), + .remove = __devexit_p(pxa2xx_flash_remove), which leads to the following build error: `pxa2xx_flash_remove' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o This is not the only instance of it in this patch - all __exit_p's touched by this patch have been converted to __devexit_p's without regard to the original function. Let's revert this change and, if we are going to convert functions to be __devexit/__devinit, lets have that as a _separate_ patch doing just that change. Signed-off-by: Russell King diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index e9026cb..572d32f 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c @@ -117,7 +117,7 @@ static int __init pxa2xx_flash_probe(struct platform_device *pdev) return 0; } -static int __exit pxa2xx_flash_remove(struct platform_device *dev) +static int __devexit pxa2xx_flash_remove(struct platform_device *dev) { struct pxa2xx_flash_info *info = platform_get_drvdata(dev); -- cgit v0.10.2