Skip to contentSkip to conversation

PRxK sub-architecture

PATCH In review Marcelo Tosatti 3 participants 4 messages Oct 15, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PRxK sub-architecture

Hi PPC folks,

Cyclades manufactures several embedded PowerPC products (based on mpc8xx), serial console servers, digital kvm's, etc. that run Linux, and we need certain modifications (a group of new sub-sub architectures on arch/ppc/ and some others) for it to work.

We maintain a v2.4 tree with this modifications in-house.

We would like to merge this code upstream. The following patch is the basic structure for getting the system to boot. Its basically flash access code (to retrieve bootup information), a different start function at a custom address (head.S), and the embed_config() function to fill the bdinfo structure with the correct board data.

We need to get rid of _bcopy_str() function and use memcpy instead, but apart from that it should be clean.

The fec.c change is probably in the main repository already (BTW this fec.c driver didnt work for our board, we're using ported v2.4's fec.c, but thats a later story).

Tom, Dan, can you take a look at the patch and see if you reject anything for merging to linuxppc-2.5 tree. Its all non-intrusive code based on CONFIG_PRxK selection.

Kudos to all Cyclades developers who worked on this.

Once we have this merged, there are other patches we would like to see in.

arch/ppc/8xx_io/fec.c +9 -7
diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/8xx_io/fec.c linux-2.6-bkppc/arch/ppc/8xx_io/fec.c
@@ -173,7 +173,7 @@
 	uint	phy_status;
 	uint	phy_speed;
 	phy_info_t	*phy;
-	struct tq_struct phy_task;
+	struct work_struct phy_task;
 
 	uint	sequence_done;
 
@@ -1320,18 +1320,18 @@
 {
 	struct fec_enet_private *fep = dev->priv;
 
-	fep->phy_task.routine = (void *)mii_relink;
-	fep->phy_task.data = dev;
-	schedule_task(&fep->phy_task);
+	PREPARE_WORK (&fep->phy_task, mii_relink ,dev);
+
+	schedule_work(&fep->phy_task);
 }
 
 static void mii_queue_config(uint mii_reg, struct net_device *dev)
 {
 	struct fec_enet_private *fep = dev->priv;
 
-	fep->phy_task.routine = (void *)mii_display_config;
-	fep->phy_task.data = dev;
-	schedule_task(&fep->phy_task);
+	PREPARE_WORK (&fep->phy_task, mii_display_config, dev);
+
+	schedule_work(&fep->phy_task);
 }
 
 
@@ -1682,6 +1682,8 @@
 	fep->ph_priv = NULL;
 #endif
 
+	INIT_WORK(&fep->phy_task, NULL, NULL);
+
 	/* Install our interrupt handler.
 	*/
 	if (request_irq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0)
arch/ppc/boot/cyc_banner.h +50 -0

50 lines not on this page · raw message

arch/ppc/boot/simple/embed_config.c +352 -0

360 lines not on this page · raw message

arch/ppc/boot/simple/head.S +14 -0
diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/boot/simple/head.S linux-2.6-bkppc/arch/ppc/boot/simple/head.S
@@ -32,6 +32,20 @@
  *
  */
 
+#ifdef CONFIG_PRxK
+        .globl  start1
+start1: .long   0x00002120
+        .ascii  "Entry Point\x00"
+        .long   0x00000000
+        .long   0x00000000
+        .long   0x00000000
+#ifdef CONFIG_TS1H
+        .long   start1
+#else
+        .long   0x00000000
+#endif
+#endif
+
 	.globl	start
 start:
 	bl	start_
arch/ppc/configs/prxk_defconfig +756 -0

756 lines not on this page · raw message

arch/ppc/Kconfig +22 -0
diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/Kconfig linux-2.6-bkppc/arch/ppc/Kconfig
@@ -354,6 +354,12 @@
 	  LEDs.  Variants with Ethernet ports exist.  Say Y here to support it
 	  directly.
 
+config PRxK
+	bool "PRxK"
+	help
+	The PRxK's are Cyclades embedded PowerPC hardware: serial servers, 
+	kvm managers, routers.
+
 config BSEIP
 	bool "BSE-IP"
 	help
@@ -472,6 +478,22 @@
 endchoice
 
 choice
+        prompt "PRxK Machine Type"
+        depends on PRxK
+        default TSxK
+
+config TSxK
+	bool TSxK
+	help	
+	  Say Y here to support the ACS, KVM families. 
+config TS1H
+	bool TS1H
+	help
+	  Say Y here to support the TS1H family.
+
+endchoice
+
+choice
 	prompt "Machine Type"
 	depends on 6xx || POWER3 || POWER4
 	default PPC_MULTIPLATFORM
arch/ppc/platforms/prxk.h +118 -0

118 lines not on this page · raw message

include/asm-ppc/flash.h +72 -0

72 lines not on this page · raw message

include/asm-ppc/mpc8xx.h +4 -0
diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/include/asm-ppc/mpc8xx.h linux-2.6-bkppc/include/asm-ppc/mpc8xx.h
@@ -24,6 +24,10 @@
 #include <platforms/rpxlite.h>
 #endif
 
