r1809 - trunk/src/target/u-boot/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Thu Apr 19 18:10:51 CEST 2007
Author: laforge
Date: 2007-04-19 18:10:50 +0200 (Thu, 19 Apr 2007)
New Revision: 1809
Modified:
trunk/src/target/u-boot/patches/uboot-hxd8.patch
Log:
* use correct serial UART (3) for HXD8
* add lowlevel_foo.bin building for HXD8
* only use 300MHz core frequency due to PLL capacitor bug in early hardware
Modified: trunk/src/target/u-boot/patches/uboot-hxd8.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-hxd8.patch 2007-04-19 16:09:23 UTC (rev 1808)
+++ trunk/src/target/u-boot/patches/uboot-hxd8.patch 2007-04-19 16:10:50 UTC (rev 1809)
@@ -2,9 +2,9 @@
Index: u-boot/Makefile
===================================================================
---- u-boot.orig/Makefile 2007-03-29 21:46:29.000000000 +0200
-+++ u-boot/Makefile 2007-03-29 21:46:30.000000000 +0200
-@@ -1988,6 +1988,9 @@
+--- u-boot.orig/Makefile
++++ u-boot/Makefile
+@@ -1995,6 +1995,9 @@
qt2410_config : unconfig
@./mkconfig $(@:_config=) arm arm920t qt2410 NULL s3c24x0
@@ -16,9 +16,9 @@
Index: u-boot/board/hxd8/Makefile
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/board/hxd8/Makefile 2007-03-29 21:46:30.000000000 +0200
-@@ -0,0 +1,51 @@
+--- /dev/null
++++ u-boot/board/hxd8/Makefile
+@@ -0,0 +1,65 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -53,9 +53,23 @@
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
++all: $(LIB) lowevel_foo.bin
++
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
++lowlevel_foo.o: lowlevel_foo.S
++ $(CC) -c -DTEXT_BASE=0x33F80000 -march=armv4 \
++ -o lowlevel_foo.o lowlevel_foo.S
++
++lowlevel_foo: lowlevel_foo.o lowlevel_init.o lowlevel_foo.lds
++ $(LD) -T ./lowlevel_foo.lds -Ttext 0x33f80000 -Bstatic \
++ lowlevel_init.o lowlevel_foo.o -o lowlevel_foo
++
++lowevel_foo.bin: lowlevel_foo
++ $(CROSS_COMPILE)objcopy --gap-fill=0xff -O binary \
++ lowlevel_foo lowlevel_foo.bin
++
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
@@ -72,9 +86,9 @@
+#########################################################################
Index: u-boot/board/hxd8/hxd8.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/board/hxd8/hxd8.c 2007-03-29 21:46:30.000000000 +0200
-@@ -0,0 +1,152 @@
+--- /dev/null
++++ u-boot/board/hxd8/hxd8.c
+@@ -0,0 +1,169 @@
+/*
+ * (C) Copyright 2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -116,11 +130,17 @@
+#define M_MDIV 0xC3
+#define M_PDIV 0x4
+#define M_SDIV 0x1
-+#elif FCLK_SPEED==1 /* Fout = 399.65MHz */
-+#define M_MDIV 0x6e
++#elif FCLK_SPEED==1
++#if 0
++#define M_MDIV 0x6e /* Fout = 399.65MHz */
+#define M_PDIV 0x3
+#define M_SDIV 0x1
++#else
++#define M_MDIV 0x61 /* Fout = 296.35MHz due to wrong PLL capacitors */
++#define M_PDIV 0x1
++#define M_SDIV 0x2
+#endif
++#endif
+
+#define USB_CLOCK 1
+
@@ -227,11 +247,22 @@
+{
+ return 0x00000110;
+}
++
++/* The sum of all part_size[]s must equal to the NAND size, i.e., 0x4000000.
++ "initrd" is sized such that it can hold two uncompressed 16 bit 640*480
++ images: 640*480*2*2 = 1228800 < 1245184. */
++
++unsigned int dynpart_size[] = {
++ CFG_UBOOT_SIZE, 0x20000, 0x200000, 0xa0000, 0x3d5c000-CFG_UBOOT_SIZE, 0 };
++char *dynpart_names[] = {
++ "u-boot", "u-boot_env", "kernel", "splash", "rootfs", NULL };
++
++
Index: u-boot/board/hxd8/lowlevel_init.S
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/board/hxd8/lowlevel_init.S 2007-03-29 21:57:23.000000000 +0200
-@@ -0,0 +1,166 @@
+--- /dev/null
++++ u-boot/board/hxd8/lowlevel_init.S
+@@ -0,0 +1,171 @@
+/*
+ * Memory Setup stuff - taken from blob memsetup.S
+ *
@@ -378,6 +409,11 @@
+ cmp r2, r0
+ bne 0b
+
++ /* setup asynchronous bus mode */
++ mrc p15, 0, r1 ,c1 ,c0, 0
++ orr r1, r1, #0xc0000000
++ mcr p15, 0, r1, c1, c0, 0
++
+ /* everything is fine now */
+ mov pc, lr
+
@@ -400,9 +436,9 @@
+ .word 0x30
Index: u-boot/include/configs/hxd8.h
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/configs/hxd8.h 2007-03-29 21:46:30.000000000 +0200
-@@ -0,0 +1,268 @@
+--- /dev/null
++++ u-boot/include/configs/hxd8.h
+@@ -0,0 +1,272 @@
+/*
+ * (C) Copyright 2007 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -467,7 +503,7 @@
+/*
+ * select serial console configuration
+ */
-+#define CONFIG_SERIAL1 1 /* we use SERIAL 1 on GTA01 */
++#define CONFIG_SERIAL3 1 /* we use SERIAL 3 on HXD8 */
+
+/************************************************************
+ * RTC
@@ -528,7 +564,7 @@
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
+/* what's this ? it's not used anywhere */
-+#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
++#define CONFIG_KGDB_SER_INDEX 3 /* which serial port to use */
+#endif
+
+/*
@@ -570,6 +606,7 @@
+#define CONFIG_USB_OHCI 1
+#endif
+
++#if 0
+#define CONFIG_USB_DEVICE 1
+#define CONFIG_USB_TTY 1
+#define CFG_CONSOLE_IS_IN_ENV 1
@@ -581,10 +618,12 @@
+#define CONFIG_USBD_DFU 1
+#define CONFIG_USBD_DFU_XFER_SIZE 4096 /* 0x4000 */
+#define CONFIG_USBD_DFU_INTERFACE 2
++#endif
++#define CFG_CONSOLE_IS_IN_ENV 1
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "usbtty=cdc_acm\0" \
-+ "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8\0" \
++ "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
+ ""
+
+/*-----------------------------------------------------------------------
@@ -663,18 +702,19 @@
+#define LCD_VIDEO_ADDR 0x33d00000
+
+#define CONFIG_S3C2410_NAND_BBT 1
-+#define CONFIG_S3C2410_NAND_HWECC 1
++//#define CONFIG_S3C2410_NAND_HWECC 1
+
+#define CONFIG_DRIVER_PCF50606 1
+
+#define MTDIDS_DEFAULT "nand0=hxd8-nand"
+#define MTPARTS_DEFAULT "hxd8-nand:256k(u-boot),16k(u-boot_env),2M(kernel),640k(splash),-(jffs2)"
++#define CFG_NAND_DYNPART_MTD_KERNEL_NAME "hxd8-nand"
+
+#endif /* __CONFIG_H */
Index: u-boot/board/hxd8/udc.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/board/hxd8/udc.c 2007-03-29 21:46:30.000000000 +0200
+--- /dev/null
++++ u-boot/board/hxd8/udc.c
@@ -0,0 +1,30 @@
+
+#include <common.h>
@@ -708,8 +748,8 @@
+#endif /* CONFIG_USB_DEVICE */
Index: u-boot/board/hxd8/pcf50606.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/board/hxd8/pcf50606.c 2007-03-29 21:46:30.000000000 +0200
+--- /dev/null
++++ u-boot/board/hxd8/pcf50606.c
@@ -0,0 +1,67 @@
+
+#include <common.h>
@@ -780,8 +820,8 @@
+
Index: u-boot/board/hxd8/config.mk
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/board/hxd8/config.mk 2007-03-29 21:46:30.000000000 +0200
+--- /dev/null
++++ u-boot/board/hxd8/config.mk
@@ -0,0 +1,22 @@
+#
+# (C) Copyright 2002
@@ -807,8 +847,8 @@
+TEXT_BASE = 0x33F80000
Index: u-boot/board/hxd8/u-boot.lds
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/board/hxd8/u-boot.lds 2007-03-29 21:46:30.000000000 +0200
+--- /dev/null
++++ u-boot/board/hxd8/u-boot.lds
@@ -0,0 +1,58 @@
+/*
+ * (C) Copyright 2002
@@ -868,3 +908,156 @@
+ .bss : { *(.bss) }
+ _end = .;
+}
+Index: u-boot/board/hxd8/lowlevel_foo.S
+===================================================================
+--- /dev/null
++++ u-boot/board/hxd8/lowlevel_foo.S
+@@ -0,0 +1,87 @@
++
++_start:
++ b reset
++undefvec:
++ b undefvec
++swivec:
++ b swivec
++pabtvec:
++ b pabtvec
++dabtvec:
++ b dabtvec
++rsvdvec:
++ b rsvdvec
++irqvec:
++ b irqvec
++fiqvec:
++ b fiqvec
++
++reset:
++ /*
++ * set the cpu to SVC32 mode
++ */
++ mrs r0,cpsr
++ bic r0,r0,#0x1f
++ orr r0,r0,#0xd3
++ msr cpsr,r0
++
++/* turn off the watchdog */
++#define pWTCON 0x53000000
++#define INTMSK 0x4A000008 /* Interupt-Controller base addresses */
++#define INTSUBMSK 0x4A00001C
++#define CLKDIVN 0x4C000014 /* clock divisor register */
++#define CAMDIVN 0x4C000018
++
++ ldr r0, =pWTCON
++ mov r1, #0x0
++ str r1, [r0]
++
++ mov r1, #0xffffffff
++ ldr r0, =INTMSK
++ str r1, [r0]
++ ldr r1, =0x7ff
++ ldr r0, =INTSUBMSK
++ str r1, [r0]
++
++ /* FCLK:HCLK:PCLK = 1:3:6 */
++ ldr r0, =CAMDIVN
++ mov r1, #0
++ str r1, [r0]
++
++ /* FCLK:HCLK:PCLK = 1:3:6 */
++ ldr r0, =CLKDIVN
++ mov r1, #7
++ str r1, [r0]
++
++ bl cpu_init_crit
++ ldr r0,=TEXT_BASE
++ mov pc, r0
++
++cpu_init_crit:
++ /*
++ * flush v4 I/D caches
++ */
++ mov r0, #0
++ mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */
++ mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */
++
++ /*
++ * disable MMU stuff and caches
++ */
++ mrc p15, 0, r0, c1, c0, 0
++ bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS)
++ bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM)
++ orr r0, r0, #0x00000002 @ set bit 2 (A) Align
++ orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache
++ mcr p15, 0, r0, c1, c0, 0
++
++ /*
++ * before relocating, we have to setup RAM timing
++ * because memory timing is board-dependend, you will
++ * find a lowlevel_init.S in your board directory.
++ */
++ mov ip, lr
++ bl lowlevel_init
++ mov lr, ip
++ mov pc, lr
++
+Index: u-boot/board/hxd8/lowlevel_foo.lds
+===================================================================
+--- /dev/null
++++ u-boot/board/hxd8/lowlevel_foo.lds
+@@ -0,0 +1,56 @@
++/*
++ * (C) Copyright 2002
++ * Gary Jennejohn, DENX Software Engineering, <gj at 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
++ */
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(_start)
++SECTIONS
++{
++ . = 0x00000000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ lowlevel_foo.o (.text)
++ *(.text)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(.rodata) }
++
++ . = ALIGN(4);
++ .data : { *(.data) }
++
++ . = ALIGN(4);
++ .got : { *(.got) }
++
++ . = .;
++ __u_boot_cmd_start = .;
++ .u_boot_cmd : { *(.u_boot_cmd) }
++ __u_boot_cmd_end = .;
++
++ . = ALIGN(4);
++ __bss_start = .;
++ .bss : { *(.bss) }
++ _end = .;
++}
More information about the commitlog
mailing list