diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-01 12:16:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-01 12:16:31 +0200 |
commit | 0dd24dc17d561fa0a9f8d5b2ffb5c31e1cf7985c (patch) | |
tree | 47720635ddb703562906ed5e0c9811254acffefe /board/pm9263 | |
parent | 74874be56a6a0aa0b543aae5ba96e451f6ecaa8c (diff) | |
download | barebox-0dd24dc17d561fa0a9f8d5b2ffb5c31e1cf7985c.tar.gz barebox-0dd24dc17d561fa0a9f8d5b2ffb5c31e1cf7985c.tar.xz |
add Ronetix pm9263 board support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'board/pm9263')
-rw-r--r-- | board/pm9263/Makefile | 2 | ||||
-rw-r--r-- | board/pm9263/config.h | 6 | ||||
-rw-r--r-- | board/pm9263/env/bin/boot | 38 | ||||
-rw-r--r-- | board/pm9263/env/bin/init | 19 | ||||
-rw-r--r-- | board/pm9263/env/bin/update_kernel | 8 | ||||
-rw-r--r-- | board/pm9263/env/bin/update_root | 8 | ||||
-rw-r--r-- | board/pm9263/env/config | 21 | ||||
-rw-r--r-- | board/pm9263/init.c | 105 | ||||
-rw-r--r-- | board/pm9263/lowlevel_init.S | 26 |
9 files changed, 233 insertions, 0 deletions
diff --git a/board/pm9263/Makefile b/board/pm9263/Makefile new file mode 100644 index 0000000000..73ef72e210 --- /dev/null +++ b/board/pm9263/Makefile @@ -0,0 +1,2 @@ +obj-y += lowlevel_init.o +obj-y += init.o diff --git a/board/pm9263/config.h b/board/pm9263/config.h new file mode 100644 index 0000000000..afd8563212 --- /dev/null +++ b/board/pm9263/config.h @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define AT91_MASTER_CLOCK 99328000 /* peripheral = main / 2 */ + +#endif /* __CONFIG_H */ diff --git a/board/pm9263/env/bin/boot b/board/pm9263/env/bin/boot new file mode 100644 index 0000000000..ed6f11a108 --- /dev/null +++ b/board/pm9263/env/bin/boot @@ -0,0 +1,38 @@ +#!/bin/sh + +. /env/config + +if [ x$1 = xflash ]; then + root=flash + kernel=flash +fi + +if [ x$1 = xnet ]; then + root=net + kernel=net +fi + +if [ x$ip = xdhcp ]; then + bootargs="$bootargs ip=dhcp" +else + bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::" +fi + +if [ x$root = xflash ]; then + bootargs="$bootargs root=$rootpart rootfstype=jffs2" +else + bootargs="$bootargs root=/dev/nfs nfsroot=192.168.23.111:$nfsroot" +fi + +bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts" + +if [ $kernel = net ]; then + if [ x$ip = xdhcp ]; then + dhcp + fi + tftp $uimage uImage + bootm uImage +else + bootm /dev/nor0.kernel +fi + diff --git a/board/pm9263/env/bin/init b/board/pm9263/env/bin/init new file mode 100644 index 0000000000..b8d8399842 --- /dev/null +++ b/board/pm9263/env/bin/init @@ -0,0 +1,19 @@ +#!/bin/sh + +PATH=/env/bin +export PATH + +. /env/config + +echo +echo -n "Hit any key to stop autoboot: " +timeout -a $autoboot_timeout +if [ $? != 0 ]; then + echo + echo "type update_kernel [<imagename>] to update kernel into flash" + echo "type udate_root [<imagename>] to update rootfs into flash" + echo + exit +fi + +boot
\ No newline at end of file diff --git a/board/pm9263/env/bin/update_kernel b/board/pm9263/env/bin/update_kernel new file mode 100644 index 0000000000..1ad95fc5d6 --- /dev/null +++ b/board/pm9263/env/bin/update_kernel @@ -0,0 +1,8 @@ +#!/bin/sh + +. /env/config + +image=$uimage +part=/dev/nor0.kernel + +. /env/bin/_update $1 diff --git a/board/pm9263/env/bin/update_root b/board/pm9263/env/bin/update_root new file mode 100644 index 0000000000..b757a5b922 --- /dev/null +++ b/board/pm9263/env/bin/update_root @@ -0,0 +1,8 @@ +#!/bin/sh + +. /env/config + +image=$jffs2 +part=/dev/nor0.root + +. /env/bin/_update $1 diff --git a/board/pm9263/env/config b/board/pm9263/env/config new file mode 100644 index 0000000000..9d2b0b1116 --- /dev/null +++ b/board/pm9263/env/config @@ -0,0 +1,21 @@ +#!/bin/sh + +# can be either 'net' or 'flash' +kernel=net +root=net + +# use 'dhcp' todo dhcp in uboot and in kernel +ip=dhcp + +# +# setup default ethernet address +# +eth0.serverip=192.168.23.108 +eth0.ethaddr=80:97:78:38:27:73 + +uimage=uImage-at91sam9260ek + +autoboot_timeout=3 + +nfsroot="/home/jbe/pengutronix/bsp/OSELAS.BSP-Phytec-phyCORE-i.MX27-trunk/root,v3" +bootargs="console=ttyS0,115200 rw init=/bin/sh" diff --git a/board/pm9263/init.c b/board/pm9263/init.c new file mode 100644 index 0000000000..6a35fb26ba --- /dev/null +++ b/board/pm9263/init.c @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2007 Sascha Hauer, Pengutronix + * + * 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 <cfi_flash.h> +#include <init.h> +#include <environment.h> +#include <fec.h> +#include <asm/armlinux.h> +#include <asm/mach-types.h> +#include <partition.h> +#include <fs.h> +#include <fcntl.h> +#include <asm/io.h> +#include <asm/hardware.h> +#include <asm/arch/memory-map.h> +#include <asm/arch/ether.h> +#include <nand.h> +#include <linux/mtd/nand.h> +#include <asm/arch/gpio.h> + +static struct device_d sdram_dev = { + .name = "ram", + .id = "ram0", + + .map_base = 0x20000000, + .size = 64 * 1024 * 1024, + + .type = DEVICE_TYPE_DRAM, +}; + +static struct device_d cfi_dev = { + .name = "cfi_flash", + .id = "nor0", + + .map_base = 0x10000000, + .size = 4 * 1024 * 1024, +}; + +static struct at91sam_ether_platform_data macb_pdata = { + .flags = AT91SAM_ETHER_RMII, + .phy_addr = 0, +}; + +static struct device_d macb_dev = { + .name = "macb", + .id = "eth0", + .map_base = AT91SAM9263_BASE_EMAC, + .size = 0x1000, + .type = DEVICE_TYPE_ETHER, + .platform_data = &macb_pdata, +}; + +static int pm9263_devices_init(void) +{ + register_device(&sdram_dev); + register_device(&macb_dev); + register_device(&cfi_dev); + +#ifdef CONFIG_PARTITION + dev_add_partition(&cfi_dev, 0x00000, 0x40000, PARTITION_FIXED, "self"); + dev_add_partition(&cfi_dev, 0x40000, 0x10000, PARTITION_FIXED, "env"); +#endif + + armlinux_set_bootparams((void *)0x20000100); + armlinux_set_architecture(0x4b2); + + return 0; +} + +device_initcall(pm9263_devices_init); + +static struct device_d pm9263_serial_device = { + .name = "atmel_serial", + .id = "cs0", + .map_base = AT91_DBGU + AT91_BASE_SYS, + .size = 4096, + .type = DEVICE_TYPE_CONSOLE, +}; + +static int pm9263_console_init(void) +{ + register_device(&pm9263_serial_device); + return 0; +} + +console_initcall(pm9263_console_init); diff --git a/board/pm9263/lowlevel_init.S b/board/pm9263/lowlevel_init.S new file mode 100644 index 0000000000..4961682322 --- /dev/null +++ b/board/pm9263/lowlevel_init.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 |