Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Old U-boot compatibility for 824x
0004  *
0005  * Copyright (c) 2007 Freescale Semiconductor, Inc.
0006  */
0007 
0008 #include "ops.h"
0009 #include "stdio.h"
0010 #include "cuboot.h"
0011 
0012 #define TARGET_824x
0013 #include "ppcboot.h"
0014 
0015 static bd_t bd;
0016 
0017 
0018 static void platform_fixups(void)
0019 {
0020     void *soc;
0021 
0022     dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
0023     dt_fixup_mac_addresses(bd.bi_enetaddr);
0024     dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
0025 
0026     soc = find_node_by_devtype(NULL, "soc");
0027     if (soc) {
0028         void *serial = NULL;
0029 
0030         setprop(soc, "bus-frequency", &bd.bi_busfreq,
0031                 sizeof(bd.bi_busfreq));
0032 
0033         while ((serial = find_node_by_devtype(serial, "serial"))) {
0034             if (get_parent(serial) != soc)
0035                 continue;
0036 
0037             setprop(serial, "clock-frequency", &bd.bi_busfreq,
0038                     sizeof(bd.bi_busfreq));
0039         }
0040     }
0041 }
0042 
0043 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
0044                    unsigned long r6, unsigned long r7)
0045 {
0046     CUBOOT_INIT();
0047     fdt_init(_dtb_start);
0048     serial_console_init();
0049     platform_ops.fixups = platform_fixups;
0050 }