Enhance the leds-net5501 to be a generic platform driver.

Simplify kernel config.

Other missing drivers.

Add system and network configs.
Index: target/linux/x86/net5501/config-default
===================================================================
--- target/linux/x86/net5501/config-default     (revision 29492)
+++ target/linux/x86/net5501/config-default     (working copy)
@@ -1,42 +1,24 @@
-CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx"
+CONFIG_PROCESSOR_SELECT=y
 CONFIG_CPU_SUP_AMD=y
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_GENERIC_GPIO=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
-CONFIG_HAVE_EARLY_RES=y
-CONFIG_HAVE_HW_BREAKPOINT=y
-CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
-CONFIG_HAVE_OPTPROBES=y
+CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_USER_RETURN_NOTIFIER=y
+CONFIG_GENERIC_GPIO=y
 CONFIG_HWMON=y
 # CONFIG_HWMON_DEBUG_CHIP is not set
-CONFIG_ILLEGAL_POINTER_VALUE=0
-CONFIG_INSTRUCTION_DECODER=y
-CONFIG_ISA_DMA_API=y
-CONFIG_K8_NB=y
-# CONFIG_LEDS_GPIO is not set
 # CONFIG_M486 is not set
 CONFIG_MGEODE_LX=y
-CONFIG_GEODE_MFGPT_TIMER=y
-# CONFIG_NEED_DMA_MAP_STATE is not set
-CONFIG_NEED_SG_DMA_LENGTH=y
+# CONFIG_MOUSE_PS2 is not set
 # CONFIG_PCIEPORTBUS is not set
-# CONFIG_PCSPKR_PLATFORM is not set
-CONFIG_PERF_EVENTS=y
-CONFIG_PROCESSOR_SELECT=y
-CONFIG_SCSI_MOD=y
+CONFIG_PCSPKR_PLATFORM=y
 # CONFIG_SCx200 is not set
 # CONFIG_SERIO_I8042 is not set
 # CONFIG_SERIO_LIBPS2 is not set
-# CONFIG_TINY_RCU is not set
-CONFIG_X86_CMOV=y
 CONFIG_X86_DEBUGCTLMSR=y
 # CONFIG_X86_GENERIC is not set
 CONFIG_X86_INTERNODE_CACHE_SHIFT=5
 CONFIG_X86_L1_CACHE_SHIFT=5
-CONFIG_X86_TSC=y
-CONFIG_X86_USE_3DNOW=y
-CONFIG_X86_USE_PPRO_CHECKSUM=y
+# CONFIG_CS5535_CLOCK_EVENT_SRC is not set
+CONFIG_PATA_CS5536=y
+CONFIG_NET5501=y
Index: target/linux/x86/net5501/base-files/etc/hotplug.d/button/50-reboot
===================================================================
--- target/linux/x86/net5501/base-files/etc/hotplug.d/button/50-reboot  
(revision 0)
+++ target/linux/x86/net5501/base-files/etc/hotplug.d/button/50-reboot  
(revision 0)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+logger -t button -p daemon.info "$BUTTON/$ACTION"
+
+case "$BUTTON/$ACTION" in
+
+reset/released)
+  reboot -f
+  ;;
+
+esac
+
+exit 0

Property changes on: 
target/linux/x86/net5501/base-files/etc/hotplug.d/button/50-reboot
___________________________________________________________________
Added: svn:executable
   + *

