diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/gumstix-kernel-2.6.21/smc91x-fail-if-no-chip.patch | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/gumstix-kernel-2.6.21/smc91x-fail-if-no-chip.patch')
-rw-r--r-- | recipes/linux/gumstix-kernel-2.6.21/smc91x-fail-if-no-chip.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes/linux/gumstix-kernel-2.6.21/smc91x-fail-if-no-chip.patch b/recipes/linux/gumstix-kernel-2.6.21/smc91x-fail-if-no-chip.patch new file mode 100644 index 0000000000..17ead87f12 --- /dev/null +++ b/recipes/linux/gumstix-kernel-2.6.21/smc91x-fail-if-no-chip.patch @@ -0,0 +1,58 @@ +--- linux-2.6.21/drivers/net/gumstix-smc91x.c-orig 2008-02-24 22:06:30.000000000 -0800 ++++ linux-2.6.21/drivers/net/gumstix-smc91x.c 2008-02-25 08:12:57.000000000 -0800 +@@ -90,18 +90,42 @@ + pxa_gpio_mode(GPIO49_nPWE_MD); + + pxa_gpio_mode(GPIO78_nCS_2_MD); +- // If either if statement fails, then we'll drop out and turn_off_eth1, ++ ++ // First look for smc91x0 ++ // If either if statement fails, then we'll drop out and turn_off_eth0, ++ // if both succeed, then we'll skip that and just proceed ++ // to test for 2 smc91x chips ++ if(request_mem_region(gumstix_smc91x0_resources[0].start, SMC_IO_EXTENT, "smc91x0 probe")) ++ { ++ ioaddr = ioremap(gumstix_smc91x0_resources[0].start, SMC_IO_EXTENT); ++ val = ioread16(ioaddr + BANK_SELECT); ++ iounmap(ioaddr); ++ release_mem_region(gumstix_smc91x0_resources[0].start, SMC_IO_EXTENT); ++ if ((val & 0xFF00) == 0x3300) { ++ goto proceed; ++ } ++ } ++ ++ printk(KERN_ERR "%s: smc91x chip not found, returning -ENXIO\n", __FUNCTION__); ++ return -ENXIO; ++ ++proceed: ++ printk(KERN_ERR "%s: smc91x chip found\n", __FUNCTION__); ++ ++ // Now look for a second smc91x ++ // If either if statement fails, then we'll drop out and return -ENXIO + // if both succeed, then we'll skip that and just proceed with 2 cards +- if(request_mem_region(gumstix_smc91x1_resources[0].start, SMC_IO_EXTENT, "smc91x probe")) ++ if(request_mem_region(gumstix_smc91x1_resources[0].start, SMC_IO_EXTENT, "smc91x1 probe")) + { + ioaddr = ioremap(gumstix_smc91x1_resources[0].start, SMC_IO_EXTENT); + val = ioread16(ioaddr + BANK_SELECT); + iounmap(ioaddr); + release_mem_region(gumstix_smc91x1_resources[0].start, SMC_IO_EXTENT); + if ((val & 0xFF00) == 0x3300) { +- goto proceed; ++ goto proceed1; + } + } ++ + + turn_off_eth1: + // This is apparently not an SMC91C111 +@@ -110,7 +134,8 @@ + smc91x_devices[1] = NULL; + pxa_gpio_mode(78 | GPIO_IN); + +-proceed: ++proceed1: ++ printk(KERN_ERR "%s: found %d smc91x chip(s)\n", __FUNCTION__,num_devices); + pxa_gpio_mode(GPIO15_nCS_1_MD); + + if(smc91x_devices[1]) pxa_gpio_mode(GPIO_GUMSTIX_ETH1_RST_MD); |