^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 PPC405EX. This image is already included
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * a dtb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Author: Tiejun Chen <tiejun.chen@windriver.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (C) 2009 Wind River Systems, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include "ops.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "io.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include "dcr.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 "4xx.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include "44x.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include "cuboot.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define TARGET_4xx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define TARGET_44x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include "ppcboot.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define KILAUEA_SYS_EXT_SERIAL_CLOCK 11059200 /* ext. 11.059MHz clk */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) static bd_t bd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) static void kilauea_fixups(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) unsigned long sysclk = 33333333;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) ibm405ex_fixup_clocks(sysclk, KILAUEA_SYS_EXT_SERIAL_CLOCK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) unsigned long r6, unsigned long r7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) CUBOOT_INIT();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) platform_ops.fixups = kilauea_fixups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) platform_ops.exit = ibm40x_dbcr_reset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) fdt_init(_dtb_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) serial_console_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }