Commit 6b7c0f5ebf767dec8cac0463867fbbeb5493eec3

Authored by Nobuhiro Iwamatsu
1 parent f3a7b9535b

sh: Add support shmin board

This adds support for the SHMIN SH7706 board(T-SH7706LAN).
The CPU of this board is SH7706.
There are SDRAM of 32M byte, Flash memory of 512K byte, Serial,
10Base Ether and MMC.

http://web.kyoto-inet.or.jp/people/takagaki/T-SH7706/T-SH7706.htm

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

Showing 7 changed files with 337 additions and 0 deletions Side-by-side Diff

... ... @@ -1011,6 +1011,7 @@
1011 1011 SH7763RDP SH7763
1012 1012 RSK7203 SH7203
1013 1013 AP325RXA SH7723
  1014 + SHMIN SH7706
1014 1015  
1015 1016 Mark Jonas <mark.jonas@de.bosch.com>
1016 1017  
board/shmin/Makefile
  1 +#
  2 +# Copyright (C) 2010 Nobuhiro Iwamatsu
  3 +# Copyright (C) 2008 Renesas Solutions Corp.
  4 +#
  5 +# u-boot/board/shmin/Makefile
  6 +#
  7 +# This program is free software; you can redistribute it and/or
  8 +# modify it under the terms of the GNU General Public License as
  9 +# published by the Free Software Foundation; either version 2 of
  10 +# the License, or (at your option) any later version.
  11 +#
  12 +# This program is distributed in the hope that it will be useful,
  13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15 +# GNU General Public License for more details.
  16 +#
  17 +# You should have received a copy of the GNU General Public License
  18 +# along with this program; if not, write to the Free Software
  19 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20 +# MA 02111-1307 USA
  21 +
  22 +include $(TOPDIR)/config.mk
  23 +
  24 +LIB = lib$(BOARD).a
  25 +
  26 +OBJS := shmin.o
  27 +SOBJS := lowlevel_init.o
  28 +
  29 +LIB := $(addprefix $(obj),$(LIB))
  30 +OBJS := $(addprefix $(obj),$(OBJS))
  31 +SOBJS := $(addprefix $(obj),$(SOBJS))
  32 +
  33 +$(LIB): $(obj).depend $(OBJS) $(SOBJS)
  34 + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
  35 +
  36 +clean:
  37 + rm -f $(SOBJS) $(OBJS)
  38 +
  39 +distclean: clean
  40 + rm -f $(LIB) core *.bak .depend
  41 +
  42 +#########################################################################
  43 +
  44 +# defines $(obj).depend target
  45 +include $(SRCTREE)/rules.mk
  46 +
  47 +sinclude $(obj).depend
  48 +
  49 +#########################################################################
board/shmin/config.mk
  1 +#
  2 +# Copyright (C) 2010 Nobuhiro Iwamatsu
  3 +#
  4 +# u-boot/board/shmin/config.mk
  5 +#
  6 +# This program is free software; you can redistribute it and/or
  7 +# modify it under the terms of the GNU General Public License as
  8 +# published by the Free Software Foundation; either version 2 of
  9 +# the License, or (at your option) any later version.
  10 +#
  11 +# This program is distributed in the hope that it will be useful,
  12 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 +# GNU General Public License for more details.
  15 +#
  16 +# You should have received a copy of the GNU General Public License
  17 +# along with this program; if not, write to the Free Software
  18 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19 +# MA 02111-1307 USA
  20 +
  21 +#
  22 +# TEXT_BASE refers to image _after_ relocation.
  23 +#
  24 +# NOTE: Must match value used in u-boot.lds (in this directory).
  25 +#
  26 +
  27 +CONFIG_SYS_TEXT_BASE = 0x8DFC0000
