Index: barebox-2010.05.0/board/phyCARD-L/Kconfig
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/Kconfig	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,137 @@
+# OMAP based Board Specific Configuration file
+#
+# (C) Copyright 2008
+# OMAP Architecture specific features
+# Texas Instruments, <www.ti.com>
+# Nishanth Menon <x0nishan@ti.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
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x80e80000 if MACH_PCA102
+
+menu "OMAP Platform Features"
+
+config BOARDINFO
+	default "Phytec Messtechnik GmbH phyCARD-L PCA-102 Omap 35xx" if MACH_PCA102
+
+choice
+	prompt "Select OMAP platform"
+
+config MACH_PCA102
+	bool "Phytec Messtechnik GmbH phyCARD-L PCA-102"
+	select MACH_HAS_LOWLEVEL_INIT
+	select OMAP_CLOCK_ALL
+	select HAS_OMAP_NAND
+	  help
+	  Say Y here if you are using PCA-102
+
+endchoice
+
+if MACH_PCA102_
+	choice
+	prompt "Select UART"
+
+	config OMAP3_PCA102_UART3
+		bool "Use UART3"
+		depends on MACH_PCA102
+		help
+		  Say Y here if you would like to use UART3 as console.
+	endchoice
+endif
+
+config MACH_OMAP_ADVANCED_MUX
+	bool "Enable advanced pin muxing"
+	depends on MACH_OMAP343xSDP
+	default n
+	help
+	  Say Y here if you would like to have complete pin muxing to be
+	  done at boot time
+
+config HAS_OMAP_NAND
+	bool
+
+
+menuconfig MACH_OMAP_GPMC_NAND
+	tristate "Enable NAND device support for GPMC"
+	depends on HAS_OMAP_NAND
+	default n
+	help
+	  Say Y here if you would like to have NAND device support
+
+if MACH_OMAP_GPMC_NAND
+# Single definition used to club all generic definitions together
+config MACH_OMAP_GPMC_GENERICNAND
+	bool
+
+choice
+	prompt "Select NAND Device"
+
+config MACH_OMAP_GPMC_GENERICNAND_LP_X8
+	tristate "Enable 8 bit Large page nand"
+	depends on MACH_OMAP_GPMC_NAND
+	select MACH_OMAP_GPMC_GENERICNAND
+	help
+	  Say Y here if you would support for 8 bit NAND
+	  with large page
+	  NOTE: The timing parameter are the most relaxed
+	  If you need optimized timing, selec appropriate
+	  supported NAND flash
+
+config MACH_OMAP_GPMC_GENERICNAND_LP_X16
+	tristate "Enable 16 bit Large page nand"
+	depends on MACH_OMAP_GPMC_NAND
+	select MACH_OMAP_GPMC_GENERICNAND
+	help
+	  Say Y here if you would support for 16 bit NAND
+	  with large page
+	  NOTE: The timing parameter are the most relaxed
+	  If you need optimized timing, selec appropriate
+	  supported NAND flash
+
+config MACH_OMAP_GPMC_GENERICNAND_SP_X8
+	tristate "Enable 8 bit Small page nand"
+	depends on MACH_OMAP_GPMC_NAND
+	select MACH_OMAP_GPMC_GENERICNAND
+	help
+	  Say Y here if you would support for 8 bit NAND
+	  with small page
+	  NOTE: The timing parameter are the most relaxed
+	  If you need optimized timing, selec appropriate
+	  supported NAND flash
+
+config MACH_OMAP_GPMC_GENERICNAND_SP_X16
+	tristate "Enable 16 bit Small page nand"
+	depends on MACH_OMAP_GPMC_NAND
+	select MACH_OMAP_GPMC_GENERICNAND
+	help
+	  Say Y here if you would support for 16 bit NAND
+	  with small page
+	  NOTE: The timing parameter are the most relaxed
+	  If you need optimized timing, selec appropriate
+	  supported NAND flash
+endchoice
+
+config MACH_OMAP_CS
+	hex "NAND CS"
+	depends on MACH_OMAP_GPMC_NAND
+	default 0x0
+	help
+	  Provide the Chip select of the NAND flash
+endif
+
+endmenu
Index: barebox-2010.05.0/board/phyCARD-L/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/Makefile	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,26 @@
+# OMAP Board Specific Makefile
+#
+# (C) Copyright 2008
+# OMAP Architecture specific features
+# Texas Instruments, <www.ti.com>
+# Nishanth Menon <x0nishan@ti.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
+
+obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += platform.o
+obj-y += pca102.o
+obj-$(CONFIG_MACH_OMAP_GPMC_GENERICNAND) += devices-gpmc-nand.o
+
Index: barebox-2010.05.0/board/phyCARD-L/board.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/board.h	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,35 @@
+/**
+ * @file
+ * @brief exported generic APIs which various board files implement
+ *
+ * FileName: board/omap/board.h
+ *
+ * This file will not contain any board specific implementations.
+ */
+/*
+ * (C) Copyright 2008
+ * Texas Instruments, <www.ti.com>
+ * Raghavendra KH <r-khandenahally@ti.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
+ */
+#ifndef __BOARD_OMAP_H_
+#define __BOARD_OMAP_H_
+
+/** Generic Board initialization called from platform.S */
+void board_init(void);
+
+#endif         /* __BOARD_OMAP_H_ */
Index: barebox-2010.05.0/board/phyCARD-L/config.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/config.h	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,38 @@
+/**
+ * @file
+ * @brief provide a wrapper for standard malloc and stack size defines
+ *
+ * FileName: board/omap/config.h
+ *
+ * Standard defines should be configurable for us to move Stack and malloc
+ * areas around this defines some basics for that
+ */
+/*
+ * (C) Copyright 2006-2008
+ * Texas Instruments, <www.ti.com>
+ * Nishanth Menon <x0nishan@ti.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
+ */
+#ifndef __MACH_OMAP_CONFIG_H
+#define __MACH_OMAP_CONFIG_H
+
+/** define CFG_MALLOC_LEN from Kconfig define */
+#define CFG_MALLOC_LEN     CONFIG_OMAP_MALLOC_LEN
+/** define CONFIG_STACKSIZE from Kconfig define */
+#define CONFIG_STACKSIZE   CONFIG_OMAP_CONFIG_STACKSIZE
+
+#endif /* __MACH_OMAP_CONFIG_H */
Index: barebox-2010.05.0/board/phyCARD-L/devices-gpmc-nand.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/devices-gpmc-nand.c	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,138 @@
+/**
+ * @file
+ * @brief GPMC specific NAND devices
+ *
+ * FileName: board/omap/devices-gpmc-nand.c
+ *
+ * GPMC NAND Devices such as those from Micron, Samsung are listed here
+ */
+/*
+ * (C) Copyright 2006-2008
+ * Texas Instruments, <www.ti.com>
+ * Nishanth Menon <x0nishan@ti.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 <console.h>
+#include <init.h>
+#include <driver.h>
+#include <clock.h>
+#include <asm/io.h>
+
+#include <mach/silicon.h>
+#include <mach/gpmc.h>
+#include <mach/gpmc_nand.h>
+
+#ifdef CONFIG_MACH_OMAP_GPMC_GENERICNAND
+
+#define GPMC_CONF1_VALx8	0x00000800
+#define GPMC_CONF1_VALx16	0x00001800
+/* Set up the generic params */
+#ifdef CONFIG_MACH_OMAP_GPMC_GENERICNAND_LP_X8
+#define GPMC_NAND_ECC_LAYOUT	GPMC_NAND_ECC_LP_x8_LAYOUT
+#define GPMC_CONF1_VAL		GPMC_CONF1_VALx8
+#define GPMC_NAND_DEV_WIDTH	8
+#endif
+
+#ifdef CONFIG_MACH_OMAP_GPMC_GENERICNAND_LP_X16
+#define GPMC_NAND_ECC_LAYOUT	GPMC_NAND_ECC_LP_x16_LAYOUT
+#define GPMC_CONF1_VAL		GPMC_CONF1_VALx16
+#define GPMC_NAND_DEV_WIDTH	16
+#endif
+
+#ifdef CONFIG_MACH_OMAP_GPMC_GENERICNAND_SP_X8
+#define GPMC_NAND_ECC_LAYOUT	GPMC_NAND_ECC_SP_x8_LAYOUT
+#define GPMC_CONF1_VAL		GPMC_CONF1_VALx8
+#define GPMC_NAND_DEV_WIDTH	8
+#endif
+
+#ifdef CONFIG_MACH_OMAP_GPMC_GENERICNAND_SP_X16
+#define GPMC_NAND_ECC_LAYOUT	GPMC_NAND_ECC_SP_x16_LAYOUT
+#define GPMC_CONF1_VAL		GPMC_CONF1_VALx16
+#define GPMC_NAND_DEV_WIDTH	16
+#endif
+
+#ifdef CONFIG_NAND_OMAP_GPMC_HWECC
+/**
+ * The following is the organization of ECC as expected by BootROM.
+ * Based on the type of device, this can vary. select the config accordingly
+ */
+static struct nand_ecclayout boot_rom_ecc = GPMC_NAND_ECC_LAYOUT;
+#endif
+
+/** GPMC timing for our nand device */
+static struct gpmc_config nand_cfg = {
+	.cfg = {
+		GPMC_CONF1_VAL,	/*CONF1 */
+		0x00141400,	/*CONF2 */
+		0x00141400,	/*CONF3 */
+		0x0F010F01,	/*CONF4 */
+		0x010C1414,	/*CONF5 */
+#ifdef CONFIG_ARCH_OMAP3
+		/* Additional bits in OMAP3 */
+		0x1F040000 |
+#endif
+		0x00000A80,	/*CONF6 */
+		},
+
+	/* Nand: dont care about base address */
+	.base = 0x28000000,
+	/* GPMC address map as small as possible */
+	.size = GPMC_SIZE_16M,
+};
+
+/** NAND platform specific settings settings */
+static struct gpmc_nand_platform_data nand_plat = {
+	.cs = CONFIG_MACH_OMAP_CS,
+	.device_width = GPMC_NAND_DEV_WIDTH,
+	.max_timeout = MSECOND,
+	.wait_mon_pin = 0,
+#ifdef CONFIG_NAND_OMAP_GPMC_HWECC
+	.plat_options = NAND_HWECC_ENABLE,
+	.oob = &boot_rom_ecc,
+#else
+	.plat_options = NAND_HWECC_DISABLE,
+#endif
+	.priv = (void *)&nand_cfg,
+};
+
+/** NAND device definition */
+static struct device_d gpmc_generic_nand_nand_device = {
+	.name = "gpmc_nand",
+	.map_base = OMAP_GPMC_BASE,
+	.size = 1024 * 4,	/* GPMC size */
+	.platform_data = (void *)&nand_plat,
+};
+
+/**
+ * @brief gpmc_generic_nand_devices_init - init generic nand device
+ *
+ * @return success/fail based on device funtion
+ */
+static int gpmc_generic_nand_devices_init(void)
+{
+	/* Configure GPMC CS before register */
+	gpmc_cs_config(nand_plat.cs, &nand_cfg);
+	return register_device(&gpmc_generic_nand_nand_device);
+}
+
+device_initcall(gpmc_generic_nand_devices_init);
+
+#endif				/* CONFIG_MACH_OMAP_GPMC_GENERICNAND */
+
+/* All specific optimized nand configurations for GPMC NAND comes here */
+
Index: barebox-2010.05.0/board/phyCARD-L/pca102.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/pca102.c	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,406 @@
+/**
+ * @file
+ * @brief Board Initialization routines for OMAP3EVM.
+ *
+ * FileName: board/omap/board-omap3evm.c
+ *
+ * This board is based on OMAP3530.
+ * More on OMAP3530 (including documentation can be found here):
+ * http://focus.ti.com/docs/prod/folders/print/omap3530.html
+ *
+ * This file provides initialization in two stages:
+ * @li Boot time initialization - just get SDRAM working.
+ * This is run from SRAM - so no case constructs and global vars can be used.
+ * @li Run time initialization - this is for the rest of the initializations
+ * such as flash, uart etc.
+ *
+ * Boot time initialization includes:
+ * @li SDRAM initialization.
+ * @li Pin Muxing relevant for the EVM.
+ *
+ * Run time initialization includes
+ * @li serial @ref serial_ns16550.c driver device definition
+ *
+ * Originally from board/omap/board-beagle.c
+ */
+
+/*
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ * Sanjeev Premi <premi@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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 <console.h>
+#include <init.h>
+#include <driver.h>
+#include <asm/io.h>
+#include <ns16550.h>
+#include <asm/armlinux.h>
+#include <asm/mach-types.h>
+#include <mach/silicon.h>
+#include <mach/sdrc.h>
+#include <mach/sys_info.h>
+#include <mach/syslib.h>
+#include <mach/control.h>
+#include <mach/omap3-mux.h>
+#include <mach/gpmc.h>
+#include <partition.h>
+#include <nand.h>
+
+#include "board.h"
+
+#define SMC911X_BASE 0x2c000000
+/*
+ * Boot-time initialization(s)
+ */
+
+/**
+ * @brief Initialize the SDRC module
+ *
+ * @return void
+ */
+static void sdrc_init(void)
+{
+	/* SDRAM software reset */
+	/* No idle ack and RESET enable */
+	writel(0x1A, SDRC_REG(SYSCONFIG));
+	sdelay(100);
+	/* No idle ack and RESET disable */
+	writel(0x18, SDRC_REG(SYSCONFIG));
+
+	/* SDRC Sharing register */
+	/* 32-bit SDRAM on data lane [31:0] - CS0 */
+	/* pin tri-stated = 1 */
+	writel(0x00000100, SDRC_REG(SHARING));
+
+	/* ----- SDRC Registers Configuration --------- */
+	/* SDRC_MCFG0 register */
+	writel(0x02584099, SDRC_REG(MCFG_0));
+
+	/* SDRC_RFR_CTRL0 register */
+	writel(0x54601, SDRC_REG(RFR_CTRL_0));
+
+	/* SDRC_ACTIM_CTRLA0 register */
+	writel(0xA29DB4C6, SDRC_REG(ACTIM_CTRLA_0));
+
+	/* SDRC_ACTIM_CTRLB0 register */
+	writel(0x12214, SDRC_REG(ACTIM_CTRLB_0));
+
+	/* Disble Power Down of CKE due to 1 CKE on combo part */
+	writel(0x00000081, SDRC_REG(POWER));
+
+	/* SDRC_MANUAL command register */
+	/* NOP command */
+	writel(0x00000000, SDRC_REG(MANUAL_0));
+	/* Precharge command */
+	writel(0x00000001, SDRC_REG(MANUAL_0));
+	/* Auto-refresh command */
+	writel(0x00000002, SDRC_REG(MANUAL_0));
+	/* Auto-refresh command */
+	writel(0x00000002, SDRC_REG(MANUAL_0));
+
+	/* SDRC MR0 register Burst length=4 */
+	writel(0x00000032, SDRC_REG(MR_0));
+
+	/* SDRC DLLA control register */
+	writel(0x0000000A, SDRC_REG(DLLA_CTRL));
+
+	return;
+}
+
+/**
+ * @brief Do the necessary pin muxing required for OMAP3EVM. Some pins in OMAP3
+ * do not have alternate modes. We don't program these pins.
+ *
+ * See @ref MUX_VAL for description of the muxing mode.
+ *
+ * @return void
+ */
+static void mux_config(void)
+{
+	/*
+	 * SDRC
+	 * - SDRC_D0-SDRC_D31: Default MUX mode is mode0.
+	 */
+
+	/*
+	 * GPMC
+	 * - GPMC_D0-GPMC_D7: Default MUX mode is mode0.
+	 * - GPMC_NADV_ALE: Default MUX mode is mode0.
+	 * - GPMC_NOE: Default MUX mode is mode0.
+	 * - GPMC_NWE: Default MUX mode is mode0.
+	 * - GPMC_WAIT0: Default MUX mode is mode0.
+	 */
+	MUX_VAL(CP(GPMC_A1),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A2),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A3),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A4),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A5),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A6),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A7),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A8),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A9),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_A10),		(IDIS | PTD | DIS | M0));
+
+	MUX_VAL(CP(GPMC_D8),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_D9),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_D10),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_D11),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_D12),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_D13),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_D14),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_D15),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTD | DIS | M0));
+
+	MUX_VAL(CP(GPMC_NBE0_CLE),	(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NBE1),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NWP),		(IEN  | PTD | DIS | M0));
+
+	MUX_VAL(CP(GPMC_WAIT1),		(IEN  | PTU | EN  | M0));
+
+	/*
+	 * Serial Interface
+	 */
+#if defined(CONFIG_OMAP3_PCA102_UART1)
+	MUX_VAL(CP(UART1_TX),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(UART1_RTS),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(UART1_CTS),		(IEN  | PTU | DIS | M0));
+	MUX_VAL(CP(UART1_RX),		(IEN  | PTD | DIS | M0));
+#elif defined(CONFIG_OMAP3_PCA102_UART3)
+	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTD | EN  | M0));
+	MUX_VAL(CP(UART3_RTS_SD),	(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0));
+#endif
+	/*GPMC*/
+        MUX_VAL(CP(GPMC_A1),            (IDIS | PTU | EN  | M0));
+        MUX_VAL(CP(GPMC_A2),            (IDIS | PTU | EN  | M0));
+        MUX_VAL(CP(GPMC_A3),            (IDIS | PTU | EN  | M0));
+        MUX_VAL(CP(GPMC_A4),            (IDIS | PTU | EN  | M0));
+        MUX_VAL(CP(GPMC_A5),            (IDIS | PTU | EN  | M0)); /*GPMC_A5*/
+        MUX_VAL(CP(GPMC_A6),            (IDIS | PTU | EN  | M0)); /*GPMC_A6*/
+        MUX_VAL(CP(GPMC_A7),            (IDIS | PTU | EN  | M0)); /*GPMC_A7*/
+        MUX_VAL(CP(GPMC_A8),            (IDIS | PTU | EN  | M0)); /*GPMC_A8*/
+        MUX_VAL(CP(GPMC_A9),            (IDIS | PTU | EN  | M0)); /*GPMC_A9*/
+        MUX_VAL(CP(GPMC_A10),           (IDIS | PTU | EN  | M0)); /*GPMC_A10*/
+        MUX_VAL(CP(GPMC_D0),            (IEN  | PTU | EN  | M0)); /*GPMC_D0*/
+        MUX_VAL(CP(GPMC_D1),            (IEN  | PTU | EN  | M0)); /*GPMC_D1*/
+        MUX_VAL(CP(GPMC_D2),            (IEN  | PTU | EN  | M0)); /*GPMC_D2*/
+        MUX_VAL(CP(GPMC_D3),            (IEN  | PTU | EN  | M0)); /*GPMC_D3*/
+        MUX_VAL(CP(GPMC_D4),            (IEN  | PTU | EN  | M0)); /*GPMC_D4*/
+        MUX_VAL(CP(GPMC_D5),            (IEN  | PTU | EN  | M0)); /*GPMC_D5*/
+        MUX_VAL(CP(GPMC_D6),            (IEN  | PTU | EN  | M0)); /*GPMC_D6*/
+        MUX_VAL(CP(GPMC_D7),            (IEN  | PTU | EN  | M0)); /*GPMC_D7*/
+        MUX_VAL(CP(GPMC_D8),            (IEN  | PTU | EN  | M0)); /*GPMC_D8*/
+        MUX_VAL(CP(GPMC_D9),            (IEN  | PTU | EN  | M0)); /*GPMC_D9*/
+        MUX_VAL(CP(GPMC_D10),           (IEN  | PTU | EN  | M0)); /*GPMC_D10*/
+        MUX_VAL(CP(GPMC_D11),           (IEN  | PTU | EN  | M0)); /*GPMC_D11*/
+        MUX_VAL(CP(GPMC_D12),           (IEN  | PTU | EN  | M0)); /*GPMC_D12*/
+        MUX_VAL(CP(GPMC_D13),           (IEN  | PTU | EN  | M0)); /*GPMC_D13*/
+        MUX_VAL(CP(GPMC_D14),           (IEN  | PTU | EN  | M0)); /*GPMC_D14*/
+        MUX_VAL(CP(GPMC_D15),           (IEN  | PTU | EN  | M0)); /*GPMC_D15*/
+        MUX_VAL(CP(GPMC_NCS0),          (IDIS | PTU | EN  | M0)); /*GPMC_nCS0*/
+        MUX_VAL(CP(GPMC_NCS1),          (IDIS | PTU | EN  | M0)); /*GPMC_nCS1*/
+        MUX_VAL(CP(GPMC_NCS2),          (IDIS | PTU | EN  | M0)); /*GPMC_nCS2*/
+        MUX_VAL(CP(GPMC_NCS3),          (IEN  | PTU | EN  | M4)); /*GPIO_54*/
+        MUX_VAL(CP(GPMC_NCS4),          (IDIS | PTU | EN  | M0)); /*GPMC_nCS4*/
+        MUX_VAL(CP(GPMC_NCS5),          (IDIS | PTU | EN  | M0)); /*GPMC_nCS5*/
+        MUX_VAL(CP(GPMC_NCS6),          (IDIS | PTD | EN  | M4)); /*ETH_FIFO_SEL*/
+        MUX_VAL(CP(GPMC_NCS7),          (IEN  | PTU | EN  | M0)); /*GPMC_nCS7*/
+        MUX_VAL(CP(GPMC_NBE1),          (IEN  | PTD | DIS | M0)); /*GPMC_nCS3*/
+        MUX_VAL(CP(GPMC_CLK),           (IDIS | PTU | EN  | M0)); /*GPMC_CLK*/
+        MUX_VAL(CP(GPMC_NADV_ALE),      (IDIS | PTD | DIS | M0)); /*GPMC_nADV_ALE*/
+        MUX_VAL(CP(GPMC_NOE),           (IDIS | PTD | DIS | M0)); /*GPMC_nOE*/
+        MUX_VAL(CP(GPMC_NWE),           (IDIS | PTD | DIS | M0)); /*GPMC_nWE*/
+        MUX_VAL(CP(GPMC_NBE0_CLE),      (IDIS | PTD | DIS | M0)); /*GPMC_nBE0_CLE*/
+        MUX_VAL(CP(GPMC_NWP),           (IEN  | PTD | DIS | M0)); /*GPMC_nWP*/
+        MUX_VAL(CP(GPMC_WAIT0),         (IEN  | PTU | EN  | M0)); /*GPMC_WAIT0*/
+        MUX_VAL(CP(GPMC_WAIT1),         (IEN  | PTU | EN  | M0)); /*GPMC_WAIT1*/
+        MUX_VAL(CP(GPMC_WAIT2),         (IEN  | PTU | EN  | M4)); /*GPIO_64*/
+        MUX_VAL(CP(GPMC_WAIT3),         (IEN  | PTU | EN  | M0)); /*GPMC_nCS3*/
+}
+
+/**
+ * @brief The basic entry point for board initialization.
+ *
+ * This is called as part of machine init (after arch init).
+ * This is again called with stack in SRAM, so not too many
+ * constructs possible here.
+ *
+ * @return void
+ */
+void board_init(void)
+{
+	int in_sdram = running_in_sdram();
+
+	mux_config();
+	/* Dont reconfigure SDRAM while running in SDRAM! */
+	if (!in_sdram)
+		sdrc_init();
+}
+
+/*
+ * Run-time initialization(s)
+ */
+
+#ifdef CONFIG_DRIVER_SERIAL_NS16550
+
+static struct NS16550_plat serial_plat = {
+	.clock		= 48000000,      /* 48MHz (APLL96/2) */
+	.f_caps		= CONSOLE_STDIN | CONSOLE_STDOUT | CONSOLE_STDERR,
+	.reg_read	= omap_uart_read,
+	.reg_write	= omap_uart_write,
+};
+
+static struct device_d omap3_pca102_serial_device = {
+	.name		= "serial_ns16550",
+#if defined(CONFIG_OMAP3_PCA102_UART1)
+	.map_base	= OMAP_UART1_BASE,
+#elif defined(CONFIG_OMAP3_PCA102_UART3)
+	.map_base	= OMAP_UART3_BASE,
+#endif
+	.size		= 1024,
+	.platform_data	= (void *)&serial_plat,
+};
+
+/**
+ * @brief Initialize the serial port to be used as console.
+ *
+ * @return result of device registration
+ */
+static int omap3_pca102_init_console(void)
+{
+	return register_device(&omap3_pca102_serial_device);
+}
+console_initcall(omap3_pca102_init_console);
+#endif /* CONFIG_DRIVER_SERIAL_NS16550 */
+
+/*
+ * SMSC 9221 network controller
+ * connected to CS line 5 and interrupt line
+ * GPIO177, data width is 16 bit
+ */
+static struct device_d network_dev = {
+        .name     = "smc911x",
+        .map_base = SMC911X_BASE,
+        .size     = GPMC_SIZE_16M,      /* area size */
+};
+
+static struct memory_platform_data sram_pdata0 = {
+	.name	= "ram0",
+	.flags	= DEVFS_RDWR,
+};
+
+static struct memory_platform_data sram_pdata1 = {
+	.name	= "ram1",
+	.flags	= DEVFS_RDWR,
+};
+
+static struct device_d sdram_dev0 = {
+	.name		= "mem",
+	.map_base	= 0x80000000,
+	.size		= 128 * 1024 * 1024,
+	.platform_data	= &sram_pdata0,
+};
+
+static struct device_d sdram_dev1 = {
+	.name		= "mem",
+	.map_base	= 0x88000000,
+	.size		= 128 * 1024 * 1024,
+	.platform_data	= &sram_pdata1,
+};
+
+/** GPMC timing for our SMSC9221 device */
+static struct gpmc_config smsc_cfg = {
+        .cfg = {
+                0x00001000, 	/*CONF1 */
+                0x001e1e01,     /*CONF2 */
+                0x00080300,     /*CONF3 */
+                0x1c091c09,     /*CONF4 */
+                0x04181f1f,     /*CONF5 */
+                0x00000fcf,     /*CONF6 */
+                },
+        .base = SMC911X_BASE,
+        /* GPMC address map as small as possible */
+        .size = GPMC_SIZE_16M,
+};
+
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *            Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+        gpmc_cs_config(5, &smsc_cfg);
+
+#if 0
+	/* Make GPIO 57 as output pin and set it to low FIFO_SEL=0 */
+        if (!omap_request_gpio(57)) {
+                omap_set_gpio_direction(57, 0);
+                omap_set_gpio_dataout(57, 0);
+        }
+#endif
+}
+
+static int omap3_pca102_init_devices(void)
+{
+	int ret;
+	struct device_d *nand;
+
+#ifdef CONFIG_GPMC
+	/*
+	 * WP is made high and WAIT1 active Low
+	 */
+	gpmc_generic_init(0x10);
+#endif
+
+	register_device(&sdram_dev0);
+	register_device(&sdram_dev1);
+	setup_net_chip();
+	register_device(&network_dev);
+
+        armlinux_add_dram(&sdram_dev0);
+        armlinux_add_dram(&sdram_dev1);
+        armlinux_set_bootparams((void *)0x80000100);
+        armlinux_set_architecture(MACH_TYPE_PCA102);
+
+	return 0;
+}
+device_initcall(omap3_pca102_init_devices);
+
+static int omap3_pca102_late_init(void)
+{
+	struct device_d *nand;
+
+ 	nand = get_device_by_name("nand0");
+
+        devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "x-loader");
+        dev_add_bb_dev("self_raw", "x_loader0");
+
+        devfs_add_partition("nand0", 0x80000, 0x1e0000, PARTITION_FIXED, "self_raw");
+        dev_add_bb_dev("self_raw", "self0");
+
+        devfs_add_partition("nand0", 0x260000, 0x20000, PARTITION_FIXED, "env_raw");
+        dev_add_bb_dev("env_raw", "env0");
+
+	return 0;
+}
+late_initcall(omap3_pca102_late_init);
+
+
Index: barebox-2010.05.0/board/phyCARD-L/pca102.dox
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/pca102.dox	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,7 @@
+/** @page PCA-102 Phytec's phyCARD-L (OMAP35xx)
+
+This CPU card is based on a Texas Instruments OMAP35xx CPU. The card is shipped with:
+
+- 256MiB DDR-RAM / 256MiB NAND Flash Memory
+
+*/
Index: barebox-2010.05.0/board/phyCARD-L/platform.S
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/platform.S	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,65 @@
+/**
+ * @file
+ * @brief Wrapper to call board level initialization routine
+ *
+ * FileName: board/phyCARD-L/platform.S
+ *
+ * board_init_lowlevel is defined here. This calls board_init which
+ * is linked to the binary - the board_init only has a SRAM stack.
+ * so it needs to be careful about the usage of global variables
+ * and the likes. Enabled only if CONFIG_MACH_DO_LOWLEVEL_INIT is
+ * defined
+ */
+/*
+ * (C) Copyright 2006-2008
+ * Texas Instruments, <www.ti.com>
+ * Nishanth Menon <x0nishan@ti.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 <config.h>
+#include <mach/silicon.h>
+
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
+/**
+ * @fn void board_init_lowlevel(void)
+ *
+ * @brief This provides a assembly wrapper setting up SRAM before calling
+ * board_init
+ *
+ * @return void
+ */
+.globl board_init_lowlevel
+board_init_lowlevel:
+	/* Setup a temporary stack so that we can call C functions
+	 * Yes. this might have been already done by arch code.
+	 * No harm in being a bit redundant to avoid future complications
+	 */
+	ldr	sp,	SRAM_STACK
+        str     ip,	[sp]    /* stash old link register */
+        str     lr,	[sp]    /* stash current link register */
+	mov	ip,	lr	/* save link reg across call */
+	/* Do the pin muxes, sdram init etc..board-xxx.c */
+	bl	board_init
+        ldr     lr,	[sp]    /* restore current link register */
+        ldr     ip,	[sp]    /* restore save ip */
+	/* back to arch calling code */
+	mov	pc,	lr
+SRAM_STACK:
+	.word	OMAP_SRAM_STACK
+
+#endif /* CONFIG_MACH_DO_LOWLEVEL_INIT */
Index: barebox-2010.05.0/arch/arm/configs/pca102_defconfig
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/arch/arm/configs/pca102_defconfig	2010-05-28 12:15:10.558902193 +0200
@@ -0,0 +1,216 @@
+#
+# Automatically generated make config: don't edit
+# barebox version: 2009.12.0-pre
+# Fri Dec 18 16:39:27 2009
+#
+# CONFIG_BOARD_LINKER_SCRIPT is not set
+CONFIG_GENERIC_LINKER_SCRIPT=y
+CONFIG_ARM=y
+
+#
+# System Type
+#
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_AT91RM9200 is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NETX is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_S3C24xx is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+
+#
+# processor features
+#
+CONFIG_BOARDINFO="Texas Instrument's OMAP3EVM"
+
+#
+# OMAP Features
+#
+CONFIG_ARCH_OMAP3=y
+CONFIG_OMAP_CONFIG_STACKSIZE=0x00008000
+CONFIG_OMAP_MALLOC_LEN=0x00008000
+CONFIG_OMAP_CLOCK_ALL=y
+CONFIG_OMAP_CLOCK_SOURCE_S32K=y
+CONFIG_OMAP3_CLOCK_CONFIG=y
+# CONFIG_OMAP3_COPY_CLOCK_SRAM is not set
+CONFIG_GPMC=y
+
+#
+# OMAP Platform Features
+#
+# CONFIG_MACH_OMAP343xSDP is not set
+# CONFIG_MACH_BEAGLE is not set
+CONFIG_MACH_OMAP3EVM=y
+CONFIG_OMAP3EVM_UART1=y
+# CONFIG_OMAP3EVM_UART3 is not set
+CONFIG_HAS_OMAP_NAND=y
+# CONFIG_MACH_OMAP_GPMC_NAND is not set
+CONFIG_AEABI=y
+
+#
+# Arm specific settings
+#
+CONFIG_CMD_ARM_CPUINFO=y
+# CONFIG_CMDLINE_TAG is not set
+# CONFIG_SETUP_MEMORY_TAGS is not set
+# CONFIG_INITRD_TAG is not set
+# CONFIG_CPU_V7_DCACHE_SKIP is not set
+# CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS is not set
+CONFIG_HAS_KALLSYMS=y
+CONFIG_HAS_MODULES=y
+# CONFIG_CMD_MEMORY is not set
+
+#
+# General Settings
+#
+CONFIG_LOCALVERSION_AUTO=y
+
+#
+# memory layout
+#
+CONFIG_HAVE_CONFIGURABLE_TEXT_BASE=y
+CONFIG_TEXT_BASE=0x40200000
+CONFIG_HAVE_CONFIGURABLE_MEMORY_LAYOUT=y
+# CONFIG_MEMORY_LAYOUT_DEFAULT is not set
+CONFIG_MEMORY_LAYOUT_FIXED=y
+CONFIG_STACK_BASE=0x87BF7F10
+CONFIG_STACK_SIZE=0x8000
+CONFIG_MALLOC_BASE=0x87BFFF10
+CONFIG_MALLOC_SIZE=0x400000
+# CONFIG_BROKEN is not set
+# CONFIG_EXPERIMENTAL is not set
+CONFIG_MACH_HAS_LOWLEVEL_INIT=y
+CONFIG_MACH_DO_LOWLEVEL_INIT=y
+CONFIG_ARCH_HAS_LOWLEVEL_INIT=y
+CONFIG_PROMPT="OMAP3_EVM> "
+CONFIG_BAUDRATE=115200
+CONFIG_SIMPLE_READLINE=y
+CONFIG_LONGHELP=y
+CONFIG_CBSIZE=1024
+CONFIG_MAXARGS=16
+# CONFIG_SHELL_HUSH is not set
+CONFIG_SHELL_SIMPLE=y
+# CONFIG_CMDLINE_EDITING is not set
+# CONFIG_ERRNO_MESSAGES is not set
+# CONFIG_TIMESTAMP is not set
+CONFIG_CONSOLE_FULL=y
+CONFIG_CONSOLE_ACTIVATE_FIRST=y
+# CONFIG_OF_FLAT_TREE is not set
+# CONFIG_PARTITION is not set
+# CONFIG_DEFAULT_ENVIRONMENT is not set
+
+#
+# Debugging
+#
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_ENABLE_FLASH_NOISE is not set
+# CONFIG_ENABLE_PARTITION_NOISE is not set
+# CONFIG_ENABLE_DEVICE_NOISE is not set
+
+#
+# Commands
+#
+
+#
+# scripting
+#
+# CONFIG_CMD_EDIT is not set
+# CONFIG_CMD_EXEC is not set
+# CONFIG_CMD_SLEEP is not set
+# CONFIG_CMD_SAVEENV is not set
+# CONFIG_CMD_LOADENV is not set
+# CONFIG_CMD_EXPORT is not set
+# CONFIG_CMD_PRINTENV is not set
+# CONFIG_CMD_READLINE is not set
+CONFIG_CMD_TRUE=y
+CONFIG_CMD_FALSE=y
+
+#
+# file commands
+#
+CONFIG_CMD_LS=y
+# CONFIG_CMD_RM is not set
+# CONFIG_CMD_CAT is not set
+# CONFIG_CMD_MKDIR is not set
+# CONFIG_CMD_RMDIR is not set
+# CONFIG_CMD_CP is not set
+CONFIG_CMD_PWD=y
+CONFIG_CMD_CD=y
+# CONFIG_CMD_MOUNT is not set
+# CONFIG_CMD_UMOUNT is not set
+
+#
+# console
+#
+CONFIG_CMD_CLEAR=y
+CONFIG_CMD_ECHO=y
+
+#
+# memory
+#
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_MEMINFO=y
+# CONFIG_CMD_CRC is not set
+# CONFIG_CMD_MTEST is not set
+
+#
+# flash
+#
+# CONFIG_CMD_FLASH is not set
+
+#
+# booting
+#
+# CONFIG_CMD_BOOTM is not set
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_BOOTU=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_GO=y
+# CONFIG_CMD_TIMEOUT is not set
+# CONFIG_CMD_PARTITION is not set
+CONFIG_CMD_VERSION=y
+CONFIG_CMD_HELP=y
+CONFIG_CMD_DEVINFO=y
+# CONFIG_NET is not set
+
+#
+# Drivers
+#
+
+#
+# serial drivers
+#
+# CONFIG_DRIVER_SERIAL_ARM_DCC is not set
+CONFIG_DRIVER_SERIAL_NS16550=y
+CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
+
+#
+# SPI drivers
+#
+# CONFIG_SPI is not set
+# CONFIG_I2C is not set
+
+#
+# flash drivers
+#
+# CONFIG_DRIVER_CFI is not set
+CONFIG_DRIVER_CFI_OLD=y
+# CONFIG_NAND is not set
+# CONFIG_USB is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_VIDEO is not set
+
+#
+# Filesystem support
+#
+# CONFIG_FS_CRAMFS is not set
+CONFIG_FS_RAMFS=y
+CONFIG_FS_DEVFS=y
+CONFIG_CRC16=y
+# CONFIG_GENERIC_FIND_NEXT_BIT is not set
Index: barebox-2010.05.0/arch/arm/mach-omap/Kconfig
===================================================================
--- barebox-2010.05.0.orig/arch/arm/mach-omap/Kconfig	2010-05-03 14:32:02.000000000 +0200
+++ barebox-2010.05.0/arch/arm/mach-omap/Kconfig	2010-05-28 12:15:10.558902193 +0200
@@ -98,5 +98,4 @@
 
 # Get the board specific configurations
 source board/omap/Kconfig
