I want to control the error LED on the net5501 under Linux 2.6. With a bit of
hacking* I got a GPIO module designed for the 4801** to compile and install.
With it the temperature sensors work but I'm unable to control the LED. From
the CS5536 data book it appears one needs to clear bit 4 of MSR 51400015 to
use be able to use GPIO20. I tried doing this but it had no effect. Has
anyone gotten GPIO to work on this hardware under Linux? Thanks in advance.
* See the attached patch
** From http://www.meduna.org/sw_gpio_en.html
--
Alex Hajnal
Network Administrator
DataSynapse
Voice: 212-204-5858
Mobile: 347-753-4941
View the DataSynapse privacy statement:
http://www.datasynapse.com/emailprivacy.html
diff -u --new-file --recursive gpio-1.3.2+trillian0.01/4801driver.c gpio-1.3.2+trillian0.01.patched/4801driver.c
--- gpio-1.3.2+trillian0.01/4801driver.c 2005-02-18 06:53:24.000000000 -0500
+++ gpio-1.3.2+trillian0.01.patched/4801driver.c 2008-03-28 15:14:08.000000000 -0400
@@ -82,7 +82,11 @@
static void _net4801_write_error_led(unsigned int on) {
static unsigned long value;
-
+
+ value = (long)native_read_msr(0x51400015);
+ value &= 0xFFFFFFEF;
+ native_write_msr(0x51400015, value);
+
value = inb(geode_gpio_base+GEODE_GPIO_DATA_OUT+2);
if (on!=0) {
set_bit(4, &value);
@@ -335,17 +339,21 @@
static unsigned base;
static int i;
- if ((bridge = pci_find_device(SC1100_VENDOR_ID,
+ if ((bridge = pci_get_device(SC1100_VENDOR_ID,
SC1100_F0_DEVICE_ID ,
- NULL)) == NULL)
+ NULL)) == NULL) {
+ printk(KERN_ERR OUR_NAME ": can't find bridge device %4x:%4x\n", SC1100_VENDOR_ID, SC1100_F0_DEVICE_ID);
return -ENODEV;
-
- base = pci_resource_start(bridge, 0);
-
- if (request_region(base, GEODE_GPIO_SIZE, "Soekris net4801 GPIO") == 0) {
- printk(KERN_ERR OUR_NAME ": can't allocate I/O for Geode GPIOs\n");
- return -EBUSY;
}
+ printk(KERN_ERR OUR_NAME ": found bridge device %4x:%4x\n", SC1100_VENDOR_ID, SC1100_F0_DEVICE_ID);
+
+ base = 0x6100; //pci_resource_start(bridge, 0);
+ printk(KERN_ERR OUR_NAME ": base at %x\n", base);
+
+ //if (request_region(base, GEODE_GPIO_SIZE, "Soekris net4801 GPIO") == 0) {
+ // printk(KERN_ERR OUR_NAME ": can't allocate I/O for Geode GPIOs\n");
+ // return -EBUSY;
+ //}
printk(OUR_NAME ": Soekris net4801 GPIO driver Version " VERSION " (C) 2003 Martin Hejl\n");
@@ -375,7 +383,7 @@
printk(KERN_ERR OUR_NAME ": GPIOs are disabled\n");
/* clean up */
//unregister_chrdev(gpio_major, OUR_NAME);
- release_region(geode_gpio_base, GEODE_GPIO_SIZE);
+ //release_region(geode_gpio_base, GEODE_GPIO_SIZE);
return -ENODEV;
}
@@ -476,7 +484,7 @@
static void _net4801_cleanup(void)
{
- release_region(geode_gpio_base, GEODE_GPIO_SIZE);
+ //release_region(geode_gpio_base, GEODE_GPIO_SIZE);
}
EXPORT_SYMBOL(net4801_init);
diff -u --new-file --recursive gpio-1.3.2+trillian0.01/4801driver.h gpio-1.3.2+trillian0.01.patched/4801driver.h
--- gpio-1.3.2+trillian0.01/4801driver.h 2005-02-18 06:52:39.000000000 -0500
+++ gpio-1.3.2+trillian0.01.patched/4801driver.h 2008-03-28 12:53:47.000000000 -0400
@@ -39,8 +39,10 @@
/* 12 gpio pins */
#define NUMBER_OF_PINS 12
-#define SC1100_VENDOR_ID 0x100B
-#define SC1100_F0_DEVICE_ID 0x0510
+//#define SC1100_VENDOR_ID 0x100B
+//#define SC1100_F0_DEVICE_ID 0x0510
+#define SC1100_VENDOR_ID 0x1022
+#define SC1100_F0_DEVICE_ID 0x2080
/* ofset to use if we can't find the SIO at 0x2E */
#define SIO_BASE_OFFSET 0x20
diff -u --new-file --recursive gpio-1.3.2+trillian0.01/Makefile gpio-1.3.2+trillian0.01.patched/Makefile
--- gpio-1.3.2+trillian0.01/Makefile 2005-02-18 06:48:30.000000000 -0500
+++ gpio-1.3.2+trillian0.01.patched/Makefile 2008-03-28 15:15:28.000000000 -0400
@@ -2,7 +2,7 @@
# Makefile for the Net4801 drivers
#
-REL=2.6.11-rc4-soekris
+REL=2.6.24.4-net5501
ifneq ($(KERNELRELEASE),)
@@ -13,10 +13,16 @@
writelcd-objs := common_writelcd.o 4501driver.o 4801driver.o
else
#KDIR := /lib/modules/$(shell uname -r)/build
-KDIR := /lib/modules/$(REL)/build
+#KDIR := /lib/modules/$(REL)/build
+KDIR := /lib/modules/$(REL)/source
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
+install:
+ cp -a *.ko /lib/modules/$(REL)/kernel/drivers/misc/
+
+clean:
+ rm -rf Module.symvers .tmp_versions ./.*.cmd *.mod.c *.o *.ko || true
diff -u --new-file --recursive gpio-1.3.2+trillian0.01/common.h gpio-1.3.2+trillian0.01.patched/common.h
--- gpio-1.3.2+trillian0.01/common.h 2005-02-18 07:50:36.000000000 -0500
+++ gpio-1.3.2+trillian0.01.patched/common.h 2008-03-28 11:05:40.000000000 -0400
@@ -25,7 +25,9 @@
#ifndef __COMMON_GPIO_H__
#define __COMMON_GPIO_H__
-#include <linux/config.h>
+#define KBUILD_MODNAME KBUILD_STR(gpio)
+//#include <linux/config.h>
+#include <linux/autoconf.h>
#include <config/modversions.h>
#include <linux/module.h>
#include <linux/kernel.h>
diff -u --new-file --recursive gpio-1.3.2+trillian0.01/gpio.mod.c gpio-1.3.2+trillian0.01.patched/gpio.mod.c
--- gpio-1.3.2+trillian0.01/gpio.mod.c 2005-02-18 06:42:34.000000000 -0500
+++ gpio-1.3.2+trillian0.01.patched/gpio.mod.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,43 +0,0 @@
-#include <linux/module.h>
-#include <linux/vermagic.h>
-#include <linux/compiler.h>
-
-MODULE_INFO(vermagic, VERMAGIC_STRING);
-
-#undef unix
-struct module __this_module
-__attribute__((section(".gnu.linkonce.this_module"))) = {
- .name = __stringify(KBUILD_MODNAME),
- .init = init_module,
-#ifdef CONFIG_MODULE_UNLOAD
- .exit = cleanup_module,
-#endif
-};
-
-static const struct modversion_info ____versions[]
-__attribute_used__
-__attribute__((section("__versions"))) = {
- { 0xda01d437, "struct_module" },
- { 0x1a1a4f09, "__request_region" },
- { 0x98c09509, "remove_proc_entry" },
- { 0x1d26aa98, "sprintf" },
- { 0x865ebccd, "ioport_resource" },
- { 0x1b7d4074, "printk" },
- { 0x6e12ea6f, "pci_find_device" },
- { 0x2f287f0d, "copy_to_user" },
- { 0x625acc81, "__down_failed_interruptible" },
- { 0x9eac042a, "__ioremap" },
- { 0x986c1c3b, "register_chrdev" },
- { 0x8aced1a, "create_proc_entry" },
- { 0xd49501d4, "__release_region" },
- { 0xedc03953, "iounmap" },
- { 0xc192d491, "unregister_chrdev" },
- { 0x60a4461c, "__up_wakeup" },
- { 0xd6c963c, "copy_from_user" },
-};
-
-static const char __module_depends[]
-__attribute_used__
-__attribute__((section(".modinfo"))) =
-"depends=";
-
diff -u --new-file --recursive gpio-1.3.2+trillian0.01/writelcd.mod.c gpio-1.3.2+trillian0.01.patched/writelcd.mod.c
--- gpio-1.3.2+trillian0.01/writelcd.mod.c 2005-02-18 06:42:34.000000000 -0500
+++ gpio-1.3.2+trillian0.01.patched/writelcd.mod.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,38 +0,0 @@
-#include <linux/module.h>
-#include <linux/vermagic.h>
-#include <linux/compiler.h>
-
-MODULE_INFO(vermagic, VERMAGIC_STRING);
-
-#undef unix
-struct module __this_module
-__attribute__((section(".gnu.linkonce.this_module"))) = {
- .name = __stringify(KBUILD_MODNAME),
- .init = init_module,
-#ifdef CONFIG_MODULE_UNLOAD
- .exit = cleanup_module,
-#endif
-};
-
-static const struct modversion_info ____versions[]
-__attribute_used__
-__attribute__((section("__versions"))) = {
- { 0xda01d437, "struct_module" },
- { 0x1a1a4f09, "__request_region" },
- { 0xeae3dfd6, "__const_udelay" },
- { 0x1d26aa98, "sprintf" },
- { 0x865ebccd, "ioport_resource" },
- { 0x1b7d4074, "printk" },
- { 0x6e12ea6f, "pci_find_device" },
- { 0x9eac042a, "__ioremap" },
- { 0x446004dc, "__number_of_pins" },
- { 0xd49501d4, "__release_region" },
- { 0xedc03953, "iounmap" },
- { 0x9e7d6bd0, "__udelay" },
-};
-
-static const char __module_depends[]
-__attribute_used__
-__attribute__((section(".modinfo"))) =
-"depends=gpio";
-
_______________________________________________
Soekris-tech mailing list
[email protected]
http://lists.soekris.com/mailman/listinfo/soekris-tech