xref: /OK3568_Linux_fs/kernel/arch/powerpc/boot/cuboot-katmai.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Old U-boot compatibility for Katmai
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Author: Hugh Blemings <hugh@au.ibm.com>
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Copyright 2007 Hugh Blemings, IBM Corporation.
8*4882a593Smuzhiyun  *   Based on cuboot-ebony.c which is:
9*4882a593Smuzhiyun  * Copyright 2007 David Gibson, IBM Corporation.
10*4882a593Smuzhiyun  *   Based on cuboot-83xx.c, which is:
11*4882a593Smuzhiyun  * Copyright (c) 2007 Freescale Semiconductor, Inc.
12*4882a593Smuzhiyun  */
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #include "ops.h"
15*4882a593Smuzhiyun #include "stdio.h"
16*4882a593Smuzhiyun #include "reg.h"
17*4882a593Smuzhiyun #include "dcr.h"
18*4882a593Smuzhiyun #include "4xx.h"
19*4882a593Smuzhiyun #include "44x.h"
20*4882a593Smuzhiyun #include "cuboot.h"
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun #define TARGET_4xx
23*4882a593Smuzhiyun #define TARGET_44x
24*4882a593Smuzhiyun #include "ppcboot.h"
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun static bd_t bd;
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun BSS_STACK(4096);
29*4882a593Smuzhiyun 
katmai_fixups(void)30*4882a593Smuzhiyun static void katmai_fixups(void)
31*4882a593Smuzhiyun {
32*4882a593Smuzhiyun 	unsigned long sysclk = 33333000;
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun 	/* 440SP Clock logic is all but identical to 440GX
35*4882a593Smuzhiyun 	 * so we just use that code for now at least
36*4882a593Smuzhiyun 	 */
37*4882a593Smuzhiyun 	ibm440spe_fixup_clocks(sysclk, 6 * 1843200, 0);
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun 	ibm440spe_fixup_memsize();
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun 	dt_fixup_mac_address(0, bd.bi_enetaddr);
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun 	ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
44*4882a593Smuzhiyun }
45*4882a593Smuzhiyun 
platform_init(unsigned long r3,unsigned long r4,unsigned long r5,unsigned long r6,unsigned long r7)46*4882a593Smuzhiyun void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
47*4882a593Smuzhiyun 		   unsigned long r6, unsigned long r7)
48*4882a593Smuzhiyun {
49*4882a593Smuzhiyun 	CUBOOT_INIT();
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun 	platform_ops.fixups = katmai_fixups;
52*4882a593Smuzhiyun 	fdt_init(_dtb_start);
53*4882a593Smuzhiyun 	serial_console_init();
54*4882a593Smuzhiyun }
55