From 9b7f5eba5fa07d65188d1f40b5bc244f0a2aa129 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 18 Oct 2009 12:04:02 +0200 Subject: update gcc, binutils, gdb, linux kernel, dnsmasq and alsa WARNING: tested only on qemu-x86 --- target/foxboard/device.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/foxboard') diff --git a/target/foxboard/device.mk b/target/foxboard/device.mk index e9be810b6..b2eb19f57 100644 --- a/target/foxboard/device.mk +++ b/target/foxboard/device.mk @@ -1,6 +1,6 @@ ARCH:= cris CPU_ARCH:= cris -KERNEL_VERSION:= 2.6.30.5 +KERNEL_VERSION:= 2.6.31.4 KERNEL_RELEASE:= 1 KERNEL_MD5SUM:= be9c3a697a54ac099c910d068ff0dc03 TARGET_OPTIMIZATION:= -Os -pipe -fno-peephole2 -- cgit v1.2.3 From b27533599deeccfe4ca6d176baa8a05307f3805e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 8 Nov 2009 19:46:16 +0100 Subject: update to latest stable kernel, fix grub2 terminal output - grub2 documentation is really outdated. you have to read the source to get serial working. --- target/foxboard/device.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target/foxboard') diff --git a/target/foxboard/device.mk b/target/foxboard/device.mk index b2eb19f57..0dabf25ab 100644 --- a/target/foxboard/device.mk +++ b/target/foxboard/device.mk @@ -1,7 +1,7 @@ ARCH:= cris CPU_ARCH:= cris -KERNEL_VERSION:= 2.6.31.4 +KERNEL_VERSION:= 2.6.31.5 KERNEL_RELEASE:= 1 -KERNEL_MD5SUM:= be9c3a697a54ac099c910d068ff0dc03 +KERNEL_MD5SUM:= 926bff46d24e2f303e4ee92234e394d8 TARGET_OPTIMIZATION:= -Os -pipe -fno-peephole2 TARGET_CFLAGS_ARCH:= -march=v10 -- cgit v1.2.3 From 3c05b754e8b6cef8d16c0fa4dcf0829b64621fbf Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 11 Nov 2009 20:09:59 +0100 Subject: make target foxboard compile --- target/foxboard/patches/cris.patch | 130 +++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 62 deletions(-) (limited to 'target/foxboard') diff --git a/target/foxboard/patches/cris.patch b/target/foxboard/patches/cris.patch index 5914a4ab5..277e1757d 100644 --- a/target/foxboard/patches/cris.patch +++ b/target/foxboard/patches/cris.patch @@ -1,6 +1,6 @@ -diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2.6.30.5/arch/cris/arch-v10/drivers/axisflashmap.c ---- linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/arch-v10/drivers/axisflashmap.c 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2.6.31.5/arch/cris/arch-v10/drivers/axisflashmap.c +--- linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/arch-v10/drivers/axisflashmap.c 2009-11-09 21:10:52.565914436 +0100 @@ -122,19 +122,19 @@ */ static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = { @@ -132,9 +132,9 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2. return err; } -diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.30.5/arch/cris/arch-v10/drivers/ds1302.c ---- linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/ds1302.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/arch-v10/drivers/ds1302.c 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.31.5/arch/cris/arch-v10/drivers/ds1302.c +--- linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/ds1302.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/arch-v10/drivers/ds1302.c 2009-11-09 21:10:52.569915505 +0100 @@ -21,6 +21,7 @@ #include #include @@ -167,9 +167,9 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.30.5 return 0; } -diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.30.5/arch/cris/arch-v10/drivers/gpio.c ---- linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/gpio.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/arch-v10/drivers/gpio.c 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.31.5/arch/cris/arch-v10/drivers/gpio.c +--- linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/gpio.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/arch-v10/drivers/gpio.c 2009-11-09 21:10:52.569915505 +0100 @@ -21,6 +21,7 @@ #include #include @@ -203,18 +203,18 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.30.5/a /* Clear all leds */ #if defined (CONFIG_ETRAX_CSP0_LEDS) || defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS) CRIS_LED_NETWORK_SET(0); -diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/lib/hw_settings.S linux-2.6.30.5/arch/cris/arch-v10/lib/hw_settings.S ---- linux-2.6.30.5.orig/arch/cris/arch-v10/lib/hw_settings.S 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/arch-v10/lib/hw_settings.S 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/lib/hw_settings.S linux-2.6.31.5/arch/cris/arch-v10/lib/hw_settings.S +--- linux-2.6.31.5.orig/arch/cris/arch-v10/lib/hw_settings.S 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/arch-v10/lib/hw_settings.S 2009-11-09 21:10:52.622221897 +0100 @@ -60,3 +60,5 @@ .dword R_PORT_PB_SET .dword PB_SET_VALUE .dword 0 ; No more register values + .ascii "ACME_PART_MAGIC" + .dword 0xdeadc0de -diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/mm/init.c linux-2.6.30.5/arch/cris/arch-v10/mm/init.c ---- linux-2.6.30.5.orig/arch/cris/arch-v10/mm/init.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/arch-v10/mm/init.c 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/mm/init.c linux-2.6.31.5/arch/cris/arch-v10/mm/init.c +--- linux-2.6.31.5.orig/arch/cris/arch-v10/mm/init.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/arch-v10/mm/init.c 2009-11-09 21:10:52.669914289 +0100 @@ -184,6 +184,9 @@ free_area_init_node(0, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0); @@ -225,9 +225,9 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/arch-v10/mm/init.c linux-2.6.30.5/arch/c /* Initialize remaps of some I/O-ports. It is important that this * is called before any driver is initialized. -diff -Nur linux-2.6.30.5.orig/arch/cris/boot/compressed/Makefile linux-2.6.30.5/arch/cris/boot/compressed/Makefile ---- linux-2.6.30.5.orig/arch/cris/boot/compressed/Makefile 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/boot/compressed/Makefile 2009-08-23 13:22:41.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/boot/compressed/Makefile linux-2.6.31.5/arch/cris/boot/compressed/Makefile +--- linux-2.6.31.5.orig/arch/cris/boot/compressed/Makefile 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/boot/compressed/Makefile 2009-11-09 21:10:52.673930723 +0100 @@ -18,7 +18,7 @@ OBJECTS-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o OBJECTS-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o @@ -237,9 +237,9 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/boot/compressed/Makefile linux-2.6.30.5/ quiet_cmd_image = BUILD $@ cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@ -diff -Nur linux-2.6.30.5.orig/arch/cris/boot/compressed/misc.c linux-2.6.30.5/arch/cris/boot/compressed/misc.c ---- linux-2.6.30.5.orig/arch/cris/boot/compressed/misc.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/boot/compressed/misc.c 2009-08-23 12:56:32.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/boot/compressed/misc.c linux-2.6.31.5/arch/cris/boot/compressed/misc.c +--- linux-2.6.31.5.orig/arch/cris/boot/compressed/misc.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/boot/compressed/misc.c 2009-11-09 21:10:52.677915030 +0100 @@ -106,7 +106,7 @@ static void flush_window(void); @@ -290,9 +290,9 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/boot/compressed/misc.c linux-2.6.30.5/ar - puts("Done. Now booting the kernel\n"); + putstr("Done. Now booting the kernel\n"); } -diff -Nur linux-2.6.30.5.orig/arch/cris/boot/Makefile linux-2.6.30.5/arch/cris/boot/Makefile ---- linux-2.6.30.5.orig/arch/cris/boot/Makefile 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/boot/Makefile 2009-08-23 13:23:10.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/boot/Makefile linux-2.6.31.5/arch/cris/boot/Makefile +--- linux-2.6.31.5.orig/arch/cris/boot/Makefile 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/boot/Makefile 2009-11-09 21:10:52.729928085 +0100 @@ -5,7 +5,7 @@ objcopyflags-$(CONFIG_ETRAX_ARCH_V10) += -R .note -R .comment objcopyflags-$(CONFIG_ETRAX_ARCH_V32) += --remove-section=.bss @@ -310,9 +310,9 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/boot/Makefile linux-2.6.30.5/arch/cris/b $(obj)/zImage: $(obj)/compressed/vmlinux @cp $< $@ -diff -Nur linux-2.6.30.5.orig/arch/cris/Kconfig linux-2.6.30.5/arch/cris/Kconfig ---- linux-2.6.30.5.orig/arch/cris/Kconfig 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/Kconfig 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/arch/cris/Kconfig linux-2.6.31.5/arch/cris/Kconfig +--- linux-2.6.31.5.orig/arch/cris/Kconfig 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/Kconfig 2009-11-09 21:10:52.761915122 +0100 @@ -168,6 +168,12 @@ help Size of DRAM (decimal in MB) typically 2, 8 or 16. @@ -347,27 +347,25 @@ diff -Nur linux-2.6.30.5.orig/arch/cris/Kconfig linux-2.6.30.5/arch/cris/Kconfig source "drivers/net/Kconfig" source "drivers/i2c/Kconfig" -diff -Nur linux-2.6.30.5.orig/arch/cris/Makefile linux-2.6.30.5/arch/cris/Makefile ---- linux-2.6.30.5.orig/arch/cris/Makefile 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/arch/cris/Makefile 2009-08-23 13:23:50.000000000 +0200 -@@ -40,12 +40,12 @@ +diff -Nur linux-2.6.31.5.orig/arch/cris/Makefile linux-2.6.31.5/arch/cris/Makefile +--- linux-2.6.31.5.orig/arch/cris/Makefile 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/arch/cris/Makefile 2009-11-09 21:12:38.534695929 +0100 +@@ -40,10 +40,10 @@ LD = $(CROSS_COMPILE)ld -mcrislinux -OBJCOPYFLAGS := -O binary -R .note -R .comment -S +OBJCOPYFLAGS := -O binary -R .bss -R .note -R .note.gnu.build-id -R .comment -S - CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) - KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc) -KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc) +KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe -fno-peephole2 $(inc) KBUILD_CPPFLAGS += $(inc) ifdef CONFIG_FRAME_POINTER -diff -Nur linux-2.6.30.5.orig/drivers/net/cris/eth_v10.c linux-2.6.30.5/drivers/net/cris/eth_v10.c ---- linux-2.6.30.5.orig/drivers/net/cris/eth_v10.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/drivers/net/cris/eth_v10.c 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/drivers/net/cris/eth_v10.c linux-2.6.31.5/drivers/net/cris/eth_v10.c +--- linux-2.6.31.5.orig/drivers/net/cris/eth_v10.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/drivers/net/cris/eth_v10.c 2009-11-09 21:10:52.857914224 +0100 @@ -1711,7 +1711,7 @@ static void e100_netpoll(struct net_device* netdev) @@ -377,10 +375,18 @@ diff -Nur linux-2.6.30.5.orig/drivers/net/cris/eth_v10.c linux-2.6.30.5/drivers/ } #endif -diff -Nur linux-2.6.30.5.orig/drivers/serial/crisv10.c linux-2.6.30.5/drivers/serial/crisv10.c ---- linux-2.6.30.5.orig/drivers/serial/crisv10.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/drivers/serial/crisv10.c 2009-08-23 12:37:27.000000000 +0200 -@@ -26,6 +26,7 @@ +diff -Nur linux-2.6.31.5.orig/drivers/serial/crisv10.c linux-2.6.31.5/drivers/serial/crisv10.c +--- linux-2.6.31.5.orig/drivers/serial/crisv10.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/drivers/serial/crisv10.c 2009-11-10 07:59:31.341915786 +0100 +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -26,6 +27,7 @@ #include #include #include @@ -388,7 +394,7 @@ diff -Nur linux-2.6.30.5.orig/drivers/serial/crisv10.c linux-2.6.30.5/drivers/se #include #include #include -@@ -4414,6 +4415,7 @@ +@@ -4414,6 +4416,7 @@ #endif }; @@ -396,7 +402,7 @@ diff -Nur linux-2.6.30.5.orig/drivers/serial/crisv10.c linux-2.6.30.5/drivers/se static int __init rs_init(void) { int i; -@@ -4547,6 +4549,24 @@ +@@ -4547,6 +4550,24 @@ #endif #endif /* CONFIG_SVINTO_SIM */ @@ -421,9 +427,9 @@ diff -Nur linux-2.6.30.5.orig/drivers/serial/crisv10.c linux-2.6.30.5/drivers/se return 0; } -diff -Nur linux-2.6.30.5.orig/drivers/usb/host/hc-cris-dbg.h linux-2.6.30.5/drivers/usb/host/hc-cris-dbg.h ---- linux-2.6.30.5.orig/drivers/usb/host/hc-cris-dbg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30.5/drivers/usb/host/hc-cris-dbg.h 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/drivers/usb/host/hc-cris-dbg.h linux-2.6.31.5/drivers/usb/host/hc-cris-dbg.h +--- linux-2.6.31.5.orig/drivers/usb/host/hc-cris-dbg.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.31.5/drivers/usb/host/hc-cris-dbg.h 2009-11-09 21:10:52.977927276 +0100 @@ -0,0 +1,146 @@ + +/* macros for debug output */ @@ -571,9 +577,9 @@ diff -Nur linux-2.6.30.5.orig/drivers/usb/host/hc-cris-dbg.h linux-2.6.30.5/driv + }; \ + s; \ + }) -diff -Nur linux-2.6.30.5.orig/drivers/usb/host/hc-crisv10.c linux-2.6.30.5/drivers/usb/host/hc-crisv10.c ---- linux-2.6.30.5.orig/drivers/usb/host/hc-crisv10.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30.5/drivers/usb/host/hc-crisv10.c 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/drivers/usb/host/hc-crisv10.c linux-2.6.31.5/drivers/usb/host/hc-crisv10.c +--- linux-2.6.31.5.orig/drivers/usb/host/hc-crisv10.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.31.5/drivers/usb/host/hc-crisv10.c 2009-11-09 21:10:53.049913537 +0100 @@ -0,0 +1,4801 @@ +/* + * @@ -5376,9 +5382,9 @@ diff -Nur linux-2.6.30.5.orig/drivers/usb/host/hc-crisv10.c linux-2.6.30.5/drive +/* Module hooks */ +module_init(module_hcd_init); +module_exit(module_hcd_exit); -diff -Nur linux-2.6.30.5.orig/drivers/usb/host/hc-crisv10.h linux-2.6.30.5/drivers/usb/host/hc-crisv10.h ---- linux-2.6.30.5.orig/drivers/usb/host/hc-crisv10.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.30.5/drivers/usb/host/hc-crisv10.h 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/drivers/usb/host/hc-crisv10.h linux-2.6.31.5/drivers/usb/host/hc-crisv10.h +--- linux-2.6.31.5.orig/drivers/usb/host/hc-crisv10.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.31.5/drivers/usb/host/hc-crisv10.h 2009-11-09 21:10:53.061914787 +0100 @@ -0,0 +1,331 @@ +#ifndef __LINUX_ETRAX_USB_H +#define __LINUX_ETRAX_USB_H @@ -5711,18 +5717,18 @@ diff -Nur linux-2.6.30.5.orig/drivers/usb/host/hc-crisv10.h linux-2.6.30.5/drive +#define USB_SB_command__full__yes 1 + +#endif -diff -Nur linux-2.6.30.5.orig/drivers/usb/host/Makefile linux-2.6.30.5/drivers/usb/host/Makefile ---- linux-2.6.30.5.orig/drivers/usb/host/Makefile 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/drivers/usb/host/Makefile 2009-08-23 12:37:27.000000000 +0200 -@@ -29,3 +29,4 @@ +diff -Nur linux-2.6.31.5.orig/drivers/usb/host/Makefile linux-2.6.31.5/drivers/usb/host/Makefile +--- linux-2.6.31.5.orig/drivers/usb/host/Makefile 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/drivers/usb/host/Makefile 2009-11-09 21:10:53.090776289 +0100 +@@ -31,3 +31,4 @@ obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o +obj-$(CONFIG_ETRAX_USB_HOST) += hc-crisv10.o -diff -Nur linux-2.6.30.5.orig/drivers/usb/Makefile linux-2.6.30.5/drivers/usb/Makefile ---- linux-2.6.30.5.orig/drivers/usb/Makefile 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/drivers/usb/Makefile 2009-08-23 12:37:27.000000000 +0200 -@@ -19,6 +19,7 @@ +diff -Nur linux-2.6.31.5.orig/drivers/usb/Makefile linux-2.6.31.5/drivers/usb/Makefile +--- linux-2.6.31.5.orig/drivers/usb/Makefile 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/drivers/usb/Makefile 2009-11-09 21:10:53.111922280 +0100 +@@ -20,6 +20,7 @@ obj-$(CONFIG_USB_R8A66597_HCD) += host/ obj-$(CONFIG_USB_HWA_HCD) += host/ obj-$(CONFIG_USB_ISP1760_HCD) += host/ @@ -5730,9 +5736,9 @@ diff -Nur linux-2.6.30.5.orig/drivers/usb/Makefile linux-2.6.30.5/drivers/usb/Ma obj-$(CONFIG_USB_C67X00_HCD) += c67x00/ -diff -Nur linux-2.6.30.5.orig/lib/klist.c linux-2.6.30.5/lib/klist.c ---- linux-2.6.30.5.orig/lib/klist.c 2009-08-16 23:19:38.000000000 +0200 -+++ linux-2.6.30.5/lib/klist.c 2009-08-23 12:37:27.000000000 +0200 +diff -Nur linux-2.6.31.5.orig/lib/klist.c linux-2.6.31.5/lib/klist.c +--- linux-2.6.31.5.orig/lib/klist.c 2009-10-23 00:57:56.000000000 +0200 ++++ linux-2.6.31.5/lib/klist.c 2009-11-09 21:10:53.142378957 +0100 @@ -60,7 +60,7 @@ { knode->n_klist = klist; -- cgit v1.2.3 From a934246178d7c686bf28c3dbed57b06120cb48d0 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 19 Nov 2009 09:53:00 +0100 Subject: rename DEVICE to ADK_TARGET - the name is better, because qemu f.e. is no hardware device - use make TARGET=alix1c to start with a configuration for this target - use make TARGET=alix1c allmodconfig to generate a mostly complete config to build all available packages for this platform as a package The all.config and .defconfig files needed to get this working are dynamically generated. --- target/foxboard/device.mk | 7 ------- target/foxboard/target.mk | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 target/foxboard/device.mk create mode 100644 target/foxboard/target.mk (limited to 'target/foxboard') diff --git a/target/foxboard/device.mk b/target/foxboard/device.mk deleted file mode 100644 index 0dabf25ab..000000000 --- a/target/foxboard/device.mk +++ /dev/null @@ -1,7 +0,0 @@ -ARCH:= cris -CPU_ARCH:= cris -KERNEL_VERSION:= 2.6.31.5 -KERNEL_RELEASE:= 1 -KERNEL_MD5SUM:= 926bff46d24e2f303e4ee92234e394d8 -TARGET_OPTIMIZATION:= -Os -pipe -fno-peephole2 -TARGET_CFLAGS_ARCH:= -march=v10 diff --git a/target/foxboard/target.mk b/target/foxboard/target.mk new file mode 100644 index 000000000..0dabf25ab --- /dev/null +++ b/target/foxboard/target.mk @@ -0,0 +1,7 @@ +ARCH:= cris +CPU_ARCH:= cris +KERNEL_VERSION:= 2.6.31.5 +KERNEL_RELEASE:= 1 +KERNEL_MD5SUM:= 926bff46d24e2f303e4ee92234e394d8 +TARGET_OPTIMIZATION:= -Os -pipe -fno-peephole2 +TARGET_CFLAGS_ARCH:= -march=v10 -- cgit v1.2.3 From 94e883da1b5ae86935ceebd6a9fb8cab01d0c741 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 22 Nov 2009 18:37:50 +0100 Subject: add pcengines wrap support - fix DEVICE -> ADK_TARGET conversions missed last time - make wrap boot via PXE --- target/foxboard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index e8dbd9108..1ede6b378 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -18,7 +18,7 @@ tools-compile: $(TOOLS_BUILD_DIR) kernel-install: tools-compile PATH='${TARGET_PATH}' mkfimage $(LINUX_DIR)/arch/cris/boot/zImage \ - $(BIN_DIR)/${DEVICE}-${ARCH}-kernel $(MAKE_TRACE) + $(BIN_DIR)/${ADK_TARGET}-${ARCH}-kernel $(MAKE_TRACE) ifeq ($(FS),squashfs) imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) @@ -30,7 +30,7 @@ endif ifeq ($(FS),nfsroot) imageinstall: ${BIN_DIR}/${ROOTFSTARBALL} @echo - @echo Use sudo ./boot_linux -F -i ${DEVICE}-${ARCH}-kernel to flash the kernel + @echo Use sudo ./boot_linux -F -i ${ADK_TARGET}-${ARCH}-kernel to flash the kernel @echo Do not forget to set network boot jumper, before you start the foxboard @echo ${ROOTFSTARBALL} is your nfs root and can be extracted on your nfs server @echo 'Login as user root with password linux123 via ssh or console' -- cgit v1.2.3 From 02e9bb0970ba681f228dc642b1e5026cc97047c7 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Nov 2009 21:13:21 +0100 Subject: simplify buildsystem - remove ADK_IPV6, ADK_CXX and ADK_X11 - enable ipv6 by default in uclibc - enable build of c++ compiler by default --- target/foxboard/uclibc.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/foxboard') diff --git a/target/foxboard/uclibc.config b/target/foxboard/uclibc.config index 19c3e431f..50ba1fc5b 100644 --- a/target/foxboard/uclibc.config +++ b/target/foxboard/uclibc.config @@ -145,7 +145,7 @@ UCLIBC_HAS_CRYPT=y UCLIBC_HAS_NETWORK_SUPPORT=y UCLIBC_HAS_SOCKET=y UCLIBC_HAS_IPV4=y -# UCLIBC_HAS_IPV6 is not set +UCLIBC_HAS_IPV6=y UCLIBC_HAS_RPC=y UCLIBC_HAS_FULL_RPC=y UCLIBC_HAS_REENTRANT_RPC=y -- cgit v1.2.3 From 512519037afdd5376ddc95aa61b5bfbcb4b0adaf Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 19 Dec 2009 16:53:42 +0100 Subject: update all targets to 2.6.32 --- target/foxboard/target.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target/foxboard') diff --git a/target/foxboard/target.mk b/target/foxboard/target.mk index 0dabf25ab..be0628c10 100644 --- a/target/foxboard/target.mk +++ b/target/foxboard/target.mk @@ -1,7 +1,7 @@ ARCH:= cris CPU_ARCH:= cris -KERNEL_VERSION:= 2.6.31.5 +KERNEL_VERSION:= 2.6.32 KERNEL_RELEASE:= 1 -KERNEL_MD5SUM:= 926bff46d24e2f303e4ee92234e394d8 +KERNEL_MD5SUM:= 260551284ac224c3a43c4adac7df4879 TARGET_OPTIMIZATION:= -Os -pipe -fno-peephole2 TARGET_CFLAGS_ARCH:= -march=v10 -- cgit v1.2.3 From 8c2e653abcbeadde7460c34bc2264056a6e2d886 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 19 Dec 2009 21:59:09 +0100 Subject: rename kernel and images files to be conform - use ADK_TARGET and FS for kernel files - use ADK_TARGET, ADK_LIBC and FS for image files ARCH is implicit in ADK_TARGET encoded. --- target/foxboard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index 1ede6b378..f33dc813a 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -18,7 +18,7 @@ tools-compile: $(TOOLS_BUILD_DIR) kernel-install: tools-compile PATH='${TARGET_PATH}' mkfimage $(LINUX_DIR)/arch/cris/boot/zImage \ - $(BIN_DIR)/${ADK_TARGET}-${ARCH}-kernel $(MAKE_TRACE) + $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel $(MAKE_TRACE) ifeq ($(FS),squashfs) imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) @@ -30,7 +30,7 @@ endif ifeq ($(FS),nfsroot) imageinstall: ${BIN_DIR}/${ROOTFSTARBALL} @echo - @echo Use sudo ./boot_linux -F -i ${ADK_TARGET}-${ARCH}-kernel to flash the kernel + @echo Use sudo ./boot_linux -F -i ${ADK_TARGET}-${FS}-kernel to flash the kernel @echo Do not forget to set network boot jumper, before you start the foxboard @echo ${ROOTFSTARBALL} is your nfs root and can be extracted on your nfs server @echo 'Login as user root with password linux123 via ssh or console' -- cgit v1.2.3 From 9036ad7c2fa2829855aff75b83d86818a978a242 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 29 Dec 2009 18:41:30 +0100 Subject: move squashfs host tools to common tools dir fix bsd compile errors. --- target/foxboard/Makefile | 4 ++-- target/foxboard/tools/squashfs/Makefile | 25 ------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 target/foxboard/tools/squashfs/Makefile (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index f33dc813a..c4a64c26b 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -12,8 +12,8 @@ $(TOOLS_BUILD_DIR): tools-compile: $(TOOLS_BUILD_DIR) $(MAKE) -C tools/mkfimage - $(MAKE) -C tools/e100boot prepare compile install $(MAKE_TRACE) - $(MAKE) -C tools/squashfs prepare compile install + #$(MAKE) -C tools/e100boot prepare compile install $(MAKE_TRACE) + $(MAKE) -C ../tools/squashfs prepare compile install $(INSTALL_BIN) tools/boot_linux $(BIN_DIR)/ kernel-install: tools-compile diff --git a/target/foxboard/tools/squashfs/Makefile b/target/foxboard/tools/squashfs/Makefile deleted file mode 100644 index a55181f88..000000000 --- a/target/foxboard/tools/squashfs/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# This file is part of the OpenADK project. OpenADK is copyrighted -# material, please see the LICENCE file in the top-level directory. - -include $(TOPDIR)/rules.mk - -PKG_NAME:= squashfs -PKG_VERSION:= 4.0 -PKG_RELEASE:= 1 -PKG_MD5SUM:= a3c23391da4ebab0ac4a75021ddabf96 -PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=squashfs/} -DISTFILES:= ${PKG_NAME}${PKG_VERSION}.tar.gz -WRKDIST= ${WRKDIR}/$(PKG_NAME)${PKG_VERSION} - -include ../rules.mk - -$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared - $(MAKE) -C $(WRKBUILD)/squashfs-tools - touch $@ - -$(WRKBUILD)/.installed: - $(INSTALL_BIN) $(WRKBUILD)/squashfs-tools/mksquashfs \ - ${STAGING_TOOLS}/bin - touch $@ - -include $(TOPDIR)/mk/tools.mk -- cgit v1.2.3 From 127dc886eeb53c64ce8729935534c0e522f1d9e1 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 8 Jan 2010 16:13:47 +0100 Subject: enable e100boot compile again, accidentally removed --- target/foxboard/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index c4a64c26b..8b9816ce7 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -12,7 +12,7 @@ $(TOOLS_BUILD_DIR): tools-compile: $(TOOLS_BUILD_DIR) $(MAKE) -C tools/mkfimage - #$(MAKE) -C tools/e100boot prepare compile install $(MAKE_TRACE) + $(MAKE) -C tools/e100boot prepare compile install $(MAKE_TRACE) $(MAKE) -C ../tools/squashfs prepare compile install $(INSTALL_BIN) tools/boot_linux $(BIN_DIR)/ -- cgit v1.2.3 From 0d0796ca606c51fb3e3d5af7e35376206ff1c741 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 8 Jan 2010 17:19:59 +0100 Subject: add message for nfs root users. device nodes need to be created manually --- target/foxboard/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index c4a64c26b..facf2fb3e 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -33,5 +33,6 @@ imageinstall: ${BIN_DIR}/${ROOTFSTARBALL} @echo Use sudo ./boot_linux -F -i ${ADK_TARGET}-${FS}-kernel to flash the kernel @echo Do not forget to set network boot jumper, before you start the foxboard @echo ${ROOTFSTARBALL} is your nfs root and can be extracted on your nfs server + @echo 'Do not forget to create device nodes for console,null and tty in your nfsroot' @echo 'Login as user root with password linux123 via ssh or console' endif -- cgit v1.2.3 From 4b9dfa69fd59e619b22e27ebb3795bebbc025b07 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 9 Jan 2010 11:42:49 +0100 Subject: install image padded to bindir --- target/foxboard/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index 8b9816ce7..d151225ac 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -22,6 +22,8 @@ kernel-install: tools-compile ifeq ($(FS),squashfs) imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) + dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \ + bs=4063232 conv=sync $(MAKE_TRACE) @echo @echo Use sudo ./boot_linux -F -i $(ROOTFSSQUASHFS) to flash @echo Do not forget to set network boot jumper, before you start the foxboard -- cgit v1.2.3 From ed0cbf11579279dd9ea8f33d5b6e387cedc278db Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 10 Jan 2010 12:42:35 +0100 Subject: remove unused stuff. comment debug output. --- target/foxboard/Makefile | 2 +- target/foxboard/tools/mkfimage/mkfimage.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index ffa6f4152..a21647355 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -12,7 +12,7 @@ $(TOOLS_BUILD_DIR): tools-compile: $(TOOLS_BUILD_DIR) $(MAKE) -C tools/mkfimage - $(MAKE) -C tools/e100boot prepare compile install $(MAKE_TRACE) + $(MAKE) -C tools/e100boot prepare compile install $(MAKE) -C ../tools/squashfs prepare compile install $(INSTALL_BIN) tools/boot_linux $(BIN_DIR)/ diff --git a/target/foxboard/tools/mkfimage/mkfimage.c b/target/foxboard/tools/mkfimage/mkfimage.c index 6904170cf..b1897fbd7 100644 --- a/target/foxboard/tools/mkfimage/mkfimage.c +++ b/target/foxboard/tools/mkfimage/mkfimage.c @@ -37,7 +37,7 @@ int main(int argc, char **argv){ for(loop = 0; loop < (64 * 1024) - sizeof(magic_str); loop++){ if(buffer[loop] == magic_str[0]){ if((magic = strstr(&buffer[loop], magic_str))){ - printf("Magic at 0x%.08X %p %p\n", magic - buffer, magic, buffer); + //printf("Magic at 0x%.08X %p %p\n", magic - buffer, magic, buffer); printf("Found Magic %X%X%X%X\n", buffer[loop + strlen(magic_str)], buffer[loop + strlen(magic_str) + 2], -- cgit v1.2.3 From e268ce3ada4d6a15d48d1065a6e5a2ab80b43cb5 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 10 Jan 2010 15:19:38 +0100 Subject: implement update for foxboard --- target/foxboard/Makefile | 11 +- target/foxboard/patches/cris.patch | 6988 ++++++++++++++++++++++++++++++++++-- 2 files changed, 6714 insertions(+), 285 deletions(-) (limited to 'target/foxboard') diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile index a21647355..dd6e167c2 100644 --- a/target/foxboard/Makefile +++ b/target/foxboard/Makefile @@ -24,10 +24,13 @@ ifeq ($(FS),squashfs) imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \ bs=4063232 conv=sync $(MAKE_TRACE) - @echo - @echo Use sudo ./boot_linux -F -i $(ROOTFSSQUASHFS) to flash - @echo Do not forget to set network boot jumper, before you start the foxboard - @echo 'Login as user root with password linux123 via ssh or console' + @if [ $$(stat --format=%s ${BIN_DIR}/${ROOTFSSQUASHFS}) -gt 4063232 ];then \ + echo 'Image is too big!'; \ + else \ + echo 'Use sudo ./boot_linux -F -i $(ROOTFSSQUASHFS) to flash'; \ + echo 'Do not forget to set the network boot jumper, before you start the foxboard'; \ + echo 'Login as user root with password linux123 via ssh or console'; \ + fi endif ifeq ($(FS),nfsroot) imageinstall: ${BIN_DIR}/${ROOTFSTARBALL} diff --git a/target/foxboard/patches/cris.patch b/target/foxboard/patches/cris.patch index 277e1757d..3c6bca534 100644 --- a/target/foxboard/patches/cris.patch +++ b/target/foxboard/patches/cris.patch @@ -1,7 +1,16 @@ -diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2.6.31.5/arch/cris/arch-v10/drivers/axisflashmap.c ---- linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c 2009-10-23 00:57:56.000000000 +0200 -+++ linux-2.6.31.5/arch/cris/arch-v10/drivers/axisflashmap.c 2009-11-09 21:10:52.565914436 +0100 -@@ -122,19 +122,19 @@ +diff -Nur linux-2.6.32.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2.6.32/arch/cris/arch-v10/drivers/axisflashmap.c +--- linux-2.6.32.orig/arch/cris/arch-v10/drivers/axisflashmap.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/arch-v10/drivers/axisflashmap.c 2010-01-10 14:34:37.376309632 +0100 +@@ -113,7 +113,7 @@ + + /* If no partition-table was found, we use this default-set. */ + #define MAX_PARTITIONS 7 +-#define NUM_DEFAULT_PARTITIONS 3 ++#define NUM_DEFAULT_PARTITIONS 4 + + /* + * Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the +@@ -122,19 +122,24 @@ */ static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = { { @@ -26,10 +35,15 @@ diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2. + .name = "cfgfs", + .size = 0x20000 , + .offset = CONFIG_ETRAX_MTD_SIZE - 0x20000 ++ }, ++ { ++ .name = "linux", ++ .size = CONFIG_ETRAX_MTD_SIZE - 0x20000, ++ .offset = 0 } }; -@@ -281,6 +281,11 @@ +@@ -281,6 +286,11 @@ struct partitiontable_entry *ptable; int use_default_ptable = 1; /* Until proven otherwise. */ const char pmsg[] = " /dev/flash%d at 0x%08x, size 0x%08x\n"; @@ -41,7 +55,7 @@ diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2. if (!(mymtd = flash_probe())) { /* There's no reason to use this module if no flash chip can -@@ -292,6 +297,31 @@ +@@ -292,6 +302,31 @@ mymtd->name, mymtd->size); axisflash_mtd = mymtd; } @@ -73,7 +87,7 @@ diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2. if (mymtd) { mymtd->owner = THIS_MODULE; -@@ -360,21 +390,6 @@ +@@ -360,21 +395,6 @@ use_default_ptable = !ptable_ok; } @@ -95,7 +109,7 @@ diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2. #ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE if (mymtd) { main_partition.size = mymtd->size; -@@ -397,36 +412,6 @@ +@@ -397,36 +417,6 @@ if (err) panic("axisflashmap could not add MTD partitions!\n"); } @@ -132,9 +146,9 @@ diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2. return err; } -diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.31.5/arch/cris/arch-v10/drivers/ds1302.c ---- linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/ds1302.c 2009-10-23 00:57:56.000000000 +0200 -+++ linux-2.6.31.5/arch/cris/arch-v10/drivers/ds1302.c 2009-11-09 21:10:52.569915505 +0100 +diff -Nur linux-2.6.32.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.32/arch/cris/arch-v10/drivers/ds1302.c +--- linux-2.6.32.orig/arch/cris/arch-v10/drivers/ds1302.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/arch-v10/drivers/ds1302.c 2010-01-10 13:41:59.256309588 +0100 @@ -21,6 +21,7 @@ #include #include @@ -164,272 +178,6596 @@ diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.31.5 + NULL, "rtc"); + #endif + - return 0; - - } -diff -Nur linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.31.5/arch/cris/arch-v10/drivers/gpio.c ---- linux-2.6.31.5.orig/arch/cris/arch-v10/drivers/gpio.c 2009-10-23 00:57:56.000000000 +0200 -+++ linux-2.6.31.5/arch/cris/arch-v10/drivers/gpio.c 2009-11-09 21:10:52.569915505 +0100 -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -771,6 +772,10 @@ - - /* main driver initialization routine, called from mem.c */ - -+#ifdef CONFIG_SYSFS -+static struct class *gpio_class; + return 0; + + } +diff -Nur linux-2.6.32.orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.32/arch/cris/arch-v10/drivers/gpio.c +--- linux-2.6.32.orig/arch/cris/arch-v10/drivers/gpio.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/arch-v10/drivers/gpio.c 2010-01-10 13:41:59.256309588 +0100 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -771,6 +772,10 @@ + + /* main driver initialization routine, called from mem.c */ + ++#ifdef CONFIG_SYSFS ++static struct class *gpio_class; ++#endif ++ + static int __init gpio_init(void) + { + int res; +@@ -784,6 +789,13 @@ + return res; + } + ++#ifdef CONFIG_SYSFS ++ gpio_class = class_create(THIS_MODULE, "gpio"); ++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 0), NULL, "gpioa"); ++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 1), NULL, "gpiob"); ++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 2), NULL, "leds"); ++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 3), NULL, "gpiog"); ++#endif + /* Clear all leds */ + #if defined (CONFIG_ETRAX_CSP0_LEDS) || defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS) + CRIS_LED_NETWORK_SET(0); +diff -Nur linux-2.6.32.orig/arch/cris/arch-v10/lib/hw_settings.S linux-2.6.32/arch/cris/arch-v10/lib/hw_settings.S +--- linux-2.6.32.orig/arch/cris/arch-v10/lib/hw_settings.S 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/arch-v10/lib/hw_settings.S 2010-01-10 13:41:59.256309588 +0100 +@@ -60,3 +60,5 @@ + .dword R_PORT_PB_SET + .dword PB_SET_VALUE + .dword 0 ; No more register values ++ .ascii "ACME_PART_MAGIC" ++ .dword 0xdeadc0de +diff -Nur linux-2.6.32.orig/arch/cris/arch-v10/mm/init.c linux-2.6.32/arch/cris/arch-v10/mm/init.c +--- linux-2.6.32.orig/arch/cris/arch-v10/mm/init.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/arch-v10/mm/init.c 2010-01-10 13:41:59.256309588 +0100 +@@ -184,6 +184,9 @@ + + free_area_init_node(0, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0); + } ++void free_initrd_mem(unsigned long start, unsigned long end) ++{ ++} + + /* Initialize remaps of some I/O-ports. It is important that this + * is called before any driver is initialized. +diff -Nur linux-2.6.32.orig/arch/cris/boot/compressed/Makefile linux-2.6.32/arch/cris/boot/compressed/Makefile +--- linux-2.6.32.orig/arch/cris/boot/compressed/Makefile 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/boot/compressed/Makefile 2010-01-10 13:41:59.256309588 +0100 +@@ -18,7 +18,7 @@ + OBJECTS-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o + OBJECTS-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o + OBJECTS= $(OBJECTS-y) $(obj)/misc.o +-OBJCOPYFLAGS = -O binary --remove-section=.bss ++#OBJCOPYFLAGS = -O binary --remove-section=.bss + + quiet_cmd_image = BUILD $@ + cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@ +diff -Nur linux-2.6.32.orig/arch/cris/boot/compressed/misc.c linux-2.6.32/arch/cris/boot/compressed/misc.c +--- linux-2.6.32.orig/arch/cris/boot/compressed/misc.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/boot/compressed/misc.c 2010-01-10 13:41:59.256309588 +0100 +@@ -106,7 +106,7 @@ + + static void flush_window(void); + static void error(char *m); +-static void puts(const char *); ++static void putstr(const char *); + + extern char *input_data; /* lives in head.S */ + +@@ -139,7 +139,7 @@ + } + #endif + +-static void puts(const char *s) ++static void putstr(const char *s) + { + #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL + while (*s) { +@@ -233,9 +233,9 @@ + + static void error(char *x) + { +- puts("\n\n"); +- puts(x); +- puts("\n\n -- System halted\n"); ++ putstr("\n\n"); ++ putstr(x); ++ putstr("\n\n -- System halted\n"); + + while(1); /* Halt */ + } +@@ -378,14 +378,14 @@ + __asm__ volatile ("move $vr,%0" : "=rm" (revision)); + if (revision < compile_rev) { + #ifdef CONFIG_ETRAX_ARCH_V32 +- puts("You need an ETRAX FS to run Linux 2.6/crisv32\n"); ++ putstr("You need an ETRAX FS to run Linux 2.6/crisv32\n"); + #else +- puts("You need an ETRAX 100LX to run linux 2.6\n"); ++ putstr("You need an ETRAX 100LX to run linux 2.6\n"); + #endif + while(1); + } + +- puts("Uncompressing Linux...\n"); ++ putstr("Uncompressing Linux...\n"); + gunzip(); +- puts("Done. Now booting the kernel\n"); ++ putstr("Done. Now booting the kernel\n"); + } +diff -Nur linux-2.6.32.orig/arch/cris/boot/Makefile linux-2.6.32/arch/cris/boot/Makefile +--- linux-2.6.32.orig/arch/cris/boot/Makefile 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/boot/Makefile 2010-01-10 13:41:59.256309588 +0100 +@@ -5,7 +5,7 @@ + objcopyflags-$(CONFIG_ETRAX_ARCH_V10) += -R .note -R .comment + objcopyflags-$(CONFIG_ETRAX_ARCH_V32) += --remove-section=.bss + +-OBJCOPYFLAGS = -O binary $(objcopyflags-y) ++#OBJCOPYFLAGS = -O binary $(objcopyflags-y) + + + subdir- := compressed rescue +@@ -17,7 +17,6 @@ + + $(obj)/compressed/vmlinux: $(obj)/Image FORCE + $(Q)$(MAKE) $(build)=$(obj)/compressed $@ +- $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin + + $(obj)/zImage: $(obj)/compressed/vmlinux + @cp $< $@ +diff -Nur linux-2.6.32.orig/arch/cris/Kconfig linux-2.6.32/arch/cris/Kconfig +--- linux-2.6.32.orig/arch/cris/Kconfig 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/Kconfig 2010-01-10 13:41:59.256309588 +0100 +@@ -168,6 +168,12 @@ + help + Size of DRAM (decimal in MB) typically 2, 8 or 16. + ++config ETRAX_MTD_SIZE ++ hex "MTD size (hex)" ++ default "0x00800000" ++ help ++ Size of MTD device typically 4 or 8 MB. ++ + config ETRAX_VMEM_SIZE + int "Video memory size (dec, in MB)" + depends on ETRAX_ARCH_V32 && !ETRAXFS +@@ -273,7 +279,7 @@ + select MTD_CFI_AMDSTD + select MTD_JEDECPROBE if ETRAX_ARCH_V32 + select MTD_CHAR +- select MTD_BLOCK ++ select MTD_BLOCK_RO + select MTD_PARTITIONS + select MTD_CONCAT + select MTD_COMPLEX_MAPPINGS +@@ -662,6 +668,11 @@ + + source "drivers/ide/Kconfig" + ++#mysteriously part of this standard linux driver was removed from cris build! - info@crisos.org ++source "drivers/scsi/Kconfig" ++ ++source "drivers/media/Kconfig" ++ + source "drivers/net/Kconfig" + + source "drivers/i2c/Kconfig" +diff -Nur linux-2.6.32.orig/arch/cris/Makefile linux-2.6.32/arch/cris/Makefile +--- linux-2.6.32.orig/arch/cris/Makefile 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/cris/Makefile 2010-01-10 13:41:59.256309588 +0100 +@@ -40,10 +40,10 @@ + + LD = $(CROSS_COMPILE)ld -mcrislinux + +-OBJCOPYFLAGS := -O binary -R .note -R .comment -S ++OBJCOPYFLAGS := -O binary -R .bss -R .note -R .note.gnu.build-id -R .comment -S + + KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc) +-KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc) ++KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe -fno-peephole2 $(inc) + KBUILD_CPPFLAGS += $(inc) + + ifdef CONFIG_FRAME_POINTER +diff -Nur linux-2.6.32.orig/drivers/net/cris/eth_v10.c linux-2.6.32/drivers/net/cris/eth_v10.c +--- linux-2.6.32.orig/drivers/net/cris/eth_v10.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/drivers/net/cris/eth_v10.c 2010-01-10 13:41:59.256309588 +0100 +@@ -1725,7 +1725,7 @@ + static void + e100_netpoll(struct net_device* netdev) + { +- e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev, NULL); ++ e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev); + } + #endif + +diff -Nur linux-2.6.32.orig/drivers/net/cris/eth_v10.c.orig linux-2.6.32/drivers/net/cris/eth_v10.c.orig +--- linux-2.6.32.orig/drivers/net/cris/eth_v10.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.32/drivers/net/cris/eth_v10.c.orig 2009-12-03 04:51:21.000000000 +0100 +@@ -0,0 +1,1760 @@ ++/* ++ * e100net.c: A network driver for the ETRAX 100LX network controller. ++ * ++ * Copyright (c) 1998-2002 Axis Communications AB. ++ * ++ * The outline of this driver comes from skeleton.c. ++ * ++ */ ++ ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include /* DMA and register descriptions */ ++#include /* CRIS_LED_* I/O functions */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++//#define ETHDEBUG ++#define D(x) ++ ++/* ++ * The name of the card. Is used for messages and in the requests for ++ * io regions, irqs and dma channels ++ */ ++ ++static const char* cardname = "ETRAX 100LX built-in ethernet controller"; ++ ++/* A default ethernet address. Highlevel SW will set the real one later */ ++ ++static struct sockaddr default_mac = { ++ 0, ++ { 0x00, 0x40, 0x8C, 0xCD, 0x00, 0x00 } ++}; ++ ++/* Information that need to be kept for each board. */ ++struct net_local { ++ struct net_device_stats stats; ++ struct mii_if_info mii_if; ++ ++ /* Tx control lock. This protects the transmit buffer ring ++ * state along with the "tx full" state of the driver. This ++ * means all netif_queue flow control actions are protected ++ * by this lock as well. ++ */ ++ spinlock_t lock; ++ ++ spinlock_t led_lock; /* Protect LED state */ ++ spinlock_t transceiver_lock; /* Protect transceiver state. */ ++}; ++ ++typedef struct etrax_eth_descr ++{ ++ etrax_dma_descr descr; ++ struct sk_buff* skb; ++} etrax_eth_descr; ++ ++/* Some transceivers requires special handling */ ++struct transceiver_ops ++{ ++ unsigned int oui; ++ void (*check_speed)(struct net_device* dev); ++ void (*check_duplex)(struct net_device* dev); ++}; ++ ++/* Duplex settings */ ++enum duplex ++{ ++ half, ++ full, ++ autoneg ++}; ++ ++/* Dma descriptors etc. */ ++ ++#define MAX_MEDIA_DATA_SIZE 1522 ++ ++#define MIN_PACKET_LEN 46 ++#define ETHER_HEAD_LEN 14 ++ ++/* ++** MDIO constants. ++*/ ++#define MDIO_START 0x1 ++#define MDIO_READ 0x2 ++#define MDIO_WRITE 0x1 ++#define MDIO_PREAMBLE 0xfffffffful ++ ++/* Broadcom specific */ ++#define MDIO_AUX_CTRL_STATUS_REG 0x18 ++#define MDIO_BC_FULL_DUPLEX_IND 0x1 ++#define MDIO_BC_SPEED 0x2 ++ ++/* TDK specific */ ++#define MDIO_TDK_DIAGNOSTIC_REG 18 ++#define MDIO_TDK_DIAGNOSTIC_RATE 0x400 ++#define MDIO_TDK_DIAGNOSTIC_DPLX 0x800 ++ ++/*Intel LXT972A specific*/ ++#define MDIO_INT_STATUS_REG_2 0x0011 ++#define MDIO_INT_FULL_DUPLEX_IND (1 << 9) ++#define MDIO_INT_SPEED (1 << 14) ++ ++/* Network flash constants */ ++#define NET_FLASH_TIME (HZ/50) /* 20 ms */ ++#define NET_FLASH_PAUSE (HZ/100) /* 10 ms */ ++#define NET_LINK_UP_CHECK_INTERVAL (2*HZ) /* 2 s */ ++#define NET_DUPLEX_CHECK_INTERVAL (2*HZ) /* 2 s */ ++ ++#define NO_NETWORK_ACTIVITY 0 ++#define NETWORK_ACTIVITY 1 ++ ++#define NBR_OF_RX_DESC 32 ++#define NBR_OF_TX_DESC 16 ++ ++/* Large packets are sent directly to upper layers while small packets are */ ++/* copied (to reduce memory waste). The following constant decides the breakpoint */ ++#define RX_COPYBREAK 256 ++ ++/* Due to a chip bug we need to flush the cache when descriptors are returned */ ++/* to the DMA. To decrease performance impact we return descriptors in chunks. */ ++/* The following constant determines the number of descriptors to return. */ ++#define RX_QUEUE_THRESHOLD NBR_OF_RX_DESC/2 ++ ++#define GET_BIT(bit,val) (((val) >> (bit)) & 0x01) ++ ++/* Define some macros to access ETRAX 100 registers */ ++#define SETF(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \ ++ IO_FIELD_(reg##_, field##_, val) ++#define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \ ++ IO_STATE_(reg##_, field##_, _##val) ++ ++static etrax_eth_descr *myNextRxDesc; /* Points to the next descriptor to ++ to be processed */ ++static etrax_eth_descr *myLastRxDesc; /* The last processed descriptor */ ++ ++static etrax_eth_descr RxDescList[NBR_OF_RX_DESC] __attribute__ ((aligned(32))); ++ ++static etrax_eth_descr* myFirstTxDesc; /* First packet not yet sent */ ++static etrax_eth_descr* myLastTxDesc; /* End of send queue */ ++static etrax_eth_descr* myNextTxDesc; /* Next descriptor to use */ ++static etrax_eth_descr TxDescList[NBR_OF_TX_DESC] __attribute__ ((aligned(32))); ++ ++static unsigned int network_rec_config_shadow = 0; ++ ++static unsigned int network_tr_ctrl_shadow = 0; ++ ++/* Network speed indication. */ ++static DEFINE_TIMER(speed_timer, NULL, 0, 0); ++static DEFINE_TIMER(clear_led_timer, NULL, 0, 0); ++static int current_speed; /* Speed read from transceiver */ ++static int current_speed_selection; /* Speed selected by user */ ++static unsigned long led_next_time; ++static int led_active; ++static int rx_queue_len; ++ ++/* Duplex */ ++static DEFINE_TIMER(duplex_timer, NULL, 0, 0); ++static int full_duplex; ++static enum duplex current_duplex; ++ ++/* Index to functions, as function prototypes. */ ++ ++static int etrax_ethernet_init(void); ++ ++static int e100_open(struct net_device *dev); ++static int e100_set_mac_address(struct net_device *dev, void *addr); ++static int e100_send_packet(struct sk_buff *skb, struct net_device *dev); ++static irqreturn_t e100rxtx_interrupt(int irq, void *dev_id); ++static irqreturn_t e100nw_interrupt(int irq, void *dev_id); ++static void e100_rx(struct net_device *dev); ++static int e100_close(struct net_device *dev); ++static int e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++static int e100_set_config(struct net_device* dev, struct ifmap* map); ++static void e100_tx_timeout(struct net_device *dev); ++static struct net_device_stats *e100_get_stats(struct net_device *dev); ++static void set_multicast_list(struct net_device *dev); ++static void e100_hardware_send_packet(struct net_local* np, char *buf, int length); ++static void update_rx_stats(struct net_device_stats *); ++static void update_tx_stats(struct net_device_stats *); ++static int e100_probe_transceiver(struct net_device* dev); ++ ++static void e100_check_speed(unsigned long priv); ++static void e100_set_speed(struct net_device* dev, unsigned long speed); ++static void e100_check_duplex(unsigned long priv); ++static void e100_set_duplex(struct net_device* dev, enum duplex); ++static void e100_negotiate(struct net_device* dev); ++ ++static int e100_get_mdio_reg(struct net_device *dev, int phy_id, int location); ++static void e100_set_mdio_reg(struct net_device *dev, int phy_id, int location, int value); ++ ++static void e100_send_mdio_cmd(unsigned short cmd, int write_cmd); ++static void e100_send_mdio_bit(unsigned char bit); ++static unsigned char e100_receive_mdio_bit(void); ++static void e100_reset_transceiver(struct net_device* net); ++ ++static void e100_clear_network_leds(unsigned long dummy); ++static void e100_set_network_leds(int active); ++ ++static const struct ethtool_ops e100_ethtool_ops; ++#if defined(CONFIG_ETRAX_NO_PHY) ++static void dummy_check_speed(struct net_device* dev); ++static void dummy_check_duplex(struct net_device* dev); ++#else ++static void broadcom_check_speed(struct net_device* dev); ++static void broadcom_check_duplex(struct net_device* dev); ++static void tdk_check_speed(struct net_device* dev); ++static void tdk_check_duplex(struct net_device* dev); ++static void intel_check_speed(struct net_device* dev); ++static void intel_check_duplex(struct net_device* dev); ++static void generic_check_speed(struct net_device* dev); ++static void generic_check_duplex(struct net_device* dev); ++#endif ++#ifdef CONFIG_NET_POLL_CONTROLLER ++static void e100_netpoll(struct net_device* dev); ++#endif ++ ++static int autoneg_normal = 1; ++ ++struct transceiver_ops transceivers[] = ++{ ++#if defined(CONFIG_ETRAX_NO_PHY) ++ {0x0000, dummy_check_speed, dummy_check_duplex} /* Dummy */ ++#else ++ {0x1018, broadcom_check_speed, broadcom_check_duplex}, /* Broadcom */ ++ {0xC039, tdk_check_speed, tdk_check_duplex}, /* TDK 2120 */ ++ {0x039C, tdk_check_speed, tdk_check_duplex}, /* TDK 2120C */ ++ {0x04de, intel_check_speed, intel_check_duplex}, /* Intel LXT972A*/ ++ {0x0000, generic_check_speed, generic_check_duplex} /* Generic, must be last */ ++#endif ++}; ++ ++struct transceiver_ops* transceiver = &transceivers[0]; ++ ++static const struct net_device_ops e100_netdev_ops = { ++ .ndo_open = e100_open, ++ .ndo_stop = e100_close, ++ .ndo_start_xmit = e100_send_packet, ++ .ndo_tx_timeout = e100_tx_timeout, ++ .ndo_get_stats = e100_get_stats, ++ .ndo_set_multicast_list = set_multicast_list, ++ .ndo_do_ioctl = e100_ioctl, ++ .ndo_set_mac_address = e100_set_mac_address, ++ .ndo_validate_addr = eth_validate_addr, ++ .ndo_change_mtu = eth_change_mtu, ++ .ndo_set_config = e100_set_config, ++#ifdef CONFIG_NET_POLL_CONTROLLER ++ .ndo_poll_controller = e100_netpoll, ++#endif ++}; ++ ++#define tx_done(dev) (*R_DMA_CH0_CMD == 0) ++ ++/* ++ * Check for a network adaptor of this type, and return '0' if one exists. ++ * If dev->base_addr == 0, probe all likely locations. ++ * If dev->base_addr == 1, always return failure. ++ * If dev->base_addr == 2, allocate space for the device and return success ++ * (detachable devices only). ++ */ ++ ++static int __init ++etrax_ethernet_init(void) ++{ ++ struct net_device *dev; ++ struct net_local* np; ++ int i, err; ++ ++ printk(KERN_INFO ++ "ETRAX 100LX 10/100MBit ethernet v2.0 (c) 1998-2007 Axis Communications AB\n"); ++ ++ if (cris_request_io_interface(if_eth, cardname)) { ++ printk(KERN_CRIT "etrax_ethernet_init failed to get IO interface\n"); ++ return -EBUSY; ++ } ++ ++ dev = alloc_etherdev(sizeof(struct net_local)); ++ if (!dev) ++ return -ENOMEM; ++ ++ np = netdev_priv(dev); ++ ++ /* we do our own locking */ ++ dev->features |= NETIF_F_LLTX; ++ ++ dev->base_addr = (unsigned int)R_NETWORK_SA_0; /* just to have something to show */ ++ ++ /* now setup our etrax specific stuff */ ++ ++ dev->irq = NETWORK_DMA_RX_IRQ_NBR; /* we really use DMATX as well... */ ++ dev->dma = NETWORK_RX_DMA_NBR; ++ ++ /* fill in our handlers so the network layer can talk to us in the future */ ++ ++ dev->ethtool_ops = &e100_ethtool_ops; ++ dev->netdev_ops = &e100_netdev_ops; ++ ++ spin_lock_init(&np->lock); ++ spin_lock_init(&np->led_lock); ++ spin_lock_init(&np->transceiver_lock); ++ ++ /* Initialise the list of Etrax DMA-descriptors */ ++ ++ /* Initialise receive descriptors */ ++ ++ for (i = 0; i < NBR_OF_RX_DESC; i++) { ++ /* Allocate two extra cachelines to make sure that buffer used ++ * by DMA does not share cacheline with any other data (to ++ * avoid cache bug) ++ */ ++ RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES); ++ if (!RxDescList[i].skb) ++ return -ENOMEM; ++ RxDescList[i].descr.ctrl = 0; ++ RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE; ++ RxDescList[i].descr.next = virt_to_phys(&RxDescList[i + 1]); ++ RxDescList[i].descr.buf = L1_CACHE_ALIGN(virt_to_phys(RxDescList[i].skb->data)); ++ RxDescList[i].descr.status = 0; ++ RxDescList[i].descr.hw_len = 0; ++ prepare_rx_descriptor(&RxDescList[i].descr); ++ } ++ ++ RxDescList[NBR_OF_RX_DESC - 1].descr.ctrl = d_eol; ++ RxDescList[NBR_OF_RX_DESC - 1].descr.next = virt_to_phys(&RxDescList[0]); ++ rx_queue_len = 0; ++ ++ /* Initialize transmit descriptors */ ++ for (i = 0; i < NBR_OF_TX_DESC; i++) { ++ TxDescList[i].descr.ctrl = 0; ++ TxDescList[i].descr.sw_len = 0; ++ TxDescList[i].descr.next = virt_to_phys(&TxDescList[i + 1].descr); ++ TxDescList[i].descr.buf = 0; ++ TxDescList[i].descr.status = 0; ++ TxDescList[i].descr.hw_len = 0; ++ TxDescList[i].skb = 0; ++ } ++ ++ TxDescList[NBR_OF_TX_DESC - 1].descr.ctrl = d_eol; ++ TxDescList[NBR_OF_TX_DESC - 1].descr.next = virt_to_phys(&TxDescList[0].descr); ++ ++ /* Initialise initial pointers */ ++ ++ myNextRxDesc = &RxDescList[0]; ++ myLastRxDesc = &RxDescList[NBR_OF_RX_DESC - 1]; ++ myFirstTxDesc = &TxDescList[0]; ++ myNextTxDesc = &TxDescList[0]; ++ myLastTxDesc = &TxDescList[NBR_OF_TX_DESC - 1]; ++ ++ /* Register device */ ++ err = register_netdev(dev); ++ if (err) { ++ free_netdev(dev); ++ return err; ++ } ++ ++ /* set the default MAC address */ ++ ++ e100_set_mac_address(dev, &default_mac); ++ ++ /* Initialize speed indicator stuff. */ ++ ++ current_speed = 10; ++ current_speed_selection = 0; /* Auto */ ++ speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL; ++ speed_timer.data = (unsigned long)dev; ++ speed_timer.function = e100_check_speed; ++ ++ clear_led_timer.function = e100_clear_network_leds; ++ clear_led_timer.data = (unsigned long)dev; ++ ++ full_duplex = 0; ++ current_duplex = autoneg; ++ duplex_timer.expires = jiffies + NET_DUPLEX_CHECK_INTERVAL; ++ duplex_timer.data = (unsigned long)dev; ++ duplex_timer.function = e100_check_duplex; ++ ++ /* Initialize mii interface */ ++ np->mii_if.phy_id_mask = 0x1f; ++ np->mii_if.reg_num_mask = 0x1f; ++ np->mii_if.dev = dev; ++ np->mii_if.mdio_read = e100_get_mdio_reg; ++ np->mii_if.mdio_write = e100_set_mdio_reg; ++ ++ /* Initialize group address registers to make sure that no */ ++ /* unwanted addresses are matched */ ++ *R_NETWORK_GA_0 = 0x00000000; ++ *R_NETWORK_GA_1 = 0x00000000; ++ ++ /* Initialize next time the led can flash */ ++ led_next_time = jiffies; ++ return 0; ++} ++ ++/* set MAC address of the interface. called from the core after a ++ * SIOCSIFADDR ioctl, and from the bootup above. ++ */ ++ ++static int ++e100_set_mac_address(struct net_device *dev, void *p) ++{ ++ struct net_local *np = netdev_priv(dev); ++ struct sockaddr *addr = p; ++ ++ spin_lock(&np->lock); /* preemption protection */ ++ ++ /* remember it */ ++ ++ memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); ++ ++ /* Write it to the hardware. ++ * Note the way the address is wrapped: ++ * *R_NETWORK_SA_0 = a0_0 | (a0_1 << 8) | (a0_2 << 16) | (a0_3 << 24); ++ * *R_NETWORK_SA_1 = a0_4 | (a0_5 << 8); ++ */ ++ ++ *R_NETWORK_SA_0 = dev->dev_addr[0] | (dev->dev_addr[1] << 8) | ++ (dev->dev_addr[2] << 16) | (dev->dev_addr[3] << 24); ++ *R_NETWORK_SA_1 = dev->dev_addr[4] | (dev->dev_addr[5] << 8); ++ *R_NETWORK_SA_2 = 0; ++ ++ /* show it in the log as well */ ++ ++ printk(KERN_INFO "%s: changed MAC to %pM\n", dev->name, dev->dev_addr); ++ ++ spin_unlock(&np->lock); ++ ++ return 0; ++} ++ ++/* ++ * Open/initialize the board. This is called (in the current kernel) ++ * sometime after booting when the 'ifconfig' program is run. ++ * ++ * This routine should set everything up anew at each open, even ++ * registers that "should" only need to be set once at boot, so that ++ * there is non-reboot way to recover if something goes wrong. ++ */ ++ ++static int ++e100_open(struct net_device *dev) ++{ ++ unsigned long flags; ++ ++ /* enable the MDIO output pin */ ++ ++ *R_NETWORK_MGM_CTRL = IO_STATE(R_NETWORK_MGM_CTRL, mdoe, enable); ++ ++ *R_IRQ_MASK0_CLR = ++ IO_STATE(R_IRQ_MASK0_CLR, overrun, clr) | ++ IO_STATE(R_IRQ_MASK0_CLR, underrun, clr) | ++ IO_STATE(R_IRQ_MASK0_CLR, excessive_col, clr); ++ ++ /* clear dma0 and 1 eop and descr irq masks */ ++ *R_IRQ_MASK2_CLR = ++ IO_STATE(R_IRQ_MASK2_CLR, dma0_descr, clr) | ++ IO_STATE(R_IRQ_MASK2_CLR, dma0_eop, clr) | ++ IO_STATE(R_IRQ_MASK2_CLR, dma1_descr, clr) | ++ IO_STATE(R_IRQ_MASK2_CLR, dma1_eop, clr); ++ ++ /* Reset and wait for the DMA channels */ ++ ++ RESET_DMA(NETWORK_TX_DMA_NBR); ++ RESET_DMA(NETWORK_RX_DMA_NBR); ++ WAIT_DMA(NETWORK_TX_DMA_NBR); ++ WAIT_DMA(NETWORK_RX_DMA_NBR); ++ ++ /* Initialise the etrax network controller */ ++ ++ /* allocate the irq corresponding to the receiving DMA */ ++ ++ if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt, ++ IRQF_SAMPLE_RANDOM, cardname, (void *)dev)) { ++ goto grace_exit0; ++ } ++ ++ /* allocate the irq corresponding to the transmitting DMA */ ++ ++ if (request_irq(NETWORK_DMA_TX_IRQ_NBR, e100rxtx_interrupt, 0, ++ cardname, (void *)dev)) { ++ goto grace_exit1; ++ } ++ ++ /* allocate the irq corresponding to the network errors etc */ ++ ++ if (request_irq(NETWORK_STATUS_IRQ_NBR, e100nw_interrupt, 0, ++ cardname, (void *)dev)) { ++ goto grace_exit2; ++ } ++ ++ /* ++ * Always allocate the DMA channels after the IRQ, ++ * and clean up on failure. ++ */ ++ ++ if (cris_request_dma(NETWORK_TX_DMA_NBR, ++ cardname, ++ DMA_VERBOSE_ON_ERROR, ++ dma_eth)) { ++ goto grace_exit3; ++ } ++ ++ if (cris_request_dma(NETWORK_RX_DMA_NBR, ++ cardname, ++ DMA_VERBOSE_ON_ERROR, ++ dma_eth)) { ++ goto grace_exit4; ++ } ++ ++ /* give the HW an idea of what MAC address we want */ ++ ++ *R_NETWORK_SA_0 = dev->dev_addr[0] | (dev->dev_addr[1] << 8) | ++ (dev->dev_addr[2] << 16) | (dev->dev_addr[3] << 24); ++ *R_NETWORK_SA_1 = dev->dev_addr[4] | (dev->dev_addr[5] << 8); ++ *R_NETWORK_SA_2 = 0; ++ ++#if 0 ++ /* use promiscuous mode for testing */ ++ *R_NETWORK_GA_0 = 0xffffffff; ++ *R_NETWORK_GA_1 = 0xffffffff; ++ ++ *R_NETWORK_REC_CONFIG = 0xd; /* broadcast rec, individ. rec, ma0 enabled */ ++#else ++ SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, max_size, size1522); ++ SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, broadcast, receive); ++ SETS(network_rec_config_shadow, R_NETWORK_REC_CONFIG, ma0, enable); ++ SETF(network_rec_config_shadow, R_NETWORK_REC_CONFIG, duplex, full_duplex); ++ *R_NETWORK_REC_CONFIG = network_rec_config_shadow; ++#endif ++ ++ *R_NETWORK_GEN_CONFIG = ++ IO_STATE(R_NETWORK_GEN_CONFIG, phy, mii_clk) | ++ IO_STATE(R_NETWORK_GEN_CONFIG, enable, on); ++ ++ SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, clr); ++ SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, delay, none); ++ SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, cancel, dont); ++ SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, cd, enable); ++ SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, retry, enable); ++ SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, pad, enable); ++ SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, crc, enable); ++ *R_NETWORK_TR_CTRL = network_tr_ctrl_shadow; ++ ++ local_irq_save(flags); ++ ++ /* enable the irq's for ethernet DMA */ ++ ++ *R_IRQ_MASK2_SET = ++ IO_STATE(R_IRQ_MASK2_SET, dma0_eop, set) | ++ IO_STATE(R_IRQ_MASK2_SET, dma1_eop, set); ++ ++ *R_IRQ_MASK0_SET = ++ IO_STATE(R_IRQ_MASK0_SET, overrun, set) | ++ IO_STATE(R_IRQ_MASK0_SET, underrun, set) | ++ IO_STATE(R_IRQ_MASK0_SET, excessive_col, set); ++ ++ /* make sure the irqs are cleared */ ++ ++ *R_DMA_CH0_CLR_INTR = IO_STATE(R_DMA_CH0_CLR_INTR, clr_eop, do); ++ *R_DMA_CH1_CLR_INTR = IO_STATE(R_DMA_CH1_CLR_INTR, clr_eop, do); ++ ++ /* make sure the rec and transmit error counters are cleared */ ++ ++ (void)*R_REC_COUNTERS; /* dummy read */ ++ (void)*R_TR_COUNTERS; /* dummy read */ ++ ++ /* start the receiving DMA channel so we can receive packets from now on */ ++ ++ *R_DMA_CH1_FIRST = virt_to_phys(myNextRxDesc); ++ *R_DMA_CH1_CMD = IO_STATE(R_DMA_CH1_CMD, cmd, start); ++ ++ /* Set up transmit DMA channel so it can be restarted later */ ++ ++ *R_DMA_CH0_FIRST = 0; ++ *R_DMA_CH0_DESCR = virt_to_phys(myLastTxDesc); ++ netif_start_queue(dev); ++ ++ local_irq_restore(flags); ++ ++ /* Probe for transceiver */ ++ if (e100_probe_transceiver(dev)) ++ goto grace_exit5; ++ ++ /* Start duplex/speed timers */ ++ add_timer(&speed_timer); ++ add_timer(&duplex_timer); ++ ++ /* We are now ready to accept transmit requeusts from ++ * the queueing layer of the networking. ++ */ ++ netif_carrier_on(dev); ++ ++ return 0; ++ ++grace_exit5: ++ cris_free_dma(NETWORK_RX_DMA_NBR, cardname); ++grace_exit4: ++ cris_free_dma(NETWORK_TX_DMA_NBR, cardname); ++grace_exit3: ++ free_irq(NETWORK_STATUS_IRQ_NBR, (void *)dev); ++grace_exit2: ++ free_irq(NETWORK_DMA_TX_IRQ_NBR, (void *)dev); ++grace_exit1: ++ free_irq(NETWORK_DMA_RX_IRQ_NBR, (void *)dev); ++grace_exit0: ++ return -EAGAIN; ++} ++ ++#if defined(CONFIG_ETRAX_NO_PHY) ++static void ++dummy_check_speed(struct net_device* dev) ++{ ++ current_speed = 100; ++} ++#else ++static void ++generic_check_speed(struct net_device* dev) ++{ ++ unsigned long data; ++ struct net_local *np = netdev_priv(dev); ++ ++ data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE); ++ if ((data & ADVERTISE_100FULL) || ++ (data & ADVERTISE_100HALF)) ++ current_speed = 100; ++ else ++ current_speed = 10; ++} ++ ++static void ++tdk_check_speed(struct net_device* dev) ++{ ++ unsigned long data; ++ struct net_local *np = netdev_priv(dev); ++ ++ data = e100_get_mdio_reg(dev, np->mii_if.phy_id, ++ MDIO_TDK_DIAGNOSTIC_REG); ++ current_speed = (data & MDIO_TDK_DIAGNOSTIC_RATE ? 100 : 10); ++} ++ ++static void ++broadcom_check_speed(struct net_device* dev) ++{ ++ unsigned long data; ++ struct net_local *np = netdev_priv(dev); ++ ++ data =