Path: blob/master/arch/powerpc/boot/cuboot-85xx-cpm2.c
10817 views
/*1* Old U-boot compatibility for 85xx2*3* Author: Scott Wood <[email protected]>4*5* Copyright (c) 2007 Freescale Semiconductor, Inc.6*7* This program is free software; you can redistribute it and/or modify it8* under the terms of the GNU General Public License version 2 as published9* by the Free Software Foundation.10*/1112#include "ops.h"13#include "stdio.h"14#include "cuboot.h"1516#define TARGET_85xx17#define TARGET_CPM218#include "ppcboot.h"1920static bd_t bd;2122static void platform_fixups(void)23{24void *devp;2526dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);27dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);28dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);29dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);30dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);3132/* Unfortunately, the specific model number is encoded in the33* soc node name in existing dts files -- once that is fixed,34* this can do a simple path lookup.35*/36devp = find_node_by_devtype(NULL, "soc");37if (devp) {38void *serial = NULL;3940setprop(devp, "bus-frequency", &bd.bi_busfreq,41sizeof(bd.bi_busfreq));4243while ((serial = find_node_by_devtype(serial, "serial"))) {44if (get_parent(serial) != devp)45continue;4647setprop(serial, "clock-frequency", &bd.bi_busfreq,48sizeof(bd.bi_busfreq));49}50}5152devp = find_node_by_compatible(NULL, "fsl,cpm2-brg");53if (devp)54setprop(devp, "clock-frequency", &bd.bi_brgfreq,55sizeof(bd.bi_brgfreq));56}5758void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,59unsigned long r6, unsigned long r7)60{61CUBOOT_INIT();62fdt_init(_dtb_start);63serial_console_init();64platform_ops.fixups = platform_fixups;65}666768