-
 endmenu
Index: barebox-2010.05.0/board/omap/Kconfig
===================================================================
--- barebox-2010.05.0.orig/board/omap/Kconfig	2010-05-03 14:32:02.000000000 +0200
+++ barebox-2010.05.0/board/omap/Kconfig	2010-05-28 12:15:10.558902193 +0200
@@ -31,7 +31,7 @@
 	default "Texas Instrument's SDP343x" if MACH_OMAP343xSDP
 	default "Texas Instrument's Beagle" if MACH_BEAGLE
 	default "Texas Instrument's OMAP3EVM" if MACH_OMAP3EVM
-
+	default "Phytec Messtechnik GmbH phyCARD-L PCA-102" if MACH_PCA102
 choice
 	prompt "Select OMAP platform"
 
@@ -59,6 +59,14 @@
 	  help
 	  Say Y here if you are using OMAP3EVM
 
+config MACH_PCA102
+	bool "Phytec Messtechnik GmbH phyCARD-L PCA-102"
+	select MACH_HAS_LOWLEVEL_INIT
+	select OMAP_CLOCK_ALL
+	select HAS_OMAP_NAND
+	  help
+	  Say Y here if you are using a phyCARD-L PCA-102
+
 endchoice
 
 if MACH_OMAP3EVM
