xref: /OK3568_Linux_fs/kernel/arch/powerpc/boot/cuboot-kilauea.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Old U-boot compatibility for PPC405EX. This image is already included
4*4882a593Smuzhiyun  * a dtb.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Author: Tiejun Chen <tiejun.chen@windriver.com>
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Copyright (C) 2009 Wind River Systems, Inc.
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include "ops.h"
12*4882a593Smuzhiyun #include "io.h"
13*4882a593Smuzhiyun #include "dcr.h"
14*4882a593Smuzhiyun #include "stdio.h"
15*4882a593Smuzhiyun #include "4xx.h"
16*4882a593Smuzhiyun #include "44x.h"
17*4882a593Smuzhiyun #include "cuboot.h"
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #define TARGET_4xx
20*4882a593Smuzhiyun #define TARGET_44x
21*4882a593Smuzhiyun #include "ppcboot.h"
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun #define KILAUEA_SYS_EXT_SERIAL_CLOCK     11059200        /* ext. 11.059MHz clk */
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun static bd_t bd;
26*4882a593Smuzhiyun 
kilauea_fixups(void)27*4882a593Smuzhiyun static void kilauea_fixups(void)
28*4882a593Smuzhiyun {
29*4882a593Smuzhiyun 	unsigned long sysclk = 33333333;
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun 	ibm405ex_fixup_clocks(sysclk, KILAUEA_SYS_EXT_SERIAL_CLOCK);
32*4882a593Smuzhiyun 	dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
33*4882a593Smuzhiyun 	ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
34*4882a593Smuzhiyun 	dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
35*4882a593Smuzhiyun 	dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
36*4882a593Smuzhiyun }
37*4882a593Smuzhiyun 
platform_init(unsigned long r3,unsigned long r4,unsigned long r5,unsigned long r6,unsigned long r7)38*4882a593Smuzhiyun void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
39*4882a593Smuzhiyun 		unsigned long r6, unsigned long r7)
40*4882a593Smuzhiyun {
41*4882a593Smuzhiyun 	CUBOOT_INIT();
42*4882a593Smuzhiyun 	platform_ops.fixups = kilauea_fixups;
43*4882a593Smuzhiyun 	platform_ops.exit = ibm40x_dbcr_reset;
44*4882a593Smuzhiyun 	fdt_init(_dtb_start);
45*4882a593Smuzhiyun 	serial_console_init();
46*4882a593Smuzhiyun }
47