Is there an execution hand-off between YAMON (or any boot code) and MIPS SMP Linux?

Tagged: 

This topic contains 1 reply, has 1 voice, and was last updated by  ChrisImgtec 3 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31565

    ChrisImgtec
    Moderator

    Yes. There is an array of structures, stored at 0x80000f00, for kick-starting all cores (other than core0). The core # is used as an index into this array.

    The “C” struct is as follows:

    typedef struct {
    unsigned long pc;
    unsigned long gp;
    unsigned long sp;
    unsigned long a0;
    unsigned long _pad[3]; /* pad to cache line size to avoid thrashing */
    unsigned long flags;
    } cpulaunch_t;

    The idea is to initialize the pc, gp, sp, and a0 field and then set the “go” bit
    in flags.

    The bit definition for flags is as follows:

    #define LAUNCH_FREADY 1
    #define LAUNCH_FGO 2
    #define LAUNCH_FGONE 4

    The Linux code that sets up all the registers and then sets the “go” bit is in
    arch/mips/mti-malta/malta-amon.c.

    The YAMON code that checks for the “go” bit and jumps to the specified pc is in
    arch/reset/init.S

    Here is the sequence:

    1. Prior to Linux boot, whoever initializes the system (be it boot-cps or something else) will bring up all VPEs, in addition to VPE0/Core0. And of course each VPE will perform its own initialization.

    2. A global data structure located at CPULAUNCH, which is an array of “struct cpulaunch”. This array can be indexed by cpu number.

    3. All VPEs (except VPE0/Core0) then set the flag LAUNCH_FREADY in the corresponding CPULAUNCH array, and then enter “polling” mode to poll the flag for LAUNCH_FGO.

    4. When Linux starts, it will check the LAUNCH_FREADY flags to ensure the readiness of each VPE.

    5. Once Linux is ready start secondary VPEs, it will program other cpulaunch data (e.g. pc, sp, gp, …), then set the flag LAUNCH_FGO, and then wait for the flag LAUNCH_FGONE to ensure the VPE has started.

    6. When other VPEs see this flag being set, the VPE will set up to jump to the new pc and set the flag FREADY_GONE.

    7. At this point, all VPEs should be running as expected.

    #38255

    ChrisImgtec
    Moderator

    Imagination MIPS Support

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.