2007-07-05 16:01:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2004 Sascha Hauer, Synertronixx GmbH
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2007-07-05 16:01:24 +00:00
|
|
|
#include <net.h>
|
|
|
|
#include <cfi_flash.h>
|
2007-07-05 16:01:24 +00:00
|
|
|
#include <init.h>
|
2007-07-05 16:01:34 +00:00
|
|
|
#include <environment.h>
|
2007-07-05 16:01:54 +00:00
|
|
|
#include <asm/arch/imx-regs.h>
|
2007-07-15 12:06:16 +00:00
|
|
|
#include <asm/arch/gpio.h>
|
2007-10-16 09:31:13 +00:00
|
|
|
#include <asm/io.h>
|
2007-07-05 16:01:54 +00:00
|
|
|
#include <partition.h>
|
2007-07-16 08:31:11 +00:00
|
|
|
#include <fs.h>
|
|
|
|
#include <fcntl.h>
|
2007-10-16 11:55:48 +00:00
|
|
|
#include <dm9000.h>
|
2007-07-05 16:01:24 +00:00
|
|
|
|
|
|
|
static struct device_d cfi_dev = {
|
2007-09-13 14:06:02 +00:00
|
|
|
.name = "cfi_flash",
|
|
|
|
.id = "nor0",
|
2007-07-05 16:01:24 +00:00
|
|
|
|
2007-09-13 14:06:02 +00:00
|
|
|
.map_base = 0x10000000,
|
|
|
|
.size = 16 * 1024 * 1024,
|
2007-07-05 16:01:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct device_d sdram_dev = {
|
2007-09-13 14:06:02 +00:00
|
|
|
.name = "ram",
|
|
|
|
.id = "ram0",
|
2007-07-05 16:01:24 +00:00
|
|
|
|
2007-09-13 14:06:02 +00:00
|
|
|
.map_base = 0x08000000,
|
|
|
|
.size = 16 * 1024 * 1024,
|
2007-07-05 16:01:27 +00:00
|
|
|
|
|
|
|
.type = DEVICE_TYPE_DRAM,
|
2007-07-05 16:01:24 +00:00
|
|
|
};
|
2007-07-05 16:01:24 +00:00
|
|
|
|
2007-10-16 11:55:48 +00:00
|
|
|
static struct dm9000_platform_data dm9000_data = {
|
|
|
|
.iobase = 0x16000000,
|
|
|
|
.iodata = 0x16000004,
|
|
|
|
.buswidth = DM9000_WIDTH_16,
|
|
|
|
};
|
|
|
|
|
2007-07-05 16:01:24 +00:00
|
|
|
static struct device_d dm9000_dev = {
|
2007-09-13 14:06:02 +00:00
|
|
|
.name = "dm9000",
|
|
|
|
.id = "eth0",
|
2007-10-16 11:55:48 +00:00
|
|
|
.map_base = 0x16000000,
|
|
|
|
.size = 8,
|
|
|
|
.platform_data = &dm9000_data,
|
2007-09-13 14:06:02 +00:00
|
|
|
.type = DEVICE_TYPE_ETHER,
|
2007-07-05 16:01:24 +00:00
|
|
|
};
|
2007-07-05 16:01:24 +00:00
|
|
|
|
2007-07-05 16:01:24 +00:00
|
|
|
static int scb9328_devices_init(void) {
|
2007-10-16 09:31:13 +00:00
|
|
|
|
|
|
|
/* adjust chipselects */
|
|
|
|
GPR(0) = 0x00800000;
|
|
|
|
GIUS(0) = 0x0043fffe;
|
|
|
|
|
|
|
|
/* CS3 becomes CS3 by clearing reset default bit 1 in FMCR */
|
|
|
|
FMCR = 0x1;
|
|
|
|
|
|
|
|
CS0U = 0x000F2000;
|
|
|
|
CS0L = 0x11110d01;
|
|
|
|
|
|
|
|
CS1U = 0x000F0a00;
|
|
|
|
CS1L = 0x11110601;
|
|
|
|
CS2U = 0x0;
|
|
|
|
CS2L = 0x0;
|
|
|
|
CS3U = 0x000FFFFF;
|
|
|
|
CS3L = 0x00000303;
|
|
|
|
CS4U = 0x000F0a00;
|
|
|
|
CS4L = 0x11110301;
|
|
|
|
CS5U = 0x00008400;
|
|
|
|
CS5L = 0x00000D03;
|
|
|
|
|
2007-07-05 16:01:24 +00:00
|
|
|
register_device(&cfi_dev);
|
|
|
|
register_device(&sdram_dev);
|
2007-07-05 16:01:24 +00:00
|
|
|
register_device(&dm9000_dev);
|
2007-07-05 16:01:27 +00:00
|
|
|
|
2007-10-19 06:45:57 +00:00
|
|
|
dev_add_partition(&cfi_dev, 0x00000, 0x20000, PARTITION_FIXED, "self");
|
|
|
|
dev_add_partition(&cfi_dev, 0x40000, 0x20000, PARTITION_FIXED, "env");
|
2007-07-16 08:31:11 +00:00
|
|
|
dev_protect(&cfi_dev, 0x20000, 0, 1);
|
2007-07-05 16:01:54 +00:00
|
|
|
|
2007-07-05 16:01:24 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
device_initcall(scb9328_devices_init);
|
2007-07-05 16:01:54 +00:00
|
|
|
|
|
|
|
static struct device_d scb9328_serial_device = {
|
2007-09-13 14:06:02 +00:00
|
|
|
.name = "imx_serial",
|
|
|
|
.id = "cs0",
|
2007-07-05 16:01:54 +00:00
|
|
|
.map_base = IMX_UART1_BASE,
|
|
|
|
.size = 4096,
|
2007-09-13 14:06:02 +00:00
|
|
|
.type = DEVICE_TYPE_CONSOLE,
|
2007-07-05 16:01:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int scb9328_console_init(void)
|
|
|
|
{
|
2007-07-05 19:44:39 +00:00
|
|
|
/* init gpios for serial port */
|
|
|
|
imx_gpio_mode(PC11_PF_UART1_TXD);
|
|
|
|
imx_gpio_mode(PC12_PF_UART1_RXD);
|
|
|
|
|
2007-07-05 16:01:54 +00:00
|
|
|
register_device(&scb9328_serial_device);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
console_initcall(scb9328_console_init);
|
|
|
|
|