提交 f179cc64 编写于 作者: S Stefan Kristiansson 提交者: Wolfgang Denk

openrisc: Add openrisc-generic example board

Signed-off-by: NStefan Kristiansson <stefan.kristiansson@saunalahti.fi>
上级 3553493d
#
# (C) Copyright 2001-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.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
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).o
COBJS-y := $(BOARD).o
SRCS := $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))
$(LIB): $(obj).depend $(OBJS)
$(call cmd_link_o_target, $(OBJS))
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################
#
# (C) Copyright 2011, Julius Baxter <julius@opencores.org>
#
# 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
#
PLATFORM_CPPFLAGS += -mhard-mul -mhard-div
ifeq ($(debug),1)
PLATFORM_CPPFLAGS += -DDEBUG
endif
/*
* Based on nios2-generic.c:
* (C) Copyright 2005, Psyent Corporation <www.psyent.com>
* Scott McNutt <smcnutt@psyent.com>
* (C) Copyright 2010, Thomas Chou <thomas@wytron.com.tw>
*
* 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
*/
#include <common.h>
#include <netdev.h>
int board_early_init_f(void)
{
return 0;
}
int checkboard(void)
{
printf("BOARD: %s\n", CONFIG_BOARD_NAME);
return 0;
}
phys_size_t initdram(int board_type)
{
return 0;
}
#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bis)
{
int rc = 0;
#ifdef CONFIG_ETHOC
rc += ethoc_initialize(0, CONFIG_SYS_ETHOC_BASE);
#endif
return rc;
}
#endif
此差异已折叠。
#include <config.h>
OUTPUT_ARCH(or32)
__DYNAMIC = 0;
MEMORY
{
vectors : ORIGIN = 0, LENGTH = 0x2000
ram : ORIGIN = CONFIG_SYS_MONITOR_BASE,
LENGTH = CONFIG_SYS_MONITOR_LEN
}
SECTIONS
{
.vectors :
{
*(.vectors)
} > vectors
__start = .;
.text : AT (__start) {
_stext = .;
*(.text)
_etext = .;
*(.lit)
*(.shdata)
_endtext = .;
} > ram
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) } > ram
__u_boot_cmd_end = .;
.rodata : {
*(.rodata);
*(.rodata.*)
} > ram
.shbss :
{
*(.shbss)
} > ram
.talias :
{
} > ram
.data : {
sdata = .;
_sdata = .;
*(.data)
edata = .;
_edata = .;
} > ram
.bss :
{
_bss_start = .;
*(.bss)
*(COMMON)
_bss_end = .;
} > ram
__end = .;
/* No stack specification - done manually */
.stab 0 (NOLOAD) :
{
[ .stab ]
}
.stabstr 0 (NOLOAD) :
{
[ .stabstr ]
}
}
......@@ -363,6 +363,7 @@ adp-ag101p nds32 n1213 adp-ag101p AndesTe
nios2-generic nios2 nios2 nios2-generic altera
PCI5441 nios2 nios2 pci5441 psyent
PK1C20 nios2 nios2 pk1c20 psyent
openrisc-generic openrisc or1200 openrisc-generic openrisc -
EVB64260 powerpc 74xx_7xx evb64260 - - EVB64260
EVB64260_750CX powerpc 74xx_7xx evb64260 - - EVB64260
P3G4 powerpc 74xx_7xx evb64260
......
/*
* (C) Copyright 2011, Stefan Kristiansson, stefan.kristianssons@saunalahti.fi
*
* 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
/*
* BOARD/CPU
*/
#define CONFIG_SYS_CLK_FREQ 50000000
#define CONFIG_SYS_RESET_ADDR 0x00000100
#define CONFIG_SYS_SDRAM_BASE 0x00000000
#define CONFIG_SYS_SDRAM_SIZE 0x02000000
#define CONFIG_SYS_CACHELINE_SIZE 16
#define CONFIG_SYS_UART_BASE 0x90000000
#define CONFIG_SYS_UART_FREQ CONFIG_SYS_CLK_FREQ
#define CONFIG_SYS_UART_BAUD 115200
#define CONFIG_BOARD_NAME "OpenRISC Generic"
#define CONFIG_SYS_NO_FLASH
#define CONFIG_SYS_MAX_FLASH_SECT 0
/*
* SERIAL
*/
# define CONFIG_SYS_NS16550
# define CONFIG_SYS_NS16550_SERIAL
# define CONFIG_SYS_NS16550_REG_SIZE 1
# define CONFIG_CONS_INDEX 1
# define CONFIG_SYS_NS16550_COM1 (0x90000000)
# define CONFIG_SYS_NS16550_CLK CONFIG_SYS_CLK_FREQ
#define CONFIG_BAUDRATE CONFIG_SYS_UART_BAUD
#define CONFIG_SYS_BAUDRATE_TABLE {CONFIG_BAUDRATE}
#define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console info */
#define CONSOLE_ARG "console=console=ttyS0,115200\0"
/*
* Ethernet
*/
#define CONFIG_ETHOC
#define CONFIG_SYS_ETHOC_BASE 0x92000000
#define CONFIG_BOOTFILE "boot.img"
#define CONFIG_LOADADDR 0x100000 /* 1MB mark */
/*
* TIMER
*/
#define CONFIG_SYS_HZ 1000
#define CONFIG_SYS_OPENRISC_TMR_HZ 100
/*
* Memory organisation:
*
* RAM start ---------------------------
* | ... |
* ---------------------------
* | Stack |
* ---------------------------
* | Global data |
* ---------------------------
* | Environment |
* ---------------------------
* | Monitor |
* RAM end ---------------------------
*/
/* We're running in RAM */
#define CONFIG_MONITOR_IS_IN_RAM
#define CONFIG_SYS_MONITOR_LEN 0x40000 /* Reserve 256k */
#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \
CONFIG_SYS_SDRAM_SIZE - \
CONFIG_SYS_MONITOR_LEN)
#define CONFIG_ENV_IS_NOWHERE
#define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment, 128KB */
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
/*
* Global data object and stack pointer
*/
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_ENV_ADDR \
- GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_GBL_DATA_ADDR CONFIG_SYS_GBL_DATA_OFFSET
#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_GBL_DATA_OFFSET
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
#define CONFIG_SYS_STACK_LENGTH 0x10000 /* 64KB */
#define CONFIG_SYS_MALLOC_LEN 0x400000 /* 4MB */
#define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_INIT_SP_OFFSET \
- CONFIG_SYS_STACK_LENGTH \
- CONFIG_SYS_MALLOC_LEN)
/*
* MISC
*/
#define CONFIG_SYS_LONGHELP /* Provide extended help */
#define CONFIG_SYS_PROMPT "==> " /* Command prompt */
#define CONFIG_SYS_CBSIZE 256 /* Console I/O buf size */
#define CONFIG_SYS_MAXARGS 16 /* Max command args */
#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Bootarg buf size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
sizeof(CONFIG_SYS_PROMPT) + \
16) /* Print buf size */
#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE
#define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE + 0x2000)
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP_ADDR - 0x20000)
#define CONFIG_CMDLINE_EDITING
/*
* Command line configuration.
*/
#include <config_cmd_default.h>
#define CONFIG_CMD_IRQ
#define CONFIG_CMD_ELF
#define CONFIG_CMD_BSP
#define CONFIG_CMD_MII
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_PING
#define CONFIG_OF_LIBFDT
#define CONFIG_LMB
/*
* BOOTP options
*/
#define CONFIG_BOOTP_BOOTFILESIZE
#define CONFIG_BOOTP_BOOTPATH
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_HOSTNAME
#endif /* __CONFIG_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册