Index: target/linux/x86/net5501/base-files/etc/config/system
===================================================================
--- target/linux/x86/net5501/base-files/etc/config/system       (revision 0)
+++ target/linux/x86/net5501/base-files/etc/config/system       (revision 0)
@@ -0,0 +1,16 @@
+config system
+       option hostname OpenWrt
+       option timezone UTC
+
+config timeserver ntp
+       list server     0.openwrt.pool.ntp.org
+       list server     1.openwrt.pool.ntp.org
+       list server     2.openwrt.pool.ntp.org
+       list server     3.openwrt.pool.ntp.org
+
+config led
+       option default  1
+       option name     Heartbeat
+       option sysfs    'net5501:1'
+       option trigger  heartbeat
+
Index: target/linux/x86/net5501/base-files/etc/config/network
===================================================================
--- target/linux/x86/net5501/base-files/etc/config/network      (revision 0)
+++ target/linux/x86/net5501/base-files/etc/config/network      (revision 0)
@@ -0,0 +1,18 @@
+# Copyright (C) 2011 OpenWrt.org
+
+config interface loopback
+       option ifname   lo
+       option proto    static
+       option ipaddr   127.0.0.1
+       option netmask  255.0.0.0
+
+config interface lan
+       option ifname   "eth1 eth2 eth3"
+       option type     bridge
+       option proto    static
+       option ipaddr   192.168.1.1
+       option netmask  255.255.255.0
+
+config interface wan
+       option ifname   eth0
+       option proto    dhcp
Index: target/linux/x86/net5501/target.mk
===================================================================
--- target/linux/x86/net5501/target.mk  (revision 29492)
+++ target/linux/x86/net5501/target.mk  (working copy)
@@ -1,13 +1,30 @@
 BOARDNAME:=Soekris net5501
 FEATURES:=squashfs pci usb gpio
-DEFAULT_PACKAGES += kmod-ata-via-sata kmod-crypto-hw-geode \
-                       kmod-gpio-cs5535 kmod-gpio-nsc kmod-gpio-pc8736x \
-                       kmod-wdt-geode kmod-hwmon-core kmod-hwmon-pc87360 \
-                       kmod-via-rhine kmod-leds-net5501 \
+NET5501_GPIO = $(if $(findstring 
2.6.32,$(LINUX_VERSION)),gpio-cs5535,gpio-cs5535-new)
+DEFAULT_PACKAGES += kmod-crypto-hw-geode kmod-crypto-ocf \
+                       kmod-$(NET5501_GPIO) kmod-gpio-nsc \
+                       kmod-wdt-geode kmod-cs5535-clockevt kmod-cs5535-mfgpt \
+                       kmod-cs5536 \
+                       kmod-hwmon-core kmod-hwmon-pc87360 kmod-gpio-pc8736x \
+                       kmod-via-rhine kmod-solos-pci \
                        kmod-i2c-core kmod-i2c-gpio \
                        kmod-i2c-algo-bit kmod-i2c-algo-pca kmod-i2c-algo-pcf \
-                       kmod-usb-core kmod-usb2 kmod-usb-uhci
+                       kmod-i2c-scx200-acb \
+                       kmod-usb-core kmod-usb2 kmod-usb-ohci \
+                       kmod-cfg80211 kmod-mac80211 \
+                       kmod-mppe kmod-pppoe kmod-pppoa kmod-pppo2ltp \
+                       kmod-ath kmod-ath5k kmod-ath9k \
+                       kmod-leds-gpio kmod-input-gpio-keys-polled \
+                       kmod-button-hotplug \
+                       kmod-ledtrig-heartbeat kmod-ledtrig-gpio \
+                       kmod-ledtrig-netdev kmod-ledtrig-netfilter \
+                       kmod-cpu-msr \
+                       soloscli linux-atm br2684ctl bridge ppp ppp-mod-pppoa \
+                       pppdump pppstats \
+                       libopenssl ocf-crypto-headers zlib hwclock hostapd
 
+CS5535_MASK:=0x01000040
+
 CFLAGS += -Os -pipe -march=k6-2 -fno-align-functions -fno-align-loops 
-fno-align-jumps \
          -fno-align-labels
 
@@ -15,3 +32,6 @@
        Build firmware images for Soekris net5501 board
 endef
 
