diff -Nuar apex-1.5.6/src/arch-arm/Kconfig apex-1.5.6-Hammer/src/arch-arm/Kconfig --- apex-1.5.6/src/arch-arm/Kconfig 2007-06-01 17:36:45.000000000 -0700 +++ apex-1.5.6-Hammer/src/arch-arm/Kconfig 2007-09-12 11:27:20.000000000 -0700 @@ -363,6 +363,7 @@ string "Environment region" depends on ENV_MUTABLE default "nor:128k+64k" if MACH_M7200 + default "nor:128k+64k" if MACH_HAMMER default "nor:128k+64k" if MACH_LPD7A40X default "nor:128k+64k" if MACH_LPD79520 default "nor:128k+64k" if MACH_LNODE80 @@ -579,6 +580,7 @@ depends on !ENV_DEFAULT_STARTUP_OVERRIDE default y if MACH_LNODE80 default y if MACH_M7200 + default y if MACH_HAMMER default y if MACH_NSLU2 config ENV_REGION_RAMDISK_SWAP @@ -597,6 +599,7 @@ string "Source region for kernel" depends on ENV default "nor:256k+1024k" if MACH_M7200 + default "nor:256k+1024k" if MACH_HAMMER default "nor:256k+1024k" if MACH_LNODE80 default "nor:256k+1536k" if MACH_LPD7A40X || MACH_LPD7952X default "nor:0x60010+0xffff0" if MACH_NSLU2 @@ -622,6 +625,7 @@ string "Source region for ramdisk image" depends on ENV && ATAG && USE_RAMDISK default "nor:1280k+1536k" if MACH_M7200 + default "nor:1280k+1024k" if MACH_HAMMER default "nor:1280k+1536k" if MACH_LNODE80 default "nor:0x160010+0x69fff0" if MACH_NSLU2 help diff -Nuar apex-1.5.6/src/mach-s3c2410/Kconfig apex-1.5.6-Hammer/src/mach-s3c2410/Kconfig --- apex-1.5.6/src/mach-s3c2410/Kconfig 2006-05-05 11:44:03.000000000 -0700 +++ apex-1.5.6-Hammer/src/mach-s3c2410/Kconfig 2007-08-16 23:31:38.000000000 -0700 @@ -2,13 +2,18 @@ choice prompt "S3C2410 Implementations" - default MACH_M7200 + default MACH_HAMMER config MACH_M7200 bool "American Microsystems M7200" select USES_NOR_CFI select USES_NOR_BOOTFLASH +config MACH_HAMMER + bool "TinCanTools Hammer Board" + select USES_NOR_CFI + select USES_NOR_BOOTFLASH + endchoice menu "Platform Setup" @@ -25,7 +30,8 @@ config ARCH_NUMBER int - default 193 + default 1023 if MACH_M7200 + default 1460 if MACH_HAMMER config APEX_VMA hex "APEX runtime address" diff -Nuar apex-1.5.6/src/mach-s3c2410/Makefile apex-1.5.6-Hammer/src/mach-s3c2410/Makefile --- apex-1.5.6/src/mach-s3c2410/Makefile 2006-03-15 17:15:13.000000000 -0800 +++ apex-1.5.6-Hammer/src/mach-s3c2410/Makefile 2007-08-16 23:31:38.000000000 -0700 @@ -23,3 +23,4 @@ obj-y := serial.o env.o obj-$(CONFIG_MACH_M7200) += init-m7200.o timer-s3c2410.o +obj-$(CONFIG_MACH_HAMMER) += init-hammer.o timer-s3c2410.o diff -Nuar apex-1.5.6/src/mach-s3c2410/hammer_config apex-1.5.6-Hammer/src/mach-s3c2410/hammer_config --- apex-1.5.6/src/mach-s3c2410/hammer_config 1969-12-31 16:00:00.000000000 -0800 +++ apex-1.5.6-Hammer/src/mach-s3c2410/hammer_config 2007-08-16 23:31:38.000000000 -0700 @@ -0,0 +1,139 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: +# Fri Aug 17 11:41:17 2007 +# +CONFIG_ARM=y +CONFIG_CPU_ARMV4=y +CONFIG_CPU_ARM920T=y +# CONFIG_ARCH_LH7952X is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_IXP42X is not set +CONFIG_ARCH_S3C2410=y +# CONFIG_ARCH_MX3 is not set +CONFIG_EXPERIMENTAL=y +# CONFIG_SMALL is not set + +# +# General Setup +# +CONFIG_TARGET_DESCRIPTION="TinCanTools Hammer Board" +CONFIG_CROSS_COMPILE="arm-linux-uclibc-" +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_CC_OPTIMIZE_FOR_SPEED is not set +# CONFIG_CC_NO_OPTIMIZATION is not set +# CONFIG_STARTUP_UART is not set +# CONFIG_DEBUG_LL is not set +CONFIG_SPINNER=y +CONFIG_ATAG=y +# CONFIG_MMU is not set +CONFIG_DISABLE_MMU_AT_BOOT=y +# CONFIG_INTERRUPTS is not set +CONFIG_SDRAMBOOT_REPORT=y +CONFIG_STACK_SIZE=0x1000 +# CONFIG_STACKLIMIT is not set +# CONFIG_BOOTSTRAP_MEMTEST is not set +CONFIG_ATAG_PHYS=0x30000100 +CONFIG_ARCH_NUMBER=1460 +CONFIG_APEX_VMA=0x30200000 +CONFIG_KERNEL_LMA=0x30008000 +CONFIG_USE_RAMDISK=y +CONFIG_RAMDISK_LMA=0x30800000 +CONFIG_SDRAM_BANK0=y +CONFIG_NOR_BUSWIDTH=16 +CONFIG_NOR_BANK0=y +CONFIG_NOR_BANK0_START=0x00000000 +CONFIG_NOR_BANK0_LENGTH=0x04000000 +CONFIG_ENV_STARTUP="" +CONFIG_MACH="s3c2410" +CONFIG_RAMDISK_SIZE=0x00100000 +# CONFIG_MACH_M7200 is not set +CONFIG_MACH_HAMMER=y + +# +# Platform Setup +# + +# +# Commands +# +CONFIG_ALLHELP=y +CONFIG_ALPHABETIZE_COMMANDS=y +CONFIG_DEL_IS_BS=y +CONFIG_ANSI_KEYS=y +CONFIG_COMMAND_HISTORY=y +CONFIG_COMMAND_EDITING=y +# CONFIG_TIME_COMMANDS is not set +CONFIG_CMD_ALIAS=y +CONFIG_CMD_CHECKSUM=y +CONFIG_CMD_COPY=y +CONFIG_CMD_COMPARE=y +CONFIG_CMD_DRVINFO=y +CONFIG_CMD_DUMP=y +CONFIG_CMD_ENV=y +CONFIG_CMD_SETENV=y +CONFIG_CMD_ERASE=y +CONFIG_CMD_FILL=y +CONFIG_CMD_GO=y +CONFIG_CMD_INFO=y +# CONFIG_CMD_PAUSE is not set +CONFIG_CMD_WAIT=y +CONFIG_CMD_XRECEIVE=y +# CONFIG_CMD_MEMLIMIT is not set +# CONFIG_CMD_MEMSCAN is not set +# CONFIG_CMD_ARM920_TEST is not set + +# +# Generic Drivers +# +# CONFIG_DRIVER_FAT is not set +# CONFIG_DRIVER_EXT2 is not set +# CONFIG_DRIVER_JFFS2 is not set +# CONFIG_DRIVER_FIS is not set +CONFIG_DRIVER_NOR_CFI=y +CONFIG_DRIVER_NOR_CFI_NO_BUFFERED=y +CONFIG_DRIVER_NOR_CFI_TYPE_INTEL=y +# CONFIG_DRIVER_NOR_CFI_TYPE_SPANSION is not set +# CONFIG_DRIVER_ONENAND is not set +CONFIG_USES_NOR_CFI=y + +# +# Environment +# +CONFIG_ENV=y +CONFIG_ENV_LINK=y +CONFIG_ENV_MUTABLE=y +CONFIG_ENV_REGION="nor:128k+64k" +# CONFIG_ENV_SAVEATONCE is not set +CONFIG_ENV_CHECK_LEN=1024 +# CONFIG_VARIATIONS is not set +CONFIG_NO_BOOTSTRAP=y +# CONFIG_NOR_BOOT is not set +# CONFIG_NAND_BOOT is not set +# CONFIG_ONENAND_BOOT is not set +# CONFIG_COMPANION_EVT1_BOOT is not set +# CONFIG_COMPANION_EVT2_BOOT is not set + +# +# Default Startup +# +# CONFIG_AUTOBOOT is not set +CONFIG_ENV_STARTUP_KERNEL_COPY=y +# CONFIG_ENV_REGION_KERNEL_SWAP is not set +CONFIG_ENV_STARTUP_RAMDISK_COPY=y +# CONFIG_ENV_REGION_RAMDISK_SWAP is not set + +# +# Regions +# +CONFIG_ENV_REGION_KERNEL="nor:256k+768k" +CONFIG_ENV_REGION_RAMDISK="nor:1024k+1024k" + +# +# Overrides +# +# CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE is not set +# CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set +CONFIG_USES_NOR_BOOTFLASH=y +CONFIG_RELOCATE_SIMPLE=y +CONFIG_ALIASES=y diff -Nuar apex-1.5.6/src/mach-s3c2410/init-hammer.c apex-1.5.6-Hammer/src/mach-s3c2410/init-hammer.c --- apex-1.5.6/src/mach-s3c2410/init-hammer.c 1969-12-31 16:00:00.000000000 -0800 +++ apex-1.5.6-Hammer/src/mach-s3c2410/init-hammer.c 2007-09-19 07:02:30.000000000 -0700 @@ -0,0 +1,132 @@ +/* init-hammer.c + + written by David Anders + 20 Nov 2005 + + 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. + + ----------- + DESCRIPTION + ----------- + + main initialization point for the s3c2410 based Hammer board + +*/ + +#include +#include +#include +#include + +#include "hardware.h" +#include + +/* initialize_bootstrap + + performs vital SDRAM initialization as well as some other memory + controller initializations. It will perform no work if we are + already running from SDRAM. It will + + The return value is true if SDRAM has been initialized and false if + this initialization has already been performed. Note that the + non-SDRAM initializations are performed regardless of whether or + not we're running in SDRAM. + +*/ + +void __naked __section (.bootstrap) initialize_bootstrap(void) +{ + unsigned long lr, nop_count; + __asm volatile ("mov %0, lr":"=r" (lr)); + + WATCHDOG_CTRL = 0x00; + INT_CTRL_MASK = 0xffffffff; + INT_CTRL_SUBMASK = 0x7ff; + CLK_CTRL_BASE = 0x00ffffff; + CLK_CTRL_DIVN = 0x03; + /* Enable Asynchronous Bus mode, NotFast and iA bits */ + { + unsigned long l; + __asm volatile ("mrc p15, 0, %0, c1, c0, 0\n\t" + "orr %0, %0, #0xc0000000\n\t" + "mcr p15, 0, %0, c1, c0, 0":"=r" (l)); + } + + + CLK_CTRL_MPLL = MPLLCON_USER; + nop_count = 0; + while (nop_count < 100) + nop_count++; + + CLK_CTRL_UPLL = UPLLCON_USER; + nop_count = 0; + while (nop_count < 100) + nop_count++; + +#if defined (CONFIG_DEBUG_LL) + GPIO_CTRL_BASE_H_CON = 0x0016faaa; + GPIO_CTRL_BASE_H_UP = 0x000007ff; + UART0_CTRL_UFCON = 0x00; + UART0_CTRL_UMCON = 0x00; + UART0_CTRL_ULCON = 0x03; + UART0_CTRL_UCON = 0x245; + UART0_CTRL_UBRDIV = UART_BRD; + PUTC_LL('A'); + nop_count = 0; + while (nop_count < 100) + nop_count++; +#endif + + BWSCON = 0x11111122; + BANKCON0 = 0x00000700; + BANKCON1 = 0x00000700; + BANKCON2 = 0x00000700; + BANKCON3 = 0x00000700; + BANKCON4 = 0x00000700; + BANKCON5 = 0x00000700; + + __asm volatile ("cmp %0, %1\n\t" +#if defined (CONFIG_SDRAMBOOT_REPORT) + "movhi r0, #1\n\t" "strhi r0, [%2]\n\t" +#endif + "movhi r0, #0\n\t" + "movhi pc, %0\n\t" + "1:"::"r" (lr), "i"(SDRAM_BANK0_PHYS) +#if defined (CONFIG_SDRAMBOOT_REPORT) + , "r"(&fSDRAMBoot) +#endif + :"r0"); + + BANKCON6 = BANKCON6_VAL; + BANKCON7 = BANKCON7_VAL; + REFRESH = REFRESH_VAL; + BANKSIZE = BANKSIZE_VAL; + MRSRB6 = MRSRB6_VAL; + MRSRB7 = MRSRB7_VAL; + + nop_count = 0; + while (nop_count < 100) + nop_count++; + + +#if defined (CONFIG_SDRAMBOOT_REPORT) + barrier(); + fSDRAMBoot = 0; +#endif + + __asm volatile ("mov r0, #-1\t\n" "mov pc, %0"::"r" (lr)); + +} diff -Nuar apex-1.5.6/src/mach-s3c2410/s3c2410.h apex-1.5.6-Hammer/src/mach-s3c2410/s3c2410.h --- apex-1.5.6/src/mach-s3c2410/s3c2410.h 2006-03-15 17:15:13.000000000 -0800 +++ apex-1.5.6-Hammer/src/mach-s3c2410/s3c2410.h 2007-09-19 07:02:30.000000000 -0700 @@ -69,6 +69,7 @@ #define CLK_CTRL_BASE __REG( S3C2410_CLOCK_POWER_BASE + 0x00) #define CLK_CTRL_DIVN __REG( S3C2410_CLOCK_POWER_BASE + 0x14) #define CLK_CTRL_MPLL __REG( S3C2410_CLOCK_POWER_BASE + 0x04) +#define CLK_CTRL_UPLL __REG( S3C2410_CLOCK_POWER_BASE + 0x08) #define GPIO_CTRL_BASE_H_CON __REG( S3C2410_GPIO_BASE_H + 0x00) #define GPIO_CTRL_BASE_H_UP __REG( S3C2410_GPIO_BASE_H + 0x08) @@ -99,6 +100,13 @@ #define MPLLCON_USER ((MDIV_203 << 12) | (PDIV_203 << 4) | (SDIV_203)) + +#define U_M_MDIV_203 0x58 +#define U_M_PDIV_203 0x01 +#define U_M_SDIV_203 0x03 + +#define UPLLCON_USER ((U_M_MDIV_203 << 12) | (U_M_PDIV_203 << 4) | (U_M_SDIV_203)) + #define UART_BAUD_RATE 115200 #define UART_BRD ((50700000 / (UART_BAUD_RATE * 16)) - 1)