diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2010-07-22 05:00:13 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-07-23 08:35:25 +0200 |
commit | d8c86961b333a9c88cf2aa4282a43b8382e9b810 (patch) | |
tree | cf8b39db96805a2ed876ba14f6824a96ebffc906 /arch/blackfin/boards/ipe337/ipe337.c | |
parent | d879de38e8430eeb9b37b7b6a2ac3341b0b029f7 (diff) | |
download | barebox-d8c86961b333a9c88cf2aa4282a43b8382e9b810.tar.gz barebox-d8c86961b333a9c88cf2aa4282a43b8382e9b810.tar.xz |
move boards to arch/<architecure>/boards
this will allow each arch to handle the boards more simply and depending on
there need
the env var BOARD will refer to the current board dirent
for sandbox as we have only one board the board dirent is arch/sandbox/board
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/blackfin/boards/ipe337/ipe337.c')
-rw-r--r-- | arch/blackfin/boards/ipe337/ipe337.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/arch/blackfin/boards/ipe337/ipe337.c b/arch/blackfin/boards/ipe337/ipe337.c new file mode 100644 index 0000000000..269e7743fc --- /dev/null +++ b/arch/blackfin/boards/ipe337/ipe337.c @@ -0,0 +1,68 @@ +#include <common.h> +#include <init.h> +#include <driver.h> +#include <asm/cpu/cdefBF561.h> +#include <partition.h> +#include <fs.h> + +static struct device_d cfi_dev = { + .name = "cfi_flash", + .map_base = 0x20000000, + .size = 32 * 1024 * 1024, +}; + +static struct memory_platform_data ram_pdata = { + .name = "ram0", + .flags = DEVFS_RDWR, +}; + +static struct device_d sdram_dev = { + .name = "mem", + .map_base = 0x0, + .size = 128 * 1024 * 1024, + .platform_data = &ram_pdata, +}; + +static struct device_d smc911x_dev = { + .name = "smc911x", + .map_base = 0x24000000, + .size = 4096, +}; + +static int ipe337_devices_init(void) { + register_device(&cfi_dev); + register_device(&sdram_dev); + + /* Reset smc911x */ + *pFIO0_DIR = (1<<12); + *pFIO0_FLAG_C = (1<<12); + mdelay(100); + *pFIO0_FLAG_S = (1<<12); + + register_device(&smc911x_dev); + + devfs_add_partition("nor0", 0x00000, 0x20000, PARTITION_FIXED, "self0"); + devfs_add_partition("nor0", 0x20000, 0x20000, PARTITION_FIXED, "env0"); + + protect_file("/dev/env0", 1); + + return 0; +} + +device_initcall(ipe337_devices_init); + +static struct device_d blackfin_serial_device = { + .name = "blackfin_serial", + .map_base = 0, + .size = 4096, +}; + +static int blackfin_console_init(void) +{ + register_device(&blackfin_serial_device); + + return 0; +} + +console_initcall(blackfin_console_init); + |