+define KernelPackage/$(NET5501_GPIO)/install
+       sed -i -r -e 's/$$$$$$$$/ mask=$(CS5535_MASK)/' 
$(1)/etc/modules.d/??-$(NET5501_GPIO)
+endef
Index: target/linux/x86/patches-2.6.39/005-net5501_platform.patch
===================================================================
--- target/linux/x86/patches-2.6.39/005-net5501_platform.patch  (revision 0)
+++ target/linux/x86/patches-2.6.39/005-net5501_platform.patch  (revision 0)
@@ -0,0 +1,270 @@
+--- linux-2.6.39.4/arch/x86/Kconfig.orig       2011-12-10 23:37:09.975015963 
-0700
++++ linux-2.6.39.4/arch/x86/Kconfig    2011-12-11 21:21:38.914010786 -0700
+@@ -2108,6 +2108,12 @@ config GEOS
+       ---help---
+         This option enables system support for the Traverse Technologies GEOS.
+ 
++config NET5501
++      bool "Soekris Engineering net5501 System Support (LEDS, GPIO, etc)"
++      select GPIOLIB
++      ---help---
++        This option enables system support for the Soekris Engineering 
net5501.
++
+ endif # X86_32
+ 
+ config AMD_NB
+--- linux-2.6.39.4/arch/x86/platform/geode/Makefile.orig       2011-12-10 
23:37:09.976016013 -0700
++++ linux-2.6.39.4/arch/x86/platform/geode/Makefile    2011-12-11 
20:47:58.277002279 -0700
+@@ -1,2 +1,3 @@
+ obj-$(CONFIG_ALIX)            += alix.o
+ obj-$(CONFIG_GEOS)            += geos.o
++obj-$(CONFIG_NET5501)         += net5501.o
+--- /dev/null  1969-12-31 17:00:00.000000000 -0700
++++ linux-2.6.39.4/arch/x86/platform/geode/net5501.c   2011-12-11 
21:17:41.473189273 -0700
+@@ -0,0 +1,147 @@
++/*
++ * System Specific setup for Soekris net5501
++ * At the moment this means setup of GPIO control of LEDs and buttons
++ * on net5501 boards.
++ *
++ *
++ * Copyright (C) 2008 Constantin Baranov <co...@mimas.ru>
++ * Copyright (C) 2011 Ed Wildgoose <ker...@wildgooses.com>
++ *                and Philip Prindeville <phil...@redfish-solutions.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/string.h>
++#include <linux/leds.h>
++#include <linux/platform_device.h>
++#include <linux/gpio.h>
++#include <linux/input.h>
++#include <linux/gpio_keys.h>
++
++#include <asm/geode.h>
++
++#define BIOS_REGION_BASE              0xffff0000
++#define BIOS_REGION_SIZE              0x00010000
++
++static struct gpio_keys_button net5501_gpio_buttons[] = {
++      {
++              .code = KEY_RESTART,
++              .gpio = 24,
++              .active_low = 1,
++              .desc = "Reset button",
++              .type = EV_KEY,
++              .wakeup = 0,
++              .debounce_interval = 100,
++              .can_disable = 0,
++      }
++};
++static struct gpio_keys_platform_data net5501_buttons_data = {
++      .buttons = net5501_gpio_buttons,
++      .nbuttons = ARRAY_SIZE(net5501_gpio_buttons),
++      .poll_interval = 20,
++};
++
++static struct platform_device net5501_buttons_dev = {
++      .name = "gpio-keys-polled",
++      .id = 1,
++      .dev = {
++              .platform_data = &net5501_buttons_data,
++      }
++};
++
++static struct gpio_led net5501_leds[] = {
++      {
++              .name = "net5501:1",
++              .gpio = 6,
++              .default_trigger = "default-on",
++              .active_low = 1,
++      },
++};
++
++static struct gpio_led_platform_data net5501_leds_data = {
++      .num_leds = ARRAY_SIZE(net5501_leds),
++      .leds = net5501_leds,
++};
++
++static struct platform_device net5501_leds_dev = {
++      .name = "leds-gpio",
++      .id = -1,
++      .dev.platform_data = &net5501_leds_data,
++};
++
++static struct __initdata platform_device *net5501_devs[] = {
++      &net5501_buttons_dev,
++      &net5501_leds_dev,
++};
++
++static void __init register_net5501(void)
++{
++      /* Setup LED control through leds-gpio driver */
++      platform_add_devices(net5501_devs, ARRAY_SIZE(net5501_devs));
++}
++
++struct net5501_board {
++      u16     offset;
++      u16     len;
++      char    *sig;
++};
++
++static struct net5501_board __initdata boards[] = {
++      { 0xb7b, 7, "net5501" },        /* net5501 v1.33/1.33c */
++      { 0xb1f, 7, "net5501" },        /* net5501 v1.32i */
++};
++
++static int __init net5501_present(void)
++{
++      int i;
++      unsigned char *rombase, *bios;
++
++      if (!is_geode())
++              return 0;
++
++      rombase = ioremap(BIOS_REGION_BASE, BIOS_REGION_SIZE - 1);
++      if (!rombase)
++              printk(KERN_INFO "Soekris net5501 LED driver failed to get 
rombase");
++
++      bios = rombase + 0x20;  /* null terminated */
++
++      if (memcmp(bios, "comBIOS", 7))
++              goto unmap;
++
++      for (i = 0; i < ARRAY_SIZE(boards); i++) {
++              unsigned char *model = rombase + boards[i].offset;
++
++              if (memcmp(model, boards[i].sig, boards[i].len) == 0) {
++                      printk(KERN_INFO "Soekris %s: %s\n", model, bios);
++
++                      register_net5501();
++                      break;
++              }
++      }
++
++unmap:
++      iounmap(rombase);
++      return 0;
++}
++
++static int __init net5501_init(void)
++{
++      if (!is_geode())
++              return 0;
++
++      if (net5501_present())
++              register_net5501();
++
++      return 0;
++}
++
++module_init(net5501_init);
++
++MODULE_AUTHOR("Philip Prindeville <phil...@redfish-solutions.com>");
++MODULE_DESCRIPTION("Soekris net5501 System Setup");
++MODULE_LICENSE("GPL");
+--- linux-2.6.39.4/drivers/leds/leds-net5501.c.orig    2011-08-03 
13:43:28.000000000 -0600
++++ linux-2.6.39.4/drivers/leds/leds-net5501.c 2011-11-22 15:00:43.615999747 
-0700
+@@ -1,96 +0,0 @@
+-/*
+- * Soekris board support code
+- *
+- * Copyright (C) 2008-2009 Tower Technologies
+- * Written by Alessandro Zummo <a.zu...@towertech.it>
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License version 2
+- * as published by the Free Software Foundation.
+- */
+-
+-#include <linux/kernel.h>
+-#include <linux/init.h>
+-#include <linux/io.h>
+-#include <linux/string.h>
+-#include <linux/leds.h>
+-#include <linux/platform_device.h>
+-#include <linux/gpio.h>
+-
+-#include <asm/geode.h>
+-
+-static const struct gpio_led net5501_leds[] = {
+-      {
+-              .name = "error",
+-              .gpio = 6,
+-              .default_trigger = "default-on",
+-      },
+-};
+-
+-static struct gpio_led_platform_data net5501_leds_data = {
+-      .num_leds = ARRAY_SIZE(net5501_leds),
+-      .leds = net5501_leds,
+-};
+-
+-static struct platform_device net5501_leds_dev = {
+-      .name = "leds-gpio",
+-      .id = -1,
+-      .dev.platform_data = &net5501_leds_data,
+-};
+-
+-static void __init init_net5501(void)
+-{
+-      platform_device_register(&net5501_leds_dev);
+-}
+-
+-struct soekris_board {
+-      u16     offset;
+-      char    *sig;
+-      u8      len;
+-      void    (*init)(void);
+-};
+-
+-static struct soekris_board __initdata boards[] = {
+-      { 0xb7b, "net5501", 7, init_net5501 },  /* net5501 v1.33/1.33c */
+-      { 0xb1f, "net5501", 7, init_net5501 },  /* net5501 v1.32i */
+-};
+-
+-static int __init soekris_init(void)
+-{
+-      int i;
+-      unsigned char *rombase, *bios;
+-
+-      if (!is_geode())
+-              return 0;
+-
+-      rombase = ioremap(0xffff0000, 0xffff);
+-      if (!rombase) {
+-              printk(KERN_INFO "Soekris net5501 LED driver failed to get 
rombase");
+-              return 0;
+-      }
+-
+-      bios = rombase + 0x20;  /* null terminated */
+-
+-      if (strncmp(bios, "comBIOS", 7))
+-              goto unmap;
+-
+-      for (i = 0; i < ARRAY_SIZE(boards); i++) {
+-              unsigned char *model = rombase + boards[i].offset;
+-
+-              if (strncmp(model, boards[i].sig, boards[i].len) == 0) {
+-                      printk(KERN_INFO "Soekris %s: %s\n", model, bios);
+-
+-                      if (boards[i].init)
+-                              boards[i].init();
+-                      break;
+-              }
+-      }
+-
+-unmap:
+-      iounmap(rombase);
+-      return 0;
+-}
+-
+-arch_initcall(soekris_init);
+-
+-MODULE_LICENSE("GPL");
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to