cfi new: fix new disabling buffer support
[barebox-mini2440.git] / board / phycore_mcf54xx / phyCore_MCF54xx.c
blobf8e96d3af3a1e85e7aaefa49d0e7d83b90d7b78d
1 /*
2 * (C) 2007 konzeptpark, Carsten Schlote <c.schlote@konzeptpark.de>
3 * See file CREDITS for list of people who contributed to this project.
5 * This file is part of U-Boot V2.
7 * U-Boot V2 is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * U-Boot V2 is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with U-Boot V2. If not, see <http://www.gnu.org/licenses/>.
21 /** @file This file contains ...
24 #include <common.h>
25 #include <init.h>
26 #include <driver.h>
27 #include <fec.h>
28 #include <environment.h>
29 #include <asm/arch/mcf54xx-regs.h>
30 #include <asm/arch/clocks.h>
31 #include <asm/io.h>
32 #include <partition.h>
35 * Return board clock in MHz FIXME move to clocks file
37 ulong mcfv4e_get_bus_clk(void)
39 return CFG_SYSTEM_CORE_CLOCK;
43 * Up to 64MiB NOR type flash, connected to
44 * CS line 0, data width is 32 bit
46 static struct device_d cfi_dev =
48 .name = "cfi_flash",
49 .map_base = CFG_FLASH_ADDRESS,
50 .size = CFG_FLASH_SIZE,
54 * Build in FastEthernetControllers (FECs)
56 static struct fec_platform_data fec_info =
58 .xcv_type = MII100,
61 static struct device_d network_dev0 =
63 .name = "fec_mcf54xx",
64 .map_base = MCF_FEC_ADDR(0),
65 .size = MCF_FEC_SIZE(0), /* area size */
66 .platform_data = &fec_info,
68 static struct device_d network_dev1 =
70 .name = "fec_mcf54xx",
71 .map_base = MCF_FEC_ADDR(1),
72 .size = MCF_FEC_SIZE(1), /* area size */
73 .platform_data = &fec_info,
77 * 128MiB of SDRAM, data width is 32 bit
79 static struct memory_platform_data ram_pdata = {
80 .name = "ram0",
81 .flags = DEVFS_RDWR,
84 static struct device_d sdram_dev =
86 .name = "mem",
87 .map_base = CFG_SDRAM_ADDRESS,
88 .size = CFG_SDRAM_SIZE,
89 .platform_data = &ram_pdata,
92 static int mcfv4e_devices_init(void)
94 printf("FIXME - setup board devices...\n");
96 register_device(&cfi_dev);
99 * Create partitions that should be
100 * not touched by any regular user
102 devfs_add_partition("nor0", 0x00000, 0x80000, PARTITION_FIXED, "self0"); /* ourself */
103 devfs_add_partition("nor0", 0x80000, 0x40000, PARTITION_FIXED, "env0"); /* environment */
104 protect_file("/dev/env0", 1);
106 register_device(&network_dev0);
107 //register_device(&network_dev1);
109 register_device(&sdram_dev);
111 return 0;
114 device_initcall(mcfv4e_devices_init);
116 static struct device_d mcfv4e_serial_device =
118 .name = "mcfv4e_serial",
119 .map_base = 1 + CFG_EARLY_UART_PORT,
120 .size = 16 * 1024,
123 static int mcfv4e_console_init(void)
125 /* init gpios for serial port */
127 /* Already set in lowlevel_init.c */
129 register_device(&mcfv4e_serial_device);
130 return 0;
133 console_initcall(mcfv4e_console_init);