Changeset 9a5b556 in mainline for boot/arch/sparc64/loader/ofwarch.c


Ignore:
Timestamp:
2006-09-12T13:03:55Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6eabb6e6
Parents:
7bb6b06
Message:

sparc64 work:

  • find a CPU node and read its clock_frequency attribute
  • implement asm_delay_loop()
  • set TICK_COMPARE register according to processor frequency
  • small improvements at random places

OpenFirmware work:

  • two new functions for walking the device tree

Generic boot loader work:

  • added basic string functions

Usual pile of indentation and formatting fixes.

File:
1 edited

Legend:

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

    r7bb6b06 r9a5b556  
    3535#include <ofw.h>
    3636#include <printf.h>
     37#include <string.h>
     38#include "main.h"
    3739
    3840int bpp2align[] = {
     
    8082        return true;
    8183}
     84
     85int ofw_cpu(cpu_t *cpu)
     86{
     87        char type_name[BUF_SIZE];
     88
     89        phandle node;
     90        node = ofw_get_child_node(ofw_root);
     91        if (node == 0 || node == -1) {
     92                printf("Could not find any child nodes of the root node.\n");
     93                return;
     94        }
     95       
     96        for (; node != 0 && node != -1; node = ofw_get_peer_node(node)) {
     97                if (ofw_get_property(node, "device_type", type_name, sizeof(type_name)) > 0) {
     98                        if (strncmp(type_name, "cpu", 3) == 0) {
     99                                uint32_t mhz;
     100                               
     101                                if (ofw_get_property(node, "clock-frequency", &mhz, sizeof(mhz)) <= 0)
     102                                        continue;
     103                                       
     104                                cpu->clock_frequency = mhz;
     105                                return 1;
     106                        }
     107                }
     108        };
     109
     110        return 0;
     111}
Note: See TracChangeset for help on using the changeset viewer.