Changeset 4872160 in mainline for boot/arch/arm32/include


Ignore:
Timestamp:
2010-05-04T10:44:55Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
568db0f
Parents:
bb252ca
Message:

new boot infrastructure

  • more code and metadata unification
  • import of up-to-date implementations from the kernel
  • the boot loaders should behave more similarly on all platforms
  • support for deflate compressed (LZ77) boot components
    • this again allows feasible boot images to be created on mips32
  • IA64 is still not booting
    • the broken forked GNU EFI library has been removed, a replacement of the functionality is on its way
Location:
boot/arch/arm32/include
Files:
5 moved

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/include/arch.h

    rbb252ca r4872160  
    11/*
    2  * Copyright (c) 2006 Martin Decky
     2 * Copyright (c) 2010 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #ifndef BOOT_ia64_TYPES_H_
    30 #define BOOT_ia64_TYPES_H_
     29#ifndef BOOT_arm32_ARCH_H
     30#define BOOT_arm32_ARCH_H
    3131
    32 #include <gentypes.h>
     32#define PAGE_WIDTH  12
     33#define PAGE_SIZE   (1 << PAGE_WIDTH)
    3334
    34 typedef signed char int8_t;
     35#define PTL0_ENTRIES     4096
     36#define PTL0_ENTRY_SIZE  4
    3537
    36 typedef unsigned char uint8_t;
    37 typedef unsigned short uint16_t;
    38 typedef unsigned int uint32_t;
    39 typedef unsigned long uint64_t;
     38#define BOOT_OFFSET  0x800000
    4039
    41 typedef uint64_t uintptr_t;
    42 typedef uint64_t unative_t;
     40#ifndef __ASM__
     41        #define PA2KA(addr)  (((uintptr_t) (addr)) + 0x80000000)
     42#else
     43        #define PA2KA(addr)  ((addr) + 0x80000000)
     44#endif
    4345
    4446#endif
     47
     48/** @}
     49 */
  • boot/arch/arm32/include/asm.h

    rbb252ca r4872160  
    2727 */
    2828
    29 
    3029/** @addtogroup arm32boot
    3130 * @{
    3231 */
    3332/** @file
    34  *  @brief Functions implemented in assembly.
     33 * @brief Functions implemented in assembly.
    3534 */
    36 
    3735
    3836#ifndef BOOT_arm32_ASM_H
    3937#define BOOT_arm32_ASM_H
    4038
     39#include <arch/arch.h>
     40#include <arch/mm.h>
    4141
    42 /** Called when the CPU is switched on.
     42extern pte_level0_section_t boot_pt[PTL0_ENTRIES];
     43extern void *boot_stack;
     44
     45/** Jump to the kernel entry point.
    4346 *
    44  *  This function is placed to the 0x0 address where ARM CPU starts execution.
    45  *  Jumps to the #bootstrap only.
    46  */
    47 extern void start(void);
    48 
    49 
    50 /** Jumps to the kernel entry point.
    51  *
    52  * @param entry    Kernel entry point address.
     47 * @param entry    Kernel entry point.
    5348 * @param bootinfo Structure holding information about loaded tasks.
    5449 *
    5550 */
    56 extern void jump_to_kernel(void *entry, void *bootinfo) __attribute__((noreturn));
    57 
     51extern void jump_to_kernel(void *entry, void *bootinfo)
     52    __attribute__((noreturn));
    5853
    5954#endif
  • boot/arch/arm32/include/main.h

    rbb252ca r4872160  
    11/*
    2  * Copyright (c) 2006 Martin Decky
     2 * Copyright (c) 2007 Michal Kebrt
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 
    3029/** @addtogroup arm32boot
    3130 * @{
    3231 */
    33 /** @file 
    34  *  @brief Definitions of basic types like #uintptr_t.
    35  */ 
     32/** @file
     33 * @brief Boot related declarations.
     34 */
    3635
     36#ifndef BOOT_arm32_MAIN_H
     37#define BOOT_arm32_MAIN_H
    3738
    38 #ifndef BOOT_arm32_TYPES_H
    39 #define BOOT_arm32_TYPES_H
     39/** Address where characters to be printed are expected. */
     40#ifdef MACHINE_testarm
     41        #define VIDEORAM_ADDRESS  0x10000000
     42#endif
    4043
     44#ifdef MACHINE_integratorcp
     45        #define VIDEORAM_ADDRESS  0x16000000
     46#endif
    4147
    42 #include <gentypes.h>
    43 
    44 typedef signed char int8_t;
    45 
    46 typedef unsigned char uint8_t;
    47 typedef unsigned short uint16_t;
    48 typedef unsigned int uint32_t;
    49 typedef unsigned long long uint64_t;
    50 
    51 typedef uint32_t uintptr_t;
    52 typedef uint32_t unative_t;
    53 
     48extern void bootstrap(void);
    5449
    5550#endif
    5651
    57 
    5852/** @}
    5953 */
  • boot/arch/arm32/include/mm.h

    rbb252ca r4872160  
    11/*
     2 * Copyright (c) 2007 Pavel Jancik
    23 * Copyright (c) 2007 Michal Kebrt
    34 * All rights reserved.
     
    2728 */
    2829
    29 
    3030/** @addtogroup arm32boot
    3131 * @{
    3232 */
    3333/** @file
    34  *  @brief Boot related declarations.
     34 * @brief Memory management used while booting the kernel.
     35 *
     36 * So called "section" paging is used while booting the kernel. The term
     37 * "section" comes from the ARM architecture specification and stands for the
     38 * following: one-level paging, 1MB sized pages, 4096 entries in the page
     39 * table.
    3540 */
    3641
     42#ifndef BOOT_arm32__MM_H
     43#define BOOT_arm32__MM_H
    3744
    38 #ifndef BOOT_arm32_MAIN_H
    39 #define BOOT_arm32_MAIN_H
     45#include <typedefs.h>
    4046
     47/** Describe "section" page table entry (one-level paging with 1 MB sized pages). */
     48#define PTE_DESCRIPTOR_SECTION  0x02
    4149
    42 /** Maximum number of tasks in the #bootinfo_t struct. */
    43 #define TASKMAP_MAX_RECORDS 32
     50/** Page table access rights: user - no access, kernel - read/write. */
     51#define PTE_AP_USER_NO_KERNEL_RW  0x01
    4452
    45 /** Size of buffer for storing task name in task_t. */
    46 #define BOOTINFO_TASK_NAME_BUFLEN 32
     53/* Page table level 0 entry - "section" format is used
     54 * (one-level paging, 1 MB sized pages). Used only while booting the kernel.
     55 */
     56typedef struct {
     57        unsigned int descriptor_type : 2;
     58        unsigned int bufferable : 1;
     59        unsigned int cacheable : 1;
     60        unsigned int impl_specific : 1;
     61        unsigned int domain : 4;
     62        unsigned int should_be_zero_1 : 1;
     63        unsigned int access_permission : 2;
     64        unsigned int should_be_zero_2 : 8;
     65        unsigned int section_base_addr : 12;
     66} __attribute__((packed)) pte_level0_section_t;
    4767
    48 
    49 /** Struct holding information about single loaded task. */
    50 typedef struct {
    51         /** Address where the task was placed. */
    52         void *addr;
    53         /** Size of the task's binary. */
    54         unsigned int size;
    55         /** Task name. */
    56         char name[BOOTINFO_TASK_NAME_BUFLEN];
    57 } task_t;
    58 
    59 
    60 /** Struct holding information about loaded tasks. */
    61 typedef struct {
    62         /** Number of loaded tasks. */
    63         unsigned int cnt;
    64         /** Array of loaded tasks. */
    65         task_t tasks[TASKMAP_MAX_RECORDS];
    66 } bootinfo_t;
    67 
    68 
    69 extern void bootstrap(void);
     68extern void mmu_start(void);
    7069
    7170#endif
  • boot/arch/arm32/include/types.h

    rbb252ca r4872160  
    11/*
    2  * Copyright (c) 2005 Martin Decky
     2 * Copyright (c) 2006 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #ifndef BOOT_ppc32_MAIN_H_
    30 #define BOOT_ppc32_MAIN_H_
     29/** @addtogroup arm32boot
     30 * @{
     31 */
     32/** @file
     33 * @brief Definitions of basic types like #uintptr_t.
     34 */
    3135
    32 #include <ofw.h>
    33 #include <ofw_tree.h>
    34 #include <balloc.h>
    35 #include <types.h>
     36#ifndef BOOT_arm32_TYPES_H
     37#define BOOT_arm32_TYPES_H
    3638
    37 #define TASKMAP_MAX_RECORDS  32
    38 
    39 /** Size of buffer for storing task name in task_t. */
     39#define TASKMAP_MAX_RECORDS        32
    4040#define BOOTINFO_TASK_NAME_BUFLEN  32
    4141
     42typedef uint32_t size_t;
     43typedef uint32_t uintptr_t;
     44
     45typedef uint32_t pfn_t;
     46
    4247typedef struct {
     48        /** Address where the task was placed. */
    4349        void *addr;
    44         uint32_t size;
     50        /** Size of the task's binary. */
     51        size_t size;
     52        /** Task name. */
    4553        char name[BOOTINFO_TASK_NAME_BUFLEN];
    4654} task_t;
    4755
    4856typedef struct {
    49         uint32_t count;
     57        size_t cnt;
    5058        task_t tasks[TASKMAP_MAX_RECORDS];
    51 } taskmap_t;
    52 
    53 typedef struct {
    54         memmap_t memmap;
    55         taskmap_t taskmap;
    56         ballocs_t ballocs;
    57         ofw_tree_node_t *ofw_root;
    5859} bootinfo_t;
    5960
    60 extern void start(void);
    61 extern void bootstrap(void);
     61#endif
    6262
    63 #endif
     63/** @}
     64 */
Note: See TracChangeset for help on using the changeset viewer.