LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* write/read PCI in Linux PPC
From: Roberto Pavon Sierra @ 2005-10-21 14:05 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

I try to write at the PCI-Addresses of the ATI´s video controller in
Linux-PPC. How can I write these Addresses? I can work only with few
commands in my Linux-kernel image.

Thanks in advance,

Roberto

^ permalink raw reply

* Re: MPC8xx soft-float userspace ...
From: Dan Malek @ 2005-10-21 14:00 UTC (permalink / raw)
  To: Schaefer-Hutter, Peter; +Cc: linuxppc-embedded
In-Reply-To: <8E342283C2100540AAC5D103097054778A4189@rcexc.racoms.loc>


On Oct 21, 2005, at 5:31 AM, Schaefer-Hutter, Peter wrote:

> Due to the fact that the in-kernel FPU emulation looks
> broken on MPC8xx i want to build a complete soft-float
> userspace.

How does it "look broken?"  It's always worked for me :-)

> ....  Does anybody have some pointers what else
> needs to be removed?

Well, if you found it, you should be able to trace this to a
source file and remove it, right?

Thanks.

	-- Dan

^ permalink raw reply

* Re: Three-Speed Ethernet support on MPC8560 (TSEC)
From: Kumar Gala @ 2005-10-21 13:39 UTC (permalink / raw)
  To: Nathael PAJANI; +Cc: linuxppc-embedded
In-Reply-To: <4358DD4C.7020507@cpe.fr>


On Oct 21, 2005, at 7:21 AM, Nathael PAJANI wrote:

> Hi all!
>
> I'm working on a port of linux (2.6.13-2) on an Actis-computer board,
> based on the Freescale MPC8560 Processor.
>
> I solved the problems I had with the init process, and I actually have
> the console (SCC1) and one ethernet controler (FCC3) running.
>
> I will now go on with the Three-Speed Ethernet Controler, and there
> actually seem to be no support for it, but maybe I did not look at the
> right place?

The TSEC has been supported for a long time.  The driver is call  
gianfar (drivers/net/gianfar*).

> I got another question, about the FCC driver: it uses a "big"  
> structure
> "fcc_enet_t" wich seems to be aimed at stats. This is initialised,  
> but I
> did not find where this is used. Is it?

The FCC enet driver has been completely rewritten recently and is in  
the process of being accepted into the kernel.  Hopefully one of the  
guys with more knowledge on the details will be able to help you on  
the specifics.

- kumar

^ permalink raw reply

* [PATCH][RFT] Make PPC7450Features useable
From: Rupert Eibauer @ 2005-10-21 12:17 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: rupert

(Please CC to me, I am not subscribed)

Hello,

This patch makes 3 of the 7450 features useable. These are:

- High BAT (BATs 4-7)
- Extended BAT Block Size (In this mode a BAT can cover
  up to 4GB)
- 36-Bit Physical addressing with BATs

I was able to test the High BAT and the 36-Bit addressing on a
7447A, for the large BAT, I don't have enough memory. Maybe somebody
with at least 512 MB of memory should test it.

I don't have much experience in submitting, kernel patches, so
if there is anything wrong with my patch, please point it out.

However, I did not manage to adjust the page tables to do the
same trick (36-Bit Addressing). The page tables seem a lot more
magic to me.

Here is the patch:

diff -urN linux-2.6.13.3.orig/arch/ppc/Kconfig linux-2.6.13.3/arch/ppc/Kconfig
--- linux-2.6.13.3.orig/arch/ppc/Kconfig	Fri Oct 21 05:42:59 2005
+++ linux-2.6.13.3/arch/ppc/Kconfig	Fri Oct 21 05:53:49 2005
@@ -115,14 +115,28 @@
 	default y if E500 && PHYS_64BIT
 
 config PHYS_64BIT
-	bool 'Large physical address support' if E500
-	depends on 44x || E500
+	bool 'Large physical address support' if E500 || 6xx
+	depends on 44x || E500 || 6xx
 	default y if 44x
 	---help---
 	  This option enables kernel support for larger than 32-bit physical
 	  addresses.  This features is not be available on all e500 cores.
 
 	  If in doubt, say N here.
+
+config PPC_LARGE_BATS
+	bool 'Extended BAT Block Bize Support' if 6xx
+	depends on 6xx
+	---help---
+	 This option enables kernel support for large BAT
+	 addressing mode, which is present on some 7450 chips.
+
+config PPC_HIGH_BATS
+	bool 'High BAT Support' if 6xx
+	depends on 6xx
+	---help---
+	 This option enables kernel support for the 4 additional
+	 BATS, which is present on some 7450 chips.
 
 config ALTIVEC
 	bool "AltiVec Support"
diff -urN linux-2.6.13.3.orig/arch/ppc/kernel/cpu_setup_6xx.S linux-2.6.13.3/arch/ppc/kernel/cpu_setup_6xx.S
--- linux-2.6.13.3.orig/arch/ppc/kernel/cpu_setup_6xx.S	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/kernel/cpu_setup_6xx.S	Fri Oct 21 05:53:49 2005
@@ -229,13 +229,19 @@
 	 */
 	ori	r11,r11,HID0_SGE | HID0_FOLD | HID0_BHTE
 	ori	r11,r11,HID0_LRSTK | HID0_BTIC
-	oris	r11,r11,HID0_DPM@h
+	oris	r11,r11,HID0_DPM@h | HID0_XAEN@h
 BEGIN_FTR_SECTION
 	xori	r11,r11,HID0_BTIC
 END_FTR_SECTION_IFSET(CPU_FTR_NO_BTIC)
 BEGIN_FTR_SECTION
 	xoris	r11,r11,HID0_DPM@h	/* disable dynamic power mgmt */
 END_FTR_SECTION_IFSET(CPU_FTR_NO_DPM)
+BEGIN_FTR_SECTION
+	xoris	r11,r11,HID0_XAEN@h
+END_FTR_SECTION_IFCLR(CPU_FTR_BIG_PHYS)
+BEGIN_FTR_SECTION
+	ori	r11,r11,HID0_XBSEN
+END_FTR_SECTION_IFSET(CPU_FTR_LARGE_BATS)
 
 	/* All of the bits we have to clear....
 	 */
diff -urN linux-2.6.13.3.orig/arch/ppc/kernel/cputable.c linux-2.6.13.3/arch/ppc/kernel/cputable.c
--- linux-2.6.13.3.orig/arch/ppc/kernel/cputable.c	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/kernel/cputable.c	Fri Oct 21 05:53:49 2005
@@ -62,6 +62,18 @@
 #define PPC_FEATURE_SPE_COMP       	0
 #endif
 
+#ifdef CONFIG_PPC_LARGE_BATS
+#define CPU_FTR_LARGE_BATS_COMP		CPU_FTR_LARGE_BATS
+#else
+#define CPU_FTR_LARGE_BATS_COMP		0
+#endif
+
+#ifndef CONFIG_PHYS_64BIT
+#define CPU_FTR_BIG_PHYS_COMP		CPU_FTR_BIG_PHYS
+#else
+#define CPU_FTR_BIG_PHYS_COMP		0
+#endif
+
 /* We need to mark all pages as being coherent if we're SMP or we
  * have a 74[45]x and an MPC107 host bridge.
  */
@@ -428,6 +440,7 @@
 			CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
 			CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -445,6 +458,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -462,6 +476,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -478,6 +493,7 @@
 			CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
 			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
@@ -496,6 +512,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -513,6 +530,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -529,6 +547,7 @@
 			CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
 			CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
diff -urN linux-2.6.13.3.orig/arch/ppc/kernel/head.S linux-2.6.13.3/arch/ppc/kernel/head.S
--- linux-2.6.13.3.orig/arch/ppc/kernel/head.S	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/kernel/head.S	Fri Oct 21 05:53:49 2005
@@ -1165,6 +1165,14 @@
 	LOAD_BAT(1,r3,r4,r5)
 	LOAD_BAT(2,r3,r4,r5)
 	LOAD_BAT(3,r3,r4,r5)
+#ifdef CONFIG_PPC_HIGH_BATS
+BEGIN_FTR_SECTION
+	LOAD_BAT(4,r3,r4,r5)
+	LOAD_BAT(5,r3,r4,r5)
+	LOAD_BAT(6,r3,r4,r5)
+	LOAD_BAT(7,r3,r4,r5)
+END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
+#endif /* CONFIG_PPC_HIGH_BATS */
 #endif /* CONFIG_POWER4 */
 	blr
 
