PowerPC + SMP
Hi.
I am trying to figure out where in the PowerPC kernel the HID1 register is updated to enable bits dealing with cache coherency in an SMP system. Grepping through the arch/ppc source does not reveal much.
I have two 7447A processors and somewhere the ABE and SYNCBE bits need
to be turned on to enable cache coherency. Is supposed to happen in
the bootloader prior to the kernel running??
Thanks,
Stuart Yoder
Quoted 10 lines · Stuart Yoder
Hi.
I am trying to figure out where in the PowerPC kernel the HID1 register is updated to enable bits dealing with cache coherency in an
SMP system. Grepping through thearch/ppcsource does not reveal
much.I have two 7447A processors and somewhere the ABE and SYNCBE bits need
to be turned on to enable cache coherency. Is supposed to happen in
the bootloader prior to the kernel running??
It's usually expected to happen in the firmware yes, though the kernel does some of it's own 'fixups' (look at setup_cpu_6xx.S)
Ben.
Thanks Ben.
That raises a question though-- how can I know what assumptions the kernel makes about the state of the CPU/system when it begins execution? Is this clearly documented anywhere?
I am using U-boot on my SMP system and U-boot is not SMP aware. Do you know of other open source bootloaders for Linux that would set up the CPUs as the kernel expects.
Thanks,
Stuart Yoder
Quoted 32 lines
-----Original Message-----
From: Benjamin Herrenschmidt [mailto:[email protected]]
Sent: Monday, April 25, 2005 10:37 PM
To: Stuart Yoder
Cc: linuxppc-dev list
Subject: Re: PowerPC + SMPQuoted 4 lines · Stuart Yoder
Hi.
I am trying to figure out where in the PowerPC kernel the HID1 register is updated to enable bits dealing with cache
coherency in an
Quoted 4 lines
SMP system. Grepping through the
arch/ppcsource does not reveal
much.I have two 7447A processors and somewhere the ABE and
SYNCBE bits need
Quoted 1 line
to be turned on to enable cache coherency. Is supposed to
happen in
Quoted 1 line
the bootloader prior to the kernel running??
It's usually expected to happen in the firmware yes, though the kernel does some of it's own 'fixups' (look at
setup_cpu_6xx.S)Ben.
Quoted 2 lines · In message <[email protected]> you wrote:
I am using U-boot on my SMP system and U-boot is not SMP aware. Do you
Strictly speaking this statement is wrong.
So far I am not aware of a port of U-Boot to a SMP system. If there was such a port, and if it was properly done, then U-Boot probably _were_ SMP aware.
Best regards,
Wolfgang Denk
Signature · 5 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to one instruction which doesn't work.
We've run into a few issues with U-boot, but they are not unsolveable--
-it doesn't provide an alternate execution path for the 2nd CPU when it is started by the kernel
-U-boot needs to detect which CPU is executing
-U-boot on the 2nd CPU should not execute any platform/board specific setup code-- this is stuff you only want to do once
-U-boot on the 2nd CPU cannot relocate itself to SDRAM because Linux is already running there and assumes it owns all of memory
-it needs some way of getting to the Linux kernel entry point for secondary CPUs
-it also appears that it should set up HID1 (other stuff??) for SMP systems
Stuart
Quoted 33 lines
-----Original Message-----
From: Wolfgang Denk [mailto:[email protected]]
Sent: Tuesday, April 26, 2005 12:35 PM
To: Stuart Yoder
Cc: 'linuxppc-dev list'
Subject: Re: PowerPC + SMPQuoted 3 lines · In message <[email protected]> you wrote:
I am using U-boot on my SMP system and U-boot is not SMP aware. Do you
Strictly speaking this statement is wrong.
So far I am not aware of a port of U-Boot to a SMP system. If there was such a port, and if it was properly done, then U-Boot probably _were_ SMP aware.
Best regards,
Wolfgang Denk
Signature · 6 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to one instruction which doesn't work.
Quoted 9 lines · Stuart Yoder
Thanks Ben.
That raises a question though-- how can I know what assumptions the kernel makes about the state of the CPU/system when it begins execution? Is this clearly documented anywhere?
I am using U-boot on my SMP system and U-boot is not SMP aware. Do you know of other open source bootloaders for Linux that would set up the CPUs as the kernel expects.
No, it's up to you to configure the CPU properly. I'm surprised that uBoot doesn't set it up properly though, but then, when you bringup a board, you rarely use a bootloader like that "as-is" :)
In general, the kernel except the CPU to be in working condition, which I consider meanings having necessary HID bits set for proper coherency etc... on an SMP system :)
Ben.
Quoted 3 lines · Stuart Yoder
That raises a question though-- how can I know what assumptions the kernel makes about the state of the CPU/system when it begins execution? Is this clearly documented anywhere?
In general the kernel assumes that firmware has set up the HID registers, caches, northbridge, memory controller, memory, etc., in a suitable state for the machine to run at full speed. There is code to set and clear various HID bits, depending on the specific cpu model - look for the __setup_cpu_* functions in arch/ppc/kernel/*.S. I guess we could add code to set ABE and SYNCBE on 7447A processors on SMP systems; I can't imagine that any SMP system would require them to be clear.
Paul.