^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Author: Roy Zang <tie-fei.zang@freescale.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Old U-boot compatibility for mpc7448hpc2 board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Based on the code of Scott Wood <scottwood@freescale.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * for 83xx and 85xx.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include "ops.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "stdio.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include "cuboot.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define TARGET_HAS_ETH1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include "ppcboot.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static bd_t bd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) extern char _dtb_start[], _dtb_end[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) static void platform_fixups(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) void *tsi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) tsi = find_node_by_devtype(NULL, "tsi-bridge");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) if (tsi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) setprop(tsi, "bus-frequency", &bd.bi_busfreq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) sizeof(bd.bi_busfreq));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) unsigned long r6, unsigned long r7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) CUBOOT_INIT();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) fdt_init(_dtb_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) serial_console_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) platform_ops.fixups = platform_fixups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) }