diff -urN linux-2.6.13.3.orig/arch/ppc/mm/pgtable.c linux-2.6.13.3/arch/ppc/mm/pgtable.c
--- linux-2.6.13.3.orig/arch/ppc/mm/pgtable.c	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/mm/pgtable.c	Fri Oct 21 05:53:49 2005
@@ -55,8 +55,8 @@
 
 #ifdef HAVE_BATS
 extern unsigned long v_mapped_by_bats(unsigned long va);
-extern unsigned long p_mapped_by_bats(unsigned long pa);
-void setbat(int index, unsigned long virt, unsigned long phys,
+extern unsigned long p_mapped_by_bats(phys_addr_t pa);
+void setbat(int index, unsigned long virt, phys_addr_t phys,
 	    unsigned int size, int flags);
 
 #else /* !HAVE_BATS */
@@ -339,7 +339,7 @@
 	/*
 	 * Use a BAT for this if possible...
 	 */
-	if (io_bat_index < 2 && is_power_of_2(size)
+	if (io_bat_index < (ppc_bat_count() - 2) && is_power_of_2(size)
 	    && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) {
 		setbat(io_bat_index, virt, phys, size, flags);
 		++io_bat_index;
diff -urN linux-2.6.13.3.orig/arch/ppc/mm/ppc_mmu.c linux-2.6.13.3/arch/ppc/mm/ppc_mmu.c
--- linux-2.6.13.3.orig/arch/ppc/mm/ppc_mmu.c	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/mm/ppc_mmu.c	Fri Oct 21 05:53:49 2005
@@ -36,6 +36,7 @@
 #include "mmu_decl.h"
 #include "mem_pieces.h"
 
+
 PTE *Hash, *Hash_end;
 unsigned long Hash_size, Hash_mask;
 unsigned long _SDR1;
@@ -47,13 +48,13 @@
 #else
 	u32	word[2];
 #endif
-} BATS[4][2];			/* 4 pairs of IBAT, DBAT */
+} BATS[PPC_BAT_COUNT][2];			/* 4 pairs of IBAT, DBAT */
 
 struct batrange {		/* stores address ranges mapped by BATs */
 	unsigned long start;
 	unsigned long limit;
-	unsigned long phys;
-} bat_addrs[4];
+	phys_addr_t phys;
+} bat_addrs[PPC_BAT_COUNT];
 
 /*
  * Return PA for this VA if it is mapped by a BAT, or 0
@@ -61,7 +62,7 @@
 unsigned long v_mapped_by_bats(unsigned long va)
 {
 	int b;
-	for (b = 0; b < 4; ++b)
+	for (b = 0; b < PPC_BAT_COUNT; ++b)
 		if (va >= bat_addrs[b].start && va < bat_addrs[b].limit)
 			return bat_addrs[b].phys + (va - bat_addrs[b].start);
 	return 0;
@@ -70,10 +71,10 @@
 /*
  * Return VA for a given PA or 0 if not mapped
  */
-unsigned long p_mapped_by_bats(unsigned long pa)
+unsigned long p_mapped_by_bats(phys_addr_t pa)
 {
 	int b;
-	for (b = 0; b < 4; ++b)
+	for (b = 0; b < PPC_BAT_COUNT; ++b)
 		if (pa >= bat_addrs[b].phys
 	    	    && pa < (bat_addrs[b].limit-bat_addrs[b].start)
 		              +bat_addrs[b].phys)
@@ -87,13 +88,14 @@
 	return 0;
 #else
 	unsigned long tot, bl, done;
-	unsigned long max_size = (256<<20);
+	unsigned long max_size = max_bat_size();
 	unsigned long align;
+	int bat_nbr = ppc_bat_count() - 2;
 
 	if (__map_without_bats)
 		return 0;
 
-	/* Set up BAT2 and if necessary BAT3 to cover RAM. */
+	/* Set up BAT[2|6] and if necessary BAT[3|7] to cover RAM. */
 
 	/* Make sure we don't map a block larger than the
 	   smallest alignment of the physical address. */
@@ -109,16 +111,17 @@
 			break;
 	}
 