@@ -79,6 +87,25 @@
 	endchoice
 endif
 
+if MACH_PCA102
+	choice
+	prompt "Select UART"
+
+	config OMAP3_PCA102_UART1
+		bool "Use UART1"
+		depends on MACH_PCA102
+		help
+		  Say Y here if you would like to use UART1 as console.
+
+	config OMAP3_PCA102_UART3
+		bool "Use UART3"
+		depends on MACH_PCA102
+		help
+		  Say Y here if you would like to use UART3 as console.
+	endchoice
+endif
+
+
 config MACH_OMAP_ADVANCED_MUX
 	bool "Enable advanced pin muxing"
 	depends on MACH_OMAP343xSDP
Index: barebox-2010.05.0/board/phyCARD-L/env/bin/_update
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/env/bin/_update	2010-05-26 10:03:41.000000000 +0200
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+if [ $# = 1 ]; then
+	image=$1
+fi
+
+if [ -z "$part" -o -z "$image" ]; then
+	echo "define \$part and \$image"
+	exit 1
+fi
+
+if [ \! -e "$part" ]; then
+	echo "Partition $part does not exist"
+	exit 1
+fi
+
+if [ x$ip = xdhcp ]; then
+	dhcp
+fi
+
+ping $eth0.serverip
+if [ $? -ne 0 ] ; then
+	echo "Server did not reply! Update aborted."
+	exit 1
+fi
+
+unprotect $part
+
+echo
+echo "erasing partition $part"
+echo
+erase $part
+
+echo
+echo "flashing $image to $part"
+echo
+tftp $image $part
+
+protect $part
Index: barebox-2010.05.0/board/phyCARD-L/env/bin/boot
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/env/bin/boot	2010-05-27 21:44:29.000000000 +0200
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. /env/config
+
+if [ x$1 = xnand ]; then
+	rootfs_loc=nand
+	kernel_loc=nand
+fi
+
+if [ x$1 = xnet ]; then
+	rootfs_loc=net
+	kernel_loc=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$rootfs_loc = xnand ]; then
+	bootargs="$bootargs root=$rootpart_nand rootfstype=jffs2"
+else
+	bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
+fi
+
+bootargs="$bootargs mtdparts=\"omap2-nand:$nand_parts\""
+
+if [ $kernel_loc = net ]; then
+	if [ x$ip = xdhcp ]; then
+		dhcp
+	fi
+	tftp $kernel uImage || exit 1
+	bootm uImage
+else
+	bootm /dev/nand0.kernel.bb
+fi
+
Index: barebox-2010.05.0/board/phyCARD-L/env/bin/hush_hack
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/env/bin/hush_hack	2010-05-26 10:03:41.000000000 +0200
@@ -0,0 +1 @@
+nand -a /dev/nand0.*
Index: barebox-2010.05.0/board/phyCARD-L/env/bin/init
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/env/bin/init	2010-05-27 21:45:30.000000000 +0200
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+PATH=/env/bin
+export PATH
+
+. /env/config
+if [ -e /dev/nand0 ]; then
+	addpart /dev/nand0 $nand_parts
+
+	# Uh, oh, hush first expands wildcards and then starts executing
+	# commands. What a bug!
+	source /env/bin/hush_hack
+fi
+
+if [ -z $eth0.ethaddr ]; then
+	while [ -z $eth0.ethaddr ]; do
+		readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
+	done
+	echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
+fi
+
+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 update_rootfs [<imagename>] to update rootfs into flash"
+	echo
+	exit
+fi
+
+boot
Index: barebox-2010.05.0/board/phyCARD-L/env/bin/update_kernel
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/env/bin/update_kernel	2010-05-27 21:47:07.000000000 +0200
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+image=$kernel
+
+part=/dev/nand0.kernel.bb
+
+. /env/bin/_update $1
Index: barebox-2010.05.0/board/phyCARD-L/env/config
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ barebox-2010.05.0/board/phyCARD-L/env/config	2010-06-10 09:37:25.995990249 +0200
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# use 'dhcp' to do dhcp in uboot and in kernel
+#ip=dhcp
+
+# or set your networking parameters here
+eth0.ipaddr=192.168.3.11
+eth0.netmask=255.255.255.0
+eth0.gateway=192.168.3.10
+eth0.serverip=192.168.3.10
+
+# can be either 'net' or 'nand''
+kernel_loc=nand
+rootfs_loc=nand
+
+kernel=uImage-pca102
+rootfs=root-pca102.jffs2
+
+autoboot_timeout=3
+
+nfsroot=/nfs/root
+bootargs="console=ttyS0,115200"
+
+# uncomment the following to use the GPIO expander on your
+# camera (needed with mapperboards < 1285.2)
+# bootargs="$bootargs use_camera_gpio=1"
+
+# comment out the following to use a black/white mode
+# mt9v022 camera
+# bootargs="$bootargs mt9v022.sensor_type=color"
+
+nand_parts="512k(x-loader)ro,1920k(barebox),128k(bareboxenv),4M(kernel),-(root)"
+rootpart_nand="/dev/mtdblock4"
Index: barebox-2010.05.0/arch/arm/Makefile
===================================================================
--- barebox-2010.05.0.orig/arch/arm/Makefile	2010-05-03 14:32:02.000000000 +0200
+++ barebox-2010.05.0/arch/arm/Makefile	2010-05-28 12:15:10.558902193 +0200
@@ -70,6 +70,7 @@
 board-$(CONFIG_MACH_NXDB500)			:= netx
 board-$(CONFIG_ARCH_OMAP)			:= omap
 board-$(CONFIG_MACH_PCA100)			:= phycard-i.MX27
+board-$(CONFIG_MACH_PCA102)			:= phyCARD-L
 board-$(CONFIG_MACH_PCM037)			:= pcm037
 board-$(CONFIG_MACH_PCM038)			:= pcm038
 board-$(CONFIG_MACH_PCM043)			:= pcm043
Index: barebox-2010.05.0/arch/arm/include/asm/common.h
===================================================================
--- barebox-2010.05.0.orig/arch/arm/include/asm/common.h	2010-05-03 14:32:02.000000000 +0200
+++ barebox-2010.05.0/arch/arm/include/asm/common.h	2010-05-28 12:15:10.558902193 +0200
@@ -1 +1 @@
-#define ARCH_SHUTDOWN
+#undef ARCH_SHUTDOWN
