0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "ops.h"
0011 #include "stdio.h"
0012 #include "cuboot.h"
0013
0014 #define TARGET_85xx
0015 #define TARGET_HAS_ETH3
0016 #include "ppcboot.h"
0017
0018 static bd_t bd;
0019
0020 static void platform_fixups(void)
0021 {
0022 void *soc;
0023
0024 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
0025 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
0026 dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
0027 dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
0028 dt_fixup_mac_address_by_alias("ethernet3", bd.bi_enet3addr);
0029 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
0030
0031
0032
0033
0034
0035 soc = find_node_by_devtype(NULL, "soc");
0036 if (soc) {
0037 void *serial = NULL;
0038
0039 setprop(soc, "bus-frequency", &bd.bi_busfreq,
0040 sizeof(bd.bi_busfreq));
0041
0042 while ((serial = find_node_by_devtype(serial, "serial"))) {
0043 if (get_parent(serial) != soc)
0044 continue;
0045
0046 setprop(serial, "clock-frequency", &bd.bi_busfreq,
0047 sizeof(bd.bi_busfreq));
0048 }
0049 }
0050 }
0051
0052 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
0053 unsigned long r6, unsigned long r7)
0054 {
0055 CUBOOT_INIT();
0056 fdt_init(_dtb_start);
0057 serial_console_init();
0058 platform_ops.fixups = platform_fixups;
0059 }