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/arm/boards/netx | |
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/arm/boards/netx')
-rw-r--r-- | arch/arm/boards/netx/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boards/netx/config.h | 4 | ||||
-rw-r--r-- | arch/arm/boards/netx/netx.c | 110 | ||||
-rw-r--r-- | arch/arm/boards/netx/netx.dox | 9 | ||||
-rw-r--r-- | arch/arm/boards/netx/platform.S | 26 |
5 files changed, 151 insertions, 0 deletions
diff --git a/arch/arm/boards/netx/Makefile b/arch/arm/boards/netx/Makefile new file mode 100644 index 0000000000..8b33fec316 --- /dev/null +++ b/arch/arm/boards/netx/Makefile @@ -0,0 +1,2 @@ +obj-y += netx.o platform.o + diff --git a/arch/arm/boards/netx/config.h b/arch/arm/boards/netx/config.h new file mode 100644 index 0000000000..ca15136817 --- /dev/null +++ b/arch/arm/boards/netx/config.h @@ -0,0 +1,4 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/netx/netx.c b/arch/arm/boards/netx/netx.c new file mode 100644 index 0000000000..d6bfcca54d --- /dev/null +++ b/arch/arm/boards/netx/netx.c @@ -0,0 +1,110 @@ +/* + * 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> +#include <net.h> +#include <init.h> +#include <environment.h> +#include <mach/netx-regs.h> +#include <partition.h> +#include <asm/armlinux.h> +#include <fs.h> +#include <fcntl.h> +#include <asm/mach-types.h> +#include <mach/netx-eth.h> + +static struct device_d cfi_dev = { + .name = "cfi_flash", + .map_base = 0xC0000000, + .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 = 0x80000000, + .size = 64 * 1024 * 1024, + .platform_data = &ram_pdata, +}; + +struct netx_eth_platform_data eth0_data = { + .xcno = 0, +}; + +static struct device_d netx_eth_dev0 = { + .name = "netx-eth", + .platform_data = ð0_data, +}; + +struct netx_eth_platform_data eth1_data = { + .xcno = 1, +}; + +static struct device_d netx_eth_dev1 = { + .name = "netx-eth", + .platform_data = ð1_data, +}; + +static int netx_devices_init(void) { + register_device(&cfi_dev); + register_device(&sdram_dev); + register_device(&netx_eth_dev0); + register_device(&netx_eth_dev1); + + devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0"); + + /* Do not overwrite primary env for now */ + devfs_add_partition("nor0", 0xc0000, 0x80000, PARTITION_FIXED, "env0"); + + protect_file("/dev/env0", 1); + + armlinux_add_dram(&sdram_dev); + armlinux_set_bootparams((void *)0x80000100); + armlinux_set_architecture(MACH_TYPE_NXDB500); + + return 0; +} + +device_initcall(netx_devices_init); + +static struct device_d netx_serial_device = { + .name = "netx_serial", + .map_base = NETX_PA_UART0, + .size = 0x40, +}; + +static int netx_console_init(void) +{ + /* configure gpio for serial */ + *(volatile unsigned long *)(0x00100800) = 2; + *(volatile unsigned long *)(0x00100804) = 2; + *(volatile unsigned long *)(0x00100808) = 2; + *(volatile unsigned long *)(0x0010080c) = 2; + + register_device(&netx_serial_device); + return 0; +} + +console_initcall(netx_console_init); + diff --git a/arch/arm/boards/netx/netx.dox b/arch/arm/boards/netx/netx.dox new file mode 100644 index 0000000000..e22c5e8554 --- /dev/null +++ b/arch/arm/boards/netx/netx.dox @@ -0,0 +1,9 @@ +/** @page netx Hilscher's NetX card family + +This CPU card is based on a Hilscher's NetX ARM CPU. The card is shipped +in various incarnations: + +Specific to this CPU is, it does not require any setup code to bring the +SDRAM up and working. This is done in a pre bootloader. + +*/
\ No newline at end of file diff --git a/arch/arm/boards/netx/platform.S b/arch/arm/boards/netx/platform.S new file mode 100644 index 0000000000..4961682322 --- /dev/null +++ b/arch/arm/boards/netx/platform.S @@ -0,0 +1,26 @@ +/* + * Board specific setup info + * + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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 + */ + +.globl board_init_lowlevel +board_init_lowlevel: + mov pc, lr |