Skip to contentSkip to conversation

ADM5120 for 2.6.10

PATCH In review Jeroen Vreeken 3 participants 7 messages Jan 27, 2005 – Jan 28, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ADM5120 for 2.6.10

Hi,

I finally succeeded in getting 2.6.10 working on my adm5120 router. Attached is a patch against 2.6.10 with the needed changes.

First a list of what it does NOT do:
-ethernet
-usb
-pci (my board doesn't have pci)
-anything usefull :)

What it does do:
-Boot
-Serial support (with improved timing compared to the official 2.4.18 kernels) -Simplified init code (the 2.4.18 code was way to complex)

I also found the most probable reason people had problems porting the released sources to other kernels: the bootloader jumps to a fixed address that just happens to be the kernel_entry in 2.4.18
I 'solved' it by adding a jump on this address to the real kernel_entry (which is at the other end of the kernel in 2.6)
I also had some great fun figuring out how the hell initramfs is supposed to work.... To finally find out after two days I had one slash to little in the configured path..... I also found that standard 2.6.10 doesn't support symlinks and my initramfs ended up being 14Mb.

Next I plan to port the ethernet driver and usb. I don't think I will port the led driver as is, its much easier to just offer a character device with access to the GPIO port than the 'LED BLINK' stuff used in the ADMtek led driver.

Jeroen

Makefile +6 -0
diff -ruN linux-2.6.10/Makefile linux-2.6.10-adm.1/Makefile
@@ -4,6 +4,8 @@
 EXTRAVERSION =
 NAME=Woozy Numbat
 
+ARCH=mips
+
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
 # More info can be located in ./README
@@ -722,6 +724,10 @@
 vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
 	$(call if_changed_rule,vmlinux__)
 
+vmlinuz: vmlinux
+	$(OBJCOPY) -O binary vmlinux vmlinux.bin
+	gzip vmlinux.bin -c >vmlinuz
+
 # The actual objects are generated when descending, 
 # make sure no implicit rule kicks in
 $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
arch/mips/Kconfig +4 -0
diff -ruN linux-2.6.10/arch/mips/Kconfig linux-2.6.10-adm.1/arch/mips/Kconfig
@@ -46,6 +46,10 @@
 	  the MIPS architecture, check out the Linux/MIPS FAQ on the WWW at
 	  <http://www.linux-mips.org/>.
 
+config MIPS_AM5120
+	bool "Support for ADM5120 board"
+	select DMA_NONCOHERENT
+
 config MIPS_MAGNUM_4000
 	bool "Support for MIPS Magnum 4000"
 	depends on MACH_JAZZ
arch/mips/Makefile +8 -1
diff -ruN linux-2.6.10/arch/mips/Makefile linux-2.6.10-adm.1/arch/mips/Makefile
@@ -49,7 +49,7 @@
 endif
 
 ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE		:= $(tool-prefix)
+CROSS_COMPILE		:= /export/tools/bin/$(tool-prefix)
 endif
 
 ifdef CONFIG_BUILD_ELF64
@@ -232,6 +232,13 @@
 load-$(CONFIG_MACH_JAZZ)	+= 0xffffffff80080000
 
 #
+# ADMtek 5120
+#
+
+core-$(CONFIG_MIPS_AM5120)	+= arch/mips/am5120/
+load-$(CONFIG_MIPS_AM5120)	+= 0xffffffff80002000
+
+#
 # Common Alchemy Au1x00 stuff
 #
 core-$(CONFIG_SOC_AU1X00)	+= arch/mips/au1000/common/
arch/mips/am5120/5120_rtc.c +73 -0

73 lines not on this page · raw message

arch/mips/am5120/Makefile +3 -0
diff -ruN linux-2.6.10/arch/mips/am5120/Makefile linux-2.6.10-adm.1/arch/mips/am5120/Makefile
@@ -0,0 +1,3 @@
+
+obj-y	:= setup.o prom.o irq.o serial.o memory.o mipsIRQ.o time.o pci.o
+# 5120_rtc.o led.o
arch/mips/am5120/irq.c +181 -0

181 lines not on this page · raw message

