Changeset e731b0d in mainline for boot/arch/ppc32/loader/ofwarch.c


Ignore:
Timestamp:
2009-08-20T16:58:55Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b9c7425
Parents:
a11099f
Message:

make ppc32 OFW usage on par with sparc64, make appropriate modifications elsewhere

  • introduce ofw_tree_walk_by_device_type() to gather all OFW devices of a given type
  • ppc32 uses canonized OFW tree, mac-io and display devices are detected in kernel (not by the boot loader) by means of device type
  • various busses (PCI, EBUS, etc.) stay sparc64 specific for now
  • boot memcpy() is defined in a common way
  • BALLOC_MAX_SIZE is platform-dependent
  • ppc32 and sparc64 boot loaders cleanup (removal of obsolete stuff, data is not passed by global variables if not necessary, etc.)
  • balloc and OFW tree canonizer have now a provision to support different mapping of the data during boot time and kernel run-time
  • OFW tree canonizer uses balloc_rebase() to store pointers suitable for access during kernel run-time (with potentially different memory mapping than during boot time)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ppc32/loader/ofwarch.c

    ra11099f re731b0d  
    3131#include <printf.h>
    3232
    33 typedef int (* ofw_entry_t)(ofw_args_t *args);
     33typedef int (*ofw_entry_t)(ofw_args_t *args);
    3434
    3535int ofw(ofw_args_t *args)
     
    4949}
    5050
    51 int ofw_macio(macio_t *macio)
    52 {
    53         char device_name[BUF_SIZE];
    54        
    55         if ((ofw_get_property(ofw_aliases, "macio", device_name, sizeof(device_name)) <= 0)
    56             && (ofw_get_property(ofw_aliases, "mac-io", device_name, sizeof(device_name)) <= 0))
    57                 return false;
    58        
    59         phandle device = ofw_find_device(device_name);
    60         if (device == -1)
    61                 return false;
    62        
    63         pci_reg_t pci_reg;
    64         if (ofw_get_property(device, "assigned-addresses", &pci_reg, sizeof(pci_reg)) <= 0)
    65                 return false;
    66        
    67         macio->addr = (void *) pci_reg.addr.addr_lo;
    68         macio->size = pci_reg.size_lo;
    69 
    70         return true;
    71 }
    72 
    7351int ofw_translate_failed(ofw_arg_t flag)
    7452{
     53        /* PearPC returns buggy flag */
    7554        return 0;
    7655}
Note: See TracChangeset for help on using the changeset viewer.