^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Old U-boot compatibility for 8xx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Author: Scott Wood <scottwood@freescale.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (c) 2007 Freescale Semiconductor, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include "ops.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include "stdio.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "cuboot.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define TARGET_8xx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define TARGET_HAS_ETH1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include "ppcboot.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static bd_t bd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static void platform_fixups(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) void *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) node = finddevice("/soc/cpm");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) if (node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) node = finddevice("/soc/cpm/brg");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) if (node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) unsigned long r6, unsigned long r7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) CUBOOT_INIT();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) fdt_init(_dtb_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) serial_console_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) platform_ops.fixups = platform_fixups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) }