Changeset 63cda71 in mainline for boot/arch/ppc32


Ignore:
Timestamp:
2006-07-13T14:58:57Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
94d614e
Parents:
eda7bf81
Message:

Fix ofw_memmap() in boot infrastructure.
The cell size is 32-bit and not equal sizeof(ofw_arg_t).
Define architecture dependant #address-cells and #size-cells for cases
the respective properties are missing in the OpenFirmware device tree.
The algorithm now works both for ppc32 and sparc64.

Add memmap_t, screen_t and keyboard_t to sparc64 bootinfo structure.
Be more verbose during sparc64 boot.

Move ALIGN_UP to generic part of boot/.

Change header guards in several places so that they don't contain double underscore.

Location:
boot/arch/ppc32/loader
Files:
6 edited
2 moved

Legend:

Unmodified
Added
Removed
  • boot/arch/ppc32/loader/Makefile

    reda7bf81 r63cda71  
    5151SOURCES = \
    5252        main.c \
    53         ofw.c \
     53        ofwarch.c \
    5454        ../../../genarch/ofw.c \
    5555        ../../../generic/printf.c \
  • boot/arch/ppc32/loader/asm.h

    reda7bf81 r63cda71  
    2727 */
    2828
    29 #ifndef __ASM_H__
    30 #define __ASM_H__
     29#ifndef BOOT_ppc32_ASM_H_
     30#define BOOT_ppc32_ASM_H_
    3131
    3232#define PAGE_SIZE 4096
  • boot/arch/ppc32/loader/boot.S

    reda7bf81 r63cda71  
    3838        stw r5, 0(r4)
    3939       
    40         bl init
     40        bl ofw_init
    4141       
    4242        b bootstrap
  • boot/arch/ppc32/loader/main.c

    reda7bf81 r63cda71  
    3131#include "asm.h"
    3232#include "_components.h"
     33#include <ofw.h>
     34#include <align.h>
    3335
    3436#define HEAP_GAP 1024000
  • boot/arch/ppc32/loader/main.h

    reda7bf81 r63cda71  
    2727 */
    2828
    29 #ifndef __MAIN_H__
    30 #define __MAIN_H__
     29#ifndef BOOT_ppc32_MAIN_H_
     30#define BOOT_ppc32_MAIN_H_
    3131
    3232#include "ofw.h"
    33 
    34 /** Align to the nearest higher address.
    35  *
    36  * @param addr  Address or size to be aligned.
    37  * @param align Size of alignment, must be power of 2.
    38  */
    39 #define ALIGN_UP(addr, align) (((addr) + ((align) - 1)) & ~((align) - 1))
    4033
    4134#define TASKMAP_MAX_RECORDS 32
  • boot/arch/ppc32/loader/ofwarch.c

    reda7bf81 r63cda71  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28  
     28
     29#include <ofwarch.h>
    2930#include <ofw.h>
    3031#include <printf.h>
     
    5657        if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0)
    5758                return false;
    58         keyboard->addr = macio.addr.addr_lo;
     59        keyboard->addr = (void *) macio.addr.addr_lo;
    5960        keyboard->size = macio.size_lo;
    6061
  • boot/arch/ppc32/loader/ofwarch.h

    reda7bf81 r63cda71  
    11/*
    2  * Copyright (C) 2005 Martin Decky
     2 * Copyright (C) 2006 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28  
    29 #include <ofw.h>
    30 #include <printf.h>
    3128
    32 void write(const char *str, const int len)
    33 {
    34         int i;
    35        
    36         for (i = 0; i < len; i++) {
    37                 if (str[i] == '\n')
    38                         ofw_write("\r", 1);
    39                 ofw_write(&str[i], 1);
    40         }
    41 }
     29#ifndef BOOT_ppc32_OFWARCH_H_
     30#define BOOT_ppc32_OFWARCH_H_
    4231
    43 int ofw_translate_failed(ofw_arg_t flag)
    44 {
    45         return flag != -1;
    46 }
     32#define OFW_ADDRESS_CELLS       1
     33#define OFW_SIZE_CELLS          1
     34
     35#endif
  • boot/arch/ppc32/loader/types.h

    reda7bf81 r63cda71  
    2727 */
    2828
    29 #ifndef TYPES_H__
    30 #define TYPES_H__
     29#ifndef BOOT_ppc32_TYPES_H_
     30#define BOOT_ppc32_TYPES_H_
    3131
    3232#include <gentypes.h>
Note: See TracChangeset for help on using the changeset viewer.