arch/mips/am5120/led.c +493 -0

493 lines not on this page · raw message

arch/mips/am5120/led.h +26 -0
diff -ruN linux-2.6.10/arch/mips/am5120/led.h linux-2.6.10-adm.1/arch/mips/am5120/led.h
@@ -0,0 +1,26 @@
+#ifndef _LED_H_INCLUDED
+#define _LED_H_INCLUDED
+
+#include <linux/config.h>
+
+#define LED_VERSION 		"v1.0"
+#define LED_MAJOR       	166
+#define LED_DEV_NUM		    8 
+#define LED_GPIO_START      1
+#define GPIO_MAJOR       	167
+#define GPIO_DEV_NUM		16
+#define REG_MINOR           128
+//#define GPIO_IO_BASE        0xB4002480
+#define GPIO_IO_BASE        ((unsigned long)0xb20000b8)
+#define GPIO_IO_EXTENT		0x40
+
+#define LED_ON              0x010000
+#define LED_OFF             0x020000
+#define LED_BLINK_CMD       0x030000
+#define LED_BLINK_PERIOD    0x00FFFF
+#define LED_BLINK           (LED_BLINK_CMD|1000)
+#define LED_BLINK_FAST      (LED_BLINK_CMD|250)
+#define LED_BLINK_SLOW      (LED_BLINK_CMD|500)
+#define LED_BLINK_EXTRA_SLOW    (LED_BLINK_CMD|2000)
+
+#endif
arch/mips/am5120/memory.c +84 -0

84 lines not on this page · raw message

arch/mips/am5120/mipsIRQ.S +135 -0

135 lines not on this page · raw message

arch/mips/am5120/pci.c +214 -0

214 lines not on this page · raw message

arch/mips/am5120/prom.c +70 -0

70 lines not on this page · raw message

arch/mips/am5120/serial.c +1711 -0

1,672 lines not on this page · raw message

arch/mips/am5120/setup.c +119 -0

119 lines not on this page · raw message

arch/mips/am5120/time.c +98 -0

98 lines not on this page · raw message

arch/mips/kernel/head.S +5 -1
diff -ruN linux-2.6.10/arch/mips/kernel/head.S linux-2.6.10-adm.1/arch/mips/kernel/head.S

Lines of this file are not shown. View the raw message.

include/asm-mips/am5120/adm5120.h +1084 -0

1,084 lines not on this page · raw message

include/asm-mips/am5120/mx.h +69 -0

69 lines not on this page · raw message

include/asm-mips/am5120/mx29lv320b.h +61 -0

61 lines not on this page · raw message

include/asm-mips/am5120/prom.h +49 -0

49 lines not on this page · raw message

include/asm-mips/bootinfo.h +6 -0
diff -ruN linux-2.6.10/include/asm-mips/bootinfo.h linux-2.6.10-adm.1/include/asm-mips/bootinfo.h

Lines of this file are not shown. View the raw message.

include/linux/init.h +2 -0
diff -ruN linux-2.6.10/include/linux/init.h linux-2.6.10-adm.1/include/linux/init.h

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw

Greetings.

First, thank you for your patch. However, there are a number of things that you have to do before it will be accepted.

1) You should be creating your patch against the Linux/MIPS kernel tree present in CVS. You can go to http://www.linux-mips.org/
to see how to get the latest code.

2) Change your machine config definition of 'MIPS_AM5120' to be 'MIPS_ADM5120' as it makes more sense.

3) A number of your files, 'arch/mips/am5120/5120_rtc.c' for an example, has an unacceptable copyright banner in it. Your code will not be accepted unless it is licensed under GPL or a shared BSD style license. Please speak with your management and get approval. You will also need to sign off your code contribution.

4) It might be good to have your serial driver up in 'drivers/serial' instead of down in 'arch/mips' somewhere. Perhaps someone else will have comments on that.

5) Your PCI code should be located in 'arch/mips/pci'.

6) Your change to 'include/linux/init.h' for early init calls is unnecessary. The latest tree already supports this and the linker script takes care of placing them in the proper section.

After you have addressed the issues above, please re-submit your patch. Thanks!

