Documente Academic
Documente Profesional
Documente Cultură
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Agenda
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 2
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Intro to the QorIQ™ P4080 Processor
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 3
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
QorIQ™ P4 Series Block Diagram
1024KB 64-bit
Power Architecture™ Frontside DDR-2 / 3
128KB L3 Cache Memory Controller
e500-mc Core
Backside 64-bit
1024KB
L2 Cache 32KB 32KB DDR-2 / 3
Frontside
D-Cache I-Cache L3 Cache Memory Controller
eOpenPIC
CoreNet™
PreBoot Loader Coherency Fabric
Peripheral
Security Monitor PAMU PAMU PAMU PAMU PAMU
Access Mgmt Unit
Internal BootROM
Power Mgmt Frame Manager Frame Manager Real Time Debug
RapidIO Watchpoint
SD/MMC eLBC
Security Queue
Message 2x DMA Cross
4.0 Mgr. Parse, Classify, Parse, Classify, Trigger
SPI Distribute Distribute Unit (RMU)
Clocks/Reset
GPIO
18-Lane 5 GHz SERDES
CCSR
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 4
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Multicore Operating System Architecture:
SMP Versus ASMP
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 5
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Symmetric Multiprocessing (SMP)
App
App
Linux
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 6
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP Concepts
► Symmetrical Multiprocessing
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 7
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
AMP Concepts
► Asymmetrical Multiprocessing
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 8
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Partitioning
► A common multicore usage model is
to run multiple operating systems
► Requires partitioning hardware
resources: App
App
App
App
App
App
• Private resources: CPUs, memory,
I/O devices
• Shared resources: memory, devices
Linux® RTOS Legacy OS
► Doing this cooperatively (all operating
systems well-behaved) presents
challenges
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 9
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Partitioning with a Hypervisor
► Hypervisor Software
partition partition partition
• Analogous to role of an operating
system kernel in managing user
processes App App App
• More privileged than operating systems App App App
• Enforces system security
• Manages globally shared resources
• Virtualizes some resources– e.g. Linux® RTOS Legacy OS
interrupt controller, UART
Hypervisor
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 10
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP and ASMP Use Cases
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 11
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Use Cases
► Consolidation
• Multiple operating systems/partitions on a single multicore chip
• Multiple homogeneous operating systems in an AMP configuration on multiple cores
► Divided workload (e.g. control plane, data plane)
• Multiple operating systems, possibly heterogeneous, need to work securely and seamlessly together
• Isolation mechanisms are needed for safety, robustness
• Efficient inter-partition communication mechanisms are needed for cooperation
► In-service upgrade
► Isolate untrusted software/sandboxes
• Isolate untrusted operating systems: Proprietary OS + open OS (e.g Linux®)
• Isolate end-user installed software
• Software under test
• Isolated partition for GPL-based software
► Migration
• Migrate functionality from legacy RTOS to another OS (e.g. Linux).
► Security
• Secure partition for sensitive security tasks (e.g. access rights control, rule definitions, key
storage/management)
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 12
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Configuration of Resources:
SMP Versus ASMP
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 13
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Configuration of Resources: SMP
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 14
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Configuration of Resources: AMP
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 15
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Configuration of Resources: Partitioned With Hypervisor
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 16
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
QorIQ™ P4080 SMP u-boot/Linux®
Boot Process
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 17
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Multicore Boot Architecture
► ePAPR describes specifics on how secondary CPUs are booted for a system with
multiple CPUs
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 18
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP Boot Process
►Power-on Reset
• Core0 comes out of reset at the reset vector 0xFFFF_FFFC and all
other cores are in boot hold off mode
Core0 runs u-boot
– After setting BPTR to secondary core’s start page, core0 kicks off each additional
secondary core
– Each secondary core comes out of reset at __secondary_start_page(boot page),
initialize resources specific that that core (caches, MMU, etc.) and enters a spin
loop
Core0 loads Linux® image and device tree and boots Linux
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 19
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP Boot Process: U-boot Boot Process
► In the u-boot source, the entry point is the reset vector 0x0_FFFF_FFFC
containing a simple branch to _start_e500, which is at the base of default
boot page at 0x0_FFFF_F000; both are found in cpu/mpc85xx/start.S
Reset vector call _start_e500()
► _start_e500() will:
Start command Prepare Linux®
_start_e500() Boot other cores interpreter device tree
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 20
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
QorIQ™ P4080 ASMP u-boot/Linux®
Boot Process
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 21
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
ASMP Boot Process
►Power-on Reset
• Core0 comes out of reset at the reset vector 0xFFFF_FFFC and all
other cores are in boot hold off mode
Core0 runs u-boot
– After setting BPTR to secondary core’s start page, core0 kicks off each additional
secondary core
– Each secondary core comes out of reset at __secondary_start_page(boot page),
initialize resources specific that that core (caches, MMU, etc.) and enters a spin
loop
Core0 loads Linux® image and device tree for each of the other cores
individually and releases the core to boot Linux
Core0 then loads its own Linux image and device tree and boots Linux
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 22
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
ASMP Boot Process: U-boot Boot Process
► In the u-boot source, the entry point is the reset vector 0x0_FFFF_FFFC
containing a simple branch to _start_e500, which is at the base of default
boot page at 0x0_FFFF_F000; both are found in cpu/mpc85xx/start.S
Reset vector call _start_e500()
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 23
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Questions and Answers
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 24
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Backup
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 25
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Abstract
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 26
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Basic System Configuration
► The device tree allocates
partition partition partition
resources to individual partitions
Hypervisor
Multicore
System
Hardware
CPU CPU CPU CPU
… CPU
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 27
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
Terminology
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 28
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP Boot Process: Linux® SMP Boot Process
smp_prepare_cpu() smp_ops->probe()
Kernel_init()
cpu_up() smp_ops->kick_cpu()
smp_init()
in main.c smp_cpus_done() smp_ops->setup_cpu()
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 29
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP Boot Process: Core1 Start Up (continued)
► Let’s look at smp_mpc85xx_kick_cpu() found in:
arch/powerpc/platforms/85xx/mpc85xx_smp.c
smp_mpc85xx_kick_cpu() {
…….
/* Get the BPTR */
bptr_vaddr = ioremap(get_immrbase() + MPC85xx_BPTR_OFFSET, 4);
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 30
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP Boot Process: Core1 “Kick-Off” Process
smp_85xx_release_core(int nr)
{
……
/*
* Startup Core #nr.
*/
ecm_vaddr = ioremap(get_immrbase() + MPC85xx_ECM_OFFSET,
MPC85xx_ECM_SIZE);
pcr = in_be32(ecm_vaddr + (ECM_PORT_CONFIG_OFFSET >> 2));
pcr |= EEBPCR_CPU1_EN;
out_be32(ecm_vaddr + (ECM_PORT_CONFIG_OFFSET >> 2), pcr);
}
EEBPCR
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 31
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
SMP Boot Process: Core1 Kernel Code Flow
• __early_start
If it is core1, it will not call start_kernel(), but jump to __secondary_start
• __secondary_start
jumps to start_secondary()
Freescale™ and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc in the U.S. and all other countries. All other TM
product or service names are the property of their respective owners. The Power Architecture and Power.org word marks and the Power and Power.org logos 32
and related marks are trademarks and service marks licensed by Power.org. © Freescale Semiconductor, Inc. 2009.
TM