+#ifdef CONFIG_PRxK
+#include <platforms/prxk.h>
+#endif
+
 #ifdef CONFIG_BSEIP
 #include <platforms/bseip.h>
 #endif
include/asm-ppc/prxk.h +118 -0

118 lines not on this page · raw message

#1 lore raw

[ Switched over to linuxppc-embedded ]

On Fri, Oct 15, 2004 at 01:09:41PM -0300, Marcelo Tosatti wrote:

Just some rough comments:

[snip]

arch/ppc/8xx_io/fec.c line 179

Quoted 12 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/8xx_io/fec.c linux-2.6-bkppc/arch/ppc/8xx_io/fec.c

arch/ppc/8xx_io/fec.c +1 -1
@@ -173,7 +173,7 @@
 	uint	phy_status;
 	uint	phy_speed;
 	phy_info_t	*phy;
-	struct tq_struct phy_task;
+	struct work_struct phy_task;
 
 	uint	sequence_done;
 

This looks like a dupe of what's already in linuxppc-2.5.

[snip]

arch/ppc/boot/simple/embed_config.c

Quoted 3 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/boot/simple/embed_config.c linux-2.6-bkppc/arch/ppc/boot/simple/embed_config.c

arch/ppc/boot/simple/embed_config.c +0 -0

This looks like it should be done in prxk.c, with the various hooks that we provide in misc.c, which might have to be ported to misc-embedded.c.

[snip]

arch/ppc/boot/simple/head.S

Quoted 3 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/boot/simple/head.S linux-2.6-bkppc/arch/ppc/boot/simple/head.S

arch/ppc/boot/simple/head.S +0 -0

Do we really need to do this? If so, why?

[snip]

Quoted 3 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/include/asm-ppc/prxk.h linux-2.6-bkppc/include/asm-ppc/prxk.h

include/asm-ppc/prxk.h +0 -0

[snip]

include/asm-ppc/prxk.h

Quoted 3 lines
include/asm-ppc/prxk.h +3 -0
+/* Machine type
+*/
+#define _MACH_8xx (_MACH_PRxK)

Eh? Is there more to come that moves 8xx towards what we have on pmac/prep/chrp ? Or a left-over from older kernels?

Thanks.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#2 lore raw
Quoted 22 lines · Tom Rini

[ Switched over to linuxppc-embedded ]

On Fri, Oct 15, 2004 at 01:09:41PM -0300, Marcelo Tosatti wrote:

Just some rough comments:

[snip]

arch/ppc/8xx_io/fec.c line 179

Quoted 12 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/8xx_io/fec.c linux-2.6-bkppc/arch/ppc/8xx_io/fec.c

arch/ppc/8xx_io/fec.c +1 -1
@@ -173,7 +173,7 @@
 	uint	phy_status;
 	uint	phy_speed;
 	phy_info_t	*phy;
-	struct tq_struct phy_task;
+	struct work_struct phy_task;
 
 	uint	sequence_done;
 

This looks like a dupe of what's already in linuxppc-2.5.

Quoted 7 lines

[snip]

arch/ppc/boot/simple/embed_config.c

Quoted 3 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/boot/simple/embed_config.c linux-2.6-bkppc/arch/ppc/boot/simple/embed_config.c

arch/ppc/boot/simple/embed_config.c +0 -0

This looks like it should be done in prxk.c, with the various hooks that we provide in misc.c, which might have to be ported to misc-embedded.c.

OK, I'll look into this.

Quoted 6 lines

[snip]

arch/ppc/boot/simple/head.S

Quoted 3 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/arch/ppc/boot/simple/head.S linux-2.6-bkppc/arch/ppc/boot/simple/head.S

arch/ppc/boot/simple/head.S +0 -0

Do we really need to do this? If so, why?

Yes because the bootloader jumps to 0x00002120.

We can't afford to change that, I think.

I'll take a closer look at this too.

Quoted 11 lines

[snip]

Quoted 3 lines

diff -Nur --exclude-from=/tmp/exclude linux-2.6-bkppc.orig/include/asm-ppc/prxk.h linux-2.6-bkppc/include/asm-ppc/prxk.h

include/asm-ppc/prxk.h +0 -0

[snip]

include/asm-ppc/prxk.h

Quoted 3 lines
include/asm-ppc/prxk.h +3 -0
+/* Machine type
+*/
+#define _MACH_8xx (_MACH_PRxK)

Eh? Is there more to come that moves 8xx towards what we have on pmac/prep/chrp ? Or a left-over from older kernels?

I think its just a leftover from older kernels.

Quoted 1 line

Thanks.

Thank you for commenting!

I'll move embed_config() to prxk.c as suggested, fix the _bcopy_str(), and come up with another patch next week.

#3 lore raw

(realized after the fact that this belonged on linuxppc-embedded)

A few comments:

1. Any reason for the duplicated header between include/asm-ppc/prxk.h & arch/ppc/platforms/prxk.h?
2. Does flash.h really belong in include/asm-ppc?

- kumar

[snip]