summaryrefslogtreecommitdiffstats
path: root/target/linux/at91-2.6/image/romboot
diff options
context:
space:
mode:
authorhcg <hcg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-03-20 09:59:17 +0000
committerhcg <hcg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-03-20 09:59:17 +0000
commit18d77c39a5b2b3a56cd356dafe305a08317f625e (patch)
tree18df426a0f5674776b7ad0d177c8abf178812f58 /target/linux/at91-2.6/image/romboot
parente4cf55f5a9b5f29680b2a96180d53075b1ae4644 (diff)
Added primary and secondary bootloaders
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6626 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/at91-2.6/image/romboot')
-rw-r--r--target/linux/at91-2.6/image/romboot/Makefile28
-rw-r--r--target/linux/at91-2.6/image/romboot/patches/000-fixenv.patch57
-rw-r--r--target/linux/at91-2.6/image/romboot/patches/001-makefile.patch50
3 files changed, 135 insertions, 0 deletions
diff --git a/target/linux/at91-2.6/image/romboot/Makefile b/target/linux/at91-2.6/image/romboot/Makefile
new file mode 100644
index 000000000..aa679aba7
--- /dev/null
+++ b/target/linux/at91-2.6/image/romboot/Makefile
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=romboot
+PKG_VERSION:=0.1
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
+PKG_SOURCE:=$(PKG_NAME).tar.gz
+PKG_SOURCE_URL:=http://www.teest.com/at91
+PKG_MD5SUM:=
+PKG_CAT:=zcat
+
+include $(INCLUDE_DIR)/package.mk
+
+define Build/InstallDev
+ dd if=$(PKG_BUILD_DIR)/romboot.bin of=$(PKG_BUILD_DIR)/romboot.block bs=32k count=1 conv=sync
+endef
+
+$(eval $(call Build/DefaultTargets))
diff --git a/target/linux/at91-2.6/image/romboot/patches/000-fixenv.patch b/target/linux/at91-2.6/image/romboot/patches/000-fixenv.patch
new file mode 100644
index 000000000..5a08d57be
--- /dev/null
+++ b/target/linux/at91-2.6/image/romboot/patches/000-fixenv.patch
@@ -0,0 +1,57 @@
+diff -uNr romboot/main.cpp romboot.new/main.cpp
+--- romboot/main.cpp 2004-07-16 17:10:04.000000000 +0200
++++ romboot.new/main.cpp 2006-03-03 02:27:37.000000000 +0100
+@@ -23,12 +23,12 @@
+ #define AT91C_UBOOT_DATAFLASH_ADDR 0xC0008000
+
+ // crystal= 18.432MHz
+-//#define AT91C_PLLA_VALUE 0x2026BE04 // -> 179.712MHz
+-//#define AT91C_PLLA_MCK 0x0000202
++#define AT91C_PLLA_VALUE 0x2026BE04 // -> 179.712MHz
++#define AT91C_PLLA_MCK 0x0000202
+
+ // crystal= 20.000MHz
+-#define AT91C_PLLA_VALUE 0x2023BE04 // -> 180MHz
+-#define AT91C_PLLA_MCK 0x0000202
++//#define AT91C_PLLA_VALUE 0x2023BE04 // -> 180MHz
++//#define AT91C_PLLA_MCK 0x0000202
+
+ #define DELAY_MAIN_FREQ 1000
+ #define DISP_LINE_LEN 16
+@@ -151,7 +151,7 @@
+ //*-----------------------------------------------------------------------------
+ void AT91F_DisplayMenu(void)
+ {
+- printf("\n\rATMEL LOADER %s %s %s\n\r", AT91C_VERSION, __DATE__, __TIME__);
++ printf("\n\rFDL LOADER %s %s %s\n\r", AT91C_VERSION, __DATE__, __TIME__);
+ printf(menu_separ);
+ AT91F_DataflashPrintInfo();
+ printf(menu_separ);
+@@ -306,6 +306,19 @@
+ AT91F_SetPLL();
+ }
+
++void LedCode(void)
++{
++ int *pRegister;
++ pRegister = (int *)0xFFFFF800; // Enable port C peripheral reg
++ *pRegister = 0x3c00;
++ pRegister = (int *)0xFFFFF810; // Output Enable reg
++ *pRegister = 0x3c00;
++ pRegister = (int *)0xFFFFF830; // Set data
++ *pRegister = 0x1400;
++ pRegister = (int *)0xFFFFF834; // Clear bits
++ *pRegister = 0x2800;
++}
++
+ void AT91F_StartUboot(unsigned int dummy, void *pvoid)
+ {
+ printf("Load U-BOOT from dataflash[%x] to SDRAM[%x]\n\r", AT91C_UBOOT_DATAFLASH_ADDR, AT91C_UBOOT_ADDR);
+@@ -313,6 +326,7 @@
+ printf("Set PLLA to 180Mhz and Master clock to 60Mhz and start U-BOOT\n\r");
+ //* Reset registers
+ AT91F_ResetRegisters();
++ LedCode();
+ Jump(AT91C_UBOOT_ADDR);
+ while(1);
+ }
diff --git a/target/linux/at91-2.6/image/romboot/patches/001-makefile.patch b/target/linux/at91-2.6/image/romboot/patches/001-makefile.patch
new file mode 100644
index 000000000..e0995c778
--- /dev/null
+++ b/target/linux/at91-2.6/image/romboot/patches/001-makefile.patch
@@ -0,0 +1,50 @@
+--- romboot/Makefile.old 2007-03-18 09:29:20.000000000 +0100
++++ romboot/Makefile 2007-03-18 09:29:13.000000000 +0100
+@@ -0,0 +1,47 @@
++LINKFLAGS= -T elf32-littlearm.lds -Ttext 0
++COMPILEFLAGS= -Os
++TARGET=romboot
++OBJFILES=cstartup_ram.o asm_isr.o jump.o at45.o com.o dataflash.o \
++ init.o main.o stdio.o _udivsi3.o _umodsi3.o div0.o
++LIBRARIES=
++INCLUDES= -Iinclude
++
++all:$(TARGET)
++
++$(TARGET): $(OBJFILES)
++ $(LD) $(OBJFILES) -o $(TARGET).out $(LINKFLAGS) -n
++ $(OBJCOPY) $(TARGET).out -O binary $(TARGET).bin
++
++asm_isr.o: asm_isr.S
++ $(CC) -c -Iinclude -o $@ $<
++
++cstartup_ram.o: cstartup_ram.S
++ $(CC) -c -Iinclude -o $@ $<
++
++jump.o: jump.S
++ $(CC) -c -Iinclude -o $@ $<
++
++_udivsi3.o: _udivsi3.S
++ $(CC) -c $<
++
++_umodsi3.o: _umodsi3.S
++ $(CC) -c $<
++
++#%.o: %.S
++# $(CC) -c $(INCLUDES) -o $@ $<
++
++%.o: %.cpp
++ $(CC) -c $(COMPILEFLAGS) $(INCLUDES) -o $@ $<
++
++div0.o: div0.c
++ $(CC) -c $(COMPILEFLAGS) $<
++
++clean:
++ rm $(OBJFILES) -f
++ rm *~ -f
++ rm $(TARGET) -f
++
++
++#LD="$CROSS"ld
++
++