2 * Copyright 2007 David Gibson, IBM Corporation.
4 * Based on earlier code:
5 * Copyright (C) Paul Mackerras 1997.
7 * Matt Porter <mporter@kernel.crashing.org>
8 * Copyright 2002-2005 MontaVista Software Inc.
10 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
11 * Copyright (c) 2003, 2004 Zultys Technologies
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
32 static u8 *ebony_mac0, *ebony_mac1;
34 #define EBONY_FPGA_PATH "/plb/opb/ebc/fpga"
35 #define EBONY_FPGA_FLASH_SEL 0x01
36 #define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash"
38 static void ebony_flashsel_fixup(void)
41 u32 reg[3] = {0x0, 0x0, 0x80000};
45 devp = finddevice(EBONY_FPGA_PATH);
47 fatal("Couldn't locate FPGA node %s\n\r", EBONY_FPGA_PATH);
49 if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
50 fatal("%s has missing or invalid virtual-reg property\n\r",
53 fpga_reg0 = in_8(fpga);
55 devp = finddevice(EBONY_SMALL_FLASH_PATH);
57 fatal("Couldn't locate small flash node %s\n\r",
58 EBONY_SMALL_FLASH_PATH);
60 if (getprop(devp, "reg", reg, sizeof(reg)) != sizeof(reg))
61 fatal("%s has reg property of unexpected size\n\r",
62 EBONY_SMALL_FLASH_PATH);
64 /* Invert address bit 14 (IBM-endian) if FLASH_SEL fpga bit is set */
65 if (fpga_reg0 & EBONY_FPGA_FLASH_SEL)
68 setprop(devp, "reg", reg, sizeof(reg));
71 static void ebony_fixups(void)
73 // FIXME: sysclk should be derived by reading the FPGA registers
74 unsigned long sysclk = 33000000;
76 ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
77 ibm4xx_sdram_fixup_memsize();
78 dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
79 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
80 ebony_flashsel_fixup();
83 void ebony_init(void *mac0, void *mac1)
85 platform_ops.fixups = ebony_fixups;
86 platform_ops.exit = ibm44x_dbcr_reset;
90 serial_console_init();