diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-04-07 12:18:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-04-07 12:18:05 +0200 |
commit | 9c7d282579f47521adb9381fbfa1b41196a6d9af (patch) | |
tree | cd916b5b99419e388a32ea2262dcec489d0837da /board | |
parent | 31b5112b7368b881f7fc958110140614a2edd2f8 (diff) | |
download | barebox-9c7d282579f47521adb9381fbfa1b41196a6d9af.tar.gz barebox-9c7d282579f47521adb9381fbfa1b41196a6d9af.tar.xz |
[general] Move include/configs/* to board/*/config.h
Diffstat (limited to 'board')
-rw-r--r-- | board/eco920/config.h | 142 | ||||
-rw-r--r-- | board/imx27ads/config.h | 31 | ||||
-rw-r--r-- | board/ipe337/config.h | 53 | ||||
-rw-r--r-- | board/netx/config.h | 2 | ||||
-rw-r--r-- | board/pcm030/config.h | 111 | ||||
-rw-r--r-- | board/pcm037/config.h | 39 | ||||
-rw-r--r-- | board/pcm038/config.h | 29 | ||||
-rw-r--r-- | board/sandbox/Makefile | 5 | ||||
-rw-r--r-- | board/sandbox/board.c | 45 | ||||
-rw-r--r-- | board/sandbox/clock.c | 48 | ||||
-rw-r--r-- | board/sandbox/config.h | 6 | ||||
-rw-r--r-- | board/sandbox/console.c | 55 | ||||
-rw-r--r-- | board/sandbox/hostfile.c | 95 | ||||
-rw-r--r-- | board/scb9328/config.h | 34 |
14 files changed, 695 insertions, 0 deletions
diff --git a/board/eco920/config.h b/board/eco920/config.h new file mode 100644 index 0000000000..c023517719 --- /dev/null +++ b/board/eco920/config.h @@ -0,0 +1,142 @@ +/* + * (C) Copyright 2007 Pengutronix + * Sascha Hauer, <s.hauer@pengutronix.de> + * + * 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 + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* ARM asynchronous clock */ +#define AT91C_MAIN_CLOCK 179712000 /* from 18.432 MHz crystal (18432000 / 4 * 39) */ +#define AT91C_MASTER_CLOCK 59904000 /* peripheral clock (AT91C_MASTER_CLOCK / 3) */ +/* #define AT91C_MASTER_CLOCK 44928000 */ /* peripheral clock (AT91C_MASTER_CLOCK / 4) */ + +#define AT91_SLOW_CLOCK 32768 /* slow clock */ + +#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ +#define USE_920T_MMU 1 + +#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ +#define CONFIG_SETUP_MEMORY_TAGS 1 +#define CONFIG_INITRD_TAG 1 + +#define CFG_USE_MAIN_OSCILLATOR 1 +/* flash */ +#define MC_PUIA_VAL 0x00000000 +#define MC_PUP_VAL 0x00000000 +#define MC_PUER_VAL 0x00000000 +#define MC_ASR_VAL 0x00000000 +#define MC_AASR_VAL 0x00000000 +#define EBI_CFGR_VAL 0x00000000 +#define SMC2_CSR_VAL 0x00003287 + +/* clocks */ +#define PLLAR_VAL 0x2026be04 +#define PLLBR_VAL 0x10483e0e +#define MCKR_VAL 0x00000202 + +/* sdram */ +#define PIOC_ASR_VAL 0xffff0000 +#define PIOC_BSR_VAL 0x00000000 +#define PIOC_PDR_VAL 0xffff0000 +#define EBI_CSA_VAL 0x00000002 /* CS1=SDRAM */ +#define SDRC_CR_VAL 0x2188c155 /* set up the SDRAM */ +#define SDRAM 0x20000000 /* address of the SDRAM */ +#define SDRAM1 0x20000080 /* address of the SDRAM */ +#define SDRAM_VAL 0x00000000 /* value written to SDRAM */ +#define SDRC_MR_VAL 0x00000002 /* Precharge All */ +#define SDRC_MR_VAL1 0x00000004 /* refresh */ +#define SDRC_MR_VAL2 0x00000003 /* Load Mode Register */ +#define SDRC_MR_VAL3 0x00000000 /* Normal Mode */ +#define SDRC_TR_VAL 0x000002E0 /* Write refresh rate */ + +/* + * Size of malloc() pool + */ +#define CFG_MALLOC_LEN (512*1024) +#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */ + +#define CONFIG_BAUDRATE 115200 + +/* + * Hardware drivers + */ + +/* define one of CONFIG_DBGU, CONFIG_USART0 or CONFIG_USART1 to choose console */ +#define CONFIG_DBGU + +#define CONFIG_BOOTDELAY 3 + +#define CONFIG_CMDLINE_EDITING 1 + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "mtdids=nor0=physmap-flash.0\0" \ + "mtdparts=mtdparts=physmap-flash.0:128k(uboot)ro,128k(env),1536k(kernel),-(jffs2)\0" \ + "bootargs_base=setenv bootargs console=ttyAT0,115200\0" \ + "bootargs_nfs=setenv bootargs $(bootargs) root=/dev/nfs ip=dhcp nfsroot=$(serverip):$(nfsrootfs),v3,tcp\0" \ + "bootargs_mtd=setenv bootargs $(bootargs) $(mtdparts)\0" \ + "bootargs_flash=setenv bootargs $(bootargs) root=/dev/mtdblock3 rootfstype=jffs2\0" \ + "bootcmd_flash=run bootargs_base bootargs_mtd bootargs_flash; bootm 0x11040000\0" \ + "bootcmd_net=run bootargs_base bootargs_mtd bootargs_nfs; tftpboot 0x20000000 $(uimage); bootm\0" \ + "autoload=n\0" \ + "uimage=uImage-eco920\0" \ + "jffs2=root-eco920.jffs2\0" + +/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ +#include <cmd_confdefs.h> + +#define CONFIG_NR_DRAM_BANKS 1 +#define PHYS_SDRAM 0x20000000 +#define PHYS_SDRAM_SIZE 0x2000000 + +#define CFG_MEMTEST_START PHYS_SDRAM +#define CFG_MEMTEST_END CFG_MEMTEST_START + PHYS_SDRAM_SIZE - 262144 + +#define CONFIG_DRIVER_ETHER +#define CONFIG_NET_RETRY_COUNT 20 +#define CONFIG_AT91C_USE_RMII + +#define CFG_LOAD_ADDR 0x21000000 /* default load address */ + +#define CFG_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 } + +#define CFG_LONGHELP /* undef to save memory */ +#define CFG_PROMPT "uboot> " /* Monitor Command Prompt */ +#define CFG_CBSIZE 1024 /* Console I/O Buffer Size */ +#define CFG_MAXARGS 32 /* max number of command args */ +#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */ + +#define CLOCK_TICK_RATE AT91C_MASTER_CLOCK/2 /* AT91C_TC0_CMR is implicitly set to */ + /* AT91C_TC_TIMER_DIV1_CLOCK */ + +#define CONFIG_STACKSIZE (32 * 1024) /* regular stack */ + +#define CONFIG_MISC_INIT_R 1 /* call misc_init_r() on init */ +#define CFG_SPLASH 1 +#define CFG_S1D13706FB 1 + +#define CFG_USB_OHCI_MAX_ROOT_PORTS 15 +#define CFG_USB_OHCI_SLOT_NAME "at91rm9200" +#define LITTLEENDIAN +#define CONFIG_AT91C_PQFP_UHPBUG + +#endif + diff --git a/board/imx27ads/config.h b/board/imx27ads/config.h new file mode 100644 index 0000000000..362fe9d29f --- /dev/null +++ b/board/imx27ads/config.h @@ -0,0 +1,31 @@ +/** + * @file + * @brief Global defintions for the ARM i.MX27 based pcm038 + * + * 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 __CONFIG_H +#define __CONFIG_H + +/* FIXME: ugly....should be simply part of the BSP file */ + +#include <asm/mach-types.h> + +#define CFG_MALLOC_LEN (4096 << 10) +#define CONFIG_STACKSIZE ( 120 << 10) /* stack size */ + +#endif /* __CONFIG_H */ diff --git a/board/ipe337/config.h b/board/ipe337/config.h new file mode 100644 index 0000000000..7799345f21 --- /dev/null +++ b/board/ipe337/config.h @@ -0,0 +1,53 @@ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* + * Board Layout + */ +#define CONFIG_MALLOC_LEN (16384 << 10) +#define CONFIG_MALLOC_BASE (TEXT_BASE - CONFIG_MALLOC_LEN) +#define CONFIG_STACKBASE (CONFIG_MALLOC_BASE - 4) + +/* + * Clock settings + */ + +/* CONFIG_CLKIN_HZ is any value in Hz */ +#if defined(CONFIG_MACH_IPE337_V1) +#define CONFIG_CLKIN_HZ 25000000 +#elif defined(CONFIG_MACH_IPE337_V2) +#define CONFIG_CLKIN_HZ 40000000 +#else +#error "Unknown IPE337 revision" +#endif + +/* CONFIG_CLKIN_HALF controls what is passed to PLL 0=CLKIN */ +/* 1=CLKIN/2 */ +#define CONFIG_CLKIN_HALF 0 +/* CONFIG_PLL_BYPASS controls if the PLL is used 0=don't bypass */ +/* 1=bypass PLL */ +#define CONFIG_PLL_BYPASS 0 +/* CONFIG_VCO_MULT controls what the multiplier of the PLL is. */ +/* Values can range from 1-64 */ +#define CONFIG_VCO_MULT 10 /* POR default */ +/* CONFIG_CCLK_DIV controls what the core clock divider is */ +/* Values can be 1, 2, 4, or 8 ONLY */ +#define CONFIG_CCLK_DIV 1 /* POR default */ +/* CONFIG_SCLK_DIV controls what the peripheral clock divider is */ +/* Values can range from 1-15 */ +#define CONFIG_SCLK_DIV 5 /* POR default */ + +/* Frequencies selected: 400MHz CCLK / 80MHz SCLK ^= 12.5ns cycle time*/ + +#define AMGCTLVAL 0x1F + +/* no need for speed, currently, leave at defaults */ +#define AMBCTL0VAL 0xFFC2FFC2 +#define AMBCTL1VAL 0xFFC2FFC2 + +#define CONFIG_MEM_MT48LC16M16A2TG_75 1 +#define CONFIG_MEM_ADD_WDTH 9 /* 8, 9, 10, 11 */ +#define CONFIG_MEM_SIZE 64 /* 128, 64, 32, 16 */ + +#endif /* __CONFIG_H */ diff --git a/board/netx/config.h b/board/netx/config.h new file mode 100644 index 0000000000..f622f67fc8 --- /dev/null +++ b/board/netx/config.h @@ -0,0 +1,2 @@ +#define CFG_MALLOC_LEN (4096 << 10) +#define CONFIG_STACKSIZE (120<<10) /* stack size */ diff --git a/board/pcm030/config.h b/board/pcm030/config.h new file mode 100644 index 0000000000..339ea71f8b --- /dev/null +++ b/board/pcm030/config.h @@ -0,0 +1,111 @@ +/* + * (C) Copyright 2003-2005 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * (C) Copyright 2006 + * Eric Schumann, Phytec Messatechnik GmbH + * + * 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 + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <asm/arch/mpc5xxx.h> + +/* #define DEBUG */ + +/*------------------------------------------------------------------------------------------------------------------------------------------------------ +High Level Configuration Options +(easy to change) + ------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CONFIG_MPC5200_DDR 1 /* (with DDR-SDRAM) */ +#define CFG_MPC5XXX_CLKIN 33333333 /* ... running at 33.333333MHz */ +#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */ +#define BOOTFLAG_WARM 0x02 /* Software reboot */ + +/*------------------------------------------------------------------------------------------------------------------------------------------------------ +Serial console configuration + ------------------------------------------------------------------------------------------------------------------------------------------------------*/ + +#if (TEXT_BASE == 0xFF000000) /* Boot low */ +#define CFG_LOWBOOT 1 +#endif +/* RAMBOOT will be defined automatically in memory section */ + +/*------------------------------------------------------------------------------------------------------------------------------------------------------ +IPB Bus clocking configuration. + ------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CFG_IPBSPEED_133 /* define for 133MHz speed */ +#if defined(CFG_IPBSPEED_133) +/* + * PCI Bus clocking configuration + * + * Actually a PCI Clock of 66 MHz is only set (in cpu_init.c) if + * CFG_IPBSPEED_133 is defined. This is because a PCI Clock of 66 MHz yet hasn't + * been tested with a IPB Bus Clock of 66 MHz. + */ +#define CFG_PCISPEED_66 /* define for 66MHz speed */ +#else +#undef CFG_PCISPEED_66 /* for 33MHz speed */ +#endif + +/* we only use CS-Boot */ +#define CFG_BOOTCS_START 0xFF000000 +#define CFG_BOOTCS_SIZE 0x01000000 + +#if CONFIG_MACH_PHYCORE_MPC5200B_TINY_REV == 1 +#define CFG_BOOTCS_CFG 0x0008FD00 +#else +#define CFG_BOOTCS_CFG 0x00083800 +#endif + +/*------------------------------------------------------------------------------------------------------------------------------------------------------ + Memory map + ------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CFG_MBAR 0xF0000000 /* MBAR hast to be switched by other bootloader or debugger config */ +#define CFG_SDRAM_BASE 0x00000000 + +/* Use SRAM until RAM will be available */ +#define CFG_INIT_RAM_ADDR MPC5XXX_SRAM +#define CFG_INIT_RAM_SIZE MPC5XXX_SRAM_SIZE /* End of used area in DPRAM */ +#define CONFIG_EARLY_INITDATA_SIZE 0x100 + +#define CFG_MALLOC_LEN (8 << 20) /* Reserve 8 MB for malloc() */ +#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ + +/*------------------------------------------------------------------------------------------------------------------------------------------------------ + GPIO configuration + ------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CFG_GPS_PORT_CONFIG 0x00558c10 /* PSC6=UART, PSC3=UART ; Ether=100MBit with MD */ + +/*------------------------------------------------------------------------------------------------------------------------------------------------------ + Various low-level settings + ------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CFG_HID0_INIT HID0_ICE | HID0_ICFI +#define CFG_HID0_FINAL HID0_ICE + +#define CFG_CS_BURST 0x00000000 +#define CFG_CS_DEADCYCLE 0x33333333 + +#define OF_CPU "PowerPC,5200@0" +#define OF_TBCLK CFG_MPC5XXX_CLKIN +#define OF_SOC "soc5200@f0000000" + +#endif /* __CONFIG_H */ diff --git a/board/pcm037/config.h b/board/pcm037/config.h new file mode 100644 index 0000000000..aa79c8a575 --- /dev/null +++ b/board/pcm037/config.h @@ -0,0 +1,39 @@ +/* + * (C) Copyright 2007 Juergen Beisert <jbe@pengutronix.de> + * + * 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 __CONFIG_H +#define __CONFIG_H + +/* + * Definitions related to passing arguments to kernel. + */ + +#define CFG_MALLOC_LEN (4096 << 10) + +#define CONFIG_STACKSIZE (120<<10) /* stack size */ + +/* #define CONFIG_SYSPLL_CLK_FREQ 26000000 */ + +/* FIXME */ +#define CONFIG_MX31_HCLK_FREQ 26000000 +#define CONFIG_MX31_CLK32 32000 + +#endif + +/* nothing to do here yet */ diff --git a/board/pcm038/config.h b/board/pcm038/config.h new file mode 100644 index 0000000000..51f9bd9983 --- /dev/null +++ b/board/pcm038/config.h @@ -0,0 +1,29 @@ +/** + * @file + * @brief Global defintions for the ARM i.MX27 based pcm038 + * + * 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 __CONFIG_H +#define __CONFIG_H + +/* FIXME: ugly....should be simply part of the BSP file */ + +#define CFG_MALLOC_LEN (4096 << 10) +#define CONFIG_STACKSIZE ( 120 << 10) /* stack size */ + +#endif /* __CONFIG_H */ diff --git a/board/sandbox/Makefile b/board/sandbox/Makefile new file mode 100644 index 0000000000..af62aa25dc --- /dev/null +++ b/board/sandbox/Makefile @@ -0,0 +1,5 @@ +obj-y += board.o +obj-y += clock.o +obj-y += hostfile.o +obj-y += console.o + diff --git a/board/sandbox/board.c b/board/sandbox/board.c new file mode 100644 index 0000000000..f7cde99537 --- /dev/null +++ b/board/sandbox/board.c @@ -0,0 +1,45 @@ +/* + * board.c + * + * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix + * + * 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 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 <driver.h> +#include <malloc.h> +#include <asm/arch/linux.h> +#include <init.h> +#include <errno.h> + +static struct device_d tap_device = { + .name = "tap", + .id = "eth0", + + .type = DEVICE_TYPE_ETHER, +}; + +static int devices_init(void) +{ + register_device(&tap_device); + + return 0; +} + +device_initcall(devices_init); + diff --git a/board/sandbox/clock.c b/board/sandbox/clock.c new file mode 100644 index 0000000000..27ae7e234c --- /dev/null +++ b/board/sandbox/clock.c @@ -0,0 +1,48 @@ +/* + * clock.c - wrapper between a U-Boot clocksource and linux + * + * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix + * + * 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 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 <init.h> +#include <clock.h> +#include <asm/arch/linux.h> + +static uint64_t linux_clocksource_read(void) +{ + return linux_get_time(); +} + +static struct clocksource cs = { + .read = linux_clocksource_read, + .mask = 0xffffffff, + .shift = 10, +}; + +static int clocksource_init (void) +{ + cs.mult = clocksource_hz2mult(1000 * 1000 * 1000, cs.shift); + + init_clock(&cs); + + return 0; +} + +core_initcall(clocksource_init); diff --git a/board/sandbox/config.h b/board/sandbox/config.h new file mode 100644 index 0000000000..c96d762f2d --- /dev/null +++ b/board/sandbox/config.h @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define __SANDBOX__ + +#endif /* __CONFIG_H */ diff --git a/board/sandbox/console.c b/board/sandbox/console.c new file mode 100644 index 0000000000..0f54e19231 --- /dev/null +++ b/board/sandbox/console.c @@ -0,0 +1,55 @@ +/* + * console.c - register a console device + * + * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix + * + * 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 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 <driver.h> +#include <asm/arch/linux.h> +#include <xfuncs.h> + +int u_boot_register_console(char *name_template, int stdinfd, int stdoutfd) +{ + struct device_d *dev; + struct linux_console_data *data; + + dev = xzalloc(sizeof(struct device_d) + sizeof(struct linux_console_data)); + + data = (struct linux_console_data *)(dev + 1); + + dev->platform_data = data; + + strcpy(dev->name, "console"); + + + if (stdinfd >= 0) + data->flags = CONSOLE_STDIN; + if (stdoutfd >= 0) + data->flags |= CONSOLE_STDOUT | CONSOLE_STDERR; + + data->stdoutfd = stdoutfd; + data->stdinfd = stdinfd; + + get_free_deviceid(dev->id, name_template); + dev->type = DEVICE_TYPE_CONSOLE; + + return register_device(dev); +} + diff --git a/board/sandbox/hostfile.c b/board/sandbox/hostfile.c new file mode 100644 index 0000000000..6521722209 --- /dev/null +++ b/board/sandbox/hostfile.c @@ -0,0 +1,95 @@ +/* + * hostfile.c - use files from the host to simalute U-Boot devices + * + * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix + * + * 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 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 <driver.h> +#include <malloc.h> +#include <asm/arch/linux.h> +#include <init.h> +#include <errno.h> +#include <asm/arch/hostfile.h> +#include <xfuncs.h> + +static ssize_t hf_read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags) +{ + struct hf_platform_data *hf = dev->platform_data; + int fd = hf->fd; + + if (linux_lseek(fd, offset) != offset) + return -EINVAL; + + return linux_read(fd, buf, count); +} + +static ssize_t hf_write(struct device_d *dev, const void *buf, size_t count, ulong offset, ulong flags) +{ + struct hf_platform_data *hf = dev->platform_data; + int fd = hf->fd; + + if (linux_lseek(fd, offset) != offset) + return -EINVAL; + + return linux_write(fd, buf, count); +} + +static void hf_info(struct device_d *dev) +{ + struct hf_platform_data *hf = dev->platform_data; + + printf("file: %s\n", hf->filename); +} + +static struct driver_d hf_drv = { + .name = "hostfile", + .probe = dummy_probe, + .read = hf_read, + .write = hf_write, + .info = hf_info, + .type = DEVICE_TYPE_BLOCK, +}; + +static int hf_init(void) +{ + return register_driver(&hf_drv); +} + +device_initcall(hf_init); + +int u_boot_register_filedev(struct hf_platform_data *hf, char *name_template) +{ + struct device_d *dev; + + dev = xzalloc(sizeof(struct device_d)); + + dev->platform_data = hf; + + hf = dev->platform_data; + + strcpy(dev->name,"hostfile"); + get_free_deviceid(dev->id, name_template); + dev->size = hf->size; + dev->map_base = hf->map_base; + dev->type = DEVICE_TYPE_BLOCK; + + return register_device(dev); +} + diff --git a/board/scb9328/config.h b/board/scb9328/config.h new file mode 100644 index 0000000000..38e11549d9 --- /dev/null +++ b/board/scb9328/config.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2003 ETC s.r.o. + * + * 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 + * + * Written by Peter Figuli <peposh@etc.sk>, 2003. + * + * 2003/13/06 Initial MP10 Support copied from wepep250 + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CFG_MALLOC_LEN (4096 << 10) + +#define CONFIG_STACKSIZE (120<<10) /* stack size */ + +#define CONFIG_SYSPLL_CLK_FREQ 16000000 + +#endif /* __CONFIG_H */ + |