📄 uboot-smdk2443.patch
字号:
Index: u-boot/Makefile===================================================================--- u-boot.orig/Makefile+++ u-boot/Makefile@@ -2362,6 +2362,9 @@ smdk2440_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm920t smdk2440 NULL s3c24x0 +smdk2443_config : unconfig+ @$(MKCONFIG) $(@:_config=) arm arm920t smdk2443 NULL s3c24x0+ SX1_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm925t sx1 Index: u-boot/board/smdk2443/Makefile===================================================================--- /dev/null+++ u-boot/board/smdk2443/Makefile@@ -0,0 +1,67 @@+#+# (C) Copyright 2000-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).a++COBJS := smdk2443.o flash.o udc.o+SOBJS := lowlevel_init.o++.PHONY: all++all: $(LIB) lowlevel_foo.bin++SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)+OBJS := $(addprefix $(obj),$(COBJS))+SOBJS := $(addprefix $(obj),$(SOBJS))++$(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++lowlevel_foo.bin: lowlevel_foo+ $(CROSS_COMPILE)objcopy --gap-fill=0xff -O binary \+ lowlevel_foo lowlevel_foo.bin++clean:+ rm -f $(SOBJS) $(OBJS)++distclean: clean+ rm -f $(LIB) core *.bak .depend++#########################################################################++# defines $(obj).depend target+include $(SRCTREE)/rules.mk++sinclude $(obj).depend++#########################################################################Index: u-boot/board/smdk2443/smdk2443.c===================================================================--- /dev/null+++ u-boot/board/smdk2443/smdk2443.c@@ -0,0 +1,147 @@+/*+ * (C) Copyright 2006 OpenMoko, Inc.+ * Author: Harald Welte <laforge@openmoko.org>+ *+ * 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 <s3c2440.h>++DECLARE_GLOBAL_DATA_PTR;++#define FCLK_SPEED 1++#if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */+#define M_MDIV 0xC3+#define M_PDIV 0x4+#define M_SDIV 0x1+#elif FCLK_SPEED==1 /* Fout = 399.65MHz */+#define M_MDIV 0x6e+#define M_PDIV 0x3+#define M_SDIV 0x1+#endif++#define USB_CLOCK 1++#if USB_CLOCK==0+#define U_M_MDIV 0xA1+#define U_M_PDIV 0x3+#define U_M_SDIV 0x1+#elif USB_CLOCK==1+#define U_M_MDIV 0x3c+#define U_M_PDIV 0x4+#define U_M_SDIV 0x2+#endif++static inline void delay (unsigned long loops)+{+ __asm__ volatile ("1:\n"+ "subs %0, %1, #1\n"+ "bne 1b":"=r" (loops):"0" (loops));+}++/*+ * Miscellaneous platform dependent initialisations+ */++int board_init (void)+{+ S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();+ S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();++ /* to reduce PLL lock time, adjust the LOCKTIME register */+ clk_power->LOCKTIME = 0xFFFFFF;++ /* configure MPLL */+ clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);++ /* some delay between MPLL and UPLL */+ delay (4000);++ /* configure UPLL */+ clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);++ /* some delay between MPLL and UPLL */+ delay (8000);++ /* set up the I/O ports */+ gpio->GPACON = 0x007FFFFF;+ gpio->GPBCON = 0x00044555;+ gpio->GPBUP = 0x000007FF;+ gpio->GPCCON = 0xAAAAAAAA;+ gpio->GPCUP = 0x0000FFFF;+ gpio->GPDCON = 0xAAAAAAAA;+ gpio->GPDUP = 0x0000FFFF;+ gpio->GPECON = 0xAAAAAAAA;+ gpio->GPEUP = 0x0000FFFF;+ gpio->GPFCON = 0x000055AA;+ gpio->GPFUP = 0x000000FF;+ gpio->GPGCON = 0xFD95FFBA;+ gpio->GPGUP = 0x0000FFFF;+#ifdef CONFIG_SERIAL3+ gpio->GPHCON = 0x002AAAAA;+#else+ gpio->GPHCON = 0x002AFAAA;+#endif+ gpio->GPHUP = 0x000007FF;++#if 0+ /* USB Device Part */+ /*GPGCON is reset for USB Device */+ gpio->GPGCON = (gpio->GPGCON & ~(3 << 24)) | (1 << 24); /* Output Mode */+ gpio->GPGUP = gpio->GPGUP | ( 1 << 12); /* Pull up disable */++ gpio->GPGDAT |= ( 1 << 12) ;+ gpio->GPGDAT &= ~( 1 << 12) ;+ udelay(20000);+ gpio->GPGDAT |= ( 1 << 12) ;+#endif++ /* arch number of SMDK2440-Board */+ gd->bd->bi_arch_number = MACH_TYPE_S3C2440;++ /* adress of boot parameters */+ gd->bd->bi_boot_params = 0x30000100;++ icache_enable();+ dcache_enable();++ return 0;+}++int dram_init (void)+{+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;++ return 0;+}++/* 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/smdk2443/u-boot.lds===================================================================--- /dev/null+++ u-boot/board/smdk2443/u-boot.lds@@ -0,0 +1,58 @@+/*+ * (C) Copyright 2002+ * Gary Jennejohn, DENX Software Engineering, <gj@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_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/+OUTPUT_ARCH(arm)+ENTRY(_start)+SECTIONS+{+ . = 0x00000000;++ . = ALIGN(4);+ .text :+ {+ cpu/arm920t/start.o (.text)+ cpu/arm920t/s3c24x0/nand_read.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 (NOLOAD) : { *(.bss) }+ _end = .;+}Index: u-boot/include/configs/smdk2443.h===================================================================--- /dev/null+++ u-boot/include/configs/smdk2443.h@@ -0,0 +1,290 @@+/*+ * (C) Copyright 2007 OpenMoko, Inc.+ * Author: Harald Welte <laforge@openmoko.org>+ *+ * Configuation settings for the SAMSUNG SMDK2443 board.+ *+ * 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++#if 0+/* If we want to start u-boot from usb bootloader in NOR flash */+#define CONFIG_SKIP_RELOCATE_UBOOT 1+#define CONFIG_SKIP_LOWLEVEL_INIT 1+#else+/* If we want to start u-boot directly from within NAND flash */+#define CONFIG_LL_INIT_NAND_ONLY+#define CONFIG_S3C2410_NAND_BOOT 1+#define CONFIG_S3C2410_NAND_SKIP_BAD 1+#endif++#define CFG_UBOOT_SIZE 0x40000 /* size of u-boot, for NAND loading */++/*+ * High Level Configuration Options+ * (easy to change)+ */+#define CONFIG_ARM920T 1 /* This is an ARM920T Core */+#define CONFIG_S3C2440 1 /* in a SAMSUNG S3C2440 SoC */+#define CONFIG_SMDK2443 1 /* on a SAMSUNG SMDK2440 Board */++/* input clock of PLL */+#define CONFIG_SYS_CLK_FREQ 16934400/* SMDK2440 has 16.9344MHz input clock */+++#define USE_920T_MMU 1+#define CONFIG_USE_IRQ 1++/*+ * Size of malloc() pool+ */+#define CFG_MALLOC_LEN (CFG_ENV_SIZE + 2048*1024)+#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */++/*+ * Hardware drivers+ */+#define CONFIG_DRIVER_CS8900 1 /* we have a CS8900 on-board */+#define CS8900_BASE 0x19000300+#define CS8900_BUS16 1 /* the Linux driver does accesses as shorts */++/*+ * select serial console configuration+ */+#define CONFIG_SERIAL1 1 /* we use SERIAL 1 on SMDK2440 */+#define CONFIG_HWFLOW 1++/************************************************************+ * RTC+ ************************************************************/+#define CONFIG_RTC_S3C24X0 1++/* allow to overwrite serial and ethaddr */+#define CONFIG_ENV_OVERWRITE++#define CONFIG_BAUDRATE 115200++/***********************************************************+ * Command definition+ ***********************************************************/+#include <config_cmd_default.h>++ /*CFG_CMD_BSP | */+#define CONFIG_CMD_CACHE+#define CONFIG_CMD_DATE+ /*CFG_CMD_DHCP | */+#define CONFIG_CMD_DIAG+#define CONFIG_CMD_ELF+#define CONFIG_CMD_EXT2+#define CONFIG_CMD_FAT+ /*CFG_CMD_HWFLOW | */+ /* CFG_CMD_IDE | */+ /* CFG_CMD_IRQ | */+#define CONFIG_CMD_JFFS2+#define CONFIG_CMD_MMC+#define CONFIG_CMD_NAND+#define CONFIG_CMD_PING+#define CONFIG_CMD_PORTIO+#define CONFIG_CMD_REGINFO+#define CONFIG_CMD_SAVES+#define CONFIG_CMD_LICENSE+#define CONFIG_CMD_USB++#define CONFIG_BOOTDELAY 3+#define CONFIG_BOOTARGS "root=/dev/mtdblock4 rootfstype=jffs2 console=ttySAC2,115200 loglevel=8"+#define CONFIG_ETHADDR 00:0c:20:02:0a:5b+#define CONFIG_NETMASK 255.255.255.0+#define CONFIG_IPADDR 192.168.1.100+#define CONFIG_SERVERIP 192.168.1.21+#define CONFIG_BOOTCOMMAND "nand read.e 0x32000000 0x100000 0x200000; bootm"++#define CONFIG_DOS_PARTITION 1++#if defined(CONFIG_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 */+#endif++/*+ * Miscellaneous configurable options+ */+#define CFG_LONGHELP /* undef to save memory */+#define CFG_PROMPT "SMDK2443 # " /* Monitor Command Prompt */+#define CFG_CBSIZE 256 /* Console I/O Buffer Size */+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */+#define CFG_MAXARGS 32 /* max number of command args */+#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */++#define CFG_MEMTEST_START 0x30000000 /* memtest works on */+#define CFG_MEMTEST_END 0x33F00000 /* 63 MB in DRAM */++#undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */++#define CFG_LOAD_ADDR 0x32000000 /* default load address */++/* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */+/* it to wrap 100 times (total 1562500) to get 1 sec. */+#define CFG_HZ 1562500++/* valid baudrates */+#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }++/*-----------------------------------------------------------------------+ * Stack sizes+ *+ * The stack sizes are set up in start.S using the settings below+ */+#define CONFIG_STACKSIZE (512*1024) /* regular stack */+#ifdef CONFIG_USE_IRQ+#define CONFIG_STACKSIZE_IRQ (8*1024) /* IRQ stack */+#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */+#endif++/* IDE/ATA config */++#if 0+#define CFG_IDE_MAXBUS 1+#define CFG_IDE_MAXDEVICE 2+#define CFG_IDE_PREINIT 0+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -