Skip to contentSkip to conversation

cris: compile fixes for 2.6.26-rc5

PATCH In review Hinko Kočevar 6 participants 13 messages Jun 6, 2008 – Jul 2, 2008

lore
Share & tools
lore
#0 lore raw

cover cris: compile fixes for 2.6.26-rc5

Hi,

Current status of cris architecture is that current GIT tree at 2.6.26-rc5 does not even compile.

To remedy this I've created two patches that are sent as a reply to this post:
1. add dummy ops for serial debug port
2. make compile succeed when building with O= (srctree != objtree)

Best regards,
Hinko

Signature · 7 lines
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: [email protected]
Http: www.cetrtapot.si
#1 lore raw

Add dummy ops for serial debug port.

---

arch/cris/arch-v10/kernel/debugport.c +8 -4
index 04d5eee..429a281 100644
@@ -432,6 +432,13 @@ dummy_write_room(struct tty_struct *tty)
 	return 8192;
 }
 
+static struct tty_operations dummy_ops = {
+	.open = &dummy_open,
+	.close = &dummy_close,
+	.write = &dummy_write,
+	.write_room = &dummy_write_room,
+};
+
 void __init
 init_dummy_console(void)
 {
@@ -448,10 +455,7 @@ init_dummy_console(void)
 		B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
 	dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
 
-	dummy_driver.open = dummy_open;
-	dummy_driver.close = dummy_close;
-	dummy_driver.write = dummy_write;
-	dummy_driver.write_room = dummy_write_room;
+	dummy_driver.ops = &dummy_ops;
 	if (tty_register_driver(&dummy_driver))
 		panic("Couldn't register dummy serial driver\n");
 }
#2 lore raw

arch/cris/arch-v10/kernel/debugport.c dummy_write_room(struct tty_struct *tty) · line 440

Quoted 6 lines
arch/cris/arch-v10/kernel/debugport.c +6 -0
+static struct tty_operations dummy_ops = {
+	.open = &dummy_open,
+	.close = &dummy_close,
+	.write = &dummy_write,
+	.write_room = &dummy_write_room,
+};

Looks ok. From 2.6.26 onward you should be able to omit write/write_room if you want writes to error, but you will need the dummies if you want them to vanish.

arch/cris/arch-v10/kernel/debugport.c init_dummy_console(void) · line 455

Quoted 2 lines
arch/cris/arch-v10/kernel/debugport.c +0 -0
@@ -448,10 +455,7 @@ init_dummy_console(void)
 		B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */

It should also be setting c_ispeed/c_ospeed

arch/cris/arch-v10/kernel/debugport.c init_dummy_console(void) · line 456

Quoted 1 line
arch/cris/arch-v10/kernel/debugport.c +0 -0
 	dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;

Alan

#3 lore raw

Stab 2

Add dummy ops for serial debug port.
Add setting of c_ispeed/c_ospeed as suggested by Alan Cox.

---

arch/cris/arch-v10/kernel/debugport.c +10 -4
index 04d5eee..36eee3d 100644
@@ -432,6 +432,13 @@ dummy_write_room(struct tty_struct *tty)
 	return 8192;
 }
 
+static struct tty_operations dummy_ops = {
+	.open = &dummy_open,
+	.close = &dummy_close,
+	.write = &dummy_write,
+	.write_room = &dummy_write_room,
+};
+
 void __init
 init_dummy_console(void)
 {
@@ -447,11 +454,10 @@ init_dummy_console(void)
 	dummy_driver.init_termios.c_cflag =
 		B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
 	dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
+	dummy_driver.init_termios.c_ispeed = 115200;
+	dummy_driver.init_termios.c_ospeed = 115200;
 
-	dummy_driver.open = dummy_open;
-	dummy_driver.close = dummy_close;
-	dummy_driver.write = dummy_write;
-	dummy_driver.write_room = dummy_write_room;
+	dummy_driver.ops = &dummy_ops;
 	if (tty_register_driver(&dummy_driver))
 		panic("Couldn't register dummy serial driver\n");
 }
#5 lore raw
In reply to Hinko Kočevar

Make compile succeed when building with O= (srctree != objtree).

---

arch/cris/arch-v10/boot/compressed/Makefile +1 -1
index 4a031cb..89ad821 100644
@@ -5,7 +5,7 @@
 CC = gcc-cris -melf $(LINUXINCLUDE)
 ccflags-y += -O2
 LD = ld-cris
-ldflags-y += -T $(obj)/decompress.ld
+ldflags-y += -T $(srctree)/$(src)/decompress.ld
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 OBJCOPY = objcopy-cris
 OBJCOPYFLAGS = -O binary --remove-section=.bss
arch/cris/arch-v10/boot/rescue/Makefile +1 -1
index 2e5045b..32b9a91 100644
@@ -6,7 +6,7 @@ CC = gcc-cris -mlinux $(LINUXINCLUDE)
 ccflags-y += -O2
 asflags-y += -traditional
 LD = gcc-cris -mlinux -nostdlib
-ldflags-y += -T $(obj)/rescue.ld
+ldflags-y += -T $(srctree)/$(src)/rescue.ld
 OBJCOPY = objcopy-cris
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
#6 lore raw
In reply to Hinko Kočevar
Quoted 5 lines · Hinko Kočevar

Hi,

Current status of cris architecture is that current GIT tree at 2.6.26-rc5 does not even compile.
...

@Mikael, Jesper:

BTW:
What happened with the stuff you have?
It seems you missed to merge for 2.6.26?

Can you try to not miss the merge window for 2.6.27, and also publish your queued patches in a way that they might get into the -next tree (Stephen Cc'ed for possibly discussing details)?

Quoted 2 lines

Best regards,
Hinko

TIA
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#7 lore raw
Quoted 7 lines · Adrian Bunk
Quoted 5 lines · Hinko Ko??evar

Hi,

Current status of cris architecture is that current GIT tree at 2.6.26-rc5 does not even compile.
...

Quoted 5 lines

@Mikael, Jesper:

BTW:
What happened with the stuff you have?
It seems you missed to merge for 2.6.26?

Yeah, unfortunately I got swamped just as the 2.6.26 merge window opened up. I'll push them out for 2.6.27.

Quoted 3 lines

Can you try to not miss the merge window for 2.6.27, and also publish your queued patches in a way that they might get into the -next tree (Stephen Cc'ed for possibly discussing details)?

Have I understood correctly that a tree exported for -next can be rebased without causing any problems? I've hesitated a bit to create a -next tree to avoid problems with later merges.

Quoted 5 lines
Quoted 2 lines

Best regards,
Hinko

TIA
Adrian

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]
#8 lore raw

Hi Jasper,

Quoted 4 lines · On Tue, 10 Jun 2008 11:49:37 +0200 Jesper Nilsson <[email protected]>…

Have I understood correctly that a tree exported for -next can be rebased without causing any problems? I've hesitated a bit to create a -next tree to avoid problems with later merges.

Yes, rebases are OK (but not encouraged :-)). The rules are that stuff in the tree for -next must have been posted somewhere appropriate, reviewed, and unit tested as much as possible and be reasonably expected to be in the next merge window.

I also merge trees containing fixes for Linus' current tree.

Also, I accept git trees or quilt series.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#9 lore raw

Re: [PATCH linux-next 1/1] cris: look for linker scripts in srctree not in objtree

In reply to Hinko Kočevar

When building kernel with O= linker looks for linker scripts in output tree, while they are located in source tree.

---

arch/cris/arch-v10/boot/compressed/Makefile +1 -1
index 9ec5f87..cc6527d 100644
@@ -4,7 +4,7 @@
 
 asflags-y += $(LINUXINCLUDE)
 ccflags-y += -O2 $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/decompress.ld
+ldflags-y += -T $(srctree)/arch/$(ARCH)/boot/compressed/decompress.ld
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 
arch/cris/arch-v10/boot/rescue/Makefile +1 -1
index bea8b9c..476007d 100644
@@ -4,7 +4,7 @@
 
 ccflags-y += -O2 $(LINUXINCLUDE)
 asflags-y += $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/rescue.ld
+ldflags-y += -T $(srctree)/arch/$(ARCH)/boot/rescue/rescue.ld
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
 OBJECT := $(obj)/head.o
#10 lore raw

Re: [PATCH linux-next 1/1] cris: look for linker scripts in srctree not in objtree

Hi!

Quoted 3 lines · Hinko Kocevar

When building kernel with O= linker looks for linker scripts in output tree, while they are located in source tree.

I think this would be cleaner:

arch/cris/arch-v10/boot/compressed/Makefile +1 -1
@@ -4,7 +4,7 @@
 
 asflags-y += $(LINUXINCLUDE)
 ccflags-y += -O2 $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/decompress.ld
+ldflags-y += -T $(srctree)/$(src)/decompress.ld
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 
arch/cris/arch-v10/boot/rescue/Makefile +1 -1
@@ -4,7 +4,7 @@
 
 ccflags-y += -O2 $(LINUXINCLUDE)
 asflags-y += $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/rescue.ld
+ldflags-y += -T $(srctree)/$(src)/rescue.ld
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
 OBJECT := $(obj)/head.o
Quoted 20 lines

---

arch/cris/arch-v10/boot/compressed/Makefile +1 -1
index 9ec5f87..cc6527d 100644
@@ -4,7 +4,7 @@
 
 asflags-y += $(LINUXINCLUDE)
 ccflags-y += -O2 $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/decompress.ld
+ldflags-y += -T $(srctree)/arch/$(ARCH)/boot/compressed/decompress.ld
 
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 OBJCOPYFLAGS = -O binary --remove-section=.bss
arch/cris/arch-v10/boot/rescue/Makefile +0 -0
index bea8b9c..476007d 100644

arch/cris/arch-v10/boot/rescue/Makefile line 10

Quoted 8 lines
arch/cris/arch-v10/boot/rescue/Makefile +1 -1
@@ -4,7 +4,7 @@
 
 ccflags-y += -O2 $(LINUXINCLUDE)
 asflags-y += $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/rescue.ld
+ldflags-y += -T $(srctree)/arch/$(ARCH)/boot/rescue/rescue.ld
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
 OBJECT := $(obj)/head.o

Thanks!

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]
Acked-by
#11 lore raw

Re: [PATCH linux-next 1/1] cris: look for linker scripts in srctree not in objtree

Quoted 13 lines · Jesper Nilsson

Hi!

Quoted 3 lines · Hinko Kocevar

When building kernel with O= linker looks for linker scripts in output tree, while they are located in source tree.

I think this would be cleaner:

arch/cris/arch-v10/boot/compressed/Makefile line 10

Quoted 8 lines
arch/cris/arch-v10/boot/compressed/Makefile +1 -1
@@ -4,7 +4,7 @@
 
 asflags-y += $(LINUXINCLUDE)
 ccflags-y += -O2 $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/decompress.ld
+ldflags-y += -T $(srctree)/$(src)/decompress.ld
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 

linker scripts are by definition named *.lds in the kernel. And if you need to preprocess them then name them *.lds.S as we do in arch/$ARCH/kernel/*

As this is not a generated linker script then the $(srctree)/$(src) prefix is correct and the $(obj) prefix was plain wrong.

So:

Sam

#12 lore raw

Re: [PATCH linux-next 1/1] cris: look for linker scripts in srctree not in objtree

In reply to Jesper Nilsson
Quoted 27 lines · Jesper Nilsson

Hi!

Quoted 3 lines · Hinko Kocevar

When building kernel with O= linker looks for linker scripts in output tree, while they are located in source tree.

I think this would be cleaner:

arch/cris/arch-v10/boot/compressed/Makefile +1 -1
@@ -4,7 +4,7 @@
 
 asflags-y += $(LINUXINCLUDE)
 ccflags-y += -O2 $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/decompress.ld
+ldflags-y += -T $(srctree)/$(src)/decompress.ld
 OBJECTS = $(obj)/head.o $(obj)/misc.o
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 

arch/cris/arch-v10/boot/rescue/Makefile line 10

Quoted 8 lines
arch/cris/arch-v10/boot/rescue/Makefile +1 -1
@@ -4,7 +4,7 @@
 
 ccflags-y += -O2 $(LINUXINCLUDE)
 asflags-y += $(LINUXINCLUDE)
-ldflags-y += -T $(obj)/rescue.ld
+ldflags-y += -T $(srctree)/$(src)/rescue.ld
 OBJCOPYFLAGS = -O binary --remove-section=.bss
 obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
 OBJECT := $(obj)/head.o

It certainly is.

Signature · 7 lines
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: [email protected]
Http: www.cetrtapot.si