xref: /linux/arch/powerpc/boot/bamboo.c (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*b886d83cSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
22ba4573cSJosh Boyer /*
32ba4573cSJosh Boyer  * Copyright IBM Corporation, 2007
42ba4573cSJosh Boyer  * Josh Boyer <jwboyer@linux.vnet.ibm.com>
52ba4573cSJosh Boyer  *
62ba4573cSJosh Boyer  * Based on ebony wrapper:
72ba4573cSJosh Boyer  * Copyright 2007 David Gibson, IBM Corporation.
82ba4573cSJosh Boyer  *
92ba4573cSJosh Boyer  * Clocking code based on code by:
102ba4573cSJosh Boyer  * Stefan Roese <sr@denx.de>
112ba4573cSJosh Boyer  */
122ba4573cSJosh Boyer #include <stdarg.h>
132ba4573cSJosh Boyer #include <stddef.h>
142ba4573cSJosh Boyer #include "types.h"
152ba4573cSJosh Boyer #include "elf.h"
162ba4573cSJosh Boyer #include "string.h"
172ba4573cSJosh Boyer #include "stdio.h"
182ba4573cSJosh Boyer #include "page.h"
192ba4573cSJosh Boyer #include "ops.h"
202ba4573cSJosh Boyer #include "dcr.h"
212ba4573cSJosh Boyer #include "4xx.h"
222ba4573cSJosh Boyer #include "44x.h"
232ba4573cSJosh Boyer 
24658e8170SJosh Boyer static u8 *bamboo_mac0, *bamboo_mac1;
252ba4573cSJosh Boyer 
bamboo_fixups(void)262ba4573cSJosh Boyer static void bamboo_fixups(void)
272ba4573cSJosh Boyer {
282ba4573cSJosh Boyer 	unsigned long sysclk = 33333333;
292ba4573cSJosh Boyer 
30190de005SBenjamin Herrenschmidt 	ibm440ep_fixup_clocks(sysclk, 11059200, 25000000);
31d23f5099SBenjamin Herrenschmidt 	ibm4xx_sdram_fixup_memsize();
322ba4573cSJosh Boyer 	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
33ecc6cd73SDavid Gibson 	dt_fixup_mac_address_by_alias("ethernet0", bamboo_mac0);
34ecc6cd73SDavid Gibson 	dt_fixup_mac_address_by_alias("ethernet1", bamboo_mac1);
352ba4573cSJosh Boyer }
362ba4573cSJosh Boyer 
bamboo_init(void * mac0,void * mac1)37658e8170SJosh Boyer void bamboo_init(void *mac0, void *mac1)
382ba4573cSJosh Boyer {
392ba4573cSJosh Boyer 	platform_ops.fixups = bamboo_fixups;
402ba4573cSJosh Boyer 	platform_ops.exit = ibm44x_dbcr_reset;
41658e8170SJosh Boyer 	bamboo_mac0 = mac0;
42658e8170SJosh Boyer 	bamboo_mac1 = mac1;
432f0dfeaaSDavid Gibson 	fdt_init(_dtb_start);
442ba4573cSJosh Boyer 	serial_console_init();
452ba4573cSJosh Boyer }
46