summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/at91rm9200ek
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-05-08 13:09:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-05-31 08:22:00 +0200
commitcbf46b2dad492d24280b3a7ce4f5bcad16b06e10 (patch)
tree01a68cb6f900442274951cb263ce4cda36421cd5 /arch/arm/boards/at91rm9200ek
parent1dec1946414136ad4d2d779905d94d9ffca896b8 (diff)
downloadbarebox-cbf46b2dad492d24280b3a7ce4f5bcad16b06e10.tar.gz
barebox-cbf46b2dad492d24280b3a7ce4f5bcad16b06e10.tar.xz
at91: Support for at91rm9200: core chip & board support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Patrice Vilchez <patrice.vilchez@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/at91rm9200ek')
-rw-r--r--arch/arm/boards/at91rm9200ek/Makefile1
-rw-r--r--arch/arm/boards/at91rm9200ek/config.h68
-rw-r--r--arch/arm/boards/at91rm9200ek/env/config41
-rw-r--r--arch/arm/boards/at91rm9200ek/init.c77
4 files changed, 187 insertions, 0 deletions
diff --git a/arch/arm/boards/at91rm9200ek/Makefile b/arch/arm/boards/at91rm9200ek/Makefile
new file mode 100644
index 0000000000..eb072c0161
--- /dev/null
+++ b/arch/arm/boards/at91rm9200ek/Makefile
@@ -0,0 +1 @@
+obj-y += init.o
diff --git a/arch/arm/boards/at91rm9200ek/config.h b/arch/arm/boards/at91rm9200ek/config.h
new file mode 100644
index 0000000000..b630a6710b
--- /dev/null
+++ b/arch/arm/boards/at91rm9200ek/config.h
@@ -0,0 +1,68 @@
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define AT91_MAIN_CLOCK 18432000 /* 18.432 MHz crystal */
+
+#define MASTER_PLL_MUL 39
+#define MASTER_PLL_DIV 4
+
+/* clocks */
+#define CONFIG_SYS_MOR_VAL \
+ (AT91_PMC_MOSCEN | \
+ (255 << 8)) /* Main Oscillator Start-up Time */
+#define CONFIG_SYS_PLLAR_VAL \
+ (AT91_PMC_PLLA_WR_ERRATA | /* Bit 29 must be 1 when prog */ \
+ (0x3e << 8) | /* PLL Counter */ \
+ (0 << 14) | /* Divider A */ \
+ ((MASTER_PLL_MUL - 1) << 16) | (MASTER_PLL_DIV))
+
+#define CONFIG_SYS_PLLBR_VAL 0x10483E0E /* 48.054857 MHz (divider by 2 for USB) */
+/* PCK/2 = MCK Master Clock from SLOW */
+#define CONFIG_SYS_MCKR2_VAL1 \
+ (AT91_PMC_CSS_SLOW | \
+ AT91RM9200_PMC_MDIV_2) \
+
+/* PCK/3 = MCK Master Clock = 59.904000MHz from PLLA */
+#define CONFIG_SYS_MCKR2_VAL2 \
+ (AT91_PMC_CSS_PLLA | \
+ AT91_PMC_PRES_1 | \
+ AT91RM9200_PMC_MDIV_3 |\
+ AT91_PMC_PDIV_1)
+
+/* flash */
+#define CONFIG_SYS_EBI_CFGR_VAL 0x00000000
+#define CONFIG_SYS_SMC_CSR0_VAL \
+ (AT91_SMC_NWS_(4) | /* Number of Wait States */ \
+ AT91_SMC_WSEN | /* Wait State Enable */ \
+ AT91_SMC_TDF_(2) | /* Data Float Time */ \
+ AT91_SMC_BAT | /* Byte Access Type */ \
+ AT91_SMC_DBW_16) /* Data Bus Width */
+
+/* sdram */
+#define CONFIG_SYS_PIOC_ASR_VAL 0xFFFF0000 /* Configure PIOC as peripheral (D16/D31) */
+#define CONFIG_SYS_PIOC_BSR_VAL 0x00000000
+#define CONFIG_SYS_PIOC_PDR_VAL 0xFFFF0000
+#define CONFIG_SYS_EBI_CSA_VAL \
+ (AT91_EBI_CS0A_SMC | \
+ AT91_EBI_CS1A_SDRAMC | \
+ AT91_EBI_CS3A_SMC | \
+ AT91_EBI_CS4A_SMC) \
+
+/* SDRAM */
+/* SDRAMC_MR Mode register */
+/* SDRAMC_CR - Configuration register*/
+#define CONFIG_SYS_SDRC_CR_VAL \
+ (AT91_SDRAMC_NC_9 | \
+ AT91_SDRAMC_NR_12 | \
+ AT91_SDRAMC_NB_4 | \
+ AT91_SDRAMC_CAS_2 | \
+ (1 << 8) | /* Write Recovery Delay */ \
+ (12 << 12) | /* Row Cycle Delay */ \
+ (8 << 16) | /* Row Precharge Delay */ \
+ (8 << 20) | /* Row to Column Delay */ \
+ (1 << 24) | /* Active to Precharge Delay */ \
+ (2 << 28)) /* Exit Self Refresh to Active Delay */
+
+#define CONFIG_SYS_SDRC_TR_VAL 0x000002E0 /* Write refresh rate */
+
+#endif /* __CONFIG_H */
diff --git a/arch/arm/boards/at91rm9200ek/env/config b/arch/arm/boards/at91rm9200ek/env/config
new file mode 100644
index 0000000000..1b56b25b5d
--- /dev/null
+++ b/arch/arm/boards/at91rm9200ek/env/config
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# 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
+#eth0.netmask=a.b.c.d
+#eth0.gateway=a.b.c.d
+#eth0.serverip=a.b.c.d
+
+# can be either 'nfs', 'tftp' or 'nor'
+kernel_loc=tftp
+# can be either 'net', 'nor' or 'initrd'
+rootfs_loc=net
+
+# can be either 'jffs2' or 'ubifs'
+rootfs_type=ubifs
+rootfsimage=root.$rootfs_type
+
+# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo
+#kernelimage_type=zimage
+#kernelimage=zImage
+kernelimage_type=uimage
+kernelimage=uImage
+#kernelimage_type=raw
+#kernelimage=Image
+#kernelimage_type=raw_lzo
+#kernelimage=Image.lzo
+
+nor_parts="256k(barebox)ro,64k(bareboxenv),1536k(kernel),-(root)"
+rootfs_mtdblock_nor=3
+
+autoboot_timeout=3
+
+bootargs="console=ttyS0,115200"
+
+# set a fancy prompt (if support is compiled in)
+PS1="\e[1;31m[barebox@\h]:\w\e[0m\n# "
+
diff --git a/arch/arm/boards/at91rm9200ek/init.c b/arch/arm/boards/at91rm9200ek/init.c
new file mode 100644
index 0000000000..a449326d5c
--- /dev/null
+++ b/arch/arm/boards/at91rm9200ek/init.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2009-2011 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
+ *
+ * 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 <asm/armlinux.h>
+#include <generated/mach-types.h>
+#include <partition.h>
+#include <fs.h>
+#include <fcntl.h>
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <mach/at91_pmc.h>
+#include <mach/board.h>
+#include <mach/gpio.h>
+#include <mach/io.h>
+
+static struct device_d cfi_dev = {
+ .id = 0,
+ .name = "cfi_flash",
+ .map_base = AT91_CHIPSELECT_0,
+};
+
+static struct at91_ether_platform_data ether_pdata = {
+ .flags = AT91SAM_ETHER_RMII,
+ .phy_addr = 0,
+};
+
+static int at91rm9200ek_devices_init(void)
+{
+ /*
+ * Correct IRDA resistor problem
+ * Set PA23_TXD in Output
+ */
+ at91_set_gpio_output(AT91_PIN_PA23, 1);
+
+ at91_add_device_sdram(64 * 1024 * 1024);
+ at91_add_device_eth(&ether_pdata);
+ register_device(&cfi_dev);
+
+#if defined(CONFIG_DRIVER_CFI) || defined(CONFIG_DRIVER_CFI_OLD)
+ devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self");
+ devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0");
+#endif
+
+ armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100));
+ armlinux_set_architecture(MACH_TYPE_AT91RM9200EK);
+
+ return 0;
+}
+device_initcall(at91rm9200ek_devices_init);
+
+static int at91rm9200ek_console_init(void)
+{
+ at91_register_uart(0, 0);
+ return 0;
+}
+console_initcall(at91rm9200ek_console_init);