diff options
author | Ulf Samuelsson <ulf.samuelsson@atmel.com> | 2011-04-14 23:32:51 +0200 |
---|---|---|
committer | Ulf Samuelsson <ulf.samuelsson@atmel.com> | 2011-05-16 22:26:53 +0200 |
commit | 96d8032fd06d820307788b61655e1551e02ea790 (patch) | |
tree | 7c11f04c92a808183aea343317f0c69ba86fa9de /recipes/u-boot/u-boot-2009.11 | |
parent | f0560cb5ef6a44ee2cde8b7fb9d8e7018ef702be (diff) | |
download | openembedded-96d8032fd06d820307788b61655e1551e02ea790.tar.gz |
Improve SD-Card support in u-boot for AT91
Add "factory" command to reset to compile time defaults
Add "U-BOOT.BIN" target (Capital letters) for SD-Card boot
Add default environment for AT91SAM9M10/G45 SD-Card boot
Add new configs
at91sam9m10g45ek_sd_config
at91sam9g45ekes_sd_config
Add AT91BUILD build scripts
Add support for building multiple boards
If UBOOT_MACHINES is defined, and is a list of boards
UBOOT_MACHINES=" at91sam9260ek at91sam9261 "
then all machines in the list will be built.
If UBOOT_MACHINES is not defined, then u-boot will
be built using the default UBOOT_MACHINE.
UBOOT_MACHINE=" at91sam9260ek_config "
Note that boards in UBOOT_MACHINES are the boardname without "_config"
Signed-off-by: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Diffstat (limited to 'recipes/u-boot/u-boot-2009.11')
4 files changed, 348 insertions, 0 deletions
diff --git a/recipes/u-boot/u-boot-2009.11/at91/0001-Add-environment-size.patch b/recipes/u-boot/u-boot-2009.11/at91/0001-Add-environment-size.patch new file mode 100644 index 0000000000..0b1e938085 --- /dev/null +++ b/recipes/u-boot/u-boot-2009.11/at91/0001-Add-environment-size.patch @@ -0,0 +1,26 @@ +From 2fde0fc4d5e6e92d123286bb410f7a5e00edba91 Mon Sep 17 00:00:00 2001 +From: Ulf Samuelsson <ulf.samuelsson@atmel.com> +Date: Fri, 4 Feb 2011 08:21:43 +0100 +Subject: [PATCH 1/2] Add environment size + +--- + include/configs/at91sam9m10g45ek.h | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h +index 261d698..a3d854b 100644 +--- a/include/configs/at91sam9m10g45ek.h ++++ b/include/configs/at91sam9m10g45ek.h +@@ -234,6 +234,9 @@ + #endif /* CONFIG_SYS_USE_DATAFLASH */ + + #ifdef CONFIG_SYS_USE_SDCARD ++#define CONFIG_ENV_IS_NOWHERE ++#define CONFIG_ENV_SIZE 0x4200 ++#define CONFIG_ENV_SECT_SIZE 0x420 + #define CONFIG_SYS_ROOTFS_SD 1 + #define CONFIG_EXTRA_ENV_SETTINGS \ + "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \ +-- +1.6.3.3 + diff --git a/recipes/u-boot/u-boot-2009.11/at91/0016-SupportEnv-load-from-SD-Card.patch b/recipes/u-boot/u-boot-2009.11/at91/0016-SupportEnv-load-from-SD-Card.patch new file mode 100644 index 0000000000..a5e9ddf6c8 --- /dev/null +++ b/recipes/u-boot/u-boot-2009.11/at91/0016-SupportEnv-load-from-SD-Card.patch @@ -0,0 +1,126 @@ +diff -urN u-boot-2009.11/common/cmd_factory.c u-boot-2009.11-OK/common/cmd_factory.c +--- u-boot-2009.11/common/cmd_factory.c 1970-01-01 01:00:00.000000000 +0100 ++++ u-boot-2009.11-OK/common/cmd_factory.c 2010-09-26 21:39:09.000000000 +0200 +@@ -0,0 +1,46 @@ ++/* ++ * (C) Copyright 2010 ++ * Ulf Samuelsson <ulf.samuelsson@atmel.com> ++ * ++ * 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 <command.h> ++#include <debug.h> ++ ++#undef DEBUG ++#if defined(DEBUG) ++#define pr_debug(fmt, args...) printf(fmt, ##args) ++#else ++#define pr_debug(...) do { } while(0) ++#endif ++ ++extern set_default_env(void); ++int do_factory (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ++{ ++ set_default_env(); ++ return 0; ++} ++ ++U_BOOT_CMD( ++ factory, 1, 0, do_factory, ++ "factory\t- set factory default environment\n", ++ "\n" ++); +diff -urN u-boot-2009.11/common/Makefile u-boot-2009.11-OK/common/Makefile +--- u-boot-2009.11/common/Makefile 2011-01-26 01:26:46.000000000 +0100 ++++ u-boot-2009.11-OK/common/Makefile 2010-09-26 21:27:30.000000000 +0200 +@@ -88,6 +88,7 @@ + COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o + COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o + COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o ++COBJS-$(CONFIG_CMD_FACTORY) += cmd_factory.o + COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o + COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o + COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o +diff -urN u-boot-2009.11/include/configs/at91sam9m10g45ek.h u-boot-2009.11-OK/include/configs/at91sam9m10g45ek.h +--- u-boot-2009.11/include/configs/at91sam9m10g45ek.h 2011-01-26 01:26:46.000000000 +0100 ++++ u-boot-2009.11-OK/include/configs/at91sam9m10g45ek.h 2011-01-15 23:18:18.000000000 +0100 +@@ -28,6 +28,7 @@ + #define __CONFIG_H + #define CONFIG_CMD_DEBUG 1 + #define CONFIG_SYS_ROOTFS_SD 1 ++#define CONFIG_CMD_FACTORY 1 + /* ARM asynchronous clock */ + #define AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */ + #define CONFIG_SYS_HZ 1000 +@@ -105,6 +106,8 @@ + #define CONFIG_CMD_FAT + #undef CONFIG_CMD_JFFS2 + #define CONFIG_CMD_MMC ++#define CONFIG_CMD_AUTOSCRIPT ++ + #define CONFIG_CMD_PING 1 + #define CONFIG_CMD_DHCP 1 + #define CONFIG_CMD_NAND 1 +@@ -219,9 +222,19 @@ + #endif + + #ifdef CONFIG_SYS_ROOTFS_SD +-#define CONFIG_BOOTCOMMAND "mmc init; fatload mmc 1:1 0x72000000 uImage; bootm 0x72000000" +-#define CONFIG_BOOTARGS "console=ttyS0,115200 " \ +- "root=/dev/mmcblk1p2 " \ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \ ++ "load_kernel=fatload mmc 0:1 0x72000000 uimage\0" \ ++ "at91sam9m10ekes=9cd\0" \ ++ "at91sam9g45ekes=8a4\0" \ ++ "at91sam9m10g45ek=726\0" \ ++ "machid=726\0" ++ ++ ++#define CONFIG_BOOTCOMMAND "mmc init; run load_env ; run load_kernel ; bootm 0x72000000" ++#define CONFIG_BOOTARGS "mem=128M " \ ++ "console=ttyS0,115200 " \ ++ "root=/dev/mmcblk0p2 " \ + "rootdelay=2 "\ + "rootfstype=rootfs rw" + #endif +diff -urN u-boot-2009.11/Makefile u-boot-2009.11-OK/Makefile +--- u-boot-2009.11/Makefile 2011-01-26 01:26:46.000000000 +0100 ++++ u-boot-2009.11-OK/Makefile 2010-09-26 21:46:35.000000000 +0200 +@@ -295,7 +295,7 @@ + ######################################################################### + + # Always append ALL so that arch config.mk's can add custom ones +-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND) $(U_BOOT_ONENAND) ++ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)U-BOOT.BIN $(obj)System.map $(U_BOOT_NAND) $(U_BOOT_ONENAND) + + all: $(ALL) + +@@ -308,6 +308,9 @@ + $(obj)u-boot.bin: $(obj)u-boot + $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + ++$(obj)U-BOOT.BIN: $(obj)u-boot ++ $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ ++ + $(obj)u-boot.ldr: $(obj)u-boot + $(obj)tools/envcrc --binary > $(obj)env-ldr.o + $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS) diff --git a/recipes/u-boot/u-boot-2009.11/at91/0017-SD-Card-boot-patch-for-SAM9M10-G45.patch b/recipes/u-boot/u-boot-2009.11/at91/0017-SD-Card-boot-patch-for-SAM9M10-G45.patch new file mode 100644 index 0000000000..2a16a125b5 --- /dev/null +++ b/recipes/u-boot/u-boot-2009.11/at91/0017-SD-Card-boot-patch-for-SAM9M10-G45.patch @@ -0,0 +1,151 @@ +From d3fa929dc47c3c4273eefd381f619d9892ff8685 Mon Sep 17 00:00:00 2001 +From: Ulf Samuelsson <ulf.samuelsson@atmel.com> +Date: Fri, 4 Feb 2011 07:30:16 +0100 +Subject: [PATCH] SD-Card boot patch for SAM9M10/G45 + +--- + Makefile | 7 ++++++- + include/configs/at91sam9m10g45ek.h | 34 ++++++++++++++++++++-------------- + 2 files changed, 26 insertions(+), 15 deletions(-) + +diff --git a/Makefile b/Makefile +index 0857fa4..2db49be 100644 +--- a/Makefile ++++ b/Makefile +@@ -2862,13 +2862,15 @@ pm9261_config : unconfig + at91sam9m10g45ek_nandflash_config \ + at91sam9m10g45ek_dataflash_config \ + at91sam9m10g45ek_dataflash_cs0_config \ ++at91sam9m10g45ek_sd_config \ + at91sam9m10g45ek_config \ + at91sam9g45ekes_nandflash_config \ + at91sam9g45ekes_dataflash_config \ + at91sam9g45ekes_dataflash_cs0_config \ ++at91sam9g45ekes_sd_config \ + at91sam9g45ekes_config : unconfig + @mkdir -p $(obj)include +- @if [ "$(findstring 9m10,$@)" ] ; then \ ++ @if [ "$(findstring 9m10,$@)" ] ; then \ + echo "#define CONFIG_AT91SAM9M10G45EK 1" >>$(obj)include/config.h ; \ + $(XECHO) "... 9M10G45 Variant" ; \ + else \ +@@ -2878,6 +2880,9 @@ at91sam9g45ekes_config : unconfig + @if [ "$(findstring _nandflash,$@)" ] ; then \ + echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ + $(XECHO) "... with environment variable in NAND FLASH" ; \ ++ elif [ "$(findstring _sd,$@)" ] ; then \ ++ echo "#define CONFIG_SYS_USE_SDCARD 1" >>$(obj)include/config.h ; \ ++ $(XECHO) "... with environment variables on an SD-Card" ; \ + else \ + echo "#define CONFIG_SYS_USE_DATAFLASH 1" >>$(obj)include/config.h ; \ + $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ +diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h +index 1d29067..261d698 100644 +--- a/include/configs/at91sam9m10g45ek.h ++++ b/include/configs/at91sam9m10g45ek.h +@@ -26,9 +26,7 @@ + + #ifndef __CONFIG_H + #define __CONFIG_H +-#define CONFIG_CMD_DEBUG 1 +-#define CONFIG_SYS_ROOTFS_SD 1 +-#define CONFIG_CMD_FACTORY 1 ++ + /* ARM asynchronous clock */ + #define AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */ + #define CONFIG_SYS_HZ 1000 +@@ -113,6 +111,9 @@ + #define CONFIG_CMD_NAND 1 + #define CONFIG_CMD_USB 1 + ++#define CONFIG_CMD_DEBUG 1 ++#define CONFIG_CMD_FACTORY 1 ++ + /* MCI */ + #define MMCI_BASE AT91SAM9G45_BASE_MCI0 + #define CONFIG_MMC 1 +@@ -206,7 +207,7 @@ + #define CONFIG_SYS_MEMTEST_END PHYS_SDRAM + PHYS_SDRAM_SIZE + + #ifdef CONFIG_SYS_USE_DATAFLASH +- ++#define CONFIG_SYS_ROOTFS_NAND 1 + /* bootstrap + u-boot + env + linux in dataflash on CS0 */ + #define CONFIG_ENV_IS_IN_DATAFLASH 1 + /* #define CONFIG_ENV_IS_IN_SPI_FLASH 1 */ +@@ -219,9 +220,21 @@ + #else + #define CONFIG_ENV_SIZE 0x420 + #define CONFIG_ENV_SECT_SIZE 0x420 ++ ++#ifdef CONFIG_SYS_ROOTFS_NAND ++#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x72000000 0x290000; bootm 0x72000000" ++#define CONFIG_BOOTARGS "console=ttyS0,115200 " \ ++ "root=/dev/mtdblock1 " \ ++ "mtdparts=atmel_nand:4M(unused)ro,-(root) "\ ++ "rw rootfstype=jffs2" ++#endif ++ + #endif + +-#ifdef CONFIG_SYS_ROOTFS_SD ++#endif /* CONFIG_SYS_USE_DATAFLASH */ ++ ++#ifdef CONFIG_SYS_USE_SDCARD ++#define CONFIG_SYS_ROOTFS_SD 1 + #define CONFIG_EXTRA_ENV_SETTINGS \ + "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \ + "load_kernel=fatload mmc 0:1 0x72000000 uimage\0" \ +@@ -239,16 +252,9 @@ + "rootfstype=rootfs rw" + #endif + +-#ifdef CONFIG_SYS_ROOTFS_NAND +-#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x72000000 0x290000; bootm 0x72000000" +-#define CONFIG_BOOTARGS "console=ttyS0,115200 " \ +- "root=/dev/mtdblock1 " \ +- "mtdparts=atmel_nand:4M(unused)ro,-(root) "\ +- "rw rootfstype=jffs2" +-#endif + + +-#else /* CONFIG_SYS_USE_NANDFLASH */ ++#ifdef CONFIG_SYS_USE_NANDFLASH + + /* bootstrap + u-boot + env + linux in nandflash */ + #define CONFIG_ENV_IS_IN_NAND 1 +@@ -263,7 +269,7 @@ + 2M(linux),-(root) " \ + "rw rootfstype=jffs2" + +-#endif ++#endif /* CONFIG_SYS_USE_NANDFLASH */ + + #define CONFIG_BAUDRATE 115200 + #define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 } +From 2fde0fc4d5e6e92d123286bb410f7a5e00edba91 Mon Sep 17 00:00:00 2001 +From: Ulf Samuelsson <ulf.samuelsson@atmel.com> +Date: Fri, 4 Feb 2011 08:21:43 +0100 +Subject: [PATCH 1/2] Add environment size + +--- + include/configs/at91sam9m10g45ek.h | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h +index 261d698..a3d854b 100644 +--- a/include/configs/at91sam9m10g45ek.h ++++ b/include/configs/at91sam9m10g45ek.h +@@ -234,6 +234,9 @@ + #endif /* CONFIG_SYS_USE_DATAFLASH */ + + #ifdef CONFIG_SYS_USE_SDCARD ++#define CONFIG_ENV_IS_NOWHERE ++#define CONFIG_ENV_SIZE 0x4200 ++#define CONFIG_ENV_SECT_SIZE 0x420 + #define CONFIG_SYS_ROOTFS_SD 1 + #define CONFIG_EXTRA_ENV_SETTINGS \ + "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \ +-- +1.6.3.3 + diff --git a/recipes/u-boot/u-boot-2009.11/at91/0018-ADD-AT91-Build-script.patch b/recipes/u-boot/u-boot-2009.11/at91/0018-ADD-AT91-Build-script.patch new file mode 100644 index 0000000000..d6b8fcb211 --- /dev/null +++ b/recipes/u-boot/u-boot-2009.11/at91/0018-ADD-AT91-Build-script.patch @@ -0,0 +1,45 @@ +From 6d57c07c8335af032b70396aa10f817bdaedf8ce Mon Sep 17 00:00:00 2001 +From: Ulf Samuelsson <ulf.samuelsson@atmel.com> +Date: Fri, 4 Feb 2011 08:22:21 +0100 +Subject: [PATCH 2/2] ADD AT91 Build script + +--- + AT91BUILD | 26 ++++++++++++++++++++++++++ + 1 files changed, 26 insertions(+), 0 deletions(-) + create mode 100755 AT91BUILD + +diff --git a/AT91BUILD b/AT91BUILD +new file mode 100755 +index 0000000..c138bd1 +--- /dev/null ++++ b/AT91BUILD +@@ -0,0 +1,26 @@ ++#!/bin/sh ++ ++GCCROOT=~/projects/OE_atmel/build/tmp/sysroots/i686-linux/usr/armv5te/bin ++PATH=${GCCROOT}:${PATH} ++CROSS_COMPILE=${GCCROOT}/arm-angstrom-linux-gnueabi- ++mkdir -p binaries ++ ++build ( ) ++{ ++ FLAGS="-j 2 CROSS_COMPILE=${CROSS_COMPILE} O=binaries/$1" ++ mkdir -p binaries/$1 ++ make ${FLAGS} distclean ++ make ${FLAGS} $1_config ++ make ${FLAGS} all ++} ++ ++build at91sam9m10g45ek_nandflash ++build at91sam9m10g45ek_dataflash ++build at91sam9m10g45ek_dataflash_cs0 ++build at91sam9m10g45ek_sd ++build at91sam9m10g45ek ++build at91sam9g45ekes_nandflash ++build at91sam9g45ekes_dataflash ++build at91sam9g45ekes_dataflash_cs0 ++build at91sam9g45ekes_sd ++build at91sam9g45ekes +-- +1.6.3.3 + |