xref: /openbmc/linux/arch/powerpc/boot/cuboot-sequoia.c (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*b886d83cSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
2606d08bcSValentine Barshak /*
3606d08bcSValentine Barshak  * Old U-boot compatibility for Sequoia
4606d08bcSValentine Barshak  *
5606d08bcSValentine Barshak  * Valentine Barshak <vbarshak@ru.mvista.com>
6606d08bcSValentine Barshak  * Copyright 2007 MontaVista Software, Inc
7606d08bcSValentine Barshak  *
8606d08bcSValentine Barshak  * Based on Ebony code by David Gibson <david@gibson.dropbear.id.au>
9606d08bcSValentine Barshak  * Copyright IBM Corporation, 2007
10606d08bcSValentine Barshak  *
11606d08bcSValentine Barshak  * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
12606d08bcSValentine Barshak  * Copyright IBM Corporation, 2007
13606d08bcSValentine Barshak  */
14606d08bcSValentine Barshak 
15606d08bcSValentine Barshak #include <stdarg.h>
16606d08bcSValentine Barshak #include <stddef.h>
17606d08bcSValentine Barshak #include "types.h"
18606d08bcSValentine Barshak #include "elf.h"
19606d08bcSValentine Barshak #include "string.h"
20606d08bcSValentine Barshak #include "stdio.h"
21606d08bcSValentine Barshak #include "page.h"
22606d08bcSValentine Barshak #include "ops.h"
23606d08bcSValentine Barshak #include "dcr.h"
24606d08bcSValentine Barshak #include "4xx.h"
25606d08bcSValentine Barshak #include "44x.h"
26606d08bcSValentine Barshak #include "cuboot.h"
27606d08bcSValentine Barshak 
28606d08bcSValentine Barshak #define TARGET_4xx
29606d08bcSValentine Barshak #define TARGET_44x
30606d08bcSValentine Barshak #include "ppcboot.h"
31606d08bcSValentine Barshak 
32606d08bcSValentine Barshak static bd_t bd;
33606d08bcSValentine Barshak 
34606d08bcSValentine Barshak 
sequoia_fixups(void)35606d08bcSValentine Barshak static void sequoia_fixups(void)
36606d08bcSValentine Barshak {
37606d08bcSValentine Barshak 	unsigned long sysclk = 33333333;
38606d08bcSValentine Barshak 
3958c50192SValentine Barshak 	ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
40606d08bcSValentine Barshak 	ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
41606d08bcSValentine Barshak 	ibm4xx_denali_fixup_memsize();
42ecc6cd73SDavid Gibson 	dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
43ecc6cd73SDavid Gibson 	dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
44606d08bcSValentine Barshak }
45606d08bcSValentine Barshak 
platform_init(unsigned long r3,unsigned long r4,unsigned long r5,unsigned long r6,unsigned long r7)46606d08bcSValentine Barshak void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
47606d08bcSValentine Barshak                    unsigned long r6, unsigned long r7)
48606d08bcSValentine Barshak {
49606d08bcSValentine Barshak 	CUBOOT_INIT();
50606d08bcSValentine Barshak 	platform_ops.fixups = sequoia_fixups;
51606d08bcSValentine Barshak 	platform_ops.exit = ibm44x_dbcr_reset;
522f0dfeaaSDavid Gibson 	fdt_init(_dtb_start);
53606d08bcSValentine Barshak 	serial_console_init();
54606d08bcSValentine Barshak }
55