board/shmin/lowlevel_init.S
  1 +/*
  2 + * (C) Copyright 2008, 2010 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  3 + *
  4 + * This program is free software; you can redistribute it and/or
  5 + * modify it under the terms of the GNU General Public License as
  6 + * published by the Free Software Foundation; either version 2 of
  7 + * the License, or (at your option) any later version.
  8 + *
  9 + * This program is distributed in the hope that it will be useful,
  10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 + * GNU General Public License for more details.
  13 + *
  14 + * You should have received a copy of the GNU General Public License
  15 + * along with this program; if not, write to the Free Software
  16 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  17 + * MA 02111-1307 USA
  18 + */
  19 +
  20 +#include <config.h>
  21 +#include <version.h>
  22 +
  23 +#include <asm/processor.h>
  24 +#include <asm/macro.h>
  25 +
  26 +
  27 + .global lowlevel_init
  28 +
  29 + .text
  30 + .align 2
  31 +
  32 +lowlevel_init:
  33 + /* Use setting of original bootloader */
  34 + rts
  35 + nop
  36 + .align 2
  1 +/*
  2 + * Copyright (C) 2007 - 2010
  3 + * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  4 + * (C) Copyright 2000-2003
  5 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6 + * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  7 + *
  8 + * board/shmin/shmin.c
  9 + *
  10 + * This program is free software; you can redistribute it and/or
  11 + * modify it under the terms of the GNU General Public License as
  12 + * published by the Free Software Foundation; either version 2 of
  13 + * the License, or (at your option) any later version.
  14 + *
  15 + * This program is distributed in the hope that it will be useful,
  16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18 + * GNU General Public License for more details.
  19 + *
  20 + * You should have received a copy of the GNU General Public License
  21 + * along with this program; if not, write to the Free Software
  22 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23 + * MA 02111-1307 USA
  24 + *
  25 + * Copy board_flash_get_legacy() from board/freescale/m54455evb/m54455evb.c
  26 + */
  27 +
  28 +#include <common.h>
  29 +#include <asm/io.h>
  30 +#include <asm/processor.h>
  31 +
  32 +int checkboard(void)
  33 +{
  34 + puts("BOARD: T-SH7706LAN ");
  35 + if(readb(0xb0008006) == 0xab)
  36 + puts("v2\n");
  37 + else
  38 + puts("v1\n");
  39 + return 0;
  40 +}
  41 +
  42 +int board_init(void)
  43 +{
  44 + writew(0x2980, BCR2);
  45 + return 0;
  46 +}
  47 +
  48 +int dram_init(void)
  49 +{
  50 + DECLARE_GLOBAL_DATA_PTR;
  51 +
  52 + gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  53 + gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
  54 + printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
  55 + return 0;
  56 +}
  57 +
  58 +void led_set_state(unsigned short value)
  59 +{
  60 +
  61 +}
  62 +
  63 +#if defined(CONFIG_FLASH_CFI_LEGACY)
  64 +#include <flash.h>
  65 +ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
  66 +{
  67 + int sect[] = CONFIG_SYS_ATMEL_SECT;
  68 + int sectsz[] = CONFIG_SYS_ATMEL_SECTSZ;
  69 + int i, j, k;
  70 +
  71 + if (base != CONFIG_SYS_ATMEL_BASE)
  72 + return 0;
  73 +
  74 + info->flash_id = 0x01000000;
  75 + info->portwidth = 1;
  76 + info->chipwidth = 1;
  77 + info->buffer_size = 1;
  78 + info->erase_blk_tout = 16384;
  79 + info->write_tout = 2;
  80 + info->buffer_write_tout = 5;
  81 + info->vendor = 0xFFF0; /* CFI_CMDSET_AMD_LEGACY */
  82 + info->cmd_reset = 0x00F0;
  83 + info->interface = FLASH_CFI_X8;
  84 + info->legacy_unlock = 0;
  85 + info->manufacturer_id = (u16) ATM_MANUFACT;
  86 + info->device_id = ATM_ID_LV040;
  87 + info->device_id2 = 0;
  88 + info->ext_addr = 0;
  89 + info->cfi_version = 0x3133;
  90 + info->cfi_offset = 0x0000;
  91 + info->addr_unlock1 = 0x00000555;
  92 + info->addr_unlock2 = 0x000002AA;
  93 + info->name = "CFI conformant";
  94 + info->size = 0;
  95 + info->sector_count = CONFIG_SYS_ATMEL_TOTALSECT;
  96 + info->start[0] = base;
  97 +
  98 + for (k = 0, i = 0; i < CONFIG_SYS_ATMEL_REGION; i++) {
  99 + info->size += sect[i] * sectsz[i];
  100 + for (j = 0; j < sect[i]; j++, k++) {
  101 + info->start[k + 1] = info->start[k] + sectsz[i];
  102 + info->protect[k] = 0;
  103 + }
  104 + }
  105 +
  106 + return 1;
  107 +}
  108 +#endif /* CONFIG_FLASH_CFI_LEGACY */
... ... @@ -745,6 +745,7 @@
745 745 rsk7203 sh sh2 rsk7203 renesas -
746 746 mpr2 sh sh3 mpr2 - -
747 747 ms7720se sh sh3 ms7720se - -
  748 +shmin sh sh3 shmin - -
748 749 espt sh sh4 espt - -
749 750 ms7722se sh sh4 ms7722se - -
750 751 ms7750se sh sh4 ms7750se - -
include/configs/shmin.h
  1 +/*
  2 + * Configuation settings for shmin (T-SH7706LAN)
  3 + *
  4 + * Copyright (C) 2010 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  5 + *
  6 + * See file CREDITS for list of people who contributed to this
  7 + * project.
  8 + *
  9 + * This program is free software; you can redistribute it and/or
  10 + * modify it under the terms of the GNU General Public License as
  11 + * published by the Free Software Foundation; either version 2 of
  12 + * the License, or (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22 + * MA 02111-1307 USA
  23 + */
  24 +
  25 +#ifndef __SHMIN_H
  26 +#define __SHMIN_H
  27 +
  28 +#define CONFIG_SH 1
  29 +#define CONFIG_SH3 1
  30 +#define CONFIG_CPU_SH7706 1
  31 +#define CONFIG_SHMIN 1
  32 +
  33 +#define CONFIG_CMD_FLASH
  34 +#define CONFIG_CMD_MEMORY
  35 +#define CONFIG_CMD_SDRAM
  36 +#define CONFIG_CMD_NET
  37 +#define CONFIG_CMD_PING
  38 +#define CONFIG_CMD_NFS
  39 +#define CONFIG_CMD_ENV
  40 +#define CONFIG_CMD_SAVEENV
  41 +
  42 +#define CONFIG_BAUDRATE 115200
  43 +#define CONFIG_BOOTARGS "console=ttySC0,115200"
  44 +
  45 +/*
  46 + * This board has original boot loader. If you write u-boot to 0x0,
  47 + * you should set undef.
  48 + */
  49 +#define CONFIG_VERSION_VARIABLE
  50 +#undef CONFIG_SHOW_BOOT_PROGRESS
  51 +
  52 +/* system */
  53 +#define SHMIN_SDRAM_BASE (0x8C000000)
  54 +#define SHMIN_FLASH_BASE_1 (0xA0000000)
  55 +
  56 +#define CONFIG_SYS_LONGHELP /* undef to save memory */
  57 +#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
  58 +#define CONFIG_SYS_CBSIZE 256 /* Buffer size for input from the Console */
  59 +#define CONFIG_SYS_PBSIZE 256 /* Buffer size for Console output */
  60 +#define CONFIG_SYS_MAXARGS 16 /* max args accepted for monitor commands */
  61 +/* Buffer size for Boot Arguments passed to kernel */
  62 +#define CONFIG_SYS_BARGSIZE 512
  63 +/* List of legal baudrate settings for this board */
  64 +#define CONFIG_SYS_BAUDRATE_TABLE { 115200 }
  65 +
  66 +/* SCIF */
  67 +#define CONFIG_SCIF_CONSOLE 1
  68 +#define CONFIG_CONS_SCIF0 1
  69 +
  70 +/* memory */
  71 +#define CONFIG_SYS_SDRAM_BASE SHMIN_SDRAM_BASE
  72 +#define CONFIG_SYS_SDRAM_SIZE (32 * 1024 * 1024)
  73 +#define CONFIG_SYS_MEMTEST_START SHMIN_SDRAM_BASE
  74 +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - (256 * 1024))
  75 +
  76 +#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 1 * 1024 * 1024)
  77 +#define CONFIG_SYS_MONITOR_BASE (SHMIN_FLASH_BASE_1 + CONFIG_ENV_SECT_SIZE)
  78 +#define CONFIG_SYS_MONITOR_LEN (128 * 1024)
  79 +#define CONFIG_SYS_MALLOC_LEN (256 * 1024)
  80 +#define CONFIG_SYS_GBL_DATA_SIZE 256
  81 +#define CONFIG_SYS_BOOTMAPSZ (8 * 1024 * 1024)
  82 +
  83 +/* FLASH */
  84 +#define CONFIG_SYS_FLASH_CFI
  85 +#define CONFIG_FLASH_CFI_DRIVER
  86 +#undef CONFIG_SYS_FLASH_QUIET_TEST
  87 +#define CONFIG_SYS_FLASH_EMPTY_INFO /* print 'E' for empty sector on flinfo */
  88 +#define CONFIG_SYS_FLASH_BASE SHMIN_FLASH_BASE_1
  89 +#define CONFIG_SYS_MAX_FLASH_SECT 11
  90 +#define CONFIG_SYS_MAX_FLASH_BANKS 1
  91 +
  92 +#define CONFIG_FLASH_CFI_LEGACY
  93 +#define CONFIG_SYS_ATMEL_BASE CONFIG_SYS_FLASH_BASE
  94 +#define CONFIG_SYS_ATMEL_TOTALSECT CONFIG_SYS_MAX_FLASH_SECT
  95 +#define CONFIG_SYS_ATMEL_REGION 4
  96 +#define CONFIG_SYS_ATMEL_SECT {1, 2, 1, 7}
  97 +#define CONFIG_SYS_ATMEL_SECTSZ {0x4000, 0x2000, 0x8000, 0x10000}
  98 +
  99 +#define CONFIG_ENV_IS_IN_FLASH
  100 +#define CONFIG_ENV_SECT_SIZE (64 * 1024)
  101 +#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
  102 +#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
  103 +#define CONFIG_SYS_FLASH_ERASE_TOUT 120000
  104 +#define CONFIG_SYS_FLASH_WRITE_TOUT 500
  105 +
  106 +/* Board Clock */
  107 +#define CONFIG_SYS_CLK_FREQ 33333333
  108 +#define CONFIG_SYS_TMU_CLK_DIV 4
  109 +#define CONFIG_SYS_HZ 1000
  110 +
  111 +/* Network device */
  112 +#define CONFIG_DRIVER_NE2000
  113 +#define CONFIG_DRIVER_NE2000_BASE (0xb0000300)
  114 +
  115 +#endif /* __SHMIN_H */