-	setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
-	done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
-	if ((done < tot) && !bat_addrs[3].limit) {
-		/* use BAT3 to cover a bit more */
+	setbat(bat_nbr, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
+	done = (unsigned long)bat_addrs[bat_nbr].limit - KERNELBASE + 1;
+	bat_nbr++;
+	if ((done < tot) && !bat_addrs[bat_nbr].limit) {
+		/* use BAT[3|7] to cover a bit more */
 		tot -= done;
 		for (bl = 128<<10; bl < max_size; bl <<= 1)
 			if (bl * 2 > tot)
 				break;
-		setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
-		done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
+		setbat(bat_nbr, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
+		done = (unsigned long)bat_addrs[bat_nbr].limit - KERNELBASE + 1;
 	}
 
 	return done;
@@ -130,7 +133,7 @@
  * The parameters are not checked; in particular size must be a power
  * of 2 between 128k and 256M.
  */
-void __init setbat(int index, unsigned long virt, unsigned long phys,
+void __init setbat(int index, unsigned long virt, phys_addr_t phys,
 		   unsigned int size, int flags)
 {
 	unsigned int bl;
@@ -148,6 +151,9 @@
 		wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
 				   | _PAGE_COHERENT | _PAGE_GUARDED);
 		wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
+#ifdef CONFIG_PHYS_64BIT
+		wimgxpp |= ((phys >> 30) & 4) | ((phys >> 24) & 0xe00);
+#endif
 		bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
 		bat[1].word[1] = phys | wimgxpp;
 #ifndef CONFIG_KGDB /* want user access for breakpoints */
diff -urN linux-2.6.13.3.orig/include/asm-ppc/cputable.h linux-2.6.13.3/include/asm-ppc/cputable.h
--- linux-2.6.13.3.orig/include/asm-ppc/cputable.h	Thu Jun 30 01:00:53 2005
+++ linux-2.6.13.3/include/asm-ppc/cputable.h	Fri Oct 21 05:53:49 2005
@@ -89,6 +89,7 @@
 #define CPU_FTR_NEED_COHERENT		0x00020000
 #define CPU_FTR_NO_BTIC			0x00040000
 #define CPU_FTR_BIG_PHYS		0x00080000
+#define CPU_FTR_LARGE_BATS		0x00100000
 
 #ifdef __ASSEMBLY__
 
diff -urN linux-2.6.13.3.orig/include/asm-ppc/mmu.h linux-2.6.13.3/include/asm-ppc/mmu.h
--- linux-2.6.13.3.orig/include/asm-ppc/mmu.h	Fri Oct 21 05:44:49 2005
+++ linux-2.6.13.3/include/asm-ppc/mmu.h	Fri Oct 21 05:53:49 2005
@@ -18,11 +18,30 @@
 #ifndef CONFIG_PHYS_64BIT
 typedef unsigned long phys_addr_t;
 #define PHYS_FMT	"%.8lx"
+#define cpu_has_bigphys() 0
 #else
 typedef unsigned long long phys_addr_t;
 extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t);
 #define PHYS_FMT	"%16Lx"
+#define cpu_has_bigphys() cpu_has_feature(CPU_FTR_BIG_PHYS)
 #endif
+
+#ifdef CONFIG_PPC_LARGE_BATS
+/* We don't allow 4G Bat's because it doesn't fit into size_t */
+#define max_bat_size() (cpu_has_feature(CPU_FTR_LARGE_BATS)?(2<<30):(256<<20))
+#else
+#define max_bat_size() (256<<20)
+#endif
+
+/* High BAT support */
+#ifdef CONFIG_PPC_HIGH_BATS
+#define PPC_BAT_COUNT 8
+#define ppc_bat_count() (cpu_has_feature(CPU_FTR_HAS_HIGH_BATS)?8:4)
+#else
+#define PPC_BAT_COUNT 4
+#define ppc_bat_count() (4)
+#endif
+
 
 /* Default "unsigned long" context */
 typedef unsigned long mm_context_t;

^ permalink raw reply

* Re: [PATCH][RFT] please use this one
From: Rupert Eibauer @ 2005-10-21 12:42 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <200510211417.49651.rupert@ces.ch>

Hello,

Please try this one. The first one contained a last-second
fix which I didn't test if it compiles.

Regards,
Rupert

diff -urN linux-2.6.13.3.orig/arch/ppc/Kconfig linux-2.6.13.3/arch/ppc/Kconfig
--- linux-2.6.13.3.orig/arch/ppc/Kconfig	Fri Oct 21 05:42:59 2005
+++ linux-2.6.13.3/arch/ppc/Kconfig	Fri Oct 21 05:53:49 2005
@@ -115,14 +115,28 @@
 	default y if E500 && PHYS_64BIT
 
 config PHYS_64BIT
-	bool 'Large physical address support' if E500
-	depends on 44x || E500
+	bool 'Large physical address support' if E500 || 6xx
+	depends on 44x || E500 || 6xx
 	default y if 44x
 	---help---
 	  This option enables kernel support for larger than 32-bit physical
 	  addresses.  This features is not be available on all e500 cores.
 
 	  If in doubt, say N here.
+
+config PPC_LARGE_BATS
+	bool 'Extended BAT Block Bize Support' if 6xx
+	depends on 6xx
+	---help---
+	 This option enables kernel support for large BAT
+	 addressing mode, which is present on some 7450 chips.
+
+config PPC_HIGH_BATS
+	bool 'High BAT Support' if 6xx
+	depends on 6xx
+	---help---
+	 This option enables kernel support for the 4 additional
+	 BATS, which is present on some 7450 chips.
 
 config ALTIVEC
 	bool "AltiVec Support"
diff -urN linux-2.6.13.3.orig/arch/ppc/kernel/cpu_setup_6xx.S linux-2.6.13.3/arch/ppc/kernel/cpu_setup_6xx.S
--- linux-2.6.13.3.orig/arch/ppc/kernel/cpu_setup_6xx.S	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/kernel/cpu_setup_6xx.S	Fri Oct 21 05:53:49 2005
@@ -229,13 +229,19 @@
 	 */
 	ori	r11,r11,HID0_SGE | HID0_FOLD | HID0_BHTE
 	ori	r11,r11,HID0_LRSTK | HID0_BTIC
-	oris	r11,r11,HID0_DPM@h
+	oris	r11,r11,(HID0_DPM | HID0_XAEN)@h
 BEGIN_FTR_SECTION
 	xori	r11,r11,HID0_BTIC
 END_FTR_SECTION_IFSET(CPU_FTR_NO_BTIC)
 BEGIN_FTR_SECTION
 	xoris	r11,r11,HID0_DPM@h	/* disable dynamic power mgmt */
 END_FTR_SECTION_IFSET(CPU_FTR_NO_DPM)
+BEGIN_FTR_SECTION
+	xoris	r11,r11,HID0_XAEN@h
+END_FTR_SECTION_IFCLR(CPU_FTR_BIG_PHYS)
+BEGIN_FTR_SECTION
+	ori	r11,r11,HID0_XBSEN
+END_FTR_SECTION_IFSET(CPU_FTR_LARGE_BATS)
 
 	/* All of the bits we have to clear....
 	 */
diff -urN linux-2.6.13.3.orig/arch/ppc/kernel/cputable.c linux-2.6.13.3/arch/ppc/kernel/cputable.c
--- linux-2.6.13.3.orig/arch/ppc/kernel/cputable.c	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/kernel/cputable.c	Fri Oct 21 05:53:49 2005
@@ -62,6 +62,18 @@
 #define PPC_FEATURE_SPE_COMP       	0
 #endif
 
+#ifdef CONFIG_PPC_LARGE_BATS
+#define CPU_FTR_LARGE_BATS_COMP		CPU_FTR_LARGE_BATS
+#else
+#define CPU_FTR_LARGE_BATS_COMP		0
+#endif
+
+#ifndef CONFIG_PHYS_64BIT
+#define CPU_FTR_BIG_PHYS_COMP		CPU_FTR_BIG_PHYS
+#else
+#define CPU_FTR_BIG_PHYS_COMP		0
+#endif
+
 /* We need to mark all pages as being coherent if we're SMP or we
  * have a 74[45]x and an MPC107 host bridge.
  */
@@ -428,6 +440,7 @@
 			CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
 			CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -445,6 +458,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -462,6 +476,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -478,6 +493,7 @@
 			CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
 			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
@@ -496,6 +512,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -513,6 +530,7 @@
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
@@ -529,6 +547,7 @@
 			CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
 			CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+			CPU_FTR_BIG_PHYS_COMP | CPU_FTR_LARGE_BATS_COMP |
 			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 		.icache_bsize		= 32,
diff -urN linux-2.6.13.3.orig/arch/ppc/kernel/head.S linux-2.6.13.3/arch/ppc/kernel/head.S
--- linux-2.6.13.3.orig/arch/ppc/kernel/head.S	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/kernel/head.S	Fri Oct 21 05:53:49 2005
@@ -1165,6 +1165,14 @@
 	LOAD_BAT(1,r3,r4,r5)
 	LOAD_BAT(2,r3,r4,r5)
 	LOAD_BAT(3,r3,r4,r5)
+#ifdef CONFIG_PPC_HIGH_BATS
+BEGIN_FTR_SECTION
+	LOAD_BAT(4,r3,r4,r5)
+	LOAD_BAT(5,r3,r4,r5)
+	LOAD_BAT(6,r3,r4,r5)
+	LOAD_BAT(7,r3,r4,r5)
+END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
+#endif /* CONFIG_PPC_HIGH_BATS */
 #endif /* CONFIG_POWER4 */
 	blr
 
diff -urN linux-2.6.13.3.orig/arch/ppc/mm/pgtable.c linux-2.6.13.3/arch/ppc/mm/pgtable.c
--- linux-2.6.13.3.orig/arch/ppc/mm/pgtable.c	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/mm/pgtable.c	Fri Oct 21 05:53:49 2005
@@ -55,8 +55,8 @@
 
 #ifdef HAVE_BATS
 extern unsigned long v_mapped_by_bats(unsigned long va);
-extern unsigned long p_mapped_by_bats(unsigned long pa);
-void setbat(int index, unsigned long virt, unsigned long phys,
+extern unsigned long p_mapped_by_bats(phys_addr_t pa);
+void setbat(int index, unsigned long virt, phys_addr_t phys,
 	    unsigned int size, int flags);
 
 #else /* !HAVE_BATS */
@@ -339,7 +339,7 @@
 	/*
 	 * Use a BAT for this if possible...
 	 */
-	if (io_bat_index < 2 && is_power_of_2(size)
+	if (io_bat_index < (ppc_bat_count() - 2) && is_power_of_2(size)
 	    && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) {
 		setbat(io_bat_index, virt, phys, size, flags);
 		++io_bat_index;
diff -urN linux-2.6.13.3.orig/arch/ppc/mm/ppc_mmu.c linux-2.6.13.3/arch/ppc/mm/ppc_mmu.c
--- linux-2.6.13.3.orig/arch/ppc/mm/ppc_mmu.c	Fri Oct 21 05:49:53 2005
+++ linux-2.6.13.3/arch/ppc/mm/ppc_mmu.c	Fri Oct 21 05:53:49 2005
@@ -36,6 +36,7 @@
 #include "mmu_decl.h"
 #include "mem_pieces.h"
 
+
 PTE *Hash, *Hash_end;
 unsigned long Hash_size, Hash_mask;
 unsigned long _SDR1;
@@ -47,13 +48,13 @@
 #else
 	u32	word[2];
 #endif
-} BATS[4][2];			/* 4 pairs of IBAT, DBAT */
+} BATS[PPC_BAT_COUNT][2];			/* 4 pairs of IBAT, DBAT */
 
 struct batrange {		/* stores address ranges mapped by BATs */
 	unsigned long start;
 	unsigned long limit;
-	unsigned long phys;
-} bat_addrs[4];
+	phys_addr_t phys;
+} bat_addrs[PPC_BAT_COUNT];
 
 /*
  * Return PA for this VA if it is mapped by a BAT, or 0
@@ -61,7 +62,7 @@
 unsigned long v_mapped_by_bats(unsigned long va)
 {
 	int b;
-	for (b = 0; b < 4; ++b)
+	for (b = 0; b < PPC_BAT_COUNT; ++b)
 		if (va >= bat_addrs[b].start && va < bat_addrs[b].limit)
 			return bat_addrs[b].phys + (va - bat_addrs[b].start);
 	return 0;
@@ -70,10 +71,10 @@
 /*
  * Return VA for a given PA or 0 if not mapped
  */
-unsigned long p_mapped_by_bats(unsigned long pa)
+unsigned long p_mapped_by_bats(phys_addr_t pa)
 {
 	int b;
-	for (b = 0; b < 4; ++b)
+	for (b = 0; b < PPC_BAT_COUNT; ++b)
 		if (pa >= bat_addrs[b].phys
 	    	    && pa < (bat_addrs[b].limit-bat_addrs[b].start)
 		              +bat_addrs[b].phys)
@@ -87,13 +88,14 @@
 	return 0;
 #else
 	unsigned long tot, bl, done;
-	unsigned long max_size = (256<<20);
+	unsigned long max_size = max_bat_size();
 	unsigned long align;
+	int bat_nbr = ppc_bat_count() - 2;
 
 	if (__map_without_bats)
 		return 0;
 
-	/* Set up BAT2 and if necessary BAT3 to cover RAM. */
+	/* Set up BAT[2|6] and if necessary BAT[3|7] to cover RAM. */
 
 	/* Make sure we don't map a block larger than the
 	   smallest alignment of the physical address. */
@@ -109,16 +111,17 @@
 			break;
 	}
 
-	setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
-	done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
-	if ((done < tot) && !bat_addrs[3].limit) {
-		/* use BAT3 to cover a bit more */
+	setbat(bat_nbr, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
+	done = (unsigned long)bat_addrs[bat_nbr].limit - KERNELBASE + 1;
+	bat_nbr++;
+	if ((done < tot) && !bat_addrs[bat_nbr].limit) {
+		/* use BAT[3|7] to cover a bit more */
 		tot -= done;
 		for (bl = 128<<10; bl < max_size; bl <<= 1)
 			if (bl * 2 > tot)
 				break;
-		setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
-		done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
+		setbat(bat_nbr, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
+		done = (unsigned long)bat_addrs[bat_nbr].limit - KERNELBASE + 1;
 	}
 
 	return done;
@@ -130,7 +133,7 @@
  * The parameters are not checked; in particular size must be a power
  * of 2 between 128k and 256M.
  */
-void __init setbat(int index, unsigned long virt, unsigned long phys,
+void __init setbat(int index, unsigned long virt, phys_addr_t phys,
 		   unsigned int size, int flags)
 {
 	unsigned int bl;
@@ -148,6 +151,9 @@
 		wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
 				   | _PAGE_COHERENT | _PAGE_GUARDED);
 		wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
+#ifdef CONFIG_PHYS_64BIT
+		wimgxpp |= ((phys >> 30) & 4) | ((phys >> 24) & 0xe00);
+#endif
 		bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
 		bat[1].word[1] = phys | wimgxpp;
 #ifndef CONFIG_KGDB /* want user access for breakpoints */
diff -urN linux-2.6.13.3.orig/include/asm-ppc/cputable.h linux-2.6.13.3/include/asm-ppc/cputable.h
--- linux-2.6.13.3.orig/include/asm-ppc/cputable.h	Thu Jun 30 01:00:53 2005
+++ linux-2.6.13.3/include/asm-ppc/cputable.h	Fri Oct 21 05:53:49 2005
@@ -89,6 +89,7 @@
 #define CPU_FTR_NEED_COHERENT		0x00020000
 #define CPU_FTR_NO_BTIC			0x00040000
 #define CPU_FTR_BIG_PHYS		0x00080000
+#define CPU_FTR_LARGE_BATS		0x00100000
 
 #ifdef __ASSEMBLY__
 
diff -urN linux-2.6.13.3.orig/include/asm-ppc/mmu.h linux-2.6.13.3/include/asm-ppc/mmu.h
--- linux-2.6.13.3.orig/include/asm-ppc/mmu.h	Fri Oct 21 05:44:49 2005
+++ linux-2.6.13.3/include/asm-ppc/mmu.h	Fri Oct 21 05:53:49 2005
@@ -18,11 +18,30 @@
 #ifndef CONFIG_PHYS_64BIT
 typedef unsigned long phys_addr_t;
 #define PHYS_FMT	"%.8lx"
+#define cpu_has_bigphys() 0
 #else
 typedef unsigned long long phys_addr_t;
 extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t);
 #define PHYS_FMT	"%16Lx"
+#define cpu_has_bigphys() cpu_has_feature(CPU_FTR_BIG_PHYS)
 #endif
+
+#ifdef CONFIG_PPC_LARGE_BATS
+/* We don't allow 4G Bat's because it doesn't fit into size_t */
+#define max_bat_size() (cpu_has_feature(CPU_FTR_LARGE_BATS)?(2<<30):(256<<20))
+#else
+#define max_bat_size() (256<<20)
+#endif
+
+/* High BAT support */
+#ifdef CONFIG_PPC_HIGH_BATS
+#define PPC_BAT_COUNT 8
+#define ppc_bat_count() (cpu_has_feature(CPU_FTR_HAS_HIGH_BATS)?8:4)
+#else
+#define PPC_BAT_COUNT 4
+#define ppc_bat_count() (4)
+#endif
+
 
 /* Default "unsigned long" context */
 typedef unsigned long mm_context_t;

^ permalink raw reply

* Three-Speed Ethernet support on MPC8560 (TSEC)
From: Nathael PAJANI @ 2005-10-21 12:21 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all!

I'm working on a port of linux (2.6.13-2) on an Actis-computer board, 
based on the Freescale MPC8560 Processor.

I solved the problems I had with the init process, and I actually have 
the console (SCC1) and one ethernet controler (FCC3) running.

I will now go on with the Three-Speed Ethernet Controler, and there 
actually seem to be no support for it, but maybe I did not look at the 
right place?

I got another question, about the FCC driver: it uses a "big" structure 
"fcc_enet_t" wich seems to be aimed at stats. This is initialised, but I 
did not find where this is used. Is it?

Thanks.

^ permalink raw reply

* Re: kgdb support in Linux 2.6 for 8xx
From: Vitaly Bordug @ 2005-10-21 12:15 UTC (permalink / raw)
  To: Chris; +Cc: linuxppc-embedded list
In-Reply-To: <4358C4AC.2070900@2net.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

Hi!
Chris wrote:
> Hi,
> 
> It would be nice to be able to do some kernel debugging on my TQM823L 
> board running 2.6 (2.6.13.1, to be exact). I have two questions
> 
> 1. Has anyone got kgdboe working in this configuration? If so, could you 
> give me a pointer to a patch?
> 
Not exactly. I have implemented support for KGDB on cpm_uart driven 
boards (most of 8xx use it), but it is only tested on 827x family. 
Anyway, 8xx should work with minimal changes.
> 2. kgdb over serial is lacking the getDebugChar and putDebugChar 
> functions that used to be in 8xx_io/uart.c. Has anyone done any work on 
> merging them into 2.6?
> 
There is a kgdb community project - http://kgdb.sf.net. The attached 
patch  is for this one (it has been submitted but not in the CVS so far).
> [OK, that's actually three questions. One just crept in]
> 
> Thanks in advance,
> Chris
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 


-- 
Sincerely,
Vitaly

[-- Attachment #2: cpm_uart_kgdb.patch --]
[-- Type: text/x-patch, Size: 14395 bytes --]

This add support for KGDB using cpm_uart driver. 
Should work on all the boards utilizing it, tested on 8272ADS.

Index: linux-2.6.13.1/drivers/serial/cpm_uart/Makefile
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/Makefile
+++ linux-2.6.13.1/drivers/serial/cpm_uart/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_SERIAL_CPM) += cpm_uart.o
 # Select the correct platform objects.
 cpm_uart-objs-$(CONFIG_CPM2)	+= cpm_uart_cpm2.o
 cpm_uart-objs-$(CONFIG_8xx)	+= cpm_uart_cpm1.o
+cpm_uart-objs-$(CONFIG_KGDB)	+= cpm_uart_kgdb.o
 
 cpm_uart-objs	:= cpm_uart_core.o $(cpm_uart-objs-y)
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart.h
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/cpm_uart.h
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart.h
@@ -42,6 +42,38 @@
 
 #define SCC_WAIT_CLOSING 100
 
+#ifdef CONFIG_KGDB
+
+/* Speed of the debug UART. */
+#if defined(CONFIG_KGDB_9600BAUD)
+#define KGDB_BAUD B9600
+#elif defined(CONFIG_KGDB_19200BAUD)
+#define KGDB_BAUD B19200
+#elif defined(CONFIG_KGDB_38400BAUD)
+#define KGDB_BAUD B38400
+#elif defined(CONFIG_KGDB_57600BAUD)
+#define KGDB_BAUD B57600
+#else
+#define KGDB_BAUD B115200	/* Start with this if not given */
+#endif
+
+#ifdef CONFIG_KGDB_CPM_UART_SCC1
+#define KGDB_PINFO_INDEX 	UART_SCC1
+#elif CONFIG_KGDB_CPM_UART_SCC2
+#define KGDB_PINFO_INDEX	UART_SCC2
+#elif CONFIG_KGDB_CPM_UART_SCC3
+#define KGDB_PINFO_INDEX	UART_SCC3
+#elif CONFIG_KGDB_CPM_UART_SCC4
+#define KGDB_PINFO_INDEX	UART_SCC4
+#elif CONFIG_KGDB_CPM_UART_SMC1
+#define KGDB_PINFO_INDEX	UART_SMC1
+#elif CONFIG_KGDB_CPM_UART_SMC2
+#define KGDB_PINFO_INDEX	UART_SMC2
+#error The S(M)CC for kgdb console is undefined
+#endif
+
+#endif /* CONFIG_KGDB */
+
 struct uart_cpm_port {
 	struct uart_port	port;
 	u16			rx_nrfifos;
@@ -77,6 +109,9 @@ extern int cpm_uart_port_map[UART_NR];
 extern int cpm_uart_nr;
 extern struct uart_cpm_port cpm_uart_ports[UART_NR];
 
+void cpm_uart_early_write(int index, const char *s, u_int count);
+int cpm_uart_early_setup(int index,int early);
+
 /* these are located in their respective files */
 void cpm_line_cr_cmd(int line, int cmd);
 int cpm_uart_init_portdesc(void);
@@ -90,4 +125,19 @@ void scc2_lineif(struct uart_cpm_port *p
 void scc3_lineif(struct uart_cpm_port *pinfo);
 void scc4_lineif(struct uart_cpm_port *pinfo);
 
+static inline unsigned long cpu2cpm_addr(void *addr)
+{
+	if ((unsigned long)addr >= CPM_ADDR)
+		return (unsigned long)addr;
+	return virt_to_bus(addr);
+}
+
+static inline void *cpm2cpu_addr(unsigned long addr)
+{
+	if (addr >= CPM_ADDR)
+		return (void *)addr;
+	return bus_to_virt(addr);
+}
+
+
 #endif /* CPM_UART_H */
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_core.c
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/cpm_uart_core.c
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -71,20 +71,6 @@ static void cpm_uart_initbd(struct uart_
 
 /**************************************************************/
 
-static inline unsigned long cpu2cpm_addr(void *addr)
-{
-	if ((unsigned long)addr >= CPM_ADDR)
-		return (unsigned long)addr;
-	return virt_to_bus(addr);
-}
-
-static inline void *cpm2cpu_addr(unsigned long addr)
-{
-	if (addr >= CPM_ADDR)
-		return (void *)addr;
-	return bus_to_virt(addr);
-}
-
 /*
  * Check, if transmit buffers are processed
 */
@@ -992,22 +978,17 @@ struct uart_cpm_port cpm_uart_ports[UART
 	},
 };
 
-#ifdef CONFIG_SERIAL_CPM_CONSOLE
-/*
- *	Print a string to the serial port trying not to disturb
- *	any possible real use of the port...
- *
- *	Note that this is called with interrupts already disabled
- */
-static void cpm_uart_console_write(struct console *co, const char *s,
+void cpm_uart_early_write(int index, const char *s,
 				   u_int count)
 {
-	struct uart_cpm_port *pinfo =
-	    &cpm_uart_ports[cpm_uart_port_map[co->index]];
+	struct uart_cpm_port *pinfo;
 	unsigned int i;
 	volatile cbd_t *bdp, *bdbase;
 	volatile unsigned char *cp;
 
+	BUG_ON(index>UART_NR);
+	pinfo = &cpm_uart_ports[index];
+
 	/* Get the address of the host memory buffer.
 	 */
 	bdp = pinfo->tx_cur;
@@ -1071,36 +1052,16 @@ static void cpm_uart_console_write(struc
 	pinfo->tx_cur = (volatile cbd_t *) bdp;
 }
 
-/*
- * Setup console. Be careful is called early !
- */
-static int __init cpm_uart_console_setup(struct console *co, char *options)
+int cpm_uart_early_setup(int index, int early)
 {
+	int ret;
 	struct uart_port *port;
 	struct uart_cpm_port *pinfo;
-	int baud = 38400;
-	int bits = 8;
-	int parity = 'n';
-	int flow = 'n';
-	int ret;
 
+	BUG_ON(index>UART_NR);
 	port =
-	    (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
+	    (struct uart_port *)&cpm_uart_ports[index];
 	pinfo = (struct uart_cpm_port *)port;
-
-	pinfo->flags |= FLAG_CONSOLE;
-
-	if (options) {
-		uart_parse_options(options, &baud, &parity, &bits, &flow);
-	} else {
-		bd_t *bd = (bd_t *) __res;
-
-		if (bd->bi_baudrate)
-			baud = bd->bi_baudrate;
-		else
-			baud = 9600;
-	}
-
 	/*
 	 * Setup any port IO, connect any baud rate generators,
 	 * etc.  This is expected to be handled by board
@@ -1108,7 +1069,6 @@ static int __init cpm_uart_console_setup
 	 */
 	if (pinfo->set_lineif)
 		pinfo->set_lineif(pinfo);
-
 	if (IS_SMC(pinfo)) {
 		pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
 		pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
@@ -1116,8 +1076,7 @@ static int __init cpm_uart_console_setup
 		pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
 		pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
 	}
-
-	ret = cpm_uart_allocbuf(pinfo, 1);
+	ret = cpm_uart_allocbuf(pinfo, early);
 
 	if (ret)
 		return ret;
@@ -1129,6 +1088,56 @@ static int __init cpm_uart_console_setup
 	else
 		cpm_uart_init_scc(pinfo);
 
+	return 0;
+}
+
+#ifdef CONFIG_SERIAL_CPM_CONSOLE
+/*
+ *	Print a string to the serial port trying not to disturb
+ *	any possible real use of the port...
+ *
+ *	Note that this is called with interrupts already disabled
+ */
+
+static void cpm_uart_console_write(struct console *co, const char *s,
+				   u_int count)
+{
+	cpm_uart_early_write(cpm_uart_port_map[co->index],s,count);
+}
+
+/*
+ * Setup console. Be careful is called early !
+ */
+static int __init cpm_uart_console_setup(struct console *co, char *options)
+{
+	struct uart_port *port;
+	struct uart_cpm_port *pinfo;
+	int baud = 115200;
+	int bits = 8;
+	int parity = 'n';
+	int flow = 'n';
+	int ret;
+
+	port =
+	    (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
+	pinfo = (struct uart_cpm_port *)port;
+
+	pinfo->flags |= FLAG_CONSOLE;
+
+	if (options) {
+		uart_parse_options(options, &baud, &parity, &bits, &flow);
+	} else {
+		bd_t *bd = (bd_t *) __res;
+
+		if (bd->bi_baudrate)
+			baud = bd->bi_baudrate;
+		else
+			baud = 9600;
+	}
+
+	ret = cpm_uart_early_setup(cpm_uart_port_map[co->index], 1);
+	if(ret)
+		return ret;
 	uart_set_options(port, co, baud, parity, bits, flow);
 
 	return 0;
@@ -1190,6 +1199,10 @@ static int __init cpm_uart_init(void)
 
 	for (i = 0; i < cpm_uart_nr; i++) {
 		int con = cpm_uart_port_map[i];
+
+		/* We are not interested in ports yet utilized by kgdb */
+		if(con == KGDB_PINFO_INDEX)
+			continue;
 		cpm_uart_ports[con].port.line = i;
 		cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF;
 		uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port);
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_cpm2.c
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -252,6 +252,10 @@ int cpm_uart_init_portdesc(void)
 {
 	pr_debug("CPM uart[-]:init portdesc\n");
 
+	/* Check if we have called this yet. This may happen if early kgdb
+	breakpoint is on */
+	if(cpm_uart_nr)
+		return 0;
 	cpm_uart_nr = 0;
 #ifdef CONFIG_SERIAL_CPM_SMC1
 	cpm_uart_ports[UART_SMC1].smcp = (smc_t *) & cpm2_immr->im_smc[0];
Index: linux-2.6.13.1/lib/Kconfig.debug
===================================================================
--- linux-2.6.13.1.orig/lib/Kconfig.debug
+++ linux-2.6.13.1/lib/Kconfig.debug
@@ -196,6 +196,7 @@ choice
 	default KGDB_8250_NOMODULE
 	default KGDB_SIBYTE if SIBYTE_SB1xxx_SOC
 	default KGDB_MPSC if SERIAL_MPSC
+	default KGDB_CPM_UART if (8xx || 8260)
 	help
 	  There are a number of different ways in which you can communicate
 	  with KGDB.  The most common is via serial, with the 8250 driver
@@ -221,6 +222,11 @@ config KGDB_8250_NOMODULE
 	  GDB.  This is independent of the normal (SERIAL_8250) driver
 	  for this chipset.
 
+config KGDB_CPM_UART
+ 	bool "KGDB: On CPM UART"
+ 	help
+ 	  Uses CPM UART to communicate with the host GDB.
+
 config KGDBOE_NOMODULE
 	bool "KGDB: On ethernet - in kernel"
 	select KGDBOE
@@ -247,6 +253,62 @@ config KGDB_SIBYTE
 
 endchoice
 
+choice
+ 	prompt "  SCC/SMC for KGDB console"
+ 	depends on KGDB_CPM_UART
+ 	default KGDB_CPM_UART_SCC4 if ADS8272
+
+config KGDB_CPM_UART_SCC1
+ 	bool "Use SCC1 for KGDB"
+ 	depends on SERIAL_CPM_SCC1
+
+config KGDB_CPM_UART_SCC2
+ 	bool "Use SCC2 for KGDB"
+ 	depends on SERIAL_CPM_SCC2
+
+config KGDB_CPM_UART_SCC3
+ 	bool "Use SCC3 for KGDB"
+ 	depends on SERIAL_CPM_SCC3
+
+config KGDB_CPM_UART_SCC4
+ 	bool "Use SCC4 for KGDB"
+ 	depends on SERIAL_CPM_SCC4
+
+config KGDB_CPM_UART_SMC1
+ 	bool "Use SMC1 for KGDB"
+ 	depends on SERIAL_CPM_SMC1
+
+config KGDB_CPM_UART_SMC2
+ 	bool "Use SMC2 for KGDB"
+ 	depends on SERIAL_CPM_SMC2
+
+endchoice
+
+choice
+	depends on KGDB && !KGDB_ETH
+    	prompt "Debug serial port BAUD"
+	default KGDB_115200BAUD
+	help
+	  gdb and the kernel stub need to agree on the baud rate to be
+	  used.  Standard rates from 9600 to 115200 are allowed, and this
+	  may be overridden via the commandline.
+
+config KGDB_9600BAUD
+	bool "9600"
+
+config KGDB_19200BAUD
+	bool "19200"
+
+config KGDB_38400BAUD
+	bool "38400"
+
+config KGDB_57600BAUD
+	bool "57600"
+
+config KGDB_115200BAUD
+	bool "115200"
+endchoice
+
 config KGDBOE
 	tristate "KGDB: On ethernet" if !KGDBOE_NOMODULE
 	depends on m && KGDB_ONLY_MODULES
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_kgdb.c
===================================================================
--- /dev/null
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_kgdb.c
@@ -0,0 +1,191 @@
+/*
+ * drivers/serial/cpm_uart/cpm_uart_kgdb.c
+ *
+ * CPM UART interface for kgdb.
+ *
+ * Author: Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * Used some bits from drivers/serial/kgdb_8250.c as a template
+ *
+ * 2005 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/kgdb.h>
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/tty.h>
+#include <linux/serial.h>
+#include <linux/serial_core.h>
+#include <linux/serial_reg.h>
+
+#include <asm/io.h>
+#include <asm/serial.h>		/* For BASE_BAUD and SERIAL_PORT_DFNS */
+
+#include "cpm_uart.h"
+
+#define GDB_BUF_SIZE	512	/* power of 2, please */
+
+
+static char kgdb_buf[GDB_BUF_SIZE], *kgdbp;
+static int kgdb_chars;
+
+/* Forward declarations. */
+
+/*
+ * Receive character from the serial port.  This only works well
+ * before the port is initialize for real use.
+ */
+static int kgdb_wait_key(char *obuf)
+{
+	struct uart_cpm_port *pinfo;
+
+	u_char				c, *cp;
+	volatile	cbd_t		*bdp;
+	int				i;
+
+	pinfo = &cpm_uart_ports[KGDB_PINFO_INDEX];
+
+	/* Get the address of the host memory buffer.
+	 */
+	bdp = pinfo->rx_cur;
+	while (bdp->cbd_sc & BD_SC_EMPTY);
+
+	/* If the buffer address is in the CPM DPRAM, don't
+	 * convert it.
+	 */
+	cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+
+	if (obuf) {
+		i = c = bdp->cbd_datlen;
+		while (i-- > 0)
+		{
+			*obuf++ = *cp++;
+		}
+	} else {
+		c = *cp;
+	}
+	bdp->cbd_sc |= BD_SC_EMPTY;
+
+	if (bdp->cbd_sc & BD_SC_WRAP) {
+		bdp = pinfo->rx_bd_base;
+	} else {
+		bdp++;
+	}
+	pinfo->rx_cur = (cbd_t *)bdp;
+
+	return((int)c);
+}
+
+
+/*
+ * Wait until the interface can accept a char, then write it.
+ */
+static void
+kgdb_put_debug_char(int chr)
+{
+	static char ch[2];
+	ch[0]=(char)chr;
+	cpm_uart_early_write(KGDB_PINFO_INDEX, ch, 1);
+}
+
+
+/*
+ * Get a char if available, return -1 if nothing available.
+ * Empty the receive buffer first, then look at the interface hardware.
+ */
+static int
+kgdb_get_debug_char(void)
+{
+	if (kgdb_chars<=0) {
+		kgdb_chars = kgdb_wait_key(kgdb_buf);
+		kgdbp = kgdb_buf;
+	}
+	kgdb_chars--;
+
+	return (*kgdbp++);
+}
+
+static void termios_set_options(int index,
+		 int baud, int parity, int bits, int flow)
+{
+	struct termios termios;
+	struct uart_port *port;
+	struct uart_cpm_port *pinfo;
+
+	BUG_ON(index>UART_NR);
+
+	port =
+	    (struct uart_port *)&cpm_uart_ports[index];
+	pinfo = (struct uart_cpm_port *)port;
+
+	/*
+	 * Ensure that the serial console lock is initialised
+	 * early.
+	 */
+	spin_lock_init(&port->lock);
+
+	memset(&termios, 0, sizeof(struct termios));
+
+	termios.c_cflag = CREAD | HUPCL | CLOCAL;
+
+	termios.c_cflag |= baud;
+
+	if (bits == 7)
+		termios.c_cflag |= CS7;
+	else
+		termios.c_cflag |= CS8;
+
+	switch (parity) {
+	case 'o': case 'O':
+		termios.c_cflag |= PARODD;
+		/*fall through*/
+	case 'e': case 'E':
+		termios.c_cflag |= PARENB;
+		break;
+	}
+
+	if (flow == 'r')
+		termios.c_cflag |= CRTSCTS;
+
+	port->ops->set_termios(port, &termios, NULL);
+}
+
+/*
+ *  Returns:
+ *	0 on success, 1 on failure.
+ */
+static int kgdb_init(void)
+{
+	struct uart_port *port;
+	struct uart_cpm_port *pinfo;
+
+	int use_bootmem = 0; /* use dma by default */
+
+	if(!cpm_uart_nr)
+	{
+		use_bootmem = 1;
+		cpm_uart_init_portdesc();
+	}
+	port = (struct uart_port *)&cpm_uart_ports[KGDB_PINFO_INDEX];
+	pinfo = (struct uart_cpm_port *)port;
+
+	if (cpm_uart_early_setup(KGDB_PINFO_INDEX, use_bootmem))
+		return 1;
+
+	termios_set_options(KGDB_PINFO_INDEX, KGDB_BAUD,'n',8,'n');
+	pinfo->sccp->scc_sccm |= UART_SCCM_TX;
+	return 0;
+}
+
+
+struct kgdb_io kgdb_io_ops = {
+	.read_char = kgdb_get_debug_char,
+	.write_char = kgdb_put_debug_char,
+	.init = kgdb_init,
+};
+

^ permalink raw reply

* Re: status of kexec for ppc on 2.6.10, any gotchas?
From: R Sharada @ 2005-10-21 11:02 UTC (permalink / raw)
  To: Christopher Friesen; +Cc: linuxppc-dev, Linux Kernel Mailing List
In-Reply-To: <435876B8.9000706@nortel.com>


	Kexec support involves kernel level support per architecture and 
a user space kexec-tools.

	Generic kexec kernel support for ppc (ppc32/GameCube) was added 
sometime back by Albert Herranz, and I think they got included in 2.6.10-mm1 
as per:
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.10/2.6.10-mm1/broken-out/
	 Albert's code was also posted on this site:
http://www.gc-linux.org/down/isobel/kexec/
	ppc64 kexec kernel support was added recently (2.6.12-rc4-mm1)
	Eric's site can be used for downloading the kexec-tools.
	
	You may want to cross post kexec discussion mails to fastboot@osdl.org,
as that is the primary list where all kexec discussions happen.

Hope this helps
Thanks and Regards,
Sharada

On Thu, Oct 20, 2005 at 11:03:52PM -0600, Christopher Friesen wrote:
> 
> I've been asked to look at kexec for ppc on 2.6.10.  The syscall appears 
> to be present, but there seem to be additional patches for 2.6.10-mm at:
> 
> http://www.xmission.com/~ebiederm/files/kexec/
> 
> Are these patches needed?
> 
> I haven't been able to find any current official documentation, although 
> I found some old stuff from 2.5 and a writeup at:
> 
> http://www-128.ibm.com/developerworks/linux/library/l-kexec.html?ca=dgr-lnxw04RebootFast
> 
> Is there any official HOWTO on this?  Any issues I should look at in 
> particular?
> 
> Thanks for any pointers,
> 
> Chris
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 

^ permalink raw reply

* kgdb support in Linux 2.6 for 8xx
From: Chris @ 2005-10-21 10:36 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

It would be nice to be able to do some kernel debugging on my TQM823L 
board running 2.6 (2.6.13.1, to be exact). I have two questions

1. Has anyone got kgdboe working in this configuration? If so, could you 
give me a pointer to a patch?

2. kgdb over serial is lacking the getDebugChar and putDebugChar 
functions that used to be in 8xx_io/uart.c. Has anyone done any work on 
merging them into 2.6?

[OK, that's actually three questions. One just crept in]

Thanks in advance,
Chris

^ permalink raw reply

* MPC8xx soft-float userspace ...
From: Schaefer-Hutter, Peter @ 2005-10-21  9:31 UTC (permalink / raw)
  To: linuxppc-embedded

Hello!

Due to the fact that the in-kernel FPU emulation looks=20
broken on MPC8xx i want to build a complete soft-float
userspace.

While i was successful in compiling a glibc with -mcpu=3D860
and soft-float (and without memset.S) there's still floating
point in there. Does anybody have some pointers what else
needs to be removed?

TIA and best regards,

 Peter=20

^ permalink raw reply

* Support for MPC8548 processor
From: Rupesh S @ 2005-10-21  8:38 UTC (permalink / raw)
  To: linuxppc-embedded

Hi

Can anyone help me know if there exists any linux kernel that supports =
MPC8548 processor based boards ?
And if it exists, does the kernel support the PCI Express module that is =
there within MPC8548 ?

Thanks in advance


--
Rupesh S

^ permalink raw reply

* Three-Speed Ethernet support on MPC8560 (CPM2 TSEC)
From: Nathael PAJANI @ 2005-10-21  8:05 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all!

I'm working on a port of linux (2.6.13-2) on an Actis-computer board, 
based on the Freescale MPC8560 Processor.

I solved the problems I had with the init process, and I actually have 
the console (SCC1) and one ethernet controler (FCC3) running.

I will now go on with the Three-Speed Ethernet Controler, and there 
actually seem to be no support for it, but maybe I did not look at the 
right place?

I got another question, about the FCC driver: it uses a "big" structure 
"fcc_enet_t" wich seems to be aimed at stats. This is initialised, but I 
did not find where this is used. Is it?

Thanks.

^ permalink raw reply

* Re: Starting the arch/powerpc merge
From: Giuliano Pochini @ 2005-10-21  7:19 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev
In-Reply-To: <17221.45591.341270.888791@cargo.ozlabs.ibm.com>


On 06-Oct-2005 Paul Mackerras wrote:

>> Out of curiosity, is there any advantage in using a 32 bits
>> kernel on ppc64 over a 64 bits kernel ?  Speed ?  Complexity ?
>> Compatibility ?  Memory ?
>
> Not really.  The main thing in the past has been that DRI with 32-bit
> X server and clients would work with a 32-bit kernel but not a 64-bit
> kernel, but that's fixed now.  A 64-bit kernel is faster on most
> lmbench tests.  I guess a 32-bit kernel might end up a little smaller,
> but that's the only possible advantage I can think of.

And 32<->64 bits compatibility layer for 32bits apps is not needed,
so maybe they run a bit faster. Well, at this point IMHO 32-on-64
support may be dropped without regrets. Spending time for an useless
thing is - uhm - useless.


> Oops, sorry, mail system breakage here...

My mail wasn't important anyway :))


--
Giuliano.

^ permalink raw reply

* Re: CHRP specifications
From: Sven Luther @ 2005-10-21  5:18 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: linuxppc-dev
In-Reply-To: <f3b993b330f790b539e585aa89c399ab@penguinppc.org>

On Thu, Oct 20, 2005 at 06:33:18PM -0500, Hollis Blanchard wrote:
> On Oct 20, 2005, at 10:17 AM, Sven Luther wrote:
> >
> >BTW, anyone know of where to get the CHRP specs in downloadable html 
> >or pdf or
> >something format. Not the chrp OF bindings, but the real CHRP specs ?
> 
> I believe you've seen this before, but the link is still in the same 
> place... http://penguinppc.org/otherhw/#chrp

ah, yes, remember now,  i even already downloaded it :)

> As I recall, though, the CHRP specification mandates such obsolete 
> features as an ADB controller, so claiming "CHRP compliance" may not be 
> all that special these days. :)

still good for the other features and for documentation.

Friendly,

Sven Luther

^ permalink raw reply

* status of kexec for ppc on 2.6.10, any gotchas?
From: Christopher Friesen @ 2005-10-21  5:03 UTC (permalink / raw)
  To: Linux Kernel Mailing List, linuxppc-dev


I've been asked to look at kexec for ppc on 2.6.10.  The syscall appears 
to be present, but there seem to be additional patches for 2.6.10-mm at:

http://www.xmission.com/~ebiederm/files/kexec/

Are these patches needed?

I haven't been able to find any current official documentation, although 
I found some old stuff from 2.5 and a writeup at:
 
http://www-128.ibm.com/developerworks/linux/library/l-kexec.html?ca=dgr-lnxw04RebootFast

Is there any official HOWTO on this?  Any issues I should look at in 
particular?

Thanks for any pointers,

Chris

^ permalink raw reply

* RE: How to make mudules on linux-ppc2.6.12
From: JohnsonCheng @ 2005-10-21  4:48 UTC (permalink / raw)
  To: linux-ppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]

Thanks for your kindly suggestion. I have found out the problem.

Just do some modification as following:

 

$(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
M=$(PWD) modules

 

Good Luck.!!

 

 

  _____  

From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
Sent: Friday, October 21, 2005 11:36 AM
To: linux-ppc-embedded
Subject: RE: How to make mudules on linux-ppc2.6.12

 

Dear Andy,

 

Thanks your reply. But I am sorry that it doesn't work on my box.

My kernel had been configured and compiled, and I also modify my Makefile as
following:

 

Obj-m := test.o

All:

  $(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIRS=$(PWD) modules

 

The output message is the same as before, no error message and no test.ko
module.

 

 

Thanks,

Johnson Cheng

 

 

  _____  

From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
Sent: Thursday, October 20, 2005 6:57 PM
To: linux-ppc-embedded
Subject: How to make mudules on linux-ppc2.6.12

 

Dear All,

 

I just write a "hello world" module code, but I can't compile it for
ppc2.6.12.

My Makefile is list as following:

 

obj-m := test.o

all:

  make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIR=. modules

 

When I run make, no error message output, but I find no test.ko modules. The
output message is list as following:

 

make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.1

2.3 SUBDIR=. modules

make[1]: Entering directory `/root/linux-2.6.12.3'

  CHK     include/linux/version.h

make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.

  Building modules, stage 2.

  MODPOST

make[1]: Leaving directory `/root/linux-2.6.12.3'

 

Do anyone can give me some help ?

 

Thanks,

Johnson Cheng

 


[-- Attachment #2: Type: text/html, Size: 14219 bytes --]

^ permalink raw reply

* Re: v2.6.13.4 : Bad page state at prep_new_page when booting with quik
From: Benjamin Herrenschmidt @ 2005-10-21  4:38 UTC (permalink / raw)
  To: maz; +Cc: linuxppc-dev
In-Reply-To: <wrpll0of535.fsf@wild-wind.fr.eu.org>

On Thu, 2005-10-20 at 19:53 +0200, Marc Zyngier wrote:
> List,
> 
> I finally managed to bring back to life an old Apus 3000/200 (PowerMac
> 6400 clone, 603e@200, no L2 cache, 144MB RAM). Kernel is vanilla
> 2.6.13.4, userland is Debian Sarge.
> 
> The strange thing is : while the machine boots perfectly with BootX,
> it fills the console with messages like this when booted from quik :

Well, it definitely looks like something is wrong :) Not sure what's up
at this point. Could be cache coherency not properly enabled on PSX
memory controller by Open Firmware maybe ...

It would be useful if you could dump the memory controller registers
between an OF boot and a BootX boot.

Look at this bit in pmac_setup.c:

	sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
	ohare_init();

The first line maps those registers, the second line enables the L2
cache on PSX memory controller. (The name "ohare_init() is actually a
bit bogus here, since that has nothing to do with ohare, but we do it in
ohare based machines only... go figure, that's pre-historical code,
certainly predates my involvement here :).

I'd suggest dumping to 8 or so first words of sysctrl_regs and checking
what difference is there.

Then, there is another blob that enables cache coherency on the PCI side
of Bandit/PSX in pmac_pci.c in init_bandit(). But this code seems to be
called for you ...

It could be something else tho ... like some problem with quik...

Ben.

^ permalink raw reply

* Re: How to make mudules on linux-ppc2.6.12
From: White @ 2005-10-21  4:36 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20051021034237.3B0A46861F@ozlabs.org>

Please try

obj-m += test.o

small case ! :)

good luck

Am Fri, 21 Oct 2005 11:35:51 +0800 schrieb "JohnsonCheng"
<JohnsonCheng@qnap.com.tw> :

> Dear Andy,
> 
>  
> 
> Thanks your reply. But I am sorry that it doesn't work on my box.
> 
> My kernel had been configured and compiled, and I also modify my Makefile as
> following:
> 
>  
> 
> Obj-m := test.o
> 
> All:
> 
>   $(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
> SUBDIRS=$(PWD) modules
> 
>  
> 
> The output message is the same as before, no error message and no test.ko
> module.
> 
>  
> 
>  
> 
> Thanks,
> 
> Johnson Cheng
> 
>  
> 
>  
> 
>   _____  
> 
> From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
> Sent: Thursday, October 20, 2005 6:57 PM
> To: linux-ppc-embedded
> Subject: How to make mudules on linux-ppc2.6.12
> 
>  
> 
> Dear All,
> 
>  
> 
> I just write a "hello world" module code, but I can't compile it for
> ppc2.6.12.
> 
> My Makefile is list as following:
> 
>  
> 
> obj-m := test.o
> 
> all:
> 
>   make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
> SUBDIR=. modules
> 
>  
> 
> When I run make, no error message output, but I find no test.ko modules. The
> output message is list as following:
> 
>  
> 
> make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.1
> 
> 2.3 SUBDIR=. modules
> 
> make[1]: Entering directory `/root/linux-2.6.12.3'
> 
>   CHK     include/linux/version.h
> 
> make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.
> 
>   Building modules, stage 2.
> 
>   MODPOST
> 
> make[1]: Leaving directory `/root/linux-2.6.12.3'
> 
>  
> 
> Do anyone can give me some help ?
> 
>  
> 
> Thanks,
> 
> Johnson Cheng
> 
>  
> 

^ permalink raw reply

* Re: MPC7447A based board with MV64462 Marvell Discovery III controller
From: Kumar Gala @ 2005-10-21  3:50 UTC (permalink / raw)
  To: Sven Luther; +Cc: linuxppc-embedded
In-Reply-To: <20051020150450.GA27704@localhost.localdomain>

> Hey, we have code to boot the Freeserv with chrp/Of, need to clean  
> it up
> and
> merge it though. Would this be a good thing to submit for mainline
> inclusion,
> it is a couple of lines at most, altough there is some reuse of the
> interrupt
> controller code i think, which needs some cleanup.

Is this board available to anyone.  I dont believe Freescale plans on  
offering it.

- kumar

^ permalink raw reply

* RE: How to make mudules on linux-ppc2.6.12
From: JohnsonCheng @ 2005-10-21  3:35 UTC (permalink / raw)
  To: linux-ppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1351 bytes --]

Dear Andy,

 

Thanks your reply. But I am sorry that it doesn't work on my box.

My kernel had been configured and compiled, and I also modify my Makefile as
following:

 

Obj-m := test.o

All:

  $(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIRS=$(PWD) modules

 

The output message is the same as before, no error message and no test.ko
module.

 

 

Thanks,

Johnson Cheng

 

 

  _____  

From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
Sent: Thursday, October 20, 2005 6:57 PM
To: linux-ppc-embedded
Subject: How to make mudules on linux-ppc2.6.12

 

Dear All,

 

I just write a "hello world" module code, but I can't compile it for
ppc2.6.12.

My Makefile is list as following:

 

obj-m := test.o

all:

  make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIR=. modules

 

When I run make, no error message output, but I find no test.ko modules. The
output message is list as following:

 

make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.1

2.3 SUBDIR=. modules

make[1]: Entering directory `/root/linux-2.6.12.3'

  CHK     include/linux/version.h

make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.

  Building modules, stage 2.

  MODPOST

make[1]: Leaving directory `/root/linux-2.6.12.3'

 

Do anyone can give me some help ?

 

Thanks,

Johnson Cheng

 


[-- Attachment #2: Type: text/html, Size: 10925 bytes --]

^ permalink raw reply

* Re: CHRP specifications
From: Hollis Blanchard @ 2005-10-20 23:33 UTC (permalink / raw)
  To: Sven Luther; +Cc: linuxppc-dev
In-Reply-To: <20051020151748.GB27704@localhost.localdomain>

On Oct 20, 2005, at 10:17 AM, Sven Luther wrote:
>
> BTW, anyone know of where to get the CHRP specs in downloadable html 
> or pdf or
> something format. Not the chrp OF bindings, but the real CHRP specs ?

I believe you've seen this before, but the link is still in the same 
place... http://penguinppc.org/otherhw/#chrp

As I recall, though, the CHRP specification mandates such obsolete 
features as an ADB controller, so claiming "CHRP compliance" may not be 
all that special these days. :)

-Hollis

^ permalink raw reply

* Re: 8248 SEC
From: Kim Phillips @ 2005-10-20 16:05 UTC (permalink / raw)
  To: Wojciech Kromer; +Cc: linuxppc-embedded
In-Reply-To: <43577838.3070307@dgt.com.pl>

On Thu, 20 Oct 2005 03:58:00 -0700
"Wojciech Kromer" <wojciech.kromer@dgt.com.pl> wrote:

> Is there any driver for security-engine on mpc8248?
> If yes, what can it do? where can I found it?
> 
follow the mpc8272 links at:

http://www.metrowerks.com/MW/Develop/Embedded/Linux/DownloadBSP.htm

Kim
-- 

^ permalink raw reply

* Re: Starting the arch/powerpc merge
From: Paul Mackerras @ 2005-10-20 23:01 UTC (permalink / raw)
  To: Giuliano Pochini, linuxppc-dev, linuxppc64-dev
In-Reply-To: <17221.45591.341270.888791@cargo.ozlabs.ibm.com>

I wrote:

> Not really.  The main thing in the past has been that DRI with 32-bit
> X server and clients would work with a 32-bit kernel but not a 64-bit
> kernel, but that's fixed now.  A 64-bit kernel is faster on most
> lmbench tests.  I guess a 32-bit kernel might end up a little smaller,
> but that's the only possible advantage I can think of.

Oops, sorry, mail system breakage here...

Paul.

^ permalink raw reply

* Re: PowerPC/Linux device driver question
From: Matt Porter @ 2005-10-20 20:21 UTC (permalink / raw)
  To: Madhu Saravana Sibi Govindan; +Cc: linuxppc-dev
In-Reply-To: <513a5e60510201256k64c0e4fan1557c28a0bdf920c@mail.gmail.com>

On Thu, Oct 20, 2005 at 02:56:21PM -0500, Madhu Saravana Sibi Govindan wrote:
> I'm not sure how to request this range of physical memory from the
> kernel. I thought I could use ioremap to map this range into the
> virtual space, but ioremap takes only an unsigned long as an argument,
> which is only 32 bits on 440GP. I don't think I can represent the range of my
> device with 32 bits.
> 
> Could someone tell me how to solve the problem? I want this range of
> physical addresses to be associated with my device driver and how do I
> do that?

Use the ppc-specific ioremap64() call. 

-Matt

^ permalink raw reply

* PowerPC/Linux device driver question
From: Madhu Saravana Sibi Govindan @ 2005-10-20 19:56 UTC (permalink / raw)
  To: linuxppc-dev

Hello all,

I'm trying to write a device driver in linux on a PowerPC processor.
The device has been allocated a range of addresses in the physical
address space of the processor (IBM 440GP) - from 0x100000000 -
0x13fffffff. (FYI, the 440GP is a 32 bit processor using 36 physical
addresses, the processor's MMU appends the extra 4 bits to get a
36-bit physical address).

I'm not sure how to request this range of physical memory from the
kernel. I thought I could use ioremap to map this range into the
virtual space, but ioremap takes only an unsigned long as an argument,
which is only 32 bits on 440GP. I don't think I can represent the range of =
my
device with 32 bits.

Could someone tell me how to solve the problem? I want this range of
physical addresses to be associated with my device driver and how do I
do that?

Thanks in advance,
G.Sibi

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox