* Re: [PATCH] mpc8540 : Fix restart
From: Philippe De Muyter @ 2008-04-09 23:06 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <64B092F9-7790-4655-AA12-B9010D87D0A4@kernel.crashing.org>
On Wed, Apr 09, 2008 at 05:51:40PM -0500, Kumar Gala wrote:
>
> On Apr 9, 2008, at 5:12 PM, Philippe De Muyter wrote:
>> Hi everybody,
>>
>> Previously, with the arch/ppc tree, mpc8540 boards could reboot.
>> Now with the arch/powerpc tree, they can not anymore.
>> Fix that.
>>
>> Signed-off-by: Philippe De Muyter <phdm@macqel.be>
>>
>> --- a/arch/powerpc/sysdev/fsl_soc.c 2008-03-21 14:53:41.000000000 +0000
>> +++ b/arch/powerpc/sysdev/fsl_soc.c 2008-03-26 12:08:25.000000000 +0000
>> @@ -1428,13 +1433,17 @@
>>
>> arch_initcall(setup_rstcr);
>>
>> +extern void abort(void);
>> +
>> void fsl_rstcr_restart(char *cmd)
>> {
>> local_irq_disable();
>> if (rstcr)
>> /* set reset control register */
>> out_be32(rstcr, 0x2); /* HRESET_REQ */
>> -
>> + else
>> + abort();
>> while (1) ;
>> +
>> }
>
> This was on purpose. abort() doesn't really do a restart and thus I didn't
> want it to be used that way.
>
What do you propose then ? The ability to reboot without power-off is
really needed for embedded targets. And abort() from head_fsl.S seems
really close to reboot.
Philippe
^ permalink raw reply
* Re: [PATCH] [POWERPC] 83xx/85xx: Reorganize defconfigs
From: Stephen Rothwell @ 2008-04-10 0:31 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0804091017440.18753@blarg.am.freescale.net>
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
Hi Kumar,
On Wed, 9 Apr 2008 10:18:06 -0500 (CDT) Kumar Gala <galak@kernel.crashing.org> wrote:
>
> Board specific defconfigs are useful, however with the ability to do
> multi-board defconfigs they aren't needed in the top level configs directory
>
> Move the 83xx/85xx board specific defconfigs to individual directories under
> arch/powerpc/configs.
So do we have multi-board defconfigs for 83xx and/or 85xx?
--
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] pseries: phyp dump: Variable size reserve space.
From: Paul Mackerras @ 2008-04-10 1:36 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Olof Johansson, mahuja, linasvepstas, linuxppc-dev
In-Reply-To: <76b6f0069fd6d80f69620e39c8528e9d@kernel.crashing.org>
Segher Boessenkool writes:
> >>> + tmp = tmp & ~0x000000001FFFFFFF;
>
> Note that this only works as you expect because the constant is
> signed here -- the extra zeroes do not magically make it a 64-bit
> number. So it goes 32-bit 0x1fffffff -> 32-bit -0x20000000 ->
> 64-bit -0x20000000.
Huh? It's not big enough to be negative when considered as a 32-bit
number...
But yes, adding a UL would be a good idea.
Paul.
^ permalink raw reply
* Kernel Panic - not syncing: Attempted to kill init!
From: Sreen Tallam @ 2008-04-10 2:07 UTC (permalink / raw)
To: linuxppc-embedded
Hi All,
Has anyone seen this error?
I am running a 2.6.18 kernel on a PPC 405GP using a AMCC Walnut board.
I added some printf's within the kernel to debug more information, and
it pointed to
init/main.c
under init() routine
in run_init_process(execute_command);
where execute_command = /sbin/tallam_init
=> tftp 0x800000 /tftpboot/tallam/kernel_5_2
ENET Speed is 100 Mbps - FULL duplex connection
Filename '/tftpboot/tallam/kernel_5_2'.
Load address: 0x800000
Loading: #################################################################
#################################################################
#################################################################
#######################################
done
Bytes transferred = 1196495 (1241cf hex)
=> bootm 0x800000
## Booting image at 00800000 ...
Image Name: Linux-2.6.18_pro500
Created: 2008-04-09 23:13:11 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1196431 Bytes = 1.1 MB
Load Address: 00400000
Entry Point: 0040053c
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Current stack ends at 0x03FAD548 => set upper limit to 0x00800000
## cmdline at 0x007FFC00 ... 0x007FFD14
gd address = 0x03FADF18
bd address = 0x03FADF48
memstart = 0x00000000
memsize = 0x04000000
flashstart = 0xFF000000
flashsize = 0x01000000
flashoffset = 0x00000000
sramstart = 0x00000000
sramsize = 0x00000000
bootflags = 0x0000A000
procfreq = 100 MHz
plb_busfreq = 100 MHz
pci_busfreq = 50 MHz
ethaddr = 00:xx:xx:04:4F:70
IP addr = 172.xx.xxx.177
baudrate = 9600 bps
No initrd
## Transferring control to Linux (at address 0040053c) ...
Memory <- <0x0 0x4000000> (64MB)
CPU clock-frequency <- 0x5f5e0ff (100MHz)
CPU timebase-frequency <- 0x5f5e0ff (100MHz)
/plb: clock-frequency <- 5f5e0ff (100MHz)
/plb/opb: clock-frequency <- 2faf07f (50MHz)
/plb/ebc: clock-frequency <- 2faf07f (50MHz)
/plb/opb/serial@ef600300: clock-frequency <- a98ac7 (11MHz)
/plb/opb/serial@ef600400: clock-frequency <- a98ac7 (11MHz)
ENET0: local-mac-address <- 00:xx:xx:04:4f:70
zImage starting: loaded at 0x00400000 (sp: 0x03fad3e8)
Allocating 0x299958 bytes for kernel ...
gunzipping (0x00000000 <- 0x0040d000:0x006a871c)...done 0x2740c0 bytes
Linux/PowerPC load:
mtdparts=phys_mapped_flash:64k@0k(envb),960k@64k(spare-log
s),6m@1m(jffs2b),768k@7m(kernelb),256k@7936k(u-bootb),64k@8m(envp),960k@8256k(
logs),6m@9m(jffs2p),768k@15m(kernelp),256k@16128k(u-bootp)
console=ttyS1,9600 rootfstype=jffs2 root=/dev/mtdblock7 ro
init=/sbin/tallam_init
Finalizing device tree... flat tree at 0x6b5420
id mach(): done
MMU:enter
MMU:hw init
MMU:mapin
MMU:setio
MMU:exit
Linux version 2.6.18_pro500 (gcc version 4.2. 0 ) #1 PREEMPT Wed
Apr 9 16:02:34 PDT 2008
Found legacy serial port 0 for /plb/opb/serial@ef600300
mem=ef600300, taddr=ef600300, irq=0, clk=11111111, speed=9600
Found legacy serial port 1 for /plb/opb/serial@e600400
mem=ef600400, taddr=ef600400, irq=0, clk=11111111, spHz
time_init: processor frequency = 99.999999 MHz
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 62228k/65536k available (2372k kernel code, 3248k reserved,
92k data, 146k bss, 156k init)
Calibrating delay loop... 198.65 BogoMIPS (lpj=397312)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
/plb/opb/gpio@ef600700: device found
PCI: Probing PCI hardware
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
/plb/opb/gpio@ef600700 character device (0) ready
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO map 0xef600300 mem 0xc5000300 (irq = 16)
is a 1655 0A
serial8250.0: ttyS1 at MMIO map 0xef600400 mem 0xc5002400 (irq = 17)
is a 1655 0A
console handover: boot [udbg0] -> real [ttyS1]
ef600300.serial: ttyS0 at MMIO map 0xef600300 mem 0xc5062300 (irq =
16) is a 1 6550A
ef600400.serial: ttyS1 at MMIO map 0xef600400 mem 0xc5064400 (irq =
17) is a 1 6550A
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: loaded (max 8 devices)
PPC 4xx OCP EMAC driver, version 3.54
MAL v1 /plb/mcmal, 1 TX channels, 1 RX channels
eth0: EMAC-0 /plb/opb/ethernet@ef600800, MAC 00:a0:xx:xx:4f:70
eth0: found Generic MII PHY (0x01)
i2c /dev entries driver
IBM IIC driver v2.1
ff000000.flash: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0040
ff000000.flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Creating 10 MTD partitions on "ff000000.flash":
0x00000000-0x00010000 : "envb"
0x00010000-0x00100000 : "spare-logs"
0x00100000-0x00700000 : "jffs2b"
0x00700000-0x007c0000 : "kernelb"
0x007c0000-0x00800000 : "u-bootb"
0x00800000-0x00810000 : "envp"
0x00810000-0x00900000 : "logs"
0x00900000-0x00f00000 : "jffs2p"
0x00f00000-0x00fc0000 : "kernelp"
0x00fc0000-0x01000000 : "u-bootp"
ip_conntrack version 2.4 (512 buckets, 4096 max) - 172 bytes per conntrack
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: timebase clocksource has been installed.
eth0: link is up, 100 FDX
IP-Config: Incomplete network configuration information.
VFS: Mounted root (jffs2 filesystem) readonly.
Freeing unused kernel memory: 156k init
Warning: unable to open an initial console.
init/main.c -- 819
init/main.c -- 821
init/main.c -- 844
init/main.c -- 704 -- /sbin/tallam_init<0>Kernel panic - not syncing:
Attempted to kill init!
Call Trace:
[C3FE7E60] [C0006D98] (unreliable)
[C3FE7EA0] [C001F150]
[C3FE7EF0] [C0023630]
[C3FE7F30] [C0023734]
[C3FE7F40] [C000DBC0]
<0>Rebooting in 180 seconds..
Any help will be appreciated.
Thanks,
Sreen
^ permalink raw reply
* Re: [PATCH 01/11] [POWERPC] bootwrapper: Allow specifying of image physical offset
From: Paul Mackerras @ 2008-04-10 2:25 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <C91EF39E-9776-4D7C-883E-F560A671E221@kernel.crashing.org>
Kumar Gala writes:
> So now we can look at the vmlinux and determine the physical offset.
> The question is how best to do that. Here are the options I see:
> * readelf, grep and parse output
> * objdump grep and parse output
> * simple C program that read's the elf and reports back
Either readelf or objdump for now, and if that proves to be fragile we
can look at a C program. You could do:
readelf -l $vmlinux | grep -m 1 LOAD | awk '{print $4}'
or
objdump -p $vmlinux | grep -m 1 LOAD | awk '{print $7}'
There's not a lot of difference. Since the wrapper already uses
objdump, I think we should use objdump rather than making the wrapper
depend on an additional program (readelf).
> The other questions is if we'd ever have a vmlinux with more than one
> PT_LOAD PHDR. If so which one do we use (the one with the lowest
> physical address)?
I think we would take the first one.
Paul.
^ permalink raw reply
* Re: Status of patches (ppc32 mm init clean and 85xx kernel reloc)
From: Paul Mackerras @ 2008-04-10 2:57 UTC (permalink / raw)
To: Kumar Gala; +Cc: ppc-dev list
In-Reply-To: <88C63CCF-7ED6-486F-8E95-FABD6CEE92E0@kernel.crashing.org>
Kumar Gala writes:
> [POWERPC] bootwrapper: Allow specifying of image physical offset
>
> reworked to look at PHDR (needs linker script update patch). Still
> open question on how best to do that (objdump, readelf, C program,
> suggestions)
Just replied about that one.
> [POWERPC] Remove Kconfig option BOOT_LOAD
>
> should be acceptable.
Looks OK.
> [POWERPC] Provide access to arch/powerpc include path on ppc64
Looks OK.
> [POWERPC] Remove and replace uses of PPC_MEMSTART with memstart_addr
>
> You had some questions about _stext and the PAGE_OFFSET vs
> KERNELBASE. Not sure if you are satisfied with the answers.
The kdump guys don't seem to be concerned, so I guess it's OK.
> [POWERPC] Introduce lowmem_end_addr to distiguish from total_lowmem
OK.
> [POWERPC] 85xx: Cleanup TLB initialization
>
> Only effects 85xx and I don't have issues with it :)
Cool :)
> [POWERPC] Use lowmem_end_addr to limit lmb allocations on ppc32
Looks fine.
> [POWERPC] Rename __initial_memory_limit to __initial_memory_limit_addr
Looks OK, though it seems a tad unnecessary.
> [POWERPC] Clean up some linker and symbol usage
>
> No comments. Straight forward patch.
Well, it is changing behaviour. In particular, klimit is not
necessarily the same as _end. It starts out initialized to &_end but
then gets advanced by some allocations very early in the boot IIRC.
It might be true by now that nothing reserves memory by advancing
klimit any more, but if that is true then the patch description needs
to mention that klimit is no longer used and this patch makes it no
longer usable. In fact in that case you should remove all mention of
klimit.
Also, this patch means that the region from PHYSICAL_START to
__pa(stext) is no longer reserved, which is another behaviour change
that deserves to be mentioned.
> [POWERPC] Move phys_addr_t definition into asm/types.h
>
> I had an open question if the Kconfig for PHYS_64BIT should get set on
> PPC64 as well (has not effect).
>
> I reworked the asm/types.h bits to look like:
> +#if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
> +typedef __u64 phys_addr_t;
> +#else
> +typedef __u32 phys_addr_t;
> +#endif
That looks OK.
> [POWERPC] 85xx: Add support for relocatble kernel (and booting at non-
> zero
>
> Should probably get a bit more review.
>
> [POWERPC] Update linker script to properly set physical addresses
>
> You felt LOAD_OFFSET should be (CONFIG_PAGE_OFFSET -
> CONFIG_PHYSICAL_START). I disagreed. We need to resolve.
I think you're right, actually, now, assuming that
CONFIG_PHYSICAL_START is the physical address of the start of the
kernel (actually, why don't you use that instead of __pa(stext) in
your patch [9/11]?).
> I think we should be able to quickly resolve and get into powerpc-next
> all but the '85xx: Add support for relocatable kernel' and
> 'bootwrapper: Allow specifying of image..' patches. If we can close
> on the phys_addr_t and linker script patches that would be great.
I'll put in the ones that look OK, and wait for you to resend the
others.
Paul.
^ permalink raw reply
* Re: [PATCH] [POWERPC] 83xx/85xx: Reorganize defconfigs
From: Kumar Gala @ 2008-04-10 3:11 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080410103131.f0dcf730.sfr@canb.auug.org.au>
On Apr 9, 2008, at 7:31 PM, Stephen Rothwell wrote:
> Hi Kumar,
>
> On Wed, 9 Apr 2008 10:18:06 -0500 (CDT) Kumar Gala <galak@kernel.crashing.org
> > wrote:
>>
>> Board specific defconfigs are useful, however with the ability to do
>> multi-board defconfigs they aren't needed in the top level configs
>> directory
>>
>> Move the 83xx/85xx board specific defconfigs to individual
>> directories under
>> arch/powerpc/configs.
>
> So do we have multi-board defconfigs for 83xx and/or 85xx?
Yeah the are mpc85xx_defconfig and mpc83xx_defconfig.
- k
^ permalink raw reply
* Re: [PATCH] pseries: phyp dump: Variable size reserve space.
From: Segher Boessenkool @ 2008-04-10 3:10 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Olof Johansson, mahuja, linasvepstas, linuxppc-dev
In-Reply-To: <18429.28416.578860.961632@cargo.ozlabs.ibm.com>
>>>>> + tmp = tmp & ~0x000000001FFFFFFF;
>>
>> Note that this only works as you expect because the constant is
>> signed here -- the extra zeroes do not magically make it a 64-bit
>> number. So it goes 32-bit 0x1fffffff -> 32-bit -0x20000000 ->
>> 64-bit -0x20000000.
>
> Huh? It's not big enough to be negative when considered as a 32-bit
> number...
0x1fffffff isn't, right; and that makes it a signed int. Applying
the complement operator to it turns it negative. And then the
implicit cast (because tmp is 64-bit) makes it 64-bit, still the
same negative value. Which is the expected result, but via a way
too tricky (and fragile) path :-)
Segher
^ permalink raw reply
* [PATCH 1/2] Add thread_info_cache_init() to all archs
From: Benjamin Herrenschmidt @ 2008-04-10 3:22 UTC (permalink / raw)
To: linux-kernel; +Cc: Linux-Arch, linuxppc-dev, takata, linux-m32r, Paul Mackerras
Some architecture need to maintain a kmem cache for thread info
structures. (next patch adds that to powerpc to fix an alignment
problem).
There is no good arch callback to use to initialize that cache
that I can find, so this adds a new one and adds an empty macro
for when it's not implemented.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
So we have the choice here between:
- the ifdef on the func name that I did, consistent with what
I did before for iomap, which iirc Linus liked
- add some more ARCH_HAS_* or HAVE_* (yuck)
- add an empty definition to all archs .h (pain in the neck but I
can do it, though it will be an annoying patch to keep around)
- do a weak function (will slightly bloat everybody for no good reason)
So unless there is strong complaints, I'd like to stick to my
current approach.
include/linux/sched.h | 4 ++++
init/main.c | 1 +
2 files changed, 5 insertions(+)
--- linux-work.orig/init/main.c 2008-04-10 13:11:06.000000000 +1000
+++ linux-work/init/main.c 2008-04-10 13:11:19.000000000 +1000
@@ -623,6 +623,7 @@ asmlinkage void __init start_kernel(void
if (efi_enabled)
efi_enter_virtual_mode();
#endif
+ thread_info_cache_init();
fork_init(num_physpages);
proc_caches_init();
buffer_init();
Index: linux-work/include/linux/sched.h
===================================================================
--- linux-work.orig/include/linux/sched.h 2008-04-10 13:11:44.000000000 +1000
+++ linux-work/include/linux/sched.h 2008-04-10 13:12:05.000000000 +1000
@@ -1893,6 +1893,10 @@ static inline unsigned long *end_of_stac
#endif
+#ifndef thread_info_cache_init
+#define thread_info_cache_init do { } while(0)
+#endif
+
/* set thread flags in other task's structures
* - see asm/thread_info.h for TIF_xxxx flags available
*/
^ permalink raw reply
* [PATCH 2/2] [POWERPC] Fix kernel stack allocation alignment
From: Benjamin Herrenschmidt @ 2008-04-10 3:22 UTC (permalink / raw)
To: linux-kernel; +Cc: Linux-Arch, linuxppc-dev, takata, linux-m32r, Paul Mackerras
The powerpc kernel stacks need to be naturally aligned, as they
contain the thread info at the bottom, which is obtained by
clearing the low bits of the stack pointer.
However, when using 64K pages (the stack is smaller than a page),
we use kmalloc to allocate it, which doesn't provide that guarantee.
It appeared to work so far... until one enables SLUB debugging
which then returns unaligned pointers. Ooops...
This patch fixes it by using a slab cache with enforced alignment
for those. It replies on my previous patch that adds a
thread_info_cache_init() callback.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Note that m32r seems to also have this problem.
arch/powerpc/kernel/process.c | 31 +++++++++++++++++++++++++++++++
include/asm-powerpc/thread_info.h | 10 ++++------
2 files changed, 35 insertions(+), 6 deletions(-)
--- linux-work.orig/arch/powerpc/kernel/process.c 2008-04-10 13:11:05.000000000 +1000
+++ linux-work/arch/powerpc/kernel/process.c 2008-04-10 13:14:29.000000000 +1000
@@ -1052,3 +1052,34 @@ void ppc64_runlatch_off(void)
}
}
#endif
+
+#if THREAD_SHIFT < PAGE_SHIFT
+
+static struct kmem_cache *thread_info_cache;
+
+struct thread_info *alloc_thread_info(struct task_struct *tsk)
+{
+ struct thread_info *ti;
+
+ ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL);
+ if (unlikely(ti == NULL))
+ return NULL;
+#ifdef CONFIG_DEBUG_STACK_USAGE
+ memset(ti, 0, THREAD_SIZE);
+#endif
+ return ti;
+}
+
+void free_thread_info(struct thread_info *ti)
+{
+ kmem_cache_free(thread_info_cache, ti);
+}
+
+void thread_info_cache_init(void)
+{
+ thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
+ THREAD_SIZE, 0, NULL);
+ BUG_ON(thread_info_cache == NULL);
+}
+
+#endif /* THREAD_SHIFT < PAGE_SHIFT */
Index: linux-work/include/asm-powerpc/thread_info.h
===================================================================
--- linux-work.orig/include/asm-powerpc/thread_info.h 2008-04-10 13:11:05.000000000 +1000
+++ linux-work/include/asm-powerpc/thread_info.h 2008-04-10 13:14:47.000000000 +1000
@@ -80,12 +80,10 @@ struct thread_info {
#else /* THREAD_SHIFT < PAGE_SHIFT */
-#ifdef CONFIG_DEBUG_STACK_USAGE
-#define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL)
-#else
-#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
-#endif
-#define free_thread_info(ti) kfree(ti)
+extern struct thread_info *alloc_thread_info(struct task_struct *tsk);
+extern void free_thread_info(struct thread_info *ti);
+extern void thread_info_cache_init(void);
+#define thread_info_cache_init thread_info_cache_init
#endif /* THREAD_SHIFT < PAGE_SHIFT */
^ permalink raw reply
* Re: [PATCH] [POWERPC] 83xx/85xx: Reorganize defconfigs
From: Stephen Rothwell @ 2008-04-10 4:24 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <6BE67DBD-325A-4628-8480-7EA0FE79DBE5@kernel.crashing.org>
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
On Wed, 9 Apr 2008 22:11:38 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> Yeah the are mpc85xx_defconfig and mpc83xx_defconfig.
So should we add mpc83xx_defconfig to the kisskb builds and remove
mpc885_ads_defconfig (we already do a mpc85xx_defconfig build)?
--
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] [POWERPC] 83xx/85xx: Reorganize defconfigs
From: Grant Likely @ 2008-04-10 4:29 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080410142430.256fd23e.sfr@canb.auug.org.au>
On Wed, Apr 9, 2008 at 10:24 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> On Wed, 9 Apr 2008 22:11:38 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
> >
> > Yeah the are mpc85xx_defconfig and mpc83xx_defconfig.
>
> So should we add mpc83xx_defconfig to the kisskb builds and remove
> mpc885_ads_defconfig (we already do a mpc85xx_defconfig build)?
Can mpc52xx_defconfig be added too?
Thanks,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: Question on mpc52xx_common.c
From: Robert Schwebel @ 2008-04-10 6:39 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40804081426u2c2a530ej8ecb6ce9f8fb49a0@mail.gmail.com>
Hi Grant,
On Tue, Apr 08, 2008 at 03:26:11PM -0600, Grant Likely wrote:
> I disagree and that is not my point.
Well, having something like a device tree that describes the hardware is
definitely a good thing, in general.
> Now, if out-of-tree ports continue to break then we've got a problem
> that needs to be fixed.
Right, that's the point. Don't get me wrong, I'm deeply against
maintaining large code bases out-of-tree. But it shows in this case that
we have a maintenance problem with the current oftree concept.
When a simple BSP that supports almost nothing than CPU, mem, serial
console and flash needs > 1 week of hacking from an experienced kernel
hacker, just in order to get all the string changes right, something is
wrong.
> Once a binding is established (which usually takes a few kernel
> releases) it should be very stable and even if the definition of ideal
> is changed, backwards compatibility must be maintained.
That's theory, but in practise we see it changing every second day.
> > The ARM method of using just a device number is so much easier ...
>
> Only if the assumption is made that very little data needs to be
> shared between the kernel and the firmware. The moment you try to do
> something more complex you either have the nightmare of bd_info or you
> use a structured data format (like the device tree)
I agree that the usual ARM hardwares are much less complicated and
configurable than what's available elsewhere. We usually need the
information "this is board FOO_BAR", maybe, if it is a module, on a
"BAZ" baseboard, and this is everything we need to register the platform
devices in some arch/arm/mach-*/my_cpu.c and arch/arm/mach-*/my_board.c
file.
> On another node, there are platforms where a device number is
> unworkable. For example, for Linux on an FPGA like the Xilinx Virtex,
> there would need to be a new platform number every time the FPGA
> bitstream was updated because it is effectively an entirely different
> platform.
Well, we have done FPGA based boards with ARM in the past, and we've
just added hardware auto-detection to the IP cores.
> Finally, using a device number means you need to encode into the
> kernel the exact layout of every platform it supports. That adds up
> to a lot of code in a real hurry; even if most of it is just
> boilerplate instantiations.
You are right in general. However, it doesn't change the fact that we
are living in maintenance-nightmare land right now ...
Robert
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9
^ permalink raw reply
* [PATCH 1/3] [POWERPC] iSeries: boot on a fake paca
From: Stephen Rothwell @ 2008-04-10 6:39 UTC (permalink / raw)
To: ppc-dev
The iSeries HV only needs the first two fields of the paca statically
initialised, so create an alternate paca that contains only those and
switch to our real paca immediately after boot.
This is in order to make the 1024 cpu patches easier since they will no
longer have to statically initialise the pacas for iSeries.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/asm-offsets.c | 6 ++++
arch/powerpc/platforms/iseries/exception.S | 12 +++++++-
arch/powerpc/platforms/iseries/lpardata.c | 39 ++++++++++++++++++++++++++-
include/asm-powerpc/iseries/alpaca.h | 31 ++++++++++++++++++++++
4 files changed, 84 insertions(+), 4 deletions(-)
create mode 100644 include/asm-powerpc/iseries/alpaca.h
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index e932b43..292c6d8 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -44,6 +44,9 @@
#include <asm/mmu.h>
#include <asm/hvcall.h>
#endif
+#ifdef CONFIG_PPC_ISERIES
+#include <asm/iseries/alpaca.h>
+#endif
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -321,6 +324,9 @@ int main(void)
DEFINE(PAGE_OFFSET_VSID, KERNEL_VSID(PAGE_OFFSET));
DEFINE(VMALLOC_START_ESID, GET_ESID(VMALLOC_START));
DEFINE(VMALLOC_START_VSID, KERNEL_VSID(VMALLOC_START));
+
+ /* alpaca */
+ DEFINE(ALPACA_SIZE, sizeof(struct alpaca));
#endif
DEFINE(PGD_TABLE_SIZE, PGD_TABLE_SIZE);
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S
index 5381038..c775cd4 100644
--- a/arch/powerpc/platforms/iseries/exception.S
+++ b/arch/powerpc/platforms/iseries/exception.S
@@ -38,11 +38,19 @@
.globl system_reset_iSeries
system_reset_iSeries:
- mfspr r13,SPRN_SPRG3 /* Get paca address */
+ mfspr r13,SPRN_SPRG3 /* Get alpaca address */
+ LOAD_REG_IMMEDIATE(r23, alpaca)
+ li r0,ALPACA_SIZE
+ sub r23,r13,r23
+ divdu r23,r23,r0 /* r23 has cpu number */
+ LOAD_REG_IMMEDIATE(r13, paca)
+ mulli r0,r23,PACA_SIZE
+ add r13,r13,r0
+ mtspr SPRN_SPRG3,r13 /* Save it away for the future */
mfmsr r24
ori r24,r24,MSR_RI
mtmsrd r24 /* RI on */
- lhz r24,PACAPACAINDEX(r13) /* Get processor # */
+ mr r24,r23
cmpwi 0,r24,0 /* Are we processor 0? */
bne 1f
b .__start_initialization_iSeries /* Start up the first processor */
diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c
index 8162049..dc84708 100644
--- a/arch/powerpc/platforms/iseries/lpardata.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -18,6 +18,7 @@
#include <asm/paca.h>
#include <asm/iseries/lpar_map.h>
#include <asm/iseries/it_lp_queue.h>
+#include <asm/iseries/alpaca.h>
#include "naca.h"
#include "vpd_areas.h"
@@ -159,6 +160,40 @@ struct SpCommArea xSpCommArea = {
.xFormat = 1,
};
+#define ALPACA_INIT(number) \
+{ \
+ .lppaca_ptr = &lppaca[number], \
+ .reg_save_ptr = &iseries_reg_save[number], \
+}
+
+struct alpaca alpaca[] = {
+ ALPACA_INIT( 0),
+#if NR_CPUS > 1
+ ALPACA_INIT( 1), ALPACA_INIT( 2), ALPACA_INIT( 3),
+#if NR_CPUS > 4
+ ALPACA_INIT( 4), ALPACA_INIT( 5), ALPACA_INIT( 6), ALPACA_INIT( 7),
+#if NR_CPUS > 8
+ ALPACA_INIT( 8), ALPACA_INIT( 9), ALPACA_INIT(10), ALPACA_INIT(11),
+ ALPACA_INIT(12), ALPACA_INIT(13), ALPACA_INIT(14), ALPACA_INIT(15),
+ ALPACA_INIT(16), ALPACA_INIT(17), ALPACA_INIT(18), ALPACA_INIT(19),
+ ALPACA_INIT(20), ALPACA_INIT(21), ALPACA_INIT(22), ALPACA_INIT(23),
+ ALPACA_INIT(24), ALPACA_INIT(25), ALPACA_INIT(26), ALPACA_INIT(27),
+ ALPACA_INIT(28), ALPACA_INIT(29), ALPACA_INIT(30), ALPACA_INIT(31),
+#if NR_CPUS > 32
+ ALPACA_INIT(32), ALPACA_INIT(33), ALPACA_INIT(34), ALPACA_INIT(35),
+ ALPACA_INIT(36), ALPACA_INIT(37), ALPACA_INIT(38), ALPACA_INIT(39),
+ ALPACA_INIT(40), ALPACA_INIT(41), ALPACA_INIT(42), ALPACA_INIT(43),
+ ALPACA_INIT(44), ALPACA_INIT(45), ALPACA_INIT(46), ALPACA_INIT(47),
+ ALPACA_INIT(48), ALPACA_INIT(49), ALPACA_INIT(50), ALPACA_INIT(51),
+ ALPACA_INIT(52), ALPACA_INIT(53), ALPACA_INIT(54), ALPACA_INIT(55),
+ ALPACA_INIT(56), ALPACA_INIT(57), ALPACA_INIT(58), ALPACA_INIT(59),
+ ALPACA_INIT(60), ALPACA_INIT(61), ALPACA_INIT(62), ALPACA_INIT(63),
+#endif
+#endif
+#endif
+#endif
+};
+
/* The LparMap data is now located at offset 0x6000 in head.S
* It was put there so that the HvReleaseData could address it
* with a 32-bit offset as required by the iSeries hypervisor
@@ -185,7 +220,7 @@ struct ItVpdAreas itVpdAreas = {
.xSlicVpdLens = { /* VPD lengths */
0,0,0, /* 0 - 2 */
sizeof(xItExtVpdPanel), /* 3 Extended VPD */
- sizeof(struct paca_struct), /* 4 length of Paca */
+ sizeof(struct alpaca), /* 4 length of (fake) Paca */
0, /* 5 */
sizeof(struct ItIplParmsReal),/* 6 length of IPL parms */
26992, /* 7 length of MS VPD */
@@ -203,7 +238,7 @@ struct ItVpdAreas itVpdAreas = {
.xSlicVpdAdrs = { /* VPD addresses */
0,0,0, /* 0 - 2 */
&xItExtVpdPanel, /* 3 Extended VPD */
- &paca[0], /* 4 first Paca */
+ &alpaca[0], /* 4 first (fake) Paca */
0, /* 5 */
&xItIplParmsReal, /* 6 IPL parms */
&xMsVpd, /* 7 MS Vpd */
diff --git a/include/asm-powerpc/iseries/alpaca.h b/include/asm-powerpc/iseries/alpaca.h
new file mode 100644
index 0000000..26fc081
--- /dev/null
+++ b/include/asm-powerpc/iseries/alpaca.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright © 2008 Stephen Rothwell IBM Corporation
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef _ASM_POWERPC_ISERIES_ALPACA_H
+#define _ASM_POWERPC_ISERIES_ALPACA_H
+
+/*
+ * This is the part of the paca that the iSeries hypervisor
+ * needs to be statically initialised. Immediately after boot
+ * we switch to the normal Linux paca.
+ */
+struct alpaca {
+ struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
+ void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
+};
+
+#endif /* _ASM_POWERPC_ISERIES_ALPACA_H */
--
1.5.4.5
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 2/3] [POWERPC] iSeries: make iseries_reg_save private to iSeries
From: Stephen Rothwell @ 2008-04-10 6:43 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20080410163918.257405e7.sfr@canb.auug.org.au>
Now that we have the alpaca, the reg_save_ptr is no longer needed in the
paca. Eradicate all global uses of it and make it static in the iSeries
lpardata.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/paca.c | 33 +++--------
arch/powerpc/platforms/iseries/lpardata.c | 72 +++++++++++++++++++---
arch/powerpc/xmon/xmon.c | 11 ---
include/asm-powerpc/iseries/it_lp_reg_save.h | 85 --------------------------
include/asm-powerpc/paca.h | 12 +---
5 files changed, 73 insertions(+), 140 deletions(-)
delete mode 100644 include/asm-powerpc/iseries/it_lp_reg_save.h
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 55f1a25..867b22d 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -15,7 +15,6 @@
#include <asm/ptrace.h>
#include <asm/page.h>
#include <asm/lppaca.h>
-#include <asm/iseries/it_lp_reg_save.h>
#include <asm/paca.h>
#include <asm/mmu.h>
@@ -25,13 +24,13 @@
extern unsigned long __toc_start;
/*
- * iSeries structure which the hypervisor knows about - this structure
+ * The structure which the hypervisor knows about - this structure
* should not cross a page boundary. The vpa_init/register_vpa call
* is now known to fail if the lppaca structure crosses a page
- * boundary. The lppaca is also used on POWER5 pSeries boxes. The
- * lppaca is 640 bytes long, and cannot readily change since the
- * hypervisor knows its layout, so a 1kB alignment will suffice to
- * ensure that it doesn't cross a page boundary.
+ * boundary. The lppaca is also used on legacy iSeries and POWER5
+ * pSeries boxes. The lppaca is 640 bytes long, and cannot readily
+ * change since the hypervisor knows its layout, so a 1kB alignment
+ * will suffice to ensure that it doesn't cross a page boundary.
*/
struct lppaca lppaca[] = {
[0 ... (NR_CPUS-1)] = {
@@ -66,32 +65,16 @@ struct slb_shadow slb_shadow[] __cacheline_aligned = {
* processors. The processor VPD array needs one entry per physical
* processor (not thread).
*/
-#define PACA_INIT_COMMON(number) \
+#define PACA_INIT(number) \
+{ \
.lppaca_ptr = &lppaca[number], \
.lock_token = 0x8000, \
.paca_index = (number), /* Paca Index */ \
.kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \
.hw_cpu_id = 0xffff, \
- .slb_shadow_ptr = &slb_shadow[number],
-
-#ifdef CONFIG_PPC_ISERIES
-#define PACA_INIT_ISERIES(number) \
- .reg_save_ptr = &iseries_reg_save[number],
-
-#define PACA_INIT(number) \
-{ \
- PACA_INIT_COMMON(number) \
- PACA_INIT_ISERIES(number) \
+ .slb_shadow_ptr = &slb_shadow[number], \
}
-#else
-#define PACA_INIT(number) \
-{ \
- PACA_INIT_COMMON(number) \
-}
-
-#endif
-
struct paca_struct paca[] = {
PACA_INIT(0),
#if NR_CPUS > 1
diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c
index dc84708..2331d97 100644
--- a/arch/powerpc/platforms/iseries/lpardata.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -14,7 +14,6 @@
#include <asm/ptrace.h>
#include <asm/abs_addr.h>
#include <asm/lppaca.h>
-#include <asm/iseries/it_lp_reg_save.h>
#include <asm/paca.h>
#include <asm/iseries/lpar_map.h>
#include <asm/iseries/it_lp_queue.h>
@@ -62,6 +61,63 @@ struct naca_struct naca = {
.xRamDiskSize = 0,
};
+struct ItLpRegSave {
+ u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003
+ u16 xSize; // Size of this class 004-005
+ u8 xInUse; // Area is live 006-007
+ u8 xRsvd1[9]; // Reserved 007-00F
+
+ u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F
+ u32 xCTRL; // Control Register 170-173
+ u32 xDEC; // Decrementer 174-177
+ u32 xFPSCR; // FP Status and Control Reg 178-17B
+ u32 xPVR; // Processor Version Number 17C-17F
+
+ u64 xMMCR0; // Monitor Mode Control Reg 0 180-187
+ u32 xPMC1; // Perf Monitor Counter 1 188-18B
+ u32 xPMC2; // Perf Monitor Counter 2 18C-18F
+ u32 xPMC3; // Perf Monitor Counter 3 190-193
+ u32 xPMC4; // Perf Monitor Counter 4 194-197
+ u32 xPIR; // Processor ID Reg 198-19B
+
+ u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F
+ u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3
+ u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7
+ u32 xPMC6; // Perf Monitor Counter 6 1A8-1AB
+ u32 xPMC7; // Perf Monitor Counter 7 1AC-1AF
+ u32 xPMC8; // Perf Monitor Counter 8 1B0-1B3
+ u32 xTSC; // Thread Switch Control 1B4-1B7
+ u32 xTST; // Thread Switch Timeout 1B8-1BB
+ u32 xRsvd; // Reserved 1BC-1BF
+
+ u64 xACCR; // Address Compare Control Reg 1C0-1C7
+ u64 xIMR; // Instruction Match Register 1C8-1CF
+ u64 xSDR1; // Storage Description Reg 1 1D0-1D7
+ u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF
+ u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7
+ u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF
+ u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7
+ u64 xTB; // Time Base Register 1F8-1FF
+
+ u64 xFPR[32]; // Floating Point Registers 200-2FF
+
+ u64 xMSR; // Machine State Register 300-307
+ u64 xNIA; // Next Instruction Address 308-30F
+
+ u64 xDABR; // Data Address Breakpoint Reg 310-317
+ u64 xIABR; // Inst Address Breakpoint Reg 318-31F
+
+ u64 xHID0; // HW Implementation Dependent0 320-327
+
+ u64 xHID4; // HW Implementation Dependent4 328-32F
+ u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337
+ u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F
+ u64 xSDAR; // Sample Data Address Register 340-347
+ u64 xSIAR; // Sample Inst Address Register 348-34F
+
+ u8 xRsvd3[176]; // Reserved 350-3FF
+};
+
extern void system_reset_iSeries(void);
extern void machine_check_iSeries(void);
extern void data_access_iSeries(void);
@@ -160,6 +216,13 @@ struct SpCommArea xSpCommArea = {
.xFormat = 1,
};
+static struct ItLpRegSave iseries_reg_save[] = {
+ [0 ... (NR_CPUS-1)] = {
+ .xDesc = 0xd397d9e2, /* "LpRS" */
+ .xSize = sizeof(struct ItLpRegSave),
+ },
+};
+
#define ALPACA_INIT(number) \
{ \
.lppaca_ptr = &lppaca[number], \
@@ -254,10 +317,3 @@ struct ItVpdAreas itVpdAreas = {
0,0
}
};
-
-struct ItLpRegSave iseries_reg_save[] = {
- [0 ... (NR_CPUS-1)] = {
- .xDesc = 0xd397d9e2, /* "LpRS" */
- .xSize = sizeof(struct ItLpRegSave),
- },
-};
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index a34172d..00fd764 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -45,7 +45,6 @@
#ifdef CONFIG_PPC64
#include <asm/hvcall.h>
#include <asm/paca.h>
-#include <asm/iseries/it_lp_reg_save.h>
#endif
#include "nonstdio.h"
@@ -1598,7 +1597,6 @@ void super_regs(void)
if (firmware_has_feature(FW_FEATURE_ISERIES)) {
struct paca_struct *ptrPaca;
struct lppaca *ptrLpPaca;
- struct ItLpRegSave *ptrLpRegSave;
/* Dump out relevant Paca data areas. */
printf("Paca: \n");
@@ -1611,15 +1609,6 @@ void super_regs(void)
printf(" Saved Gpr3=%.16lx Saved Gpr4=%.16lx \n",
ptrLpPaca->saved_gpr3, ptrLpPaca->saved_gpr4);
printf(" Saved Gpr5=%.16lx \n", ptrLpPaca->saved_gpr5);
-
- printf(" Local Processor Register Save Area (LpRegSave): \n");
- ptrLpRegSave = ptrPaca->reg_save_ptr;
- printf(" Saved Sprg0=%.16lx Saved Sprg1=%.16lx \n",
- ptrLpRegSave->xSPRG0, ptrLpRegSave->xSPRG0);
- printf(" Saved Sprg2=%.16lx Saved Sprg3=%.16lx \n",
- ptrLpRegSave->xSPRG2, ptrLpRegSave->xSPRG3);
- printf(" Saved Msr =%.16lx Saved Nia =%.16lx \n",
- ptrLpRegSave->xMSR, ptrLpRegSave->xNIA);
}
#endif
diff --git a/include/asm-powerpc/iseries/it_lp_reg_save.h b/include/asm-powerpc/iseries/it_lp_reg_save.h
deleted file mode 100644
index 5403b75..0000000
--- a/include/asm-powerpc/iseries/it_lp_reg_save.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2001 Mike Corrigan IBM Corporation
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-#ifndef _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
-#define _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
-
-/*
- * This control block contains the data that is shared between PLIC
- * and the OS
- */
-
-struct ItLpRegSave {
- u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003
- u16 xSize; // Size of this class 004-005
- u8 xInUse; // Area is live 006-007
- u8 xRsvd1[9]; // Reserved 007-00F
-
- u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F
- u32 xCTRL; // Control Register 170-173
- u32 xDEC; // Decrementer 174-177
- u32 xFPSCR; // FP Status and Control Reg 178-17B
- u32 xPVR; // Processor Version Number 17C-17F
-
- u64 xMMCR0; // Monitor Mode Control Reg 0 180-187
- u32 xPMC1; // Perf Monitor Counter 1 188-18B
- u32 xPMC2; // Perf Monitor Counter 2 18C-18F
- u32 xPMC3; // Perf Monitor Counter 3 190-193
- u32 xPMC4; // Perf Monitor Counter 4 194-197
- u32 xPIR; // Processor ID Reg 198-19B
-
- u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F
- u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3
- u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7
- u32 xPMC6; // Perf Monitor Counter 6 1A8-1AB
- u32 xPMC7; // Perf Monitor Counter 7 1AC-1AF
- u32 xPMC8; // Perf Monitor Counter 8 1B0-1B3
- u32 xTSC; // Thread Switch Control 1B4-1B7
- u32 xTST; // Thread Switch Timeout 1B8-1BB
- u32 xRsvd; // Reserved 1BC-1BF
-
- u64 xACCR; // Address Compare Control Reg 1C0-1C7
- u64 xIMR; // Instruction Match Register 1C8-1CF
- u64 xSDR1; // Storage Description Reg 1 1D0-1D7
- u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF
- u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7
- u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF
- u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7
- u64 xTB; // Time Base Register 1F8-1FF
-
- u64 xFPR[32]; // Floating Point Registers 200-2FF
-
- u64 xMSR; // Machine State Register 300-307
- u64 xNIA; // Next Instruction Address 308-30F
-
- u64 xDABR; // Data Address Breakpoint Reg 310-317
- u64 xIABR; // Inst Address Breakpoint Reg 318-31F
-
- u64 xHID0; // HW Implementation Dependent0 320-327
-
- u64 xHID4; // HW Implementation Dependent4 328-32F
- u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337
- u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F
- u64 xSDAR; // Sample Data Address Register 340-347
- u64 xSIAR; // Sample Inst Address Register 348-34F
-
- u8 xRsvd3[176]; // Reserved 350-3FF
-};
-
-extern struct ItLpRegSave iseries_reg_save[];
-
-#endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index 748b35a..eb61b9c 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -42,10 +42,7 @@ struct task_struct;
* Defines the layout of the paca.
*
* This structure is not directly accessed by firmware or the service
- * processor except for the first two pointers that point to the
- * lppaca area and the ItLpRegSave area for this CPU. The lppaca
- * object is currently contained within the PACA but it doesn't need
- * to be.
+ * processor.
*/
struct paca_struct {
/*
@@ -55,14 +52,7 @@ struct paca_struct {
* avoid cacheline bouncing.
*/
- /*
- * MAGIC: These first two pointers can't be moved - they're
- * accessed by the firmware
- */
struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
-#ifdef CONFIG_PPC_ISERIES
- void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
-#endif /* CONFIG_PPC_ISERIES */
/*
* MAGIC: the spinlock functions in arch/powerpc/lib/locks.c
--
1.5.4.5
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 3/3] [POWERPC] iSeries: localise and constify some iSeries data
From: Stephen Rothwell @ 2008-04-10 6:44 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20080410164347.2e3c4661.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/ipl_parms.h | 2 --
arch/powerpc/platforms/iseries/lpardata.c | 14 +++++++-------
arch/powerpc/platforms/iseries/naca.h | 2 +-
arch/powerpc/platforms/iseries/release_data.h | 2 +-
arch/powerpc/platforms/iseries/spcomm_area.h | 2 --
arch/powerpc/platforms/iseries/vpd_areas.h | 4 ++--
include/asm-powerpc/iseries/alpaca.h | 2 +-
7 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/ipl_parms.h b/arch/powerpc/platforms/iseries/ipl_parms.h
index 77c135d..83e4ca4 100644
--- a/arch/powerpc/platforms/iseries/ipl_parms.h
+++ b/arch/powerpc/platforms/iseries/ipl_parms.h
@@ -65,6 +65,4 @@ struct ItIplParmsReal {
u64 xRsvd13; // Reserved x38-x3F
};
-extern struct ItIplParmsReal xItIplParmsReal;
-
#endif /* _ISERIES_IPL_PARMS_H */
diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c
index 2331d97..98bd2d3 100644
--- a/arch/powerpc/platforms/iseries/lpardata.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -31,7 +31,7 @@
/* The HvReleaseData is the root of the information shared between
* the hypervisor and Linux.
*/
-struct HvReleaseData hvReleaseData = {
+const struct HvReleaseData hvReleaseData = {
.xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */
.xSize = sizeof(struct HvReleaseData),
.xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas),
@@ -186,7 +186,7 @@ struct ItLpNaca itLpNaca = {
};
/* May be filled in by the hypervisor so cannot end up in the BSS */
-struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
+static struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
/* May be filled in by the hypervisor so cannot end up in the BSS */
struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
@@ -209,14 +209,14 @@ u64 xMsVpd[3400] __attribute__((__section__(".data")));
/* Space for Recovery Log Buffer */
/* May be filled in by the hypervisor so cannot end up in the BSS */
-u64 xRecoveryLogBuffer[32] __attribute__((__section__(".data")));
+static u64 xRecoveryLogBuffer[32] __attribute__((__section__(".data")));
-struct SpCommArea xSpCommArea = {
+static const struct SpCommArea xSpCommArea = {
.xDesc = 0xE2D7C3C2,
.xFormat = 1,
};
-static struct ItLpRegSave iseries_reg_save[] = {
+static const struct ItLpRegSave iseries_reg_save[] = {
[0 ... (NR_CPUS-1)] = {
.xDesc = 0xd397d9e2, /* "LpRS" */
.xSize = sizeof(struct ItLpRegSave),
@@ -229,7 +229,7 @@ static struct ItLpRegSave iseries_reg_save[] = {
.reg_save_ptr = &iseries_reg_save[number], \
}
-struct alpaca alpaca[] = {
+const struct alpaca alpaca[] = {
ALPACA_INIT( 0),
#if NR_CPUS > 1
ALPACA_INIT( 1), ALPACA_INIT( 2), ALPACA_INIT( 3),
@@ -265,7 +265,7 @@ struct alpaca alpaca[] = {
* the Naca via the HvReleaseData area. The HvReleaseData has the
* offset into the Naca of the pointer to the ItVpdAreas.
*/
-struct ItVpdAreas itVpdAreas = {
+const struct ItVpdAreas itVpdAreas = {
.xSlicDesc = 0xc9a3e5c1, /* "ItVA" */
.xSlicSize = sizeof(struct ItVpdAreas),
.xSlicVpdEntries = ItVpdMaxEntries, /* # VPD array entries */
diff --git a/arch/powerpc/platforms/iseries/naca.h b/arch/powerpc/platforms/iseries/naca.h
index ab2372e..f01708e 100644
--- a/arch/powerpc/platforms/iseries/naca.h
+++ b/arch/powerpc/platforms/iseries/naca.h
@@ -14,7 +14,7 @@
struct naca_struct {
/* Kernel only data - undefined for user space */
- void *xItVpdAreas; /* VPD Data 0x00 */
+ const void *xItVpdAreas; /* VPD Data 0x00 */
void *xRamDisk; /* iSeries ramdisk 0x08 */
u64 xRamDiskSize; /* In pages 0x10 */
};
diff --git a/arch/powerpc/platforms/iseries/release_data.h b/arch/powerpc/platforms/iseries/release_data.h
index 66189fd..6ad7d84 100644
--- a/arch/powerpc/platforms/iseries/release_data.h
+++ b/arch/powerpc/platforms/iseries/release_data.h
@@ -58,6 +58,6 @@ struct HvReleaseData {
char xRsvd3[20]; /* Reserved x2C-x3F */
};
-extern struct HvReleaseData hvReleaseData;
+extern const struct HvReleaseData hvReleaseData;
#endif /* _ISERIES_RELEASE_DATA_H */
diff --git a/arch/powerpc/platforms/iseries/spcomm_area.h b/arch/powerpc/platforms/iseries/spcomm_area.h
index 6e3b685..598b7c1 100644
--- a/arch/powerpc/platforms/iseries/spcomm_area.h
+++ b/arch/powerpc/platforms/iseries/spcomm_area.h
@@ -31,6 +31,4 @@ struct SpCommArea {
u8 xRsvd2[80]; // Reserved 030-07F
};
-extern struct SpCommArea xSpCommArea;
-
#endif /* _ISERIES_SPCOMM_AREA_H */
diff --git a/arch/powerpc/platforms/iseries/vpd_areas.h b/arch/powerpc/platforms/iseries/vpd_areas.h
index 601e6dd..feb001f 100644
--- a/arch/powerpc/platforms/iseries/vpd_areas.h
+++ b/arch/powerpc/platforms/iseries/vpd_areas.h
@@ -80,9 +80,9 @@ struct ItVpdAreas {
u32 xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths 080-0A7
u32 xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens 0A8-0CF
u32 xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths 0D0-12F
- void *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF
+ const void *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF
};
-extern struct ItVpdAreas itVpdAreas;
+extern const struct ItVpdAreas itVpdAreas;
#endif /* _ISERIES_VPD_AREAS_H */
diff --git a/include/asm-powerpc/iseries/alpaca.h b/include/asm-powerpc/iseries/alpaca.h
index 26fc081..c0cce67 100644
--- a/include/asm-powerpc/iseries/alpaca.h
+++ b/include/asm-powerpc/iseries/alpaca.h
@@ -25,7 +25,7 @@
*/
struct alpaca {
struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
- void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
+ const void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
};
#endif /* _ASM_POWERPC_ISERIES_ALPACA_H */
--
1.5.4.5
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* Re: [PATCH] powerpc TLF_RESTORE_SIGMASK
From: Andrew Morton @ 2008-04-10 6:51 UTC (permalink / raw)
To: Roland McGrath; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <20080403210842.6C88C26F98D@magilla.localdomain>
On Thu, 3 Apr 2008 14:08:42 -0700 (PDT) Roland McGrath <roland@redhat.com> wrote:
> This requires the earlier HAVE_SET_RESTORE_SIGMASK patch series.
> This does the same for powerpc that I posted the x86 change for.
>
> ---
> Replace TIF_RESTORE_SIGMASK with TLF_RESTORE_SIGMASK and define
> our own set_restore_sigmask() function. This saves the costly
> SMP-safe set_bit operation, which we do not need for the sigmask
> flag since TIF_SIGPENDING always has to be set too.
>
> Signed-off-by: Roland McGrath <roland@redhat.com>
> ---
> arch/powerpc/kernel/entry_32.S | 4 ++--
> arch/powerpc/kernel/signal.c | 12 ++++++------
> arch/powerpc/kernel/signal_32.c | 2 +-
> include/asm-powerpc/thread_info.h | 17 +++++++++++++----
> 4 files changed, 22 insertions(+), 13 deletions(-)
This crashes my powerpc mac g5.
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting. Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Unable to handle kernel paging request for data at address 0x0000003d
Faulting instruction address: 0xc0000000000dbc3c
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=4 PowerMac
Modules linked in: autofs
NIP: c0000000000dbc3c LR: c0000000000dbda8 CTR: c0000000000dbd40
REGS: c000000178607a70 TRAP: 0300 Not tainted (2.6.25-rc8-mm2)
MSR: 9000000000009032 <EE,ME,IR,DR> CR: 42284448 XER: 20000000
DAR: 000000000000003d, DSISR: 0000000040000000
TASK = c000000178f792e0[2488] 'zsh' THREAD: c000000178604000 CPU: 0
GPR00: c0000000000dbda8 c000000178607cf0 c0000000006df7e8 000000000000000d
GPR04: 0000000000000000 0000000000000001 00000000ffb46c08 0000000000000001
GPR08: 00000000f7ff8000 c000000178607ea0 c0000000000dbd40 000000000000000d
GPR12: 100000000000d032 c000000000622e80 0000000010090000 0000000000000000
GPR16: 0000000000000001 0000000010090000 0000000010092ff8 00000000100ac34c
GPR20: 0000000000000000 0000000000000001 0000000000000000 0000000000000001
GPR24: 0000000000000000 00000000ffb46c08 000000000000000d 0000000000000000
GPR28: 0000000000000000 0000000000000001 c00000000068ff50 ffffffffffffffea
NIP [c0000000000dbc3c] .vfs_llseek+0x1c/0x84
LR [c0000000000dbda8] .sys_llseek+0x68/0xf0
Call Trace:
[c000000178607cf0] [c00000000009e210] .audit_syscall_exit+0x3fc/0x40c (unreliable)
[c000000178607d70] [c0000000000dbda8] .sys_llseek+0x68/0xf0
[c000000178607e30] [c00000000000872c] syscall_exit+0x0/0x40
Instruction dump:
e93c0018 e9690010 e80b0068 7fff0214 4bffff94 7c0802a6 fbc1fff0 ebc2abe8
7c6b1b78 f8010010 f821ff81 60000000 <80030030> 7809f7e3 e93e8000 41820024
It happens after the boot, during the first login-over-ssh.
This is with most of the rest of the -mm poopile applied. i386 and x86_64
seem OK.
^ permalink raw reply
* Re: Kernel Panic - not syncing: Attempted to kill init!
From: Sebastian Siewior @ 2008-04-10 8:50 UTC (permalink / raw)
To: Sreen Tallam; +Cc: linuxppc-embedded
In-Reply-To: <5b1d25eb0804091907n7b1d6faewf66b5d664e40c115@mail.gmail.com>
* Sreen Tallam | 2008-04-09 19:07:01 [-0700]:
>VFS: Mounted root (jffs2 filesystem) readonly.
>Freeing unused kernel memory: 156k init
>Warning: unable to open an initial console.
>init/main.c -- 819
>init/main.c -- 821
>init/main.c -- 844
>init/main.c -- 704 -- /sbin/tallam_init<0>Kernel panic - not syncing:
>Attempted to kill init!
>Call Trace:
>[C3FE7E60] [C0006D98] (unreliable)
>[C3FE7EA0] [C001F150]
>[C3FE7EF0] [C0023630]
>[C3FE7F30] [C0023734]
>[C3FE7F40] [C000DBC0]
> <0>Rebooting in 180 seconds..
>
This looks like you are missing /dev/console and probably /dev/null. You
need atleast those two nodes in your rootfs if you are using udev. You
will need a static /dev if you don't use udev/mdev.
>Thanks,
>Sreen
Sebastian
^ permalink raw reply
* Re: [PATCH] [POWERPC] 83xx/85xx: Reorganize defconfigs
From: Kumar Gala @ 2008-04-10 8:51 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080410142430.256fd23e.sfr@canb.auug.org.au>
On Apr 9, 2008, at 11:24 PM, Stephen Rothwell wrote:
> On Wed, 9 Apr 2008 22:11:38 -0500 Kumar Gala <galak@kernel.crashing.org
> > wrote:
>>
>> Yeah the are mpc85xx_defconfig and mpc83xx_defconfig.
>
> So should we add mpc83xx_defconfig to the kisskb builds and remove
> mpc885_ads_defconfig (we already do a mpc85xx_defconfig build)?
We should probably add mpc83xx_defconfig to kisskb. However,
mpc885_ads_defconfig is an 8xx (extreme low end) and mpc85xx_defconfig
(higher end) cover two different processor families so we shouldn't
drop mpc885_ads_defconfig.
- k
^ permalink raw reply
* Re: MPC8343 - "unable to handle paging request @ 0"
From: Andre Schwarz @ 2008-04-10 9:00 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <47FD15E2.2050907@freescale.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8; format=flowed, Size: 8888 bytes --]
Scott Wood schrieb:
> Andre Schwarz wrote:
>> Scott Wood schrieb:
>>> Andre Schwarz wrote:
>>>> -> find_legacy_serial_port()
>>>> stdout is /soc8343@e0000000/serial@4500
>>>
>>> It looks like you have some memory corruption between here...
>>>
>>>> clocksource: timebase mult[3c00001] shift[22] registered
>>>>
>>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>>>> -> check_legacy_serial_console()
>>>> can't find stdout package /soc8343@e0000000/serial@4500 !
>>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>>>
>>> ...and here.
>>>
>>> -Scott
>>
>> Scott,
>>
>> are you talking about a possible hardware problem or misbehaving code ?
>
> Either. The same OF call is done in both places with the same
> argument, but is getting different results.
>
>> Does it look like something gets overwritten during initrd
>> extraction/movement ?
>
> Don't know.
>
>> The system has 512MB RAM which means that we need 2 BAT regs to map
>> the memory. I've found comments in Freescale u-boot header files that
>> currently a max of 256MB is supported. I never understood why ? Could
>> this problem be related to this ?
>
> Kim's probably be the best one to answer u-boot questions.
>
> -Scott
>
Scott + Kim,
as mentioned before I have re-built u-boot with the following
modifications :
- Reduce Memsize from 512 to 256MB
- Skipped 2nd BAT setup
dtb looks the same but memory size set to 256MB.
System boots fine - this is weird !
I'm not really familiar with the powerpc tree of the kernel and far out
of sync with the current development.
Could you have a look at this ?
Any ideas right now ?
Thanks,
Andre
## Booting kernel from Legacy Image at ff810000 ...
Image Name: 2.6.25 mvBL-M7 MPC8343 #12
Image Type: PowerPC Linux Kernel Image (uncompressed)
Data Size: 2494236 Bytes = 2.4 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
## Flattened Device Tree blob at 00000000
Booting using the fdt blob at 0x600000
## Loading init Ramdisk from Legacy Image at 01000000 ...
Image Name: mvBC-1G uInitrd #1.1.03
Image Type: PowerPC Linux RAMDisk Image (uncompressed)
Data Size: 2654208 Bytes = 2.5 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Ramdisk to 0fcb7000, end 0ff3f000 ... OK
-> early_init_devtree(c0600000)
search "chosen", depth: 0, uname:
search "chosen", depth: 1, uname: chosen
Looking for initrd properties... <3>initrd_start=0xcfcb7000
initrd_end=0xcff3f000
Command line is: root=/dev/ram ro rootfstype=squashfs
dt_root_size_cells = 1
dt_root_addr_cells = 1
memory scan node memory, reg size 8, data: 0 10000000 2 1,
- 0 , 10000000
reserving: fcb7000 -> 288001
Phys. mem: 10000000
-> move_device_tree
<- move_device_tree
Scanning CPUs ...
boot cpu: logical 0 physical 0
<- early_init_devtree()
Using mvBlueLYNX-M7 machine description
Linux version 2.6.25-rc8-01197-g1de15bb-dirty (root@nova) (gcc version
4.0.0 (DENX ELDK 4.1 4.0.0)) #12 PREEMPT Wed Apr 9 14:40:48 CEST 2008
-> unflatten_device_tree()
size is 192c, allocating...
unflattening cfffe6d0...
fixed up name for ->
fixed up name for chosen -> chosen
fixed up name for wdt@200 -> wdt
fixed up name for ethernet-phy@0 -> ethernet-phy
fixed up name for ethernet-phy@1 -> ethernet-phy
fixed up name for ethernet@24000 -> ethernet
fixed up name for ethernet@25000 -> ethernet
fixed up name for serial@4500 -> serial
fixed up name for serial@4600 -> serial
fixed up name for pic@700 -> pic
fixed up name for ppcboot_env@0 -> ppcboot_env
fixed up name for ppcboot_env_red@0x2000 -> ppcboot_env_red
fixed up name for u-boot_autoscript@0x4000 -> u-boot_autoscript
fixed up name for u-boot_autoscript_red@0x4000 -> u-boot_autoscript_red
fixed up name for dtb@0x8000 -> dtb
fixed up name for dtb_red@0xa000 -> dtb_red
fixed up name for kernel@0x10000 -> kernel
fixed up name for rfs@0x400000 -> rfs
fixed up name for u-boot@0x700000 -> u-boot
fixed up name for fpga@0x780000 -> fpga
<- unflatten_device_tree()
Found initrd at 0xcfcb7000:0xcff3f000
-> find_legacy_serial_port()
stdout is /soc8343@e0000000/serial@4500
legacy_serial_console = 0
default console speed = 115740
<- find_legacy_serial_port()
console [udbg0] enabled
setup_arch: bootmem
mvblm7_setup_arch()
Adding PCI host bridge /pci@e0008500
Found MPC83xx PCI host bridge at 0x00000000e0008500. Firmware bus
number: 0->0
->Hose at 0xc0281000, cfg_addr=0xfdffd300,cfg_data=0xfdffd304
PCI host bridge /pci@e0008500 (primary) ranges:
MEM 0x0000000090000000..0x000000009fffffff -> 0x0000000090000000
MEM 0x0000000080000000..0x000000008fffffff -> 0x0000000080000000 Prefetch
IO 0x00000000e2000000..0x00000000e20fffff -> 0x0000000000000000
arch: exit
Zone PFN ranges:
DMA 0 -> 65536
Normal 65536 -> 65536
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0 -> 65536
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: root=/dev/ram ro rootfstype=squashfs
IPIC (128 IRQ sources) at fdefc700
PID hash table entries: 1024 (order: 10, 4096 bytes)
clocksource: timebase mult[3c00001] shift[22] registered
-> check_legacy_serial_console()
stdout is /soc8343@e0000000/serial@4500
Found serial console at ttyS0
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 254396k/262144k available (2328k kernel code, 7428k reserved,
88k data, 126k bss, 140k init)
SLUB: Genslabs=12, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
net_namespace: 152 bytes
NET: Registered protocol family 16
PCI: Probing PCI hardware
Try to map irq for 0000:00:00.0...
pci_busdev_to_OF_node(0,0x0)
parent is /pci@e0008500
result is <NULL>
Try to map irq for 0000:00:0b.0...
pci_busdev_to_OF_node(0,0x58)
parent is /pci@e0008500
result is <NULL>
-> got one, spec 2 cells (0x00000030 0x00000008...) on
/soc8343@e0000000/pic@700
-> mapped to linux irq 48
PCI->OF bus map:
0 -> 0
PCI: PHB (bus 0) bridge rsrc 0: 0000000000000000-00000000000fffff
[0x100], parent c024a074 (PCI IO)
PCI: PHB (bus 0) bridge rsrc 1: 0000000090000000-000000009fffffff
[0x200], parent c024a058 (PCI mem)
PCI: PHB (bus 0) bridge rsrc 2: 0000000080000000-000000008fffffff
[0x1200], parent c024a058 (PCI mem)
PCI: Allocating 0000:00:0b.0: Resource 0:
0000000090000000..0000000090007fff [200]
PCI: Assigning unassigned resouces...
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
checking if image is initramfs...it isn't (bad gzip magic numbers);
looks like an initrd
Freeing initrd memory: 2592k freed
Fixing serial ports interrupts and IO ports ...
fixup_port_irq(0)
fixup_port_mmio(0)
fixup_port_irq(1)
fixup_port_mmio(1)
Registering platform serial ports
squashfs: version 3.3 (2007/10/31) Phillip Lougher
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 18) is a 16550A
console
handover: boot [udbg0] -> real [ttyS0]
serial8250.0: ttyS1 at MMIO 0xe0004600 (irq = 19) is a 16550A
brd: module loaded
loop: module loaded
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 39, io base 0xe0022000
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
i2c /dev entries driver
24c01a EEPROM driver initialized
WDT driver for MPC83xx initialized. mode:reset timeout=65535 (16 seconds)
RAMDISK: squashfs filesystem found at block 0
RAMDISK: Loading 2591KiB [1 disk] into ram disk... done.
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 140k init
Mounting /proc
Mounting /tmp
MATRIX VISION mvBlueCOUGAR-1G gcc 4.0.0 Version: 15.05.2007
*************************************************
MATRIX VISION mvBlueCOUGAR-1G
*************************************************
executing /mnt/user/autostart ...
login[242]: root login on 'console'
BusyBox v1.4.2 (2007-05-15 09:04:24 CEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
-sh: can't access tty; job control turned off
mvBC-1G:~ $
mvBC-1G:~ $
MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
^ permalink raw reply
* Re: [PATCH 19 5/5] Convert pfc8563 i2c driver from old style to new style
From: Laurent Pinchart @ 2008-04-10 9:14 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-kernel, i2c
In-Reply-To: <20080112024748.7023.90680.stgit@terra.home>
[-- Attachment #1: Type: text/plain, Size: 3996 bytes --]
Hi Jon,
On Saturday 12 January 2008 03:47, Jon Smirl wrote:
> Convert pfc8563 i2c driver from old style to new style. The
> driver is also modified to support device tree names via the
> i2c mod alias mechanism.
The patch breaks the pfc8563 driver.
The old style driver allocated memory for a pcf8563 structure that
encapsulated an i2c_client instance. Various functions use container_of
on an i2c_client instance to get a pointer to the pcf8563 structure.
The new style driver gets rid of the pcf8563 structure allocation, as the
i2c_client structure is now allocated by I2C code.
Here is an incremental patch that fixes the issue.
From 1eac5a8e10e085c3a77c6ba7ed9dac9a39024915 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurentp@cse-semaphore.com>
Date: Thu, 10 Apr 2008 11:12:25 +0200
Subject: [PATCH] Fix pcf8563 breakage introduced by the conversion from old style to new style
The old style I2C driver used to allocate a pcf8563 instance that encapsulated
an i2c_client instance. The i2c_client instance is now allocated by I2C core.
This patch fixes the driver by storing the pcf8563 instance in the I2C client
data field.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
drivers/rtc/rtc-pcf8563.c | 29 ++++++++++++++++++-----------
1 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index e1ea2a0..7aab24e 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -50,7 +50,7 @@
#define PCF8563_MO_C 0x80 /* century */
struct pcf8563 {
- struct i2c_client client;
+ struct rtc_device *rtc;
/*
* The meaning of MO_C bit varies by the chip type.
* From PCF8563 datasheet: this bit is toggled when the years
@@ -74,7 +74,7 @@ struct pcf8563 {
*/
static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm)
{
- struct pcf8563 *pcf8563 = container_of(client, struct pcf8563, client);
+ struct pcf8563 *pcf8563 = i2c_get_clientdata(client);
unsigned char buf[13] = { PCF8563_REG_ST1 };
struct i2c_msg msgs[] = {
@@ -131,7 +131,7 @@ static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm)
static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm)
{
- struct pcf8563 *pcf8563 = container_of(client, struct pcf8563, client);
+ struct pcf8563 *pcf8563 = i2c_get_clientdata(client);
int i, err;
unsigned char buf[9];
@@ -252,10 +252,10 @@ static const struct rtc_class_ops pcf8563_rtc_ops = {
static int pcf8563_remove(struct i2c_client *client)
{
- struct rtc_device *rtc = i2c_get_clientdata(client);
+ struct pcf8563 *pcf8563 = i2c_get_clientdata(client);
- if (rtc)
- rtc_device_unregister(rtc);
+ if (pcf8563->rtc)
+ rtc_device_unregister(pcf8563->rtc);
return 0;
}
@@ -274,26 +274,33 @@ static struct i2c_driver pcf8563_driver = {
.name = "rtc-pcf8563",
},
.id = I2C_DRIVERID_PCF8563,
- .probe = &pcf8563_probe,
- .remove = &pcf8563_remove,
+ .probe = &pcf8563_probe,
+ .remove = &pcf8563_remove,
.id_table = pcf8563_id,
};
static int pcf8563_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
- int result;
+ struct pcf8563 *pcf8563;
struct rtc_device *rtc;
+ int result;
result = pcf8563_validate_client(client);
if (result)
return result;
+ if ((pcf8563 = kzalloc(sizeof(*pcf8563), GFP_KERNEL)) == NULL)
+ return -ENOMEM;
+
rtc = rtc_device_register(pcf8563_driver.driver.name, &client->dev,
&pcf8563_rtc_ops, THIS_MODULE);
- if (IS_ERR(rtc))
+ if (IS_ERR(rtc)) {
+ kfree(pcf8563);
return PTR_ERR(rtc);
+ }
- i2c_set_clientdata(client, rtc);
+ pcf8563->rtc = rtc;
+ i2c_set_clientdata(client, pcf8563);
return 0;
}
--
1.5.0
--
Laurent Pinchart
CSE Semaphore Belgium
Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
F +32 (2) 387 42 75
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related
* Re: [PATCH] [POWERPC] 4xx: Add endpoint support to 4xx PCIe driver
From: Benjamin Herrenschmidt @ 2008-04-10 9:27 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
In-Reply-To: <1207149149-17107-1-git-send-email-sr@denx.de>
On Wed, 2008-04-02 at 17:12 +0200, Stefan Roese wrote:
../..
Overall looks good, just a few things:
In general, while I have nothing against the idea of reading the HW
setup left by uboot, I wonder if it wouldn't be best to have this file
capable of fully configuring it in either mode based on DT properties
instead. The PCI node in endpoint mode would be called something
different, such as "pci-endpoint" and would contain some kind of
"endpoint-mode" property, maybe ? That way people using other
bootloaders or even booting of straight flash kernels can still use
this.
> +
> + out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(res->start));
> + out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(res->start));
> + }
>
> /* Enable inbound mapping */
> out_le32(mbase + PECFG_PIMEN, 0x1);
>
> - out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(res->start));
> - out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(res->start));
> -
does it work properly to setup the BARs before enabling the inbound
mapping ?
> * OMRs are already reset, also disable PIMs
> @@ -1531,14 +1569,26 @@ static void __init ppc4xx_pciex_port_setup_hose(struct ppc4xx_pciex_port *port)
> * and device IDs into it. Those are the same bogus one that the
> * initial code in arch/ppc add. We might want to change that.
> */
> - out_le16(mbase + 0x200, 0xaaa0 + port->index);
> - out_le16(mbase + 0x202, 0xbed0 + port->index);
> + if (!port->endpoint) {
> + out_le16(mbase + 0x200, 0xaaa0 + port->index);
> + out_le16(mbase + 0x202, 0xbed0 + port->index);
>
We should probably setup the config space IDs based on some device-tree
properties no ?
> - /* Set Class Code to PCI-PCI bridge and Revision Id to 1 */
> - out_le32(mbase + 0x208, 0x06040001);
> + /* Set Class Code to PCI-PCI bridge and Revision Id to 1 */
> + out_le32(mbase + 0x208, 0x06040001);
> +
> + printk(KERN_INFO "PCIE%d: successfully set as root-complex\n",
> + port->index);
> + } else {
> + out_le16(mbase + 0x200, 0xeee0 + port->index);
> + out_le16(mbase + 0x202, 0xfed0 + port->index);
> +
> + /* Set Class Code to Processor/PPC */
> + out_le32(mbase + 0x208, 0x0b200001);
> +
> + printk(KERN_INFO "PCIE%d: successfully set as endpoint\n",
> + port->index);
> + }
>
> - printk(KERN_INFO "PCIE%d: successfully set as root-complex\n",
> - port->index);
> return;
> fail:
> if (hose)
> @@ -1586,8 +1636,17 @@ static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
> }
> port->sdr_base = *pval;
>
> - /* XXX Currently, we only support root complex mode */
> - port->endpoint = 0;
> + /* Check whether the PCIe port is already configured as root-complex
> + * or as endpoint. This has been done previously in U-Boot and can
> + * be configured there dynamically by setting the "pcie_mode"
> + * environment variable (reboot necessary of course). Here an example:
> + *
> + * pcie_mode = 'RP:RP:EP'
> + *
> + * Port 0 & 1 are configured as root-complex and port 2 as endpoint.
> + * This mode will now be used in the Linux driver too.
> + */
> + port->endpoint = is_endpoint(port);
>
> /* Fetch config space registers address */
> if (of_address_to_resource(np, 0, &port->cfg_space)) {
> --
> 1.5.4.5
>
^ permalink raw reply
* [PATCH] powerpc: Move opcodes common to CPM1 and CPM2 to include/asm-powerpc/cpm.h
From: Laurent Pinchart @ 2008-04-10 9:31 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 3054 bytes --]
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
include/asm-powerpc/cpm.h | 14 ++++++++++++++
include/asm-powerpc/cpm1.h | 13 -------------
include/asm-powerpc/cpm2.h | 11 +----------
3 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
index 77e39da..ede38ff 100644
--- a/include/asm-powerpc/cpm.h
+++ b/include/asm-powerpc/cpm.h
@@ -4,6 +4,20 @@
#include <linux/compiler.h>
#include <linux/types.h>
+/* Opcodes common to CPM1 and CPM2
+*/
+#define CPM_CR_INIT_TRX ((ushort)0x0000)
+#define CPM_CR_INIT_RX ((ushort)0x0001)
+#define CPM_CR_INIT_TX ((ushort)0x0002)
+#define CPM_CR_HUNT_MODE ((ushort)0x0003)
+#define CPM_CR_STOP_TX ((ushort)0x0004)
+#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
+#define CPM_CR_RESTART_TX ((ushort)0x0006)
+#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
+#define CPM_CR_SET_GADDR ((ushort)0x0008)
+#define CPM_CR_SET_TIMER ((ushort)0x0008)
+#define CPM_CR_STOP_IDMA ((ushort)0x000b)
+
/* Buffer descriptors used by many of the CPM protocols. */
typedef struct cpm_buf_desc {
ushort cbd_sc; /* Status and Control */
diff --git a/include/asm-powerpc/cpm1.h b/include/asm-powerpc/cpm1.h
index b2ebd6a..3df4396 100644
--- a/include/asm-powerpc/cpm1.h
+++ b/include/asm-powerpc/cpm1.h
@@ -28,19 +28,6 @@
#define CPM_CR_CHAN ((ushort)0x00f0)
#define CPM_CR_FLG ((ushort)0x0001)
-/* Some commands (there are more...later)
-*/
-#define CPM_CR_INIT_TRX ((ushort)0x0000)
-#define CPM_CR_INIT_RX ((ushort)0x0001)
-#define CPM_CR_INIT_TX ((ushort)0x0002)
-#define CPM_CR_HUNT_MODE ((ushort)0x0003)
-#define CPM_CR_STOP_TX ((ushort)0x0004)
-#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
-#define CPM_CR_RESTART_TX ((ushort)0x0006)
-#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
-#define CPM_CR_SET_GADDR ((ushort)0x0008)
-#define CPM_CR_SET_TIMER CPM_CR_SET_GADDR
-
/* Channel numbers.
*/
#define CPM_CR_CH_SCC1 ((ushort)0x0000)
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h
index b93a53e..4c85ed9 100644
--- a/include/asm-powerpc/cpm2.h
+++ b/include/asm-powerpc/cpm2.h
@@ -71,18 +71,9 @@
#define CPM_CR_FCC_PAGE(x) (x + 0x04)
-/* Some opcodes (there are more...later)
+/* CPM2-specific opcodes (see cpm.h for common opcodes)
*/
-#define CPM_CR_INIT_TRX ((ushort)0x0000)
-#define CPM_CR_INIT_RX ((ushort)0x0001)
-#define CPM_CR_INIT_TX ((ushort)0x0002)
-#define CPM_CR_HUNT_MODE ((ushort)0x0003)
-#define CPM_CR_STOP_TX ((ushort)0x0004)
-#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
-#define CPM_CR_RESTART_TX ((ushort)0x0006)
-#define CPM_CR_SET_GADDR ((ushort)0x0008)
#define CPM_CR_START_IDMA ((ushort)0x0009)
-#define CPM_CR_STOP_IDMA ((ushort)0x000b)
#define mk_cr_cmd(PG, SBC, MCN, OP) \
((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
--
1.5.0
--
Laurent Pinchart
CSE Semaphore Belgium
Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
F +32 (2) 387 42 75
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related
* Re: Status of patches (ppc32 mm init clean and 85xx kernel reloc)
From: Kumar Gala @ 2008-04-10 10:11 UTC (permalink / raw)
To: Paul Mackerras; +Cc: ppc-dev list
In-Reply-To: <18429.33325.923972.430150@cargo.ozlabs.ibm.com>
>> [POWERPC] Clean up some linker and symbol usage
>>
>> No comments. Straight forward patch.
>
> Well, it is changing behaviour. In particular, klimit is not
> necessarily the same as _end. It starts out initialized to &_end but
> then gets advanced by some allocations very early in the boot IIRC.
> It might be true by now that nothing reserves memory by advancing
> klimit any more, but if that is true then the patch description needs
> to mention that klimit is no longer used and this patch makes it no
> longer usable. In fact in that case you should remove all mention of
> klimit.
>
> Also, this patch means that the region from PHYSICAL_START to
> __pa(stext) is no longer reserved, which is another behaviour change
> that deserves to be mentioned.
so I see iseries updating klimit.
>> [POWERPC] Update linker script to properly set physical addresses
>>
>> You felt LOAD_OFFSET should be (CONFIG_PAGE_OFFSET -
>> CONFIG_PHYSICAL_START). I disagreed. We need to resolve.
>
> I think you're right, actually, now, assuming that
> CONFIG_PHYSICAL_START is the physical address of the start of the
> kernel (actually, why don't you use that instead of __pa(stext) in
> your patch [9/11]?).
I think I can just drop that change in the patch now that I look at
it. My previous plan had been to get ride of PHYSICAL_START but now
that we still have it I don't see any reason I need to change that
particular lmb reserve.
(i'll repost the full series with a minor bit of re-ordering).
- k
^ permalink raw reply
* Re: [PATCH] [POWERPC] 4xx: Add endpoint support to 4xx PCIe driver
From: Stefan Roese @ 2008-04-10 10:21 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <1207819649.6958.3.camel@pasglop>
On Thursday 10 April 2008, Benjamin Herrenschmidt wrote:
> On Wed, 2008-04-02 at 17:12 +0200, Stefan Roese wrote:
>
> ../..
>
> Overall looks good, just a few things:
Ben, thanks for the review.
> In general, while I have nothing against the idea of reading the HW
> setup left by uboot, I wonder if it wouldn't be best to have this file
> capable of fully configuring it in either mode based on DT properties
> instead.
Sure, this would be optimal. But frankly, I currently have no need for this
non U-Boot mode, and therefore I didn't implement it. This can be added later
when really needed don't you think?
> The PCI node in endpoint mode would be called something
> different, such as "pci-endpoint" and would contain some kind of
> "endpoint-mode" property, maybe ? That way people using other
> bootloaders or even booting of straight flash kernels can still use
> this.
Good. But again, I would really prefer to first include this U-Boot style
endpoint support and later add this independent device tree endpoint
configuration when really needed.
> > +
> > + out_le32(mbase + PCI_BASE_ADDRESS_0,
> > RES_TO_U32_LOW(res->start)); + out_le32(mbase +
> > PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(res->start)); + }
> >
> > /* Enable inbound mapping */
> > out_le32(mbase + PECFG_PIMEN, 0x1);
> >
> > - out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(res->start));
> > - out_le32(mbase + PCI_BASE_ADDRESS_1,
> > RES_TO_U32_HIGH(res->start)); -
>
> does it work properly to setup the BARs before enabling the inbound
> mapping ?
Yes. At least I have seen no problems so far.
> > * OMRs are already reset, also disable PIMs
> > @@ -1531,14 +1569,26 @@ static void __init
> > ppc4xx_pciex_port_setup_hose(struct ppc4xx_pciex_port *port) * and device
> > IDs into it. Those are the same bogus one that the * initial code in
> > arch/ppc add. We might want to change that. */
> > - out_le16(mbase + 0x200, 0xaaa0 + port->index);
> > - out_le16(mbase + 0x202, 0xbed0 + port->index);
> > + if (!port->endpoint) {
> > + out_le16(mbase + 0x200, 0xaaa0 + port->index);
> > + out_le16(mbase + 0x202, 0xbed0 + port->index);
>
> We should probably setup the config space IDs based on some device-tree
> properties no ?
Good idea. How about "vendor-id" and "device-id"? And we probably need some
for endpoint mode too now. "vendor-id-endpoint" and "device-id-endpoint"?
And how should we handle the backward compatibility? Should I set the old
values as default when those properties are not available?
Thanks.
Best regards,
Stefan
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox