LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] mpc832x_rdb.c: prevent using uninitialized variable
From: Anton Vorontsov @ 2007-07-27 10:23 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20070726164833.GC28491@ld0162-tx32.am.freescale.net>

On Thu, Jul 26, 2007 at 11:48:33AM -0500, Scott Wood wrote:
> On Thu, Jul 26, 2007 at 06:01:39PM +0400, Anton Vorontsov wrote:
> > If CONFIG_PCI undefined, np will be used uninitialized, thereby
> > find_node_by_name(np, "par_io") will fail.
> 
> This is the wrong fix -- you should be passing NULL to the par_io call
> rather than np.  Otherwise, if the par_io is earlier in the tree than the
> pci, you won't find it.

Oops. Right you are, thanks!

I hope this is proper fix.

- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: [POWERPC] mpc832x_rdb.c: prevent using uninitialized variable

If CONFIG_PCI undefined, np will be used uninitialized, thereby
find_node_by_name(np, "par_io") will fail.

of_find_node_by_name(np, "par_io") isn't used inside loop,
thus we can safely pass NULL instead of np.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/platforms/83xx/mpc832x_rdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index b2b28a4..93ba957 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -56,7 +56,7 @@ static void __init mpc832x_rdb_setup_arch(void)
 #ifdef CONFIG_QUICC_ENGINE
 	qe_reset();
 
-	if ((np = of_find_node_by_name(np, "par_io")) != NULL) {
+	if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
 		par_io_init(np);
 		of_node_put(np);
 
-- 
1.5.0.6

^ permalink raw reply related

* Re: creation of jffs2 rootfile system..
From: Nethra @ 2007-07-27 10:22 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20070727104023.78048ea4.fvoegel@carangul.com>


I m creating jffs2 root file system using devrocket,

this is the bootlog i m getting....

VFS: Mounted root (jffs2 filesystem).
Freeing unused kernel memory: 108k init
readlink: /etc/mtab: No such file or directory
0
readlink: /etc/mtab: No such file or directory
Mounting local filesystems: mount nothing was mounted
Cleaning: /tmp BusyBox v1.01 (2005.12.18-04:27+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Search for files in a directory hierarchy.  The default PATH is
the current directory; default EXPRESSION is '-print'

EXPRESSION may consist of:
        -follow         Dereference symbolic links.
        -name PATTERN   File name (leading directories removed) matches
PATTERN.
        -print          Print (default and assumed).

        -type X         Filetype matches X (where X is one of:
f,d,l,b,c,...)
        -perm PERMS     Permissions match any of (+NNN); all of (-NNN);
                        or exactly (NNN)
        -mtime TIME     Modified time is greater than (+N); less than (-N);
                        or exactly (N) days

/var/lock cd: 77: can't cd to /var/lock
/var/run BusyBox v1.01 (2005.12.18-04:27+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Search for files in a directory hierarchy.  The default PATH is
the current directory; default EXPRESSION is '-print'

EXPRESSION may consist of:
        -follow         Dereference symbolic links.
        -name PATTERN   File name (leading directories removed) matches
PATTERN.
        -print          Print (default and assumed).

        -type X         Filetype matches X (where X is one of:
f,d,l,b,c,...)
        -perm PERMS     Permissions match any of (+NNN); all of (-NNN);
                        or exactly (NNN)
        -mtime TIME     Modified time is greater than (+N); less than (-N);
                        or exactly (N) days

grep: /etc/group: No such file or directory
done.
Setting pseudo-terminal access permissions...chown: unknown group name: tty
done.
Updating /etc/motd...sed: /etc/motd: No such file or directory
done.
/etc/rc.d/rcS.d/S55bootmisc.sh: 119: cannot create /var/log/dmesg: Directory
nonexistent
: done.

Please press Enter to activate this console.
/#

now ps command is working properly.

why i m not getting login..?


Florian A. Voegel wrote:
> 
> 
> Hi Nethra,
> 
> what does your inittab and your startup files look like? It looks like
> 
> - your inittab does not start a getty but rather a shell, thus no login
> - your /proc isn't mounted, and it's needed for ps to work properly
> 
> 
> Greets,
> 
> Florian Voegel
> Carangul.Tech
> 
> On Thu, 26 Jul 2007 23:41:32 -0700 (PDT)
> Nethra <nethra_gmit@yahoo.co.in> wrote:
> 
>> 
>> when boot the board with jffs2 rootfile system i m getting output like
>> this,
>> 
>> TCP: Hash tables configured (established 4096 bind 8192)
>> IPv4 over IPv4 tunneling driver
>> NET: Registered protocol family 1
>> NET: Registered protocol family 10
>> IPv6 over IPv4 tunneling driver
>> NET: Registered protocol family 17
>> Disabled Privacy Extensions on device c02527a0(lo)
>> IP-Config: Incomplete network configuration information.
>> Empty flash at 0x0000ffa0 ends at 0x00010000
>> Empty flash at 0x0002ffec ends at 0x00030000
>> Empty flash at 0x0004ffe8 ends at 0x00050000
>> Empty flash at 0x0006ffc8 ends at 0x00070000
>> Empty flash at 0x0008fffc ends at 0x00090000
>> Empty flash at 0x000afffc ends at 0x000b0000
>> Empty flash at 0x000cfffc ends at 0x000d0000
>> Empty flash at 0x000efffc ends at 0x000f0000
>> Empty flash at 0x0010fffc ends at 0x00110000
>> Empty flash at 0x0012fffc ends at 0x00130000
>> Empty flash at 0x0014fffc ends at 0x00150000
>> Empty flash at 0x0016fffc ends at 0x00170000
>> Empty flash at 0x0018fffc ends at 0x00190000
>> Empty flash at 0x001cfffc ends at 0x001d0000
>> Empty flash at 0x001efffc ends at 0x001f0000
>> Empty flash at 0x0020fffc ends at 0x00210000
>> Empty flash at 0x0022fffc ends at 0x00230000
>> Empty flash at 0x0024fffc ends at 0x00250000
>> Empty flash at 0x0026fffc ends at 0x00270000
>> Empty flash at 0x002afffc ends at 0x002b0000
>> Empty flash at 0x002cfffc ends at 0x002d0000
>> VFS: Mounted root (jffs2 filesystem).
>> Freeing unused kernel memory: 108k init
>> 
>> Please press Enter to activate this console.
>> / #
>> / #
>> / #
>> 
>> login prompt itself is not coming and
>>  
>> ps command is not working....
>> # ps
>>   PID  Uid     VmSize Stat Command
>> #
>> 
>> what is the problem..?
>> 
>> waiting for early response,
>> Nethra
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/creation-of-jffs2-rootfile-system..-tf4155759.html#a11823840
>> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/creation-of-jffs2-rootfile-system..-tf4155759.html#a11826448
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* [PATCH 12/68] 0 -> NULL, for arch/powerpc
From: Yoann Padioleau @ 2007-07-27  9:45 UTC (permalink / raw)
  To: kernel-janitors; +Cc: linuxppc-dev, akpm, paulus, linux-kernel


When comparing a pointer, it's clearer to compare it to NULL than to 0.

Here is an excerpt of the semantic patch: 

@@
expression *E;
@@

  E ==
- 0
+ NULL

@@
expression *E;
@@

  E !=
- 0
+ NULL

Signed-off-by: Yoann Padioleau <padator@wanadoo.fr>
Cc: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org
Cc: benh@kernel.crashing.org
Cc: akpm@linux-foundation.org
---

 boot/prpmc2800.c                |    2 +-
 kernel/btext.c                  |    8 ++++----
 kernel/legacy_serial.c          |    2 +-
 kernel/pci-common.c             |    2 +-
 kernel/pci_32.c                 |    8 ++++----
 kernel/prom.c                   |    4 ++--
 kernel/setup_64.c               |    4 ++--
 kernel/signal_64.c              |    4 ++--
 mm/mmu_decl.h                   |    2 +-
 mm/pgtable_32.c                 |    4 ++--
 mm/ppc_mmu_32.c                 |    2 +-
 mm/tlb_32.c                     |   12 ++++++------
 platforms/52xx/lite5200.c       |    2 +-
 platforms/83xx/mpc832x_mds.c    |    2 +-
 platforms/83xx/mpc836x_mds.c    |    2 +-
 platforms/85xx/mpc85xx_ads.c    |    4 ++--
 platforms/85xx/mpc85xx_cds.c    |    4 ++--
 platforms/86xx/mpc86xx_hpcn.c   |    4 ++--
 platforms/8xx/mpc86xads_setup.c |    4 ++--
 platforms/8xx/mpc885ads_setup.c |    4 ++--
 platforms/maple/pci.c           |    2 +-
 platforms/maple/setup.c         |    2 +-
 platforms/powermac/pci.c        |    2 +-
 platforms/powermac/pfunc_core.c |    2 +-
 platforms/powermac/setup.c      |    6 +++---
 platforms/powermac/time.c       |    6 +++---
 platforms/pseries/setup.c       |    2 +-
 sysdev/qe_lib/qe_io.c           |    2 +-
 xmon/spu-dis.c                  |   18 +++++++++---------
 xmon/xmon.c                     |    4 ++--
 30 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index f428bac..b130e5b 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -480,7 +480,7 @@ static void prpmc2800_reset(void)
 
 	udelay(5000000);
 
-	if (bridge_base != 0) {
+	if (bridge_base != NULL) {
 		temp = in_le32((u32 *)(bridge_base + MV64x60_MPP_CNTL_0));
 		temp &= 0xFFFF0FFF;
 		out_le32((u32 *)(bridge_base + MV64x60_MPP_CNTL_0), temp);
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index e7b6846..6d9b68b 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -142,14 +142,14 @@ static void map_boot_text(void)
 
 	/* By default, we are no longer mapped */
 	boot_text_mapped = 0;
-	if (dispDeviceBase == 0)
+	if (dispDeviceBase == NULL)
 		return;
 	base = ((unsigned long) dispDeviceBase) & 0xFFFFF000UL;
 	offset = ((unsigned long) dispDeviceBase) - base;
 	size = dispDeviceRowBytes * dispDeviceRect[3] + offset
 		+ dispDeviceRect[0];
 	vbase = __ioremap(base, size, _PAGE_NO_CACHE);
-	if (vbase == 0)
+	if (vbase == NULL)
 		return;
 	logicalDisplayBase = vbase + offset;
 	boot_text_mapped = 1;
@@ -253,7 +253,7 @@ static unsigned char * calc_base(int x, 
 	unsigned char *base;
 
 	base = logicalDisplayBase;
-	if (base == 0)
+	if (base == NULL)
 		base = dispDeviceBase;
 	base += (x + dispDeviceRect[0]) * (dispDeviceDepth >> 3);
 	base += (y + dispDeviceRect[1]) * dispDeviceRowBytes;
@@ -264,7 +264,7 @@ static unsigned char * calc_base(int x, 
 void btext_update_display(unsigned long phys, int width, int height,
 			  int depth, int pitch)
 {
-	if (dispDeviceBase == 0)
+	if (dispDeviceBase == NULL)
 		return;
 
 	/* check it's the same frame buffer (within 256MB) */
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index cea8045..330bd21 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -67,7 +67,7 @@ static int __init add_legacy_port(struct
 		legacy_serial_count = index + 1;
 
 	/* Check if there is a port who already claimed our slot */
-	if (legacy_serial_infos[index].np != 0) {
+	if (legacy_serial_infos[index].np != NULL) {
 		/* if we still have some room, move it, else override */
 		if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) {
 			printk(KERN_DEBUG "Moved legacy port %d -> %d\n",
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index fe7d125..5fa0be3 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -256,7 +256,7 @@ static struct resource *__pci_mmap_make_
 	unsigned long io_offset = 0;
 	int i, res_bit;
 
-	if (hose == 0)
+	if (hose == NULL)
 		return NULL;		/* should never happen */
 
 	/* If memory, add on the PCI bridge address offset */
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 721a694..4edefa6 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -598,7 +598,7 @@ make_one_node_map(struct device_node* no
 	} else
 		pci_to_OF_bus_map[pci_bus] = bus_range[0];
 
-	for (node=node->child; node != 0;node = node->sibling) {
+	for (node=node->child; node != NULL;node = node->sibling) {
 		struct pci_dev* dev;
 		const unsigned int *class_code, *reg;
 	
@@ -671,7 +671,7 @@ scan_OF_pci_childs(struct device_node* n
 {
 	struct device_node* sub_node;
 
-	for (; node != 0;node = node->sibling) {
+	for (; node != NULL;node = node->sibling) {
 		const unsigned int *class_code;
 	
 		if (filter(node, data))
@@ -1449,9 +1449,9 @@ fake_pci_bus(struct pci_controller *hose
 {
 	static struct pci_bus bus;
 
-	if (hose == 0) {
+	if (hose == NULL) {
 		hose = pci_bus_to_hose(busnr);
-		if (hose == 0)
+		if (hose == NULL)
 			printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
 	}
 	bus.number = busnr;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index a38197b..509f1e2 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1095,7 +1095,7 @@ struct device_node *of_find_node_by_phan
 	struct device_node *np;
 
 	read_lock(&devtree_lock);
-	for (np = allnodes; np != 0; np = np->allnext)
+	for (np = allnodes; np != NULL; np = np->allnext)
 		if (np->linux_phandle == handle)
 			break;
 	of_node_get(np);
@@ -1118,7 +1118,7 @@ struct device_node *of_find_all_nodes(st
 
 	read_lock(&devtree_lock);
 	np = prev ? prev->allnext : allnodes;
-	for (; np != 0; np = np->allnext)
+	for (; np != NULL; np = np->allnext)
 		if (of_node_get(np))
 			break;
 	of_node_put(prev);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6018178..95119a5 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -310,7 +310,7 @@ static void __init initialize_cache_info
 			lsizep = of_get_property(np, dc, NULL);
 			if (lsizep != NULL)
 				lsize = *lsizep;
-			if (sizep == 0 || lsizep == 0)
+			if (sizep == NULL || lsizep == NULL)
 				DBG("Argh, can't find dcache properties ! "
 				    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
@@ -327,7 +327,7 @@ static void __init initialize_cache_info
 			lsizep = of_get_property(np, ic, NULL);
 			if (lsizep != NULL)
 				lsize = *lsizep;
-			if (sizep == 0 || lsizep == 0)
+			if (sizep == NULL || lsizep == NULL)
 				DBG("Argh, can't find icache properties ! "
 				    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index de895e6..6e02ec6 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -184,13 +184,13 @@ #ifdef CONFIG_ALTIVEC
 	if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128)))
 		return -EFAULT;
 	/* Copy 33 vec registers (vr0..31 and vscr) from the stack */
-	if (v_regs != 0 && (msr & MSR_VEC) != 0)
+	if (v_regs != NULL && (msr & MSR_VEC) != 0)
 		err |= __copy_from_user(current->thread.vr, v_regs,
 					33 * sizeof(vector128));
 	else if (current->thread.used_vr)
 		memset(current->thread.vr, 0, 33 * sizeof(vector128));
 	/* Always get VRSAVE back */
-	if (v_regs != 0)
+	if (v_regs != NULL)
 		err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
 	else
 		current->thread.vrsave = 0;
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index c94a64f..b956e8b 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -83,7 +83,7 @@ extern unsigned long mmu_mapin_ram(void)
 static inline void flush_HPTE(unsigned context, unsigned long va,
 			      unsigned long pdval)
 {
-	if ((Hash != 0) &&
+	if ((Hash != NULL) &&
 	    cpu_has_feature(CPU_FTR_HPTE_TABLE))
 		flush_hash_pages(0, va, pdval, 1);
 	else
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 6448872..6c5b368 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -209,7 +209,7 @@ __ioremap(phys_addr_t addr, unsigned lon
 	if (mem_init_done) {
 		struct vm_struct *area;
 		area = get_vm_area(size, VM_IOREMAP);
-		if (area == 0)
+		if (area == NULL)
 			return NULL;
 		v = (unsigned long) area->addr;
 	} else {
@@ -262,7 +262,7 @@ int map_page(unsigned long va, phys_addr
 	pd = pmd_offset(pud_offset(pgd_offset_k(va), va), va);
 	/* Use middle 10 bits of VA to index the second-level map */
 	pg = pte_alloc_kernel(pd, va);
-	if (pg != 0) {
+	if (pg != NULL) {
 		err = 0;
 		/* The PTE should never be already set nor present in the
 		 * hash table
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index 5c45d47..8e95c56 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -182,7 +182,7 @@ void hash_preload(struct mm_struct *mm, 
 {
 	pmd_t *pmd;
 
-	if (Hash == 0)
+	if (Hash == NULL)
 		return;
 	pmd = pmd_offset(pud_offset(pgd_offset(mm, ea), ea), ea);
 	if (!pmd_none(*pmd))
diff --git a/arch/powerpc/mm/tlb_32.c b/arch/powerpc/mm/tlb_32.c
index eb4b512..5db5aff 100644
--- a/arch/powerpc/mm/tlb_32.c
+++ b/arch/powerpc/mm/tlb_32.c
@@ -40,7 +40,7 @@ void flush_hash_entry(struct mm_struct *
 {
 	unsigned long ptephys;
 
-	if (Hash != 0) {
+	if (Hash != NULL) {
 		ptephys = __pa(ptep) & PAGE_MASK;
 		flush_hash_pages(mm->context.id, addr, ptephys, 1);
 	}
@@ -52,7 +52,7 @@ void flush_hash_entry(struct mm_struct *
  */
 void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr)
 {
-	if (Hash != 0)
+	if (Hash != NULL)
 		return;
 	_tlbie(addr);
 }
@@ -63,7 +63,7 @@ void flush_tlb_page_nohash(struct vm_are
  */
 void tlb_flush(struct mmu_gather *tlb)
 {
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		/*
 		 * 603 needs to flush the whole TLB here since
 		 * it doesn't use a hash table.
@@ -104,7 +104,7 @@ static void flush_range(struct mm_struct
 	int count;
 	unsigned int ctx = mm->context.id;
 
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		_tlbia();
 		return;
 	}
@@ -144,7 +144,7 @@ void flush_tlb_mm(struct mm_struct *mm)
 {
 	struct vm_area_struct *mp;
 
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		_tlbia();
 		return;
 	}
@@ -165,7 +165,7 @@ void flush_tlb_page(struct vm_area_struc
 	struct mm_struct *mm;
 	pmd_t *pmd;
 
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		_tlbie(vmaddr);
 		return;
 	}
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 5c46e89..9926396 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -118,7 +118,7 @@ static void __init lite5200_setup_arch(v
 	if (np) {
 		const unsigned int *fp =
 			of_get_property(np, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index b39cb52..b2bf27d 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -65,7 +65,7 @@ static void __init mpc832x_sys_setup_arc
 
 	/* Map BCSR area */
 	np = of_find_node_by_name(NULL, "bcsr");
-	if (np != 0) {
+	if (np != NULL) {
 		struct resource res;
 
 		of_address_to_resource(np, 0, &res);
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 0e615fd..b979fcf 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -71,7 +71,7 @@ static void __init mpc836x_mds_setup_arc
 
 	/* Map BCSR area */
 	np = of_find_node_by_name(NULL, "bcsr");
-	if (np != 0) {
+	if (np != NULL) {
 		struct resource res;
 
 		of_address_to_resource(np, 0, &res);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 40a8286..083f915 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -201,11 +201,11 @@ #endif
 		ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 6a171e9..bc29eff 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -275,11 +275,11 @@ #endif
 		ppc_md.progress("mpc85xx_cds_setup_arch()", 0);
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 500000000 / HZ;
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index e9eaa07..fad9418 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -333,11 +333,11 @@ mpc86xx_hpcn_setup_arch(void)
 		ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
 
 	np = of_find_node_by_type(NULL, "cpu");
-	if (np != 0) {
+	if (np != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(np, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index cf0e7bc..1b02ff1 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -257,11 +257,11 @@ static void __init mpc86xads_setup_arch(
 	struct device_node *cpu;
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 5a808d6..cd435f2 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -409,11 +409,11 @@ static void __init mpc885ads_setup_arch(
 	struct device_node *cpu;
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index fceaae4..3e928d6 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -38,7 +38,7 @@ static struct pci_controller *u3_agp, *u
 
 static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
 {
-	for (; node != 0;node = node->sibling) {
+	for (; node != NULL;node = node->sibling) {
 		const int *bus_range;
 		const unsigned int *class_code;
 		int len;
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 354c058..b075c15 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -250,7 +250,7 @@ static void __init maple_init_IRQ(void)
 	root = of_find_node_by_path("/");
 	naddr = of_n_addr_cells(root);
 	opprop = of_get_property(root, "platform-open-pic", &opplen);
-	if (opprop != 0) {
+	if (opprop != NULL) {
 		openpic_addr = of_read_number(opprop, naddr);
 		has_isus = (opplen > naddr);
 		printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n",
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 92586db..0943d69 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -62,7 +62,7 @@ #define BANDIT_COHERENT	0x40
 
 static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
 {
-	for (; node != 0;node = node->sibling) {
+	for (; node != NULL;node = node->sibling) {
 		const int * bus_range;
 		const unsigned int *class_code;
 		int len;
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index 8543423..aed0c15 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -685,7 +685,7 @@ #define PP_PREFIX "platform-do-"
 	const int plen = strlen(PP_PREFIX);
 	int count = 0;
 
-	for (pp = dev->node->properties; pp != 0; pp = pp->next) {
+	for (pp = dev->node->properties; pp != NULL; pp = pp->next) {
 		char *name;
 		if (strncmp(pp->name, PP_PREFIX, plen) != 0)
 			continue;
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 7ccb923..75b600a 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -261,12 +261,12 @@ static void __init l2cr_init(void)
 	/* Checks "l2cr-value" property in the registry */
 	if (cpu_has_feature(CPU_FTR_L2CR)) {
 		struct device_node *np = of_find_node_by_name(NULL, "cpus");
-		if (np == 0)
+		if (np == NULL)
 			np = of_find_node_by_type(NULL, "cpu");
-		if (np != 0) {
+		if (np != NULL) {
 			const unsigned int *l2cr =
 				of_get_property(np, "l2cr-value", NULL);
-			if (l2cr != 0) {
+			if (l2cr != NULL) {
 				ppc_override_l2cr = 1;
 				ppc_override_l2cr_value = *l2cr;
 				_set_L2CR(0);
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index bf9da56..1767b2d 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -260,11 +260,11 @@ int __init via_calibrate_decr(void)
 	struct resource rsrc;
 
 	vias = of_find_node_by_name(NULL, "via-cuda");
-	if (vias == 0)
+	if (vias == NULL)
 		vias = of_find_node_by_name(NULL, "via-pmu");
-	if (vias == 0)
+	if (vias == NULL)
 		vias = of_find_node_by_name(NULL, "via");
-	if (vias == 0 || of_address_to_resource(vias, 0, &rsrc))
+	if (vias == NULL || of_address_to_resource(vias, 0, &rsrc))
 		return 0;
 	via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
 	if (via == NULL) {
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index f0b7146..10681c0 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -141,7 +141,7 @@ static void __init pseries_mpic_init_IRQ
 	np = of_find_node_by_path("/");
 	naddr = of_n_addr_cells(np);
 	opprop = of_get_property(np, "platform-open-pic", &opplen);
-	if (opprop != 0) {
+	if (opprop != NULL) {
 		openpic_addr = of_read_number(opprop, naddr);
 		printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
 	}
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c
index e32b45b..575ae0a 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_io.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_io.c
@@ -162,7 +162,7 @@ int par_io_of_config(struct device_node 
 	}
 
 	ph = of_get_property(np, "pio-handle", NULL);
-	if (ph == 0) {
+	if (ph == NULL) {
 		printk(KERN_ERR "pio-handle not available \n");
 		return -1;
 	}
diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c
index e5f8983..d9ef4dc 100644
--- a/arch/powerpc/xmon/spu-dis.c
+++ b/arch/powerpc/xmon/spu-dis.c
@@ -45,7 +45,7 @@ init_spu_disassemble (void)
       int o = spu_opcodes[i].opcode;
       if (o >= SPU_DISASM_TBL_SIZE)
 	continue; /* abort (); */
-      if (spu_disassemble_table[o] == 0)
+      if (spu_disassemble_table[o] == NULL)
 	spu_disassemble_table[o] = &spu_opcodes[i];
     }
 }
@@ -59,30 +59,30 @@ get_index_for_opcode (unsigned int insn)
 
   /* Init the table.  This assumes that element 0/opcode 0 (currently
    * NOP) is always used */
-  if (spu_disassemble_table[0] == 0)
+  if (spu_disassemble_table[0] == NULL)
     init_spu_disassemble ();
 
-  if ((index = spu_disassemble_table[opcode & 0x780]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x780]) != NULL
       && index->insn_type == RRR)
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7f0]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7f0]) != NULL
       && (index->insn_type == RI18 || index->insn_type == LBT))
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7f8]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7f8]) != NULL
       && index->insn_type == RI10)
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7fc]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7fc]) != NULL
       && (index->insn_type == RI16))
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7fe]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7fe]) != NULL
       && (index->insn_type == RI8))
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7ff]) != 0)
+  if ((index = spu_disassemble_table[opcode & 0x7ff]) != NULL)
     return index;
 
   return NULL;
@@ -100,7 +100,7 @@ print_insn_spu (unsigned long insn, unsi
 
   index = get_index_for_opcode (insn);
 
-  if (index == 0)
+  if (index == NULL)
     {
       printf(".long 0x%x", insn);
     }
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 121b04d..3c37276 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -591,7 +591,7 @@ static int xmon_iabr_match(struct pt_reg
 {
 	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
 		return 0;
-	if (iabr == 0)
+	if (iabr == NULL)
 		return 0;
 	xmon_core(regs, 0);
 	return 1;
@@ -1135,7 +1135,7 @@ #endif
 		} else {
 			/* assume a breakpoint address */
 			bp = at_breakpoint(a);
-			if (bp == 0) {
+			if (bp == NULL) {
 				printf("No breakpoint at %x\n", a);
 				break;
 			}

^ permalink raw reply related

* RE: [PATCH 1/5 v3] Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
From: Zhang Wei-r63237 @ 2007-07-27  9:12 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <98CA70A1-9888-4508-A0E9-0EB28C14945F@kernel.crashing.org>

Hi, Kumar,=20
> +   RapidIO is a definition of a system interconnect. This node add
> > +   the support for RapidIO processor in kernel. The node name is
> > +   suggested to be 'rapidio'.
> > +
> > +   Required properties:
> > +
> > +    - compatible : Using "fsl,rapidio-delta" for Freescale PowerPC
> > +      RapidIO controller.
> > +    - #address-cells : Address representation for=20
> "rapidio" devices.
> > +      This field represents the number of cells needed to represent
> > +      the RapidIO address of the registers.
>=20
> Can you explain this a little further.  I'm a bit confused by =20
> 'RapidIO address of the registers'.
>=20
I want to present "This field represents the number of cells [needed to
represent the RapidIO address] of the registers."
Maybe I should remove 'of the registers' to be more clear.

Thanks!
-zw

^ permalink raw reply

* RE: [PATCH 4/5 v3] Add RapidIO support to powerpc architecture.
From: Zhang Wei-r63237 @ 2007-07-27  9:03 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <FFA9FE6D-81C8-429C-A0CD-FE356CF98C69@kernel.crashing.org>

Hi, Kumar,=20

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]=20
> On Jul 26, 2007, at 3:42 AM, Zhang Wei wrote:
>=20
> > This patch adds the RapidIO support to the powerpc architecture.
> > Some files are moved from ppc. OF-tree and OF-device supports are =20
> > added.
> > New silicons such as MPC8548, MPC8641 with serial RapidIO =20
> > controller are
> > all supported.
> > Memory driver hardware operations are added.
> > Global mport variables are changed to master port private variables.
> > Multi master ports are supported.
> >
> > Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> > ---
> >  arch/powerpc/Kconfig          |    8 +
> >  arch/powerpc/kernel/Makefile  |    1 +
> >  arch/powerpc/kernel/rio.c     |   64 ++
> >  arch/powerpc/sysdev/Makefile  |    1 +
> >  arch/powerpc/sysdev/fsl_rio.c | 1455=20
> ++++++++++++++++++++++++++++++=20
> > +++++++++++
>=20
> how much of this moved from ppc85xx_rio.c?

>From the code size, 2/3 are moved from pcc85xx_rio.c with clean up, 1/3
are new coding.

>=20
> >  arch/powerpc/sysdev/fsl_rio.h |   20 +
> >  6 files changed, 1549 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/powerpc/kernel/rio.c
> >  create mode 100644 arch/powerpc/sysdev/fsl_rio.c
> >  create mode 100644 arch/powerpc/sysdev/fsl_rio.h
> >
> > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > index 00099ef..45f32f1 100644
> > --- a/arch/powerpc/Kconfig
> > +++ b/arch/powerpc/Kconfig
> > @@ -492,6 +492,14 @@ source "drivers/pci/Kconfig"
> >
> >  source "drivers/pcmcia/Kconfig"
> >
> > +config RAPIDIO
> > +	bool "RapidIO support" if MPC8540 || MPC8560 || MPC8641=20
> || MPC8548
> > +	help
> > +	  If you say Y here, the kernel will include drivers and
> > +	  infrastructure code to support RapidIO interconnect devices.
>=20
> why not make this depend on something like HAS_RAPIDIO and let the =20
> boards select HAS_RAPIDIO if they have it

It's more clear, We can know how many and which processors support
RapidIO. :-)

>=20
> > +
> > +source "drivers/rapidio/Kconfig"
> > +
> >  source "drivers/pci/hotplug/Kconfig"
> >
> >  endmenu
> > diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/=20
> > Makefile
> > index 42c42ec..02d4100 100644
> > --- a/arch/powerpc/kernel/Makefile
> > +++ b/arch/powerpc/kernel/Makefile
> > @@ -70,6 +70,7 @@ pci64-$(CONFIG_PPC64)		+=3D=20
> pci_64.o pci_dn.o isa-=20
> > bridge.o
> >  pci32-$(CONFIG_PPC32)		:=3D pci_32.o
> >  obj-$(CONFIG_PCI)		+=3D $(pci64-y) $(pci32-y) pci-common.o
> >  obj-$(CONFIG_PCI_MSI)		+=3D msi.o
> > +obj-$(CONFIG_RAPIDIO)		+=3D rio.o
>=20
> should probably live in sysdev/rio.c

This just keep the same position of ppc arch.

Thanks!
-zw

^ permalink raw reply

* Re: [RFC][PATCH] fsl_soc: add support for fsl_spi
From: Kumar Gala @ 2007-07-27  8:54 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20070726135655.GA5643@localhost.localdomain>


On Jul 26, 2007, at 8:56 AM, Anton Vorontsov wrote:

> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>  arch/powerpc/sysdev/fsl_soc.c |   76 ++++++++++++++++++++++++++++++ 
> +++++++++++
>  arch/powerpc/sysdev/fsl_soc.h |    3 ++
>  2 files changed, 79 insertions(+), 0 deletions(-)

There should be 2nd patch with updates to documentation for the SPI  
device node.

>
> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/ 
> fsl_soc.c
> index 3289fab..0599851 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -1125,3 +1125,79 @@ err:
>  arch_initcall(cpm_smc_uart_of_init);
>
>  #endif /* CONFIG_8xx */
> +
> +void (*fsl_spi_activate_cs)(u8 cs, u8 polarity) = NULL;
> +EXPORT_SYMBOL(fsl_spi_activate_cs);
> +void (*fsl_spi_deactivate_cs)(u8 cs, u8 polarity) = NULL;
> +EXPORT_SYMBOL(fsl_spi_deactivate_cs);
> +

I don't think we should do it this way.  We shouldn't arch_initcall()  
scan for fsl_spi, but have the board code call a function and pass  
some things into it.

> +static int __init fsl_spi_of_init(void)
> +{
> +	struct device_node *np;
> +	unsigned int i;
> +
> +	for (np = NULL, i = 1;
> +	     (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
> +	     i++) {
> +		int ret = 0;
> +		const char *devid, *sysclk, *mode, *max_cs;
> +		struct resource res[2];
> +		struct platform_device *pdev = NULL;
> +		struct fsl_spi_platform_data pdata = {
> +			.activate_cs = fsl_spi_activate_cs,
> +			.deactivate_cs = fsl_spi_deactivate_cs,
> +		};
> +
> +		memset(res, 0, sizeof(res));
> +
> +		devid = of_get_property(np, "device-id", NULL);
> +		sysclk = of_get_property(np, "sysclk", NULL);
> +		mode = of_get_property(np, "mode", NULL);
> +		max_cs = of_get_property(np, "max-chipselect", NULL);
> +		if (!devid || !sysclk || !mode || !max_cs)
> +			goto err;
> +
> +		pdata.bus_num = *(u32 *)devid;
> +		pdata.sysclk = *(u32 *)sysclk;
> +		pdata.max_chipselect = *(u32 *)max_cs;
> +		if (!strcmp(mode, "qe"))
> +			pdata.qe_mode = 1;
> +
> +		ret = of_address_to_resource(np, 0, &res[0]);
> +		if (ret)
> +			goto err;
> +
> +		res[1].start = res[2].end = irq_of_parse_and_map(np, 0);
> +		if (res[1].start == NO_IRQ)
> +			goto err;
> +
> +		res[1].name = "mpc83xx_spi";
> +		res[1].flags = IORESOURCE_IRQ;;
> +
> +		pdev = platform_device_alloc("mpc83xx_spi", i);
> +		if (!pdev)
> +			goto err;
> +
> +		ret = platform_device_add_data(pdev, &pdata, sizeof(pdata));
> +		if (ret)
> +			goto unreg;
> +
> +		ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
> +		if (ret)
> +			goto unreg;
> +
> +		ret = platform_device_register(pdev);
> +		if (ret)
> +			goto unreg;
> +
> +		continue;
> +unreg:
> +		platform_device_del(pdev);
> +err:
> +		continue;
> +	}
> +
> +	return 0;
> +}
> +
> +arch_initcall(fsl_spi_of_init);
> diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/ 
> fsl_soc.h
> index 04e145b..c9de2a2 100644
> --- a/arch/powerpc/sysdev/fsl_soc.h
> +++ b/arch/powerpc/sysdev/fsl_soc.h
> @@ -8,5 +8,8 @@ extern phys_addr_t get_immrbase(void);
>  extern u32 get_brgfreq(void);
>  extern u32 get_baudrate(void);
>
> +extern void (*fsl_spi_activate_cs)(u8 cs, u8 polarity);
> +extern void (*fsl_spi_deactivate_cs)(u8 cs, u8 polarity);
> +
>  #endif
>  #endif
> -- 
> 1.5.0.6
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH 1/5 v3] Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
From: Kumar Gala @ 2007-07-27  8:51 UTC (permalink / raw)
  To: Zhang Wei; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <11854393733580-git-send-email-wei.zhang@freescale.com>


On Jul 26, 2007, at 3:42 AM, Zhang Wei wrote:

> Add the explanation and a sample of RapidIO OF node to the document  
> of booting-without-of.txt file.
>
> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> ---
>  Documentation/powerpc/booting-without-of.txt |   37 +++++++++++++++ 
> +++++++++++
>  1 files changed, 37 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/powerpc/booting-without-of.txt b/ 
> Documentation/powerpc/booting-without-of.txt
> index 76733a3..d89b805 100644
> --- a/Documentation/powerpc/booting-without-of.txt
> +++ b/Documentation/powerpc/booting-without-of.txt
> @@ -1824,6 +1824,43 @@ platforms are moved over to use the  
> flattened-device-tree model.
>  		fsl,has-rstcr;
>  	};
>
> +   l) RapidIO
> +
> +   RapidIO is a definition of a system interconnect. This node add
> +   the support for RapidIO processor in kernel. The node name is
> +   suggested to be 'rapidio'.
> +
> +   Required properties:
> +
> +    - compatible : Using "fsl,rapidio-delta" for Freescale PowerPC
> +      RapidIO controller.
> +    - #address-cells : Address representation for "rapidio" devices.
> +      This field represents the number of cells needed to represent
> +      the RapidIO address of the registers.

Can you explain this a little further.  I'm a bit confused by  
'RapidIO address of the registers'.

> +      See 1) above for more details on defining #address-cells.
> +    - reg : Offset and length of the register set for the device
> +    - ranges : Should be defined as specified in 1) to describe the
> +      translation of addresses for memory mapped RapidIO memory
> +      space.
> +    - interrupts : binding interrupts for this device node,
> +      please follow below orders:
> +      <err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
> +      msg2_tx_irq msg2_rx_irq ... msgN_tx_irq msgN_rx_irq>.
> +
> +  Example:
> +
> +	rapidio@c0000 {
> +		compatible = "fsl,rapidio-delta";
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		reg = <c0000 20000>;
> +		ranges = <0 0 c0000000 20000000>;
> +		interrupt-parent = <&mpic>;
> +		/* err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
> +						      msg2_tx_irq msg2_rx_irq */
> +		interrupts = <30 2 31 2 32 2 35 2 36 2 37 2 38 2>;
> +	};
> +
>     More devices will be defined as this spec matures.
>
>  VII - Specifying interrupt information for devices
> -- 
> 1.5.1

^ permalink raw reply

* Re: [PATCH 0/5 v3] Porting RapidIO driver from ppc to powerpc architecture and adding memory mapped RapidIO driver.
From: Kumar Gala @ 2007-07-27  8:28 UTC (permalink / raw)
  To: Zhang Wei; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <11854393721520-git-send-email-wei.zhang@freescale.com>


On Jul 26, 2007, at 3:42 AM, Zhang Wei wrote:

> These patches are the version 3 patches for RapidIO with dts update  
> and some minor fixups.
>
> These patches are used for supporting RapidIO controllers of  
> Freescale. I ported them from ppc architecture to powerpc  
> architecture and added some new features, such as memory mapped  
> driver.
>
> [PATCH 1/5] Add the explanation and sample of RapidIO DTS OF-node  
> to the document of booting-without-of.txt file.
> [PATCH 2/5] Add RapidIO OF-node to MPC8641HPCN board dts file.
> [PATCH 3/5] Add the platform device support with RapidIO to  
> MPC8641HPCN platform.
> [PATCH 4/5] Add RapidIO support to powerpc architecture.
> [PATCH 5/5] Add the memory management driver to RapidIO.
>
> Please see below descriptions of these patches:
> 1. Add the RapidIO driver of-device support.
> 2. Add the RapidIO driver support to MPC8641HPCN board.
> 3. Port the RapidIO from ppc to powerpc architecture.

Can we do the port from ppc as follows:
- cp arch/ppc/syslib/*85xx*rio to arch/powerpc/syslib/fsl_rio.{c,h}  
make everything still build
- rename cleanup the code in fsl_rio.{c,h}

this makes it easier to see what changes actually are to fsl_rio.{c,h}

> 4. Add Memory mapped RapidIO driver.
> 5. Add the support to multi master ports.
> 6. Add a simple bitmap RapidIO space allocator driver.
> 7. Change the RapidIO system size of menuconfig to automatically  
> detection.

also you describe 7 items, was expect 7 patches :)

- k

^ permalink raw reply

* Re: [PATCH 4/5 v3] Add RapidIO support to powerpc architecture.
From: Kumar Gala @ 2007-07-27  8:22 UTC (permalink / raw)
  To: Zhang Wei; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <11854393763547-git-send-email-wei.zhang@freescale.com>


On Jul 26, 2007, at 3:42 AM, Zhang Wei wrote:

> This patch adds the RapidIO support to the powerpc architecture.
> Some files are moved from ppc. OF-tree and OF-device supports are  
> added.
> New silicons such as MPC8548, MPC8641 with serial RapidIO  
> controller are
> all supported.
> Memory driver hardware operations are added.
> Global mport variables are changed to master port private variables.
> Multi master ports are supported.
>
> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> ---
>  arch/powerpc/Kconfig          |    8 +
>  arch/powerpc/kernel/Makefile  |    1 +
>  arch/powerpc/kernel/rio.c     |   64 ++
>  arch/powerpc/sysdev/Makefile  |    1 +
>  arch/powerpc/sysdev/fsl_rio.c | 1455 ++++++++++++++++++++++++++++++ 
> +++++++++++

how much of this moved from ppc85xx_rio.c?

>  arch/powerpc/sysdev/fsl_rio.h |   20 +
>  6 files changed, 1549 insertions(+), 0 deletions(-)
>  create mode 100644 arch/powerpc/kernel/rio.c
>  create mode 100644 arch/powerpc/sysdev/fsl_rio.c
>  create mode 100644 arch/powerpc/sysdev/fsl_rio.h
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 00099ef..45f32f1 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -492,6 +492,14 @@ source "drivers/pci/Kconfig"
>
>  source "drivers/pcmcia/Kconfig"
>
> +config RAPIDIO
> +	bool "RapidIO support" if MPC8540 || MPC8560 || MPC8641 || MPC8548
> +	help
> +	  If you say Y here, the kernel will include drivers and
> +	  infrastructure code to support RapidIO interconnect devices.

why not make this depend on something like HAS_RAPIDIO and let the  
boards select HAS_RAPIDIO if they have it

> +
> +source "drivers/rapidio/Kconfig"
> +
>  source "drivers/pci/hotplug/Kconfig"
>
>  endmenu
> diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/ 
> Makefile
> index 42c42ec..02d4100 100644
> --- a/arch/powerpc/kernel/Makefile
> +++ b/arch/powerpc/kernel/Makefile
> @@ -70,6 +70,7 @@ pci64-$(CONFIG_PPC64)		+= pci_64.o pci_dn.o isa- 
> bridge.o
>  pci32-$(CONFIG_PPC32)		:= pci_32.o
>  obj-$(CONFIG_PCI)		+= $(pci64-y) $(pci32-y) pci-common.o
>  obj-$(CONFIG_PCI_MSI)		+= msi.o
> +obj-$(CONFIG_RAPIDIO)		+= rio.o

should probably live in sysdev/rio.c

>  kexec-$(CONFIG_PPC64)		:= machine_kexec_64.o
>  kexec-$(CONFIG_PPC32)		:= machine_kexec_32.o
>  obj-$(CONFIG_KEXEC)		+= machine_kexec.o crash.o $(kexec-y)
> diff --git a/arch/powerpc/kernel/rio.c b/arch/powerpc/kernel/rio.c
> new file mode 100644
> index 0000000..8d41e93
> --- /dev/null
> +++ b/arch/powerpc/kernel/rio.c
> @@ -0,0 +1,64 @@
> +/*
> + * RapidIO PowerPC support
> + *
> + * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights  
> reserved.
> + * Zhang Wei <wei.zhang@freescale.com>, Jun 2007
> + *
> + * This program is free software; you can redistribute  it and/or  
> modify it
> + * under  the terms of  the GNU General  Public License as  
> published by the
> + * Free Software Foundation;  either version 2 of the  License, or  
> (at your
> + * option) any later version.
> + *
> + * New RapidIO peer-to-peer network initialize with of-device  
> supoort.
> + *
> + */
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/rio.h>
> +
> +#include <asm/rio.h>
> +#include <asm/of_device.h>
> +#include <asm/of_platform.h>
> +
> +#include <../sysdev/fsl_rio.h>
> +
> +
> +/* The probe function for RapidIO peer-to-peer network.
> + */
> +static int __devinit of_rio_rpn_probe(struct of_device *dev,
> +				     const struct of_device_id *match)
> +{
> +	int rc;
> +	printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n",
> +			dev->node->full_name);
> +
> +	rc = fsl_rio_setup(dev);
> +	if (rc)
> +		goto out;
> +
> +	/* Enumerate all registered ports */
> +	rc = rio_init_mports();
> +out:
> +	return rc;
> +};
> +
> +static struct of_device_id of_rio_rpn_ids[] = {
> +	{
> +		.compatible = "fsl,rapidio-delta",
> +	},
> +	{},
> +};
> +
> +static struct of_platform_driver of_rio_rpn_driver = {
> +	.name = "of-rio",
> +	.match_table = of_rio_rpn_ids,
> +	.probe = of_rio_rpn_probe,
> +};
> +
> +static __init int of_rio_rpn_init(void)
> +{
> +	return of_register_platform_driver(&of_rio_rpn_driver);
> +}

^ permalink raw reply

* Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi, register mmc_spi stub
From: Kumar Gala @ 2007-07-27  8:14 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20070726135738.GB5643@localhost.localdomain>


On Jul 26, 2007, at 8:57 AM, Anton Vorontsov wrote:

> mmc_spi already tested to work. When it will hit mainline
> the only change that would be needed is replacing "spidev"
> by "mmc_spi", and adding trivial platform data to mmc_spi
> driver.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>  arch/powerpc/boot/dts/mpc832x_rdb.dts     |   33 ++++++++++++++++++ 
> ++-
>  arch/powerpc/platforms/83xx/mpc832x_rdb.c |   46 ++++++++++++++++++ 
> +++++++++++
>  2 files changed, 78 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/ 
> boot/dts/mpc832x_rdb.dts
> index 7c4beff..5dcbdd3 100644
> --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
> +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
> @@ -183,6 +183,21 @@
>  					1  c  1  0  1  0 	/* TX_EN */
>  					1  d  2  0  1  0>;      /* CRS */
>  			};
> +			spi1pio:spi_pin@01 {
> +				pio-map = <
> +			/* port  pin  dir  open_drain  assignment  has_irq    */
> +					3  0  3  0  1  0	/* SPI1 MOSI, I/O */
> +					3  1  3  0  1  0	/* SPI1 MISO, I/O */
> +					3  2  3  0  1  0	/* SPI1 CLK,  I/O */
> +					3  3  2  0  1  0>;	/* SPI1 SEL,  I   */
> +			};
> +			mmc1pio:mmc_pin@01 {
> +				pio-map = <
> +			/* port  pin  dir  open_drain  assignment  has_irq    */
> +					3  d  1  0  0  0	/* !SD_CS     */
> +					3  e  2  0  0  0	/* SD_INSERT  */
> +					3  f  2  0  0  0>;	/* SD_PROTECT */
> +			};
>  		};
>  	};
>
> @@ -207,20 +222,36 @@
>
>  		spi@4c0 {
>  			device_type = "spi";
> +			device-id = <1>;

Can we just use the reg value for bus_num in the kernel.

>  			compatible = "fsl_spi";
>  			reg = <4c0 40>;
>  			interrupts = <2>;
>  			interrupt-parent = <&qeic>;
> -			mode = "cpu";
> +			mode = "qe";
> +			sysclk = <5f5e100>; /* 100000000 Hz */

we don't need this in the spi node, its just the system clock  
frequency which we can get other ways.

> +			max-chipselect = <1>;

I'm not sure how I feel about this in here, I'm thinking it should go.

> +			pio-handle = <&spi1pio>;
> +
> +			mmc@01 {
> +				device_type = "mmc";
> +				compatible = "mmc-spi";
> +				device-id = <1>;
> +				max-speed-hz = <bebc20>; /* 12500000 Hz */
> +				chip-select = <0>;
> +				pio-handle = <&mmc1pio>;
> +			};

we should do this in board code and not the device tree.

>  		};
>
>  		spi@500 {
>  			device_type = "spi";
> +			device-id = <2>;
>  			compatible = "fsl_spi";
>  			reg = <500 40>;
>  			interrupts = <1>;
>  			interrupt-parent = <&qeic>;
>  			mode = "cpu";
> +			sysclk = <5f5e100>; /* 100000000 Hz */
> +			max_chipselect = <1>;
>  		};
>
>  		ucc@3000 {
> diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/ 
> powerpc/platforms/83xx/mpc832x_rdb.c
> index b2b28a4..c5463c7 100644
> --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
> +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
> @@ -15,6 +15,7 @@
>   */
>
>  #include <linux/pci.h>
> +#include <linux/spi/spi.h>
>
>  #include <asm/of_platform.h>
>  #include <asm/time.h>
> @@ -24,6 +25,7 @@
>  #include <asm/qe_ic.h>
>
>  #include "mpc83xx.h"
> +#include "../../sysdev/fsl_soc.h"
>
>  #undef DEBUG
>  #ifdef DEBUG
> @@ -32,6 +34,43 @@
>  #define DBG(fmt...)
>  #endif
>
> +extern int par_io_data_set(u8 port, u8 pin, u8 val);
> +
> +static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity)
> +{
> +	pr_debug("%s %d %d\n", __func__, cs, polarity);
> +	par_io_data_set(3, 13, polarity);
> +}
> +
> +static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity)
> +{
> +	pr_debug("%s %d %d\n", __func__, cs, polarity);
> +	par_io_data_set(3, 13, !polarity);
> +}
> +
> +static int __init mpc83xx_spi_devices_init(void)
> +{
> +	struct spi_board_info spi_bi = {
> +		.bus_num = 1,
> +		/*
> +		 * XXX: This is spidev (spi in userspace) stub, should
> +		 * be replaced by "mmc_spi" when mmc_spi will hit mainline.
> +		 */
> +		.modalias = "spidev",
> +	};
> +	struct device_node *np = NULL;
> +
> +	np = of_find_compatible_node(np, "mmc", "mmc-spi");
> +	if (!np)
> +		return 0;
> +
> +	spi_bi.max_speed_hz = *((u32 *)of_get_property(np, "max-speed- 
> hz", NULL));
> +	spi_bi.chip_select = *((u32 *)of_get_property(np, "chip-select",  
> NULL));
> +
> +	return spi_register_board_info(&spi_bi, 1);
> +}
> +device_initcall(mpc83xx_spi_devices_init);
> +
>  /*  
> ********************************************************************** 
> **
>   *
>   * Setup the architecture
> @@ -62,8 +101,15 @@ static void __init mpc832x_rdb_setup_arch(void)
>
>  		for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
>  			par_io_of_config(np);
> +		for (np = NULL; (np = of_find_node_by_name(np, "spi")) != NULL;)
> +			par_io_of_config(np);
> +		for (np = NULL; (np = of_find_node_by_name(np, "mmc")) != NULL;)
> +			par_io_of_config(np);
>  	}
>  #endif				/* CONFIG_QUICC_ENGINE */
> +
> +	fsl_spi_activate_cs = mpc83xx_spi_activate_cs;
> +	fsl_spi_deactivate_cs = mpc83xx_spi_deactivate_cs;
>  }
>
>  static struct of_device_id mpc832x_ids[] = {
> -- 
> 1.5.0.6
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH 4/5 v3] Add RapidIO support to powerpc architecture.
From: Stephen Rothwell @ 2007-07-27  8:12 UTC (permalink / raw)
  To: Zhang Wei; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <11854393763547-git-send-email-wei.zhang@freescale.com>

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

On Thu, 26 Jul 2007 16:42:51 +0800 Zhang Wei <wei.zhang@freescale.com> wrote:
>
> +
> +#include <../sysdev/fsl_rio.h>

This can just be <sysdev/fsl_rio.h> if it is only built on 32bit.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH 3/5 v3] Add the platform device support with RapidIO to MPC8641HPCN platform.
From: Stephen Rothwell @ 2007-07-27  7:54 UTC (permalink / raw)
  To: Zhang Wei; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <11854393753986-git-send-email-wei.zhang@freescale.com>

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

On Thu, 26 Jul 2007 16:42:50 +0800 Zhang Wei <wei.zhang@freescale.com> wrote:
>
> +#include <asm/of_device.h>
> +#include <asm/of_platform.h>

These should now be <linux/of_device.h> and <linux/of_platform.h>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi, registermmc_spi stub
From: Kumar Gala @ 2007-07-27  7:55 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev
In-Reply-To: <02bd01c7cfbc$cf213610$02ac10ac@Jocke>


On Jul 26, 2007, at 2:40 PM, Joakim Tjernlund wrote:

>
>
>> -----Original Message-----
>> From: Anton Vorontsov [mailto:avorontsov@ru.mvista.com]
>> Sent: den 26 juli 2007 17:48
>> To: Joakim Tjernlund
>> Cc: linuxppc-dev@ozlabs.org
>> Subject: Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi,
>> registermmc_spi stub
>>
>> On Thu, Jul 26, 2007 at 05:36:06PM +0200, Joakim Tjernlund wrote:
>> [...]
>>>>  		spi@4c0 {
>>>>  			device_type = "spi";
>>>> +			device-id = <1>;
>>>>  			compatible = "fsl_spi";
>>>>  			reg = <4c0 40>;
>>>>  			interrupts = <2>;
>>>>  			interrupt-parent = <&qeic>;
>>>> -			mode = "cpu";
>>>> +			mode = "qe";
>>>
>>> The driver is still using "cpu" mode. It just happens that
>> the cpu mode for QE
>>> enabled CPUs isn't 100% compatible with the defacto cpu
>> mode used by other CPU:s.
>>
>> Yup, indeed.
>>
>>> So mode should probably be "cpu_qe" or, even better, if the
>> drver could
>>
>> That's easy to change, thanks.
>>
>>> autodetect that it is running on a QE enabled CPU and
>> adjust accordinly.
>>> Maybe the Freescale guys have some ideas how to do that.
>>
>> Ok. Well, for now could we use machine_is() for kind of autodetect?
>> Or it's better leave it as is, and just rename mode to cpu_qe?
>
> Unless the DTS guys thinks otherwise, just rename to "cpu_qe".
> "qe" would then be reserved for true QE mode.

Agreed, we need to update booting-without-of.txt.

- k

^ permalink raw reply

* Re: [RFC][PATCH] fsl_soc: add support for fsl_spi
From: Kumar Gala @ 2007-07-27  7:52 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev
In-Reply-To: <20070726210507.18829b9a@vitb.ru.mvista.com>


On Jul 26, 2007, at 12:05 PM, Vitaly Bordug wrote:

> On Thu, 26 Jul 2007 11:45:08 -0500
> Scott Wood <scottwood@freescale.com> wrote:
>
>> On Thu, Jul 26, 2007 at 05:56:55PM +0400, Anton Vorontsov wrote:
>>> +void (*fsl_spi_activate_cs)(u8 cs, u8 polarity) = NULL;
>>> +EXPORT_SYMBOL(fsl_spi_activate_cs);
>>> +void (*fsl_spi_deactivate_cs)(u8 cs, u8 polarity) = NULL;
>>> +EXPORT_SYMBOL(fsl_spi_deactivate_cs);
>>
>> What are these for?  It looks like you're using them to set pins,
>> but that should be done in the firmware (and if the firmware  
>> sucks, then
>> do it in the platform code at bootup).
>>
> That is not exactly the point.
> I won't respond for Anton, but we already had such hooks justified  
> in SPI case iirc.

No they are used for runtime chip select handling.  The SPI  
controller is able to handle multiple devices, however the chipselect  
is not specified by SPI and thus it left to board code.

>>> +static int __init fsl_spi_of_init(void)
>>> +{
>>> +	struct device_node *np;
>>> +	unsigned int i;
>>> +
>>> +	for (np = NULL, i = 1;
>>> +	     (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
>>> +	     i++) {
>>
>> s/fsl_spi/fsl,mpc8323-spi/, please.
>>
>> Why not make the fsl spi driver an of_platform device?
>>
> Because this particular thing is not ppc-only from what I recall.

The device node name already existed before this patch.

- k

^ permalink raw reply

* Re: creation of jffs2 rootfile system..
From: Florian A. Voegel @ 2007-07-27  8:40 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <11823840.post@talk.nabble.com>


Hi Nethra,

what does your inittab and your startup files look like? It looks like

- your inittab does not start a getty but rather a shell, thus no login
- your /proc isn't mounted, and it's needed for ps to work properly


Greets,

Florian Voegel
Carangul.Tech

On Thu, 26 Jul 2007 23:41:32 -0700 (PDT)
Nethra <nethra_gmit@yahoo.co.in> wrote:

> 
> when boot the board with jffs2 rootfile system i m getting output like this,
> 
> TCP: Hash tables configured (established 4096 bind 8192)
> IPv4 over IPv4 tunneling driver
> NET: Registered protocol family 1
> NET: Registered protocol family 10
> IPv6 over IPv4 tunneling driver
> NET: Registered protocol family 17
> Disabled Privacy Extensions on device c02527a0(lo)
> IP-Config: Incomplete network configuration information.
> Empty flash at 0x0000ffa0 ends at 0x00010000
> Empty flash at 0x0002ffec ends at 0x00030000
> Empty flash at 0x0004ffe8 ends at 0x00050000
> Empty flash at 0x0006ffc8 ends at 0x00070000
> Empty flash at 0x0008fffc ends at 0x00090000
> Empty flash at 0x000afffc ends at 0x000b0000
> Empty flash at 0x000cfffc ends at 0x000d0000
> Empty flash at 0x000efffc ends at 0x000f0000
> Empty flash at 0x0010fffc ends at 0x00110000
> Empty flash at 0x0012fffc ends at 0x00130000
> Empty flash at 0x0014fffc ends at 0x00150000
> Empty flash at 0x0016fffc ends at 0x00170000
> Empty flash at 0x0018fffc ends at 0x00190000
> Empty flash at 0x001cfffc ends at 0x001d0000
> Empty flash at 0x001efffc ends at 0x001f0000
> Empty flash at 0x0020fffc ends at 0x00210000
> Empty flash at 0x0022fffc ends at 0x00230000
> Empty flash at 0x0024fffc ends at 0x00250000
> Empty flash at 0x0026fffc ends at 0x00270000
> Empty flash at 0x002afffc ends at 0x002b0000
> Empty flash at 0x002cfffc ends at 0x002d0000
> VFS: Mounted root (jffs2 filesystem).
> Freeing unused kernel memory: 108k init
> 
> Please press Enter to activate this console.
> / #
> / #
> / #
> 
> login prompt itself is not coming and
>  
> ps command is not working....
> # ps
>   PID  Uid     VmSize Stat Command
> #
> 
> what is the problem..?
> 
> waiting for early response,
> Nethra
> 
> -- 
> View this message in context: http://www.nabble.com/creation-of-jffs2-rootfile-system..-tf4155759.html#a11823840
> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 

^ permalink raw reply

* Re: Decermenter overflow interrupt atfer the init.d launch.
From: Benjamin Herrenschmidt @ 2007-07-27  7:26 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, linuxppc-embedded
In-Reply-To: <D4037DB6-8832-4057-A9FF-BAD32592E6C9@kernel.crashing.org>

On Fri, 2007-07-27 at 01:46 -0500, Kumar Gala wrote:
> On Jul 27, 2007, at 1:36 AM, Nicolas Mederle wrote:
> 
> > Hi,
> >
> >        I want to know how the kernel switch the task. Because my  
> > kernel
> > start very well, and it launch  the init.d. With the log, i can see  
> > that
> > the kernel launch the getty task. But after, there is a decrementer
> > overflow interrupt  ( vector at adress 900 ). Is it the task  
> > switch? Or
> > is it an error in the decrementer init.
> 
> This should be a task switch.  The decrementer is used to handle the  
> periodic interrupt to switch processes.

I would have expected quite of few of these actually before you get
there :-)

Ben.

^ permalink raw reply

* Re: [PATCH] powerpc: Pegasos keyboard detection
From: Benjamin Herrenschmidt @ 2007-07-27  7:15 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Alan Curry, linux-kernel
In-Reply-To: <20070726212241.032e9755.akpm@linux-foundation.org>

On Thu, 2007-07-26 at 21:22 -0700, Andrew Morton wrote:
> 
> > Merged a fixed version:
> > 
> > f5d834fc34e61f1a40435981062000e5d2b2baa8
> > 
> > (In linus tree as of now)
> 
> I hope so.  Alan's patch looks rather different from what you have
> now:
> fall back to of_find_node_by_name() if of_find_node_by_type() failed.

Which is just waht that commit does :-)

Ben.

^ permalink raw reply

* Re: ping command
From: Nethra @ 2007-07-27  6:46 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <1185458965.6839.8.camel@saruman.qstreams.net>


root@cashel:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.32.0    0.0.0.0         255.255.248.0   U     0      0        0 eth1
0.0.0.0         192.168.32.47   0.0.0.0         UG    0      0        0 eth1
0.0.0.0         192.168.178.47  0.0.0.0         UG    0      0        0 eth0
root@cashel:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:13:72:FE:A9:02
          inet addr:192.168.178.89  Bcast:192.168.178.255 
Mask:255.255.255.0
          inet6 addr: fe80::213:72ff:fefe:a902/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15665 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9285 errors:0 dropped:0 overruns:0 carrier:9019
          collisions:0 txqueuelen:1000
          RX bytes:12957285 (12.3 MiB)  TX bytes:2720267 (2.5 MiB)
          Base address:0x8400

eth1      Link encap:Ethernet  HWaddr 00:13:72:7E:A9:02
          inet addr:192.168.33.135  Bcast:192.168.33.255  Mask:255.255.248.0
          inet6 addr: fe80::213:72ff:fe7e:a902/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:634 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84 errors:0 dropped:0 overruns:0 carrier:82
          collisions:0 txqueuelen:1000
          RX bytes:103558 (101.1 KiB)  TX bytes:12832 (12.5 KiB)
          Base address:0x8500

lo        Link encap:Local Loopback
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

root@cashel:~#


On Wed, 2007-07-25 at 02:29 -0700, Nethra wrote:
> hi,
> 
> I m using custom board same as eval board MPC8272ADS board.
> 
> IP assigned for both ethernets are...
> 
>               ifconfig eth1 192.168.33.135 up
> 	 ifconfig eth1 netmask 255.255.248.0
>  	 route add default gw 192.168.32.47 eth1
>  
> 
> 	 ifconfig eth0 192.168.178.89 up
> 	 ifconfig eth0netmask 255.255.255.0
> 	 route add default gw 192.168.178.47 eth0
> 
> but if i try for ping 192.168.33.135 command pails by the server of 178
> series
> similarly ping 192.168.178.89 command pails by the server of 33 series..
> 
> what is the problem..and whre i m going wrong..?

What does your routing table show?  (route -n).  It wouldn't hurt to
also post the output of ifconfig for both interfaces.

regards,
Ben

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded



-- 
View this message in context: http://www.nabble.com/ping-command-tf4141032.html#a11823845
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: Decermenter overflow interrupt atfer the init.d launch.
From: Kumar Gala @ 2007-07-27  6:46 UTC (permalink / raw)
  To: Nicolas Mederle; +Cc: linuxppc-dev, linuxppc-embedded
In-Reply-To: <46A9925A.2060508@yahoo.fr>


On Jul 27, 2007, at 1:36 AM, Nicolas Mederle wrote:

> Hi,
>
>        I want to know how the kernel switch the task. Because my  
> kernel
> start very well, and it launch  the init.d. With the log, i can see  
> that
> the kernel launch the getty task. But after, there is a decrementer
> overflow interrupt  ( vector at adress 900 ). Is it the task  
> switch? Or
> is it an error in the decrementer init.

This should be a task switch.  The decrementer is used to handle the  
periodic interrupt to switch processes.

- k

^ permalink raw reply

* creation of jffs2 rootfile system..
From: Nethra @ 2007-07-27  6:41 UTC (permalink / raw)
  To: linuxppc-embedded


when boot the board with jffs2 rootfile system i m getting output like this,

TCP: Hash tables configured (established 4096 bind 8192)
IPv4 over IPv4 tunneling driver
NET: Registered protocol family 1
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Disabled Privacy Extensions on device c02527a0(lo)
IP-Config: Incomplete network configuration information.
Empty flash at 0x0000ffa0 ends at 0x00010000
Empty flash at 0x0002ffec ends at 0x00030000
Empty flash at 0x0004ffe8 ends at 0x00050000
Empty flash at 0x0006ffc8 ends at 0x00070000
Empty flash at 0x0008fffc ends at 0x00090000
Empty flash at 0x000afffc ends at 0x000b0000
Empty flash at 0x000cfffc ends at 0x000d0000
Empty flash at 0x000efffc ends at 0x000f0000
Empty flash at 0x0010fffc ends at 0x00110000
Empty flash at 0x0012fffc ends at 0x00130000
Empty flash at 0x0014fffc ends at 0x00150000
Empty flash at 0x0016fffc ends at 0x00170000
Empty flash at 0x0018fffc ends at 0x00190000
Empty flash at 0x001cfffc ends at 0x001d0000
Empty flash at 0x001efffc ends at 0x001f0000
Empty flash at 0x0020fffc ends at 0x00210000
Empty flash at 0x0022fffc ends at 0x00230000
Empty flash at 0x0024fffc ends at 0x00250000
Empty flash at 0x0026fffc ends at 0x00270000
Empty flash at 0x002afffc ends at 0x002b0000
Empty flash at 0x002cfffc ends at 0x002d0000
VFS: Mounted root (jffs2 filesystem).
Freeing unused kernel memory: 108k init

Please press Enter to activate this console.
/ #
/ #
/ #

login prompt itself is not coming and
 
ps command is not working....
# ps
  PID  Uid     VmSize Stat Command
#

what is the problem..?

waiting for early response,
Nethra

-- 
View this message in context: http://www.nabble.com/creation-of-jffs2-rootfile-system..-tf4155759.html#a11823840
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Decermenter overflow interrupt atfer the init.d launch.
From: Nicolas Mederle @ 2007-07-27  6:36 UTC (permalink / raw)
  To: linuxppc-dev, linuxppc-embedded

Hi,

       I want to know how the kernel switch the task. Because my kernel 
start very well, and it launch  the init.d. With the log, i can see that 
the kernel launch the getty task. But after, there is a decrementer 
overflow interrupt  ( vector at adress 900 ). Is it the task switch? Or 
is it an error in the decrementer init.

-- 

Cordialement,

MEDERLE Nicolas.

^ permalink raw reply

* Re: [spi-devel-general] [PATCH 0/4] Few spi_mpc83xx.c fixes and improvements
From: Kumar Gala @ 2007-07-27  6:32 UTC (permalink / raw)
  To: David Brownell; +Cc: linuxppc-dev, spi-devel-general
In-Reply-To: <200707261958.09127.david-b@pacbell.net>


On Jul 26, 2007, at 9:58 PM, David Brownell wrote:

> On Thursday 26 July 2007, Anton Vorontsov wrote:
>> Hi all,
>>
>> These patches based on Linus' tree, as of today.
>
> I don't know mpc83xx ... are there any PPC folk who can see
> any reason not to just merge these patches?  They look OK
> to me, but in this case that doesn't mean much.  :)
>
> If I don't hear otherwise, I'll forward all four of these
> patches upstream on Monday.
>
> (Anton, thanks for these updates!)

These all look good to me for upstream.

Acked-off-by: Kumar Gala <galak@kernel.crashing.org>

- k

^ permalink raw reply

* Re: [spi-devel-general] [PATCH 1/4] [POWERPC][SPI] spi_mpc83xx.c: should turn off SPI unit while switching any mode.
From: Kumar Gala @ 2007-07-27  6:32 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: spi-devel-general, linuxppc-dev
In-Reply-To: <20070726131346.GA3417@localhost.localdomain>


On Jul 26, 2007, at 8:13 AM, Anton Vorontsov wrote:

> Documentation clearly states, that mode should not be changed
> till SPMODE_ENABLE bit set. I've seen hangs w/o this patch.

Out of interest what board/part do you see the hang on?

- k

^ permalink raw reply

* Re: [PATCH] xmon consistency clean up
From: Ishizaki Kou @ 2007-07-27  6:11 UTC (permalink / raw)
  To: benh, michael; +Cc: linuxppc-dev, paulus
In-Reply-To: <1185365630.21877.4.camel@concordia.ozlabs.ibm.com>

Michael Ellerman <michael@ellerman.id.au> wrote:
> On Wed, 2007-07-25 at 16:21 +1000, Benjamin Herrenschmidt wrote:
> > On Wed, 2007-07-25 at 11:57 +0900, Ishizaki Kou wrote:
> > > This patch cleans up xmon to keep consistency.
> > > 
> > > In xmon, we should use console I/O functions that are named the
same
> > > as user space stdio functions. But commit
> > > 4d404edce30f911004850d472e05a31efd751662 broke this consistency.
> > > 
> > > Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
> > > ---
> > > 
> > > Index: linux-powerpc-git/arch/powerpc/xmon/nonstdio.c
> > >
===================================================================
> > > --- linux-powerpc-git.orig/arch/powerpc/xmon/nonstdio.c
> > > +++ linux-powerpc-git/arch/powerpc/xmon/nonstdio.c
> > > @@ -133,7 +133,7 @@ void xmon_printf(const char *format, ...
> > >         xmon_write(xmon_outbuf, n);
> > >  }
> > >  
> > > -void xmon_puts(const char *str)
> > > +void xmon_fputs(const char *str)
> > >  {
> > >         xmon_write(str, strlen(str)); 
> > 
> > Nah, keep it xmon_puts, since it doesn't take a stream argument and
> > define a "puts" for use by xmon core.
> 
> But then it needs to add a newline .. and we've gone around in a
circle
> again. Funny how the trivialest of patches gets the most review.

In my opinion, our goal is providing stdio functions like fputs to
xmon.c. So, xmon_fputs need not be compatible with fputs because
xmon.c doesn't use it directly.

Best regards,
Kou Ishizaki

^ permalink raw reply

* Re: [PATCH] powerpc: Pegasos keyboard detection
From: Alan Curry @ 2007-07-27  4:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linuxppc-dev
In-Reply-To: <20070726212241.032e9755.akpm@linux-foundation.org>

Andrew Morton writes the following:
>> > 
>> > Did this get merged, or otherwise fixed?  Even though the code in there has
>> > changed quite a bit, it looks to my untrained eye like the fix is still
>> > applicable?
>> 
>> Merged a fixed version:
>> 
>> f5d834fc34e61f1a40435981062000e5d2b2baa8
>> 
>> (In linus tree as of now)
>
>I hope so.  Alan's patch looks rather different from what you have now:
>fall back to of_find_node_by_name() if of_find_node_by_type() failed.
>

Looking at it via gitweb, I think the commit mentioned above is actually the
same as what I submitted. The diff context lines are different because there
was a similar patch in between the 2.6.22 release and my patch, which
apparently fixed the same problem on a different type of machine. It looks
like these 2 workarounds will function independently of each other.

The first 8042-detection fix was:
db0dbae9d9680bce69fe1ce775709e60c8ee9c29

And mine is:
f5d834fc34e61f1a40435981062000e5d2b2baa8

-- 
Alan Curry
pacman@world.std.com

^ 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