-Steve

#2 lore raw
Quoted 24 lines · [email protected] wrote:

Greetings.

First, thank you for your patch. However, there are a number of things that you have to do before it will be accepted.

1) You should be creating your patch against the Linux/MIPS kernel tree present in CVS. You can go to http://www.linux-mips.org/
to see how to get the latest code.

2) Change your machine config definition of 'MIPS_AM5120' to be 'MIPS_ADM5120' as it makes more sense.

3) A number of your files, 'arch/mips/am5120/5120_rtc.c' for an example, has an unacceptable copyright banner in it. Your code will not be accepted unless it is licensed under GPL or a shared BSD style license. Please speak with your management and get approval. You will also need to sign off your code contribution.

4) It might be good to have your serial driver up in 'drivers/serial' instead of down in 'arch/mips' somewhere. Perhaps someone else will have comments on that.

5) Your PCI code should be located in 'arch/mips/pci'.

Quoted 8 lines

6) Your change to 'include/linux/init.h' for early init calls is unnecessary. The latest tree already supports this and the linker script takes care of placing them in the proper section.

After you have addressed the issues above, please re-submit your patch. Thanks!

I agree with your points...
Just to clarify: I don't intend this patch to be merged with anything, its just an intermediate step I thought people here might be interested in. I'll try to make that clearer if I post further patches.

With respect to point 3, I am not an admtek employee, its just a hobby project. I also send an mail about this copyright notice earlier, since nobody started shouting it was wrong to remove these messages I asume I can modify them into something sensible.

Jeroen

#3 lore raw
Quoted 5 lines

I agree with your points...
Just to clarify: I don't intend this patch to be merged with anything, its just an intermediate step I thought people here might be interested in. I'll try to make that clearer if I post further patches.

If you do not plan on it being merged, it might be good if you posted the patches somewhere instead of flooding our mail boxes with extra bits we probably won't care about. I'm not trying to be mean, but just take into account people with slow connections and very little time. Maybe upload the stuff to a FTP site and provide a URL to it.

Quoted 5 lines

With respect to point 3, I am not an admtek employee, its just a hobby project. I also send an mail about this copyright notice earlier, since nobody started shouting it was wrong to remove these messages I asume I can modify them into something sensible.

You should be talking to ADMTek about being allowed to post this code then. Otherwise, it should not be not be on the list.

-Steve

#4 lore raw
Quoted 4 lines · [email protected] wrote:

You should be talking to ADMTek about being allowed to post this code then. Otherwise, it should not be not be on the list.

I am confident I am allowed to post the code. It is published publicly on the web and the blurb while irritating (which is why I want it changed) does mention that you are excepted from the mentioned restrictions if you have the appropriate license agreement. Since there is no doubt this code hase been distributed under the GPL I have such a license.
Btw I did contact admtek to ask for formal approval to change it to something less scary.

Jeroen

#5 lore raw
Quoted 6 lines · Jeroen Vreeken
Quoted 4 lines · [email protected] wrote:

You should be talking to ADMTek about being allowed to post this code then. Otherwise, it should not be not be on the list.

Quoted 9 lines

I am confident I am allowed to post the code. It is published publicly on the web and the blurb while irritating (which is why I want it changed) does mention that you are excepted from the mentioned restrictions if you have the appropriate license agreement. Since there is no doubt this code hase been distributed under the GPL I have such a license.
Btw I did contact admtek to ask for formal approval to change it to something less scary.

Jeroen

.

Hi Jeroen:
I agree with your point. I think the copyright notices of ADMTek in
arch/mips/am5120/ directory infringed GPL.
All the modifications of linux-2.4.18-admtek should be distributed under the GPL without exception.

Best regards,
TR Chang

#6 lore raw
Quoted 9 lines

Hi Jeroen:
I agree with your point. I think the copyright notices of ADMTek in
arch/mips/am5120/ directory infringed GPL.
All the modifications of linux-2.4.18-admtek should be distributed under the GPL without exception.

Best regards,
TR Chang

Are you the original copyright holder? I am just trying to get a path of responsibility established. Thanks!

-Steve