diff options
author | Juergen Beisert <jbe@pengutronix.de> | 2012-07-28 17:10:50 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-30 11:35:27 +0200 |
commit | d65926656c9e51419ec491a48f71017e3c9759cd (patch) | |
tree | e3e89c97fbb4fc5f3862ec685125ce2a9f245574 /arch/arm/boards/friendlyarm-tiny6410 | |
parent | b36d795cf0a196f1135167df3057438f50669cb5 (diff) | |
download | barebox-d65926656c9e51419ec491a48f71017e3c9759cd.tar.gz barebox-d65926656c9e51419ec491a48f71017e3c9759cd.tar.xz |
ARM/Samsung: add the Tiny6410 platform as a user of the S3C6410 SoC
The Tiny6410 and its base board is a pure development platform.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/friendlyarm-tiny6410')
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny6410/Kconfig | 19 | ||||
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny6410/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny6410/config.h | 8 | ||||
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny6410/development-board.c | 99 | ||||
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny6410/env/config | 56 | ||||
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny6410/tiny6410.c | 80 | ||||
-rw-r--r-- | arch/arm/boards/friendlyarm-tiny6410/tiny6410.h | 14 |
7 files changed, 279 insertions, 0 deletions
diff --git a/arch/arm/boards/friendlyarm-tiny6410/Kconfig b/arch/arm/boards/friendlyarm-tiny6410/Kconfig new file mode 100644 index 0000000000..374820f8b3 --- /dev/null +++ b/arch/arm/boards/friendlyarm-tiny6410/Kconfig @@ -0,0 +1,19 @@ +if MACH_TINY6410 + +choice + prompt "FriendlyARM Tiny6410 baseboard" + help + Since the Tiny6410 is a CPU card only, it requires a basebord to make + it work. Select here the baseboard Barebox should expect and + configure. + +config MACH_TINY6410_FA + bool + select HAS_DM9000 + prompt "FA development platform" + help + FriendlyARM's Tiny6410 evaluation board. + +endchoice + +endif diff --git a/arch/arm/boards/friendlyarm-tiny6410/Makefile b/arch/arm/boards/friendlyarm-tiny6410/Makefile new file mode 100644 index 0000000000..b3ab12eea3 --- /dev/null +++ b/arch/arm/boards/friendlyarm-tiny6410/Makefile @@ -0,0 +1,3 @@ +obj-y += tiny6410.o + +obj-$(CONFIG_MACH_TINY6410_FA) += development-board.o diff --git a/arch/arm/boards/friendlyarm-tiny6410/config.h b/arch/arm/boards/friendlyarm-tiny6410/config.h new file mode 100644 index 0000000000..04f68579ed --- /dev/null +++ b/arch/arm/boards/friendlyarm-tiny6410/config.h @@ -0,0 +1,8 @@ +/* FriendlyARM Tiny6410 specific global settings */ + +#ifndef _TINY6410_CONFIG_H_ +# define _TINY6410_CONFIG_H_ + +#define S3C64XX_CLOCK_REFERENCE 12000000 + +#endif /* _TINY6410_CONFIG_H_ */ diff --git a/arch/arm/boards/friendlyarm-tiny6410/development-board.c b/arch/arm/boards/friendlyarm-tiny6410/development-board.c new file mode 100644 index 0000000000..bf339d3928 --- /dev/null +++ b/arch/arm/boards/friendlyarm-tiny6410/development-board.c @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2012 Juergen Beisert + * + * 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. + * + * The FriendlyARM's Tiny6410 evaluation board comes with all connectors and + * devices to make the Tiny6410 CPU card work. This includes: + * + * - the DM9000 network controller + * - USB/MCI connectors + * - display connector + * + */ +#include <common.h> +#include <driver.h> +#include <init.h> +#include <gpio.h> +#include <dm9000.h> +#include <mach/devices-s3c64xx.h> +#include <mach/s3c-generic.h> + +#include "tiny6410.h" + +/* + * dm9000 network controller onboard + * Connected to CS line 1 and interrupt line EINT7, + * data width is 16 bit + * Area 1: Offset 0x300...0x301 + * Area 2: Offset 0x304...0x305 + */ +static struct dm9000_platform_data dm9000_data = { + .srom = 0, /* no serial ROM for the ethernet address */ +}; + +static const struct s3c6410_chipselect dm900_cs = { + .adr_setup_t = 0, + .access_setup_t = 0, + .access_t = 20, + .cs_hold_t = 3, + .adr_hold_t = 20, /* CS must be de-asserted for at least 20 ns */ + .width = 16, +}; + +static void tiny6410evk_setup_dm9000_cs(void) +{ + s3c6410_setup_chipselect(1, &dm900_cs); +} + +static const unsigned tiny6410evk_pin_usage[] = { + /* UART1 (V24) */ + GPA4_RXD1 | ENABLE_PU, + GPA5_TXD1, + GPA6_NCTS1 | ENABLE_PU, + GPA7_NRTS1, + /* UART2 (V24) */ + GPB0_RXD2 | ENABLE_PU, + GPB1_TXD2, + /* UART3 (spare, 3,3 V TTL level only) */ + GPB2_RXD3 | ENABLE_PU, + GPB3_TXD3, +}; + +static int tiny6410evk_devices_init(void) +{ + int i; + + /* init CPU card specific devices first */ + tiny6410_init("FA EVK"); + + /* ----------- configure the access to the outer space ---------- */ + for (i = 0; i < ARRAY_SIZE(tiny6410evk_pin_usage); i++) + s3c_gpio_mode(tiny6410evk_pin_usage[i]); + + tiny6410evk_setup_dm9000_cs(); + add_dm9000_device(0, S3C_CS1_BASE + 0x300, S3C_CS1_BASE + 0x304, + IORESOURCE_MEM_16BIT, &dm9000_data); + return 0; +} +device_initcall(tiny6410evk_devices_init); + +static int tiny6410evk_console_init(void) +{ + /* note: UART0 has no RTS/CTS connected */ + s3c_gpio_mode(GPA0_RXD0 | ENABLE_PU); + s3c_gpio_mode(GPA1_TXD0); + + s3c64xx_add_uart1(); + + return 0; +} +console_initcall(tiny6410evk_console_init); diff --git a/arch/arm/boards/friendlyarm-tiny6410/env/config b/arch/arm/boards/friendlyarm-tiny6410/env/config new file mode 100644 index 0000000000..35d0fac334 --- /dev/null +++ b/arch/arm/boards/friendlyarm-tiny6410/env/config @@ -0,0 +1,56 @@ +#!/bin/sh + +machine=tiny6410 +eth0.serverip=a.b.c.d.e +user= + +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration +ip=dhcp + +# or set your networking parameters here +#eth0.ipaddr=a.b.c.d.e +#eth0.netmask=a.b.c.d.e +#eth0.gateway=a.b.c.d.e +eth0.ethaddr=08:90:90:90:90:90 + +# can be either 'nfs', 'tftp' or 'nand' +kernel_loc=tftp +# can be either 'net', 'nand' or 'initrd' +rootfs_loc=net + +# can be either 'jffs2' or 'ubifs' +rootfs_type=ubifs +rootfsimage=root-${machine}.${rootfs_type} + +# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo +kernelimage_type=zimage +kernelimage=zImage-${machine} +#kernelimage_type=uimage +#kernelimage=uImage-$machine +#kernelimage_type=raw +#kernelimage=Image-$machine +#kernelimage_type=raw_lzo +#kernelimage=Image-$machine.lzo + +if [ -n $user ]; then + kernelimage="${user}"-"${kernelimage}" + nfsroot="${eth0.serverip}:/home/${user}/nfsroot/${machine}" + rootfsimage="${user}"-"${rootfsimage}" +else + nfsroot="${eth0.serverip}:/path/to/nfs/root" +fi + +autoboot_timeout=3 + +# +# "tiny6410" kernel parameter +# 0 .. 9 = screen type +# i = touchscreen with propritary FriendlyARM protocol +# Note: can be "tiny6410= " if nothing of these components are connected +# +bootargs="console=ttySAC0,115200 tiny6410=0" + +nand_device="nand" +nand_parts="256k(barebox),128k(bareboxenv),1536k(kernel),-(root)" +rootfs_mtdblock_nand=3 diff --git a/arch/arm/boards/friendlyarm-tiny6410/tiny6410.c b/arch/arm/boards/friendlyarm-tiny6410/tiny6410.c new file mode 100644 index 0000000000..db13c066cf --- /dev/null +++ b/arch/arm/boards/friendlyarm-tiny6410/tiny6410.c @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2012 Juergen Beisert + * + * 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. + */ +#include <common.h> +#include <driver.h> +#include <init.h> +#include <gpio.h> +#include <generated/mach-types.h> +#include <asm/armlinux.h> +#include <mach/s3c-iomap.h> +#include <mach/s3c-generic.h> + +static const unsigned tiny6410_pin_usage[] = { + /* UART0 */ + GPA2_GPIO | GPIO_IN | ENABLE_PU, /* CTS not connected */ + GPA3_GPIO | GPIO_IN | ENABLE_PU, /* RTS not connected */ + + /* local bus' D0 ... D15 are always active */ + /* local bus' A0...A5 are always active */ + + /* internal NAND memory */ + GPO0_NCS2, /* NAND's first chip select line */ + /* NAND's second chip select line, not used */ + GPO1_GPIO | GPIO_OUT | GPIO_VAL(1), + GPP3_FALE, + GPP4_FCLE, + GPP5_FWE, + GPP6_FRE, + GPP7_RNB, /* external pull-up */ + + GPF13_GPIO | GPIO_OUT | GPIO_VAL(0), /* OTG power supply, 0 = off */ + + /* nowhere connected */ + GPO2_GPIO | GPIO_IN | ENABLE_PU, + GPO3_GPIO | GPIO_IN | ENABLE_PU, + GPO4_GPIO | GPIO_IN | ENABLE_PU, + GPO5_GPIO | GPIO_IN | ENABLE_PU, + + /* local bus address lines 6...15 are nowhere connected */ + GPO6_GPIO | GPIO_IN | ENABLE_PU, + GPO7_GPIO | GPIO_IN | ENABLE_PU, + GPO8_GPIO | GPIO_IN | ENABLE_PU, + GPO9_GPIO | GPIO_IN | ENABLE_PU, + GPO10_GPIO | GPIO_IN | ENABLE_PU, + GPO11_GPIO | GPIO_IN | ENABLE_PU, + GPO12_GPIO | GPIO_IN | ENABLE_PU, + GPO13_GPIO | GPIO_IN | ENABLE_PU, + GPO14_GPIO | GPIO_IN | ENABLE_PU, + GPO15_GPIO | GPIO_IN | ENABLE_PU, +}; + +static int tiny6410_mem_init(void) +{ + arm_add_mem_device("ram0", S3C_SDRAM_BASE, s3c6410_get_memory_size()); + + return 0; +} +mem_initcall(tiny6410_mem_init); + +void tiny6410_init(const char *bb_name) +{ + int i; + + /* ----------- configure the access to the outer space ---------- */ + for (i = 0; i < ARRAY_SIZE(tiny6410_pin_usage); i++) + s3c_gpio_mode(tiny6410_pin_usage[i]); + + armlinux_set_bootparams((void *)S3C_SDRAM_BASE + 0x100); + armlinux_set_architecture(MACH_TYPE_TINY6410); +} diff --git a/arch/arm/boards/friendlyarm-tiny6410/tiny6410.h b/arch/arm/boards/friendlyarm-tiny6410/tiny6410.h new file mode 100644 index 0000000000..98db422422 --- /dev/null +++ b/arch/arm/boards/friendlyarm-tiny6410/tiny6410.h @@ -0,0 +1,14 @@ +/* + * 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. + */ + +/* to be called by the base board */ +void tiny6410_init(const char*); |