treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / powerpc / boot / mvme7100.c
blob1e218454ab7f7c20c3253e73045967e21c4c37b9
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Motload compatibility for the Emerson/Artesyn MVME7100
5 * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A.
7 * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu>
8 */
10 #include "ops.h"
11 #include "stdio.h"
12 #include "cuboot.h"
14 #define TARGET_86xx
15 #define TARGET_HAS_ETH1
16 #define TARGET_HAS_ETH2
17 #define TARGET_HAS_ETH3
18 #include "ppcboot.h"
20 static bd_t bd;
22 BSS_STACK(16384);
24 static void mvme7100_fixups(void)
26 void *devp;
27 unsigned long busfreq = bd.bi_busfreq * 1000000;
29 dt_fixup_cpu_clocks(bd.bi_intfreq * 1000000, busfreq / 4, busfreq);
31 devp = finddevice("/soc@f1000000");
32 if (devp)
33 setprop(devp, "bus-frequency", &busfreq, sizeof(busfreq));
35 devp = finddevice("/soc/serial@4500");
36 if (devp)
37 setprop(devp, "clock-frequency", &busfreq, sizeof(busfreq));
39 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
41 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
42 dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
43 dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
44 dt_fixup_mac_address_by_alias("ethernet3", bd.bi_enet3addr);
47 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
48 unsigned long r6, unsigned long r7)
50 CUBOOT_INIT();
51 fdt_init(_dtb_start);
52 serial_console_init();
53 platform_ops.fixups = mvme7100_fixups;