u-boot git: update beagleboard patches
authorJason Kridner <jkridner@beagleboard.org>
Sun, 6 Jun 2010 01:38:34 +0000 (20:38 -0500)
committerKoen Kooi <koen@openembedded.org>
Sun, 6 Jun 2010 07:52:45 +0000 (09:52 +0200)
recipes/u-boot/u-boot-git/beagleboard/0001-OMAP-mmc-add-support-for-second-and-third-mmc-chan.patch [new file with mode: 0644]
recipes/u-boot/u-boot-git/beagleboard/0001-OMAP3-Beagle-enable-support-for-second-and-third-m.patch [new file with mode: 0644]
recipes/u-boot/u-boot-git/beagleboard/0038-BeagleBoard-Added-LED-driver.patch [new file with mode: 0644]
recipes/u-boot/u-boot-git/beagleboard/0039-Add-led-command.patch [new file with mode: 0644]
recipes/u-boot/u-boot-git/beagleboard/0040-BeagleBoard-Check-for-ramdisk-on-boot.patch [new file with mode: 0644]
recipes/u-boot/u-boot-git/beagleboard/0041-BeagleBoard-Enabled-LEDs.patch [new file with mode: 0644]
recipes/u-boot/u-boot-git/beagleboard/0042-BeagleBoard-New-command-for-status-of-USER-button.patch [new file with mode: 0644]
recipes/u-boot/u-boot-git/beagleboard/0043-BeagleBoard-Add-CONFIG_SYS_MEMTEST_SCRATCH.patch [new file with mode: 0644]
recipes/u-boot/u-boot_git.bb

diff --git a/recipes/u-boot/u-boot-git/beagleboard/0001-OMAP-mmc-add-support-for-second-and-third-mmc-chan.patch b/recipes/u-boot/u-boot-git/beagleboard/0001-OMAP-mmc-add-support-for-second-and-third-mmc-chan.patch
new file mode 100644 (file)
index 0000000..2bda1bc
--- /dev/null
@@ -0,0 +1,126 @@
+From 7252b81ec10aea48672f66e33cb6962b98fb0782 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Thu, 29 Apr 2010 10:28:14 -0700
+Subject: [PATCH] OMAP: mmc: add support for second and third mmc channels
+
+Boards wishing to use this feature should define CONFIG_SYS_MMC_SET_DEV
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ drivers/mmc/omap3_mmc.c                   |   39 +++++++++++++++++++++++++++-
+ include/asm-arm/arch-omap3/mmc_host_def.h |   15 +++++++++--
+ 2 files changed, 49 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/mmc/omap3_mmc.c b/drivers/mmc/omap3_mmc.c
+index 96c0e65..bf650ba 100644
+--- a/drivers/mmc/omap3_mmc.c
++++ b/drivers/mmc/omap3_mmc.c
+@@ -52,7 +52,27 @@ const unsigned short mmc_transspeed_val[15][4] = {
+ mmc_card_data cur_card_data;
+ static block_dev_desc_t mmc_blk_dev;
+-static hsmmc_t *mmc_base = (hsmmc_t *)OMAP_HSMMC_BASE;
++static hsmmc_t *mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
++
++unsigned char mmc_set_dev(int dev)
++{
++      switch (dev) {
++      case 1:
++              mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
++              break;
++      case 2:
++              mmc_base = (hsmmc_t *)OMAP_HSMMC2_BASE;
++              break;
++      case 3:
++              mmc_base = (hsmmc_t *)OMAP_HSMMC3_BASE;
++              break;
++      default:
++              mmc_base = (hsmmc_t *)OMAP_HSMMC1_BASE;
++              return 1;
++      }
++
++      return 0;
++}
+ block_dev_desc_t *mmc_get_dev(int dev)
+ {
+@@ -62,6 +82,7 @@ block_dev_desc_t *mmc_get_dev(int dev)
+ unsigned char mmc_board_init(void)
+ {
+       t2_t *t2_base = (t2_t *)T2_BASE;
++      struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+ #if defined(CONFIG_TWL4030_POWER)
+       twl4030_power_mmc_init();
+@@ -74,6 +95,17 @@ unsigned char mmc_board_init(void)
+       writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
+               &t2_base->devconf0);
++      writel(readl(&t2_base->devconf1) | MMCSDIO2ADPCLKISEL,
++              &t2_base->devconf1);
++
++      writel(readl(&prcm_base->fclken1_core) | 
++              EN_MMC1 | EN_MMC2 | EN_MMC3,
++              &prcm_base->fclken1_core);
++
++      writel(readl(&prcm_base->iclken1_core) | 
++              EN_MMC1 | EN_MMC2 | EN_MMC3,
++              &prcm_base->iclken1_core);
++
+       return 1;
+ }
+@@ -512,8 +544,11 @@ unsigned long mmc_bread(int dev_num, unsigned long blknr, lbaint_t blkcnt,
+       return 1;
+ }
+-int mmc_legacy_init(int verbose)
++int mmc_legacy_init(int dev)
+ {
++      if (mmc_set_dev(dev) != 0)
++              return 1;
++
+       if (configure_mmc(&cur_card_data) != 1)
+               return 1;
+diff --git a/include/asm-arm/arch-omap3/mmc_host_def.h b/include/asm-arm/arch-omap3/mmc_host_def.h
+index aa751c9..43dd705 100644
+--- a/include/asm-arm/arch-omap3/mmc_host_def.h
++++ b/include/asm-arm/arch-omap3/mmc_host_def.h
+@@ -29,13 +29,20 @@
+ #define T2_BASE                       0x48002000
+ typedef struct t2 {
+-      unsigned char res1[0x274];
++      unsigned char res1[0x274];      /* 0x000 */
+       unsigned int devconf0;          /* 0x274 */
+-      unsigned char res2[0x2A8];
++      unsigned char res2[0x060];      /* 0x278 */
++      unsigned int devconf1;          /* 0x2D8 */
++      unsigned char res3[0x244];      /* 0x2DC */
+       unsigned int pbias_lite;        /* 0x520 */
+ } t2_t;
+ #define MMCSDIO1ADPCLKISEL            (1 << 24)
++#define MMCSDIO2ADPCLKISEL            (1 << 6)
++
++#define EN_MMC1                               (1 << 24)
++#define EN_MMC2                               (1 << 25)
++#define EN_MMC3                               (1 << 30)
+ #define PBIASLITEPWRDNZ0              (1 << 1)
+ #define PBIASSPEEDCTRL0                       (1 << 2)
+@@ -44,7 +51,9 @@ typedef struct t2 {
+ /*
+  * OMAP HSMMC register definitions
+  */
+-#define OMAP_HSMMC_BASE               0x4809C000
++#define OMAP_HSMMC1_BASE      0x4809C000
++#define OMAP_HSMMC2_BASE      0x480B4000
++#define OMAP_HSMMC3_BASE      0x480AD000
+ typedef struct hsmmc {
+       unsigned char res1[0x10];
+-- 
+1.5.6.4
+
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0001-OMAP3-Beagle-enable-support-for-second-and-third-m.patch b/recipes/u-boot/u-boot-git/beagleboard/0001-OMAP3-Beagle-enable-support-for-second-and-third-m.patch
new file mode 100644 (file)
index 0000000..21f1f13
--- /dev/null
@@ -0,0 +1,56 @@
+From 629a01965677e680ffa1fe76579ace7f69dd45b9 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Fri, 7 May 2010 07:40:26 -0700
+Subject: [PATCH] OMAP3: Beagle: enable support for second and third mmc channels
+
+Based on 629a01965677e680ffa1fe76579ace7f69dd45b9, but removed BOOTDELAY change.
+
+---
+ include/configs/omap3_beagle.h |   8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index f2d0f53..74d4159 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -95,6 +95,7 @@
+                                       115200}
+ #define CONFIG_MMC                    1
+ #define CONFIG_OMAP3_MMC              1
++#define CONFIG_SYS_MMC_SET_DEV                1
+ #define CONFIG_DOS_PARTITION          1
+ /* DDR - I use Micron DDR */
+@@ -186,6 +187,7 @@
+       "vram=12M\0" \
+       "dvimode=1024x768MR-16@60\0" \
+       "defaultdisplay=dvi\0" \
++      "mmcdev=1\0" \
+       "mmcroot=/dev/mmcblk0p2 rw\0" \
+       "mmcrootfstype=ext3 rootwait\0" \
+       "nandroot=/dev/mtdblock4 rw\0" \
+@@ -204,10 +206,10 @@
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype}\0" \
+-      "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
++      "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+-      "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
++      "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+       "mmcboot=echo Booting from mmc ...; " \
+               "run mmcargs; " \
+               "bootm ${loadaddr}\0" \
+@@ -217,7 +219,7 @@
+               "bootm ${loadaddr}\0" \
+ #define CONFIG_BOOTCOMMAND \
+-      "if mmc init; then " \
++      "if mmc init ${mmcdev}; then " \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+-- 
+1.5.6.4
+
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0038-BeagleBoard-Added-LED-driver.patch b/recipes/u-boot/u-boot-git/beagleboard/0038-BeagleBoard-Added-LED-driver.patch
new file mode 100644 (file)
index 0000000..74ee4e3
--- /dev/null
@@ -0,0 +1,164 @@
+From 157b125b905b6dc69164d3f43eeb5e40d3744648 Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Thu, 20 May 2010 06:14:01 -0500
+Subject: [PATCH] BeagleBoard: Added LED driver
+
+Added LED driver using status_led.  USR0 is set to monitor the boot
+status.  USR1 is set to be the green LED.
+(cherry picked from commit 048b526fd7cc0c642f27c674b3e235321c880b66)
+(cherry picked from commit 21c574d9e20f86ab757f5efdd9146e6607f2faba)
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ board/ti/beagle/Makefile |    4 ++-
+ board/ti/beagle/beagle.c |    8 ++++
+ board/ti/beagle/led.c    |   91 ++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 102 insertions(+), 1 deletions(-)
+ create mode 100644 board/ti/beagle/led.c
+
+diff --git a/board/ti/beagle/Makefile b/board/ti/beagle/Makefile
+index f797112..4cc675c 100644
+--- a/board/ti/beagle/Makefile
++++ b/board/ti/beagle/Makefile
+@@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk
+ LIB   = $(obj)lib$(BOARD).a
+-COBJS := beagle.o
++COBJS-y       := $(BOARD).o
++COBJS-$(CONFIG_STATUS_LED) += led.o
++COBJS := $(sort $(COBJS-y))
+ SRCS  := $(COBJS:.o=.c)
+ OBJS  := $(addprefix $(obj),$(COBJS))
+diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
+index 556e995..d21b9c8 100644
+--- a/board/ti/beagle/beagle.c
++++ b/board/ti/beagle/beagle.c
+@@ -30,6 +30,9 @@
+  * MA 02111-1307 USA
+  */
+ #include <common.h>
++#ifdef CONFIG_STATUS_LED
++#include <status_led.h>
++#endif
+ #include <twl4030.h>
+ #include <asm/io.h>
+ #include <asm/arch/mux.h>
+@@ -83,6 +86,10 @@ int board_init(void)
+       /* boot param addr */
+       gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
++#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
++      status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
++#endif
++
+       return 0;
+ }
+@@ -278,3 +285,4 @@ void set_muxconf_regs(void)
+ {
+       MUX_BEAGLE();
+ }
++
+diff --git a/board/ti/beagle/led.c b/board/ti/beagle/led.c
+new file mode 100644
+index 0000000..df26552
+--- /dev/null
++++ b/board/ti/beagle/led.c
+@@ -0,0 +1,91 @@
++/*
++ * Copyright (c) 2010 Texas Instruments, Inc.
++ * Jason Kridner <jkridner@beagleboard.org>
++ *
++ * 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 <status_led.h>
++#include <asm/arch/cpu.h>
++#include <asm/io.h>
++#include <asm/arch/sys_proto.h>
++#include <asm/arch/gpio.h>
++
++static unsigned int saved_state[2] = {STATUS_LED_OFF, STATUS_LED_OFF};
++
++/* GPIO pins for the LEDs */
++#define BEAGLE_LED_USR0       149
++#define BEAGLE_LED_USR1       150
++
++#ifdef STATUS_LED_GREEN
++void green_LED_off (void)
++{
++      __led_set (STATUS_LED_GREEN, 0);
++}
++
++void green_LED_on (void)
++{
++      __led_set (STATUS_LED_GREEN, 1);
++}
++#endif
++
++void __led_init (led_id_t mask, int state)
++{
++      __led_set (mask, state);
++}
++
++void __led_toggle (led_id_t mask)
++{
++#ifdef STATUS_LED_BIT
++      if (STATUS_LED_BIT & mask) {
++              if (STATUS_LED_ON == saved_state[0])
++                      __led_set(STATUS_LED_BIT, 0);
++              else
++                      __led_set(STATUS_LED_BIT, 1);
++      }
++#endif
++#ifdef STATUS_LED_BIT1
++      if (STATUS_LED_BIT1 & mask) {
++              if (STATUS_LED_ON == saved_state[1])
++                      __led_set(STATUS_LED_BIT1, 0);
++              else
++                      __led_set(STATUS_LED_BIT1, 1);
++      }
++#endif
++}
++
++void __led_set (led_id_t mask, int state)
++{
++#ifdef STATUS_LED_BIT
++      if (STATUS_LED_BIT & mask) {
++              if (!omap_request_gpio(BEAGLE_LED_USR0)) {
++                      omap_set_gpio_direction(BEAGLE_LED_USR0, 0);
++                      omap_set_gpio_dataout(BEAGLE_LED_USR0, state);
++              }
++              saved_state[0] = state;
++      }
++#endif
++#ifdef STATUS_LED_BIT1
++      if (STATUS_LED_BIT1 & mask) {
++              if (!omap_request_gpio(BEAGLE_LED_USR1)) {
++                      omap_set_gpio_direction(BEAGLE_LED_USR1, 0);
++                      omap_set_gpio_dataout(BEAGLE_LED_USR1, state);
++              }
++              saved_state[1] = state;
++      }
++#endif
++}
++
+-- 
+1.5.6.4
+
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0039-Add-led-command.patch b/recipes/u-boot/u-boot-git/beagleboard/0039-Add-led-command.patch
new file mode 100644 (file)
index 0000000..6adbe2f
--- /dev/null
@@ -0,0 +1,256 @@
+From 609524ecd54526b3f3c7d52cc43a3c9795970f6b Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Thu, 20 May 2010 05:41:26 -0500
+Subject: [PATCH] Add 'led' command
+
+This patch allows any board implementing the coloured LED API
+to control the LEDs from the console.
+
+led [green | yellow | red | all ]  [ on | off ]
+
+or
+
+led [ 1 | 2 | 3 | all ]  [ on | off ]
+
+Adds configuration item CONFIG_CMD_LED enabling the command.
+
+Partially based on patch from Ulf Samuelsson:
+http://www.mail-archive.com/u-boot@lists.denx.de/msg09593.html.
+(cherry picked from commit aaf47f8d6af81393b7d3275d69b5dbdf07a3d6fb)
+(cherry picked from commit 3d314bf59a48c2ee93d06d50b81f109af6a6c1ec)
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ common/Makefile  |    1 +
+ common/cmd_led.c |  207 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 208 insertions(+), 0 deletions(-)
+ create mode 100644 common/cmd_led.c
+
+diff --git a/common/Makefile b/common/Makefile
+index dbf7a05..1d717ca 100644
+--- a/common/Makefile
++++ b/common/Makefile
+@@ -106,6 +106,7 @@ COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
+ COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
+ COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
+ COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o
++COBJS-$(CONFIG_CMD_LED) += cmd_led.o
+ COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
+ COBJS-y += cmd_load.o
+ COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
+diff --git a/common/cmd_led.c b/common/cmd_led.c
+new file mode 100644
+index 0000000..3b7b534
+--- /dev/null
++++ b/common/cmd_led.c
+@@ -0,0 +1,207 @@
++/*
++ * (C) Copyright 2010
++ * Jason Kridner <jkridner@beagleboard.org>
++ *
++ * Based on cmd_led.c patch from:
++ * http://www.mail-archive.com/u-boot@lists.denx.de/msg06873.html
++ * (C) Copyright 2008
++ * 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
++ */
++
++/*
++ * This file provides a shell like 'test' function to return
++ * true/false from an integer or string compare of two memory
++ * locations or a location and a scalar/literal.
++ * A few parts were lifted from bash 'test' command
++ */
++
++#include <common.h>
++#include <config.h>
++#include <command.h>
++#include <status_led.h>
++
++int do_led ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
++{
++#ifdef CONFIG_BOARD_SPECIFIC_LED
++      led_id_t mask;
++#endif
++      int state;
++
++      /* Validate arguments */
++      if ((argc != 3)){
++              printf("Usage:\n%s\n", cmdtp->usage);
++              return 1;
++      }
++
++      if (strcmp(argv[2], "off") == 0) {
++              state = 0;
++      } else if (strcmp(argv[2], "on") == 0) {
++              state = 1;
++      } else {
++              printf ("Usage:\n%s\n", cmdtp->usage);
++              return 1;
++      }
++
++#if defined(STATUS_LED_BIT) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      if (strcmp(argv[1], "0") == 0) {
++              mask = STATUS_LED_BIT;
++              __led_set(mask, state);
++      }
++      else
++#endif
++#if defined(STATUS_LED_BIT1) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      if (strcmp(argv[1], "1") == 0) {
++              mask = STATUS_LED_BIT1;
++              __led_set(mask, state);
++      }
++      else
++#endif
++#if defined(STATUS_LED_BIT2) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      if (strcmp(argv[1], "2") == 0) {
++              mask = STATUS_LED_BIT2;
++              __led_set(mask, state);
++      }
++      else
++#endif
++#if defined(STATUS_LED_BIT3) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      if (strcmp(argv[1], "3") == 0) {
++              mask = STATUS_LED_BIT3;
++              __led_set(mask, state);
++      }
++      else
++#endif
++#ifdef STATUS_LED_RED
++      if (strcmp(argv[1], "red") == 0) {
++              if (state == 0)
++                      red_LED_off();
++              else
++                      red_LED_on();
++      }
++      else
++#endif
++#ifdef STATUS_LED_GREEN
++      if (strcmp(argv[1], "green") == 0) {
++              if (state == 0)
++                      green_LED_off();
++              else
++                      green_LED_on();
++      }
++      else
++#endif
++#ifdef STATUS_LED_YELLOW
++      if (strcmp(argv[1], "yellow") == 0) {
++              if (state == 0)
++                      yellow_LED_off();
++              else
++                      yellow_LED_on();
++      }
++      else
++#endif
++#ifdef STATUS_LED_BLUE
++      if (strcmp(argv[1], "blue") == 0) {
++              if (state == 0)
++                      blue_LED_off();
++              else
++                      blue_LED_on();
++      }
++      else
++#endif
++      if (strcmp(argv[1], "all") == 0) {
++              mask = 0
++#if defined(STATUS_LED_BIT) && defined(CONFIG_BOARD_SPECIFIC_LED)
++                      | STATUS_LED_BIT
++#endif
++#if defined(STATUS_LED_BIT1) && defined(CONFIG_BOARD_SPECIFIC_LED)
++                      | STATUS_LED_BIT1
++#endif
++#if defined(STATUS_LED_BIT2) && defined(CONFIG_BOARD_SPECIFIC_LED)
++                      | STATUS_LED_BIT2
++#endif
++#if defined(STATUS_LED_BIT3) && defined(CONFIG_BOARD_SPECIFIC_LED)
++                      | STATUS_LED_BIT3
++#endif
++                      ;
++#ifdef CONFIG_BOARD_SPECIFIC_LED
++              __led_set(mask, state);
++#endif
++#ifdef STATUS_LED_RED
++              if (state == 0)
++                      red_LED_off();
++              else
++                      red_LED_on();
++#endif
++#ifdef STATUS_LED_GREEN
++              if (state == 0)
++                      green_LED_off();
++              else
++                      green_LED_on();
++#endif
++#ifdef STATUS_LED_YELLOW
++              if (state == 0)
++                      yellow_LED_off();
++              else
++                      yellow_LED_on();
++#endif
++#ifdef STATUS_LED_BLUE
++              if (state == 0)
++                      blue_LED_off();
++              else
++                      blue_LED_on();
++#endif
++      } else {
++              printf ("Usage:\n%s\n", cmdtp->usage);
++              return 1;
++      }
++
++      return 0;
++}
++
++U_BOOT_CMD(
++      led, 3, 1, do_led,
++      "led\t- ["
++#if defined(STATUS_LED_BIT) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      "0|"
++#endif
++#if defined(STATUS_LED_BIT1) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      "1|"
++#endif
++#if defined(STATUS_LED_BIT2) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      "2|"
++#endif
++#if defined(STATUS_LED_BIT3) && defined(CONFIG_BOARD_SPECIFIC_LED)
++      "3|"
++#endif
++#ifdef STATUS_LED_GREEN
++      "green|"
++#endif
++#ifdef STATUS_LED_YELLOW
++      "yellow|"
++#endif
++#ifdef STATUS_LED_RED
++      "red|"
++#endif
++#ifdef STATUS_LED_BLUE
++      "blue|"
++#endif
++      "all] [on|off]\n",
++      "led [led_name] [on|off] sets or clears led(s)\n"
++);
++
+-- 
+1.5.6.4
+
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0040-BeagleBoard-Check-for-ramdisk-on-boot.patch b/recipes/u-boot/u-boot-git/beagleboard/0040-BeagleBoard-Check-for-ramdisk-on-boot.patch
new file mode 100644 (file)
index 0000000..c3ba38f
--- /dev/null
@@ -0,0 +1,97 @@
+From bfeec530621dd8b30d81917abe94c3c55eed0fba Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Wed, 2 Jun 2010 18:27:38 -0500
+Subject: [PATCH] BeagleBoard: Check for ramdisk on boot
+
+To simplify booting into various boot configurations, there is now a
+test for an existing ramdisk.gz image if loading the boot script fails.
+
+Adding additional boot arguments can also be done using optargs.
+
+(cherry picked from commit e96988f27cfa51f353ae4f678c59445deb161c5e)
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ include/configs/omap3_beagle.h |   29 ++++++++++++++++++++++++++---
+ 1 files changed, 26 insertions(+), 3 deletions(-)
+
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index acca697..c2fc6ba 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -181,9 +181,12 @@
+ #define CONFIG_BOOTDELAY              3
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+-      "loadaddr=0x82000000\0" \
++      "loadaddr=0x80200000\0" \
++      "rdaddr=0x81600000\0" \
+       "usbtty=cdc_acm\0" \
+       "console=ttyS2,115200n8\0" \
++      "optargs=\0" \
++      "bootscr=boot.scr\0" \
+       "mpurate=500\0" \
+       "buddy=none\0" \
+       "vram=12M\0" \
+@@ -195,6 +198,7 @@
+       "nandroot=/dev/mtdblock4 rw\0" \
+       "nandrootfstype=jffs2\0" \
+       "mmcargs=setenv bootargs console=${console} " \
++              "${optargs} " \
+               "mpurate=${mpurate} " \
+               "buddy=${buddy} "\
+               "vram=${vram} " \
+@@ -203,6 +207,7 @@
+               "root=${mmcroot} " \
+               "rootfstype=${mmcrootfstype}\0" \
+       "nandargs=setenv bootargs console=${console} " \
++              "${optargs} " \
+               "mpurate=${mpurate} " \
+               "buddy=${buddy} "\
+               "vram=${vram} " \
+@@ -210,7 +215,18 @@
+               "omapdss.def_disp=${defaultdisplay} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype}\0" \
+-      "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
++      "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} ${bootscr}\0" \
++      "ramargs=setenv bootargs console=${console} " \
++              "${optargs} " \
++              "mpurate=${mpurate} " \
++              "buddy=${buddy} "\
++              "vram=${vram} " \
++              "omapfb.mode=dvi:${dvimode} " \
++              "omapdss.def_disp=${defaultdisplay} " \
++              "root=/dev/ram0 rw ramdisk_size=65536 " \
++              "initrd=${rdaddr},64M " \
++              "rootfstype=\0" \
++      "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+               "source ${loadaddr}\0" \
+       "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+@@ -221,6 +237,9 @@
+               "run nandargs; " \
+               "nand read ${loadaddr} 280000 400000; " \
+               "bootm ${loadaddr}\0" \
++      "ramboot=echo Booting from ramdisk ...; " \
++              "run ramargs; " \
++              "bootm ${loadaddr}\0" \
+ #define CONFIG_BOOTCOMMAND \
+       "if mmc init ${mmcdev}; then " \
+@@ -228,7 +247,11 @@
+                       "run bootscript; " \
+               "else " \
+                       "if run loaduimage; then " \
+-                              "run mmcboot; " \
++                              "if run loadramdisk; then " \
++                                      "run ramboot; " \
++                              "else " \
++                                      "run mmcboot; " \
++                              "fi; " \
+                       "else run nandboot; " \
+                       "fi; " \
+               "fi; " \
+-- 
+1.5.6.4
+
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0041-BeagleBoard-Enabled-LEDs.patch b/recipes/u-boot/u-boot-git/beagleboard/0041-BeagleBoard-Enabled-LEDs.patch
new file mode 100644 (file)
index 0000000..8b04619
--- /dev/null
@@ -0,0 +1,47 @@
+From 9d3e56ba351348b6329c488a981d3e2d8f848164 Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkridner@beagleboard.org>
+Date: Wed, 19 May 2010 05:14:43 -0500
+Subject: [PATCH] BeagleBoard: Enabled LEDs
+
+Added LED driver using status_led.  USR0 is set to monitor the boot
+status.  USR1 is set to be the GREEN LED.
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ include/configs/omap3_beagle.h |   13 +++++++++++++
+ 1 files changed, 13 insertions(+), 0 deletions(-)
+
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index c2fc6ba..eaa8779 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -98,6 +98,18 @@
+ #define CONFIG_SYS_MMC_SET_DEV                1
+ #define CONFIG_DOS_PARTITION          1
++/* Status LED */
++#define CONFIG_STATUS_LED             1
++#define CONFIG_BOARD_SPECIFIC_LED     1
++#define STATUS_LED_BIT                        0x01
++#define STATUS_LED_STATE              STATUS_LED_ON
++#define STATUS_LED_PERIOD             (CONFIG_SYS_HZ / 2)
++#define STATUS_LED_BIT1                       0x02
++#define STATUS_LED_STATE1             STATUS_LED_ON
++#define STATUS_LED_PERIOD1            (CONFIG_SYS_HZ / 2)
++#define STATUS_LED_BOOT                       STATUS_LED_BIT
++#define STATUS_LED_GREEN              STATUS_LED_BIT1
++
+ /* DDR - I use Micron DDR */
+ #define CONFIG_OMAP3_MICRON_DDR               1
+@@ -132,6 +144,7 @@
+ #define CONFIG_CMD_I2C                /* I2C serial bus support       */
+ #define CONFIG_CMD_MMC                /* MMC support                  */
+ #define CONFIG_CMD_NAND               /* NAND support                 */
++#define CONFIG_CMD_LED                /* LED support                  */
+ #define CONFIG_VIDEO_OMAP3    /* DSS Support                  */
+ #undef CONFIG_CMD_FLASH               /* flinfo, erase, protect       */
+-- 
+1.5.6.4
+
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0042-BeagleBoard-New-command-for-status-of-USER-button.patch b/recipes/u-boot/u-boot-git/beagleboard/0042-BeagleBoard-New-command-for-status-of-USER-button.patch
new file mode 100644 (file)
index 0000000..c038104
--- /dev/null
@@ -0,0 +1,96 @@
+From 7d56d5aa2b3258c493f038abd6d18c7533ea734b Mon Sep 17 00:00:00 2001
+From: Greg Turner <gregturner@ti.com>
+Date: Tue, 25 May 2010 09:19:06 -0500
+Subject: [PATCH] BeagleBoard: New command for status of USER button
+
+Modified bootcmd to check the staus at boot time and set filename of the boot script.
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ common/cmd_boot.c              |   45 ++++++++++++++++++++++++++++++++++++++++
+ include/configs/omap3_beagle.h |   11 +++++++++
+ 2 files changed, 56 insertions(+), 0 deletions(-)
+
+diff --git a/common/cmd_boot.c b/common/cmd_boot.c
+index bfc1db2..4caf674 100644
+--- a/common/cmd_boot.c
++++ b/common/cmd_boot.c
+@@ -35,6 +35,51 @@ unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
+       return entry (argc, argv);
+ }
++/*
++ * This command returns the status of the user button on beagle xM
++ * Input - none
++ * Returns -  1 if button is held down
++ *            0 if button is not held down
++ */
++int do_userbutton (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++      int     button = 0;
++
++      //printf ("## Return Status of User button\n");
++
++      /*
++       * pass address parameter as argv[0] (aka command name),
++       * and all remaining args
++       */
++      omap_request_gpio(4);
++      omap_set_gpio_direction(4, 1);
++      printf("The user button is currently ");
++      if(omap_get_gpio_datain(4))
++      {
++              button = 1;
++      }
++      else
++      {
++              button = 0;
++              printf("NOT ");
++      }
++
++      printf("pressed.\n");
++
++      omap_free_gpio(4);
++
++      return button;
++}
++
++/* -------------------------------------------------------------------- */
++
++U_BOOT_CMD(
++      userbutton, CONFIG_SYS_MAXARGS, 1,      do_userbutton,
++      "Return the status of the user button",
++      ""
++);
++
++
+ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+ {
+       ulong   addr, rc;
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index eaa8779..555b350 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -254,8 +254,19 @@
+               "run ramargs; " \
+               "bootm ${loadaddr}\0" \
++/*
++ * The default bootcmd checks the status of the user button
++ * and sets the boot script accordingly.
++ * If the user button is NOT pressed: bootscr = boot.scr
++ * If the user button is pressed:     bootscr = user.scr
++ */
+ #define CONFIG_BOOTCOMMAND \
+       "if mmc init ${mmcdev}; then " \
++              "if userbutton; then " \
++                      "setenv bootscr boot.scr; " \
++              "else " \
++                      "setenv bootscr user.scr;" \
++              "fi;" \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+-- 
+1.5.6.4
+
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0043-BeagleBoard-Add-CONFIG_SYS_MEMTEST_SCRATCH.patch b/recipes/u-boot/u-boot-git/beagleboard/0043-BeagleBoard-Add-CONFIG_SYS_MEMTEST_SCRATCH.patch
new file mode 100644 (file)
index 0000000..fa6bb48
--- /dev/null
@@ -0,0 +1,35 @@
+From d912a6d2d546faf55d07e91816b47096879137cc Mon Sep 17 00:00:00 2001
+From: Steven Kipisz <s-kipisz2@ti.com>
+Date: Fri, 4 Jun 2010 10:31:04 -0500
+Subject: [PATCH] BeagleBoard: Add CONFIG_SYS_MEMTEST_SCRATCH
+
+Add CONFIG_SYS_MEMTEST_SCRATCH to point to a scratch memory area.
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ include/configs/omap3_beagle.h |    9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
+index 555b350..0c6fce6 100644
+--- a/include/configs/omap3_beagle.h
++++ b/include/configs/omap3_beagle.h
+@@ -297,10 +297,11 @@
+ /* Boot Argument Buffer Size */
+ #define CONFIG_SYS_BARGSIZE           (CONFIG_SYS_CBSIZE)
+-#define CONFIG_SYS_MEMTEST_START      (OMAP34XX_SDRC_CS0)     /* memtest */
+-                                                              /* works on */
+-#define CONFIG_SYS_MEMTEST_END                (OMAP34XX_SDRC_CS0 + \
+-                                      0x01F00000) /* 31MB */
++#define CONFIG_SYS_ALT_MEMTEST                1
++#define CONFIG_SYS_MEMTEST_START      (0x82000000)            /* memtest */
++                                                              /* defaults */
++#define CONFIG_SYS_MEMTEST_END                (0x87FFFFFF)            /* 128MB */
++#define CONFIG_SYS_MEMTEST_SCRATCH    (0x81000000)    /* dummy address */
+ #define CONFIG_SYS_LOAD_ADDR          (OMAP34XX_SDRC_CS0)     /* default */
+                                                       /* load address */
+-- 
+1.5.6.4
+
index be39354..1c36074 100644 (file)
@@ -1,5 +1,5 @@
 require u-boot.inc
-PR ="r52"
+PR ="r53"
 
 FILESPATHPKG =. "u-boot-git:"
 
@@ -60,6 +60,14 @@ SRC_URI_beagleboard = "git://www.denx.de/git/u-boot.git;protocol=git \
                        file://0037-OMAP3-beagle-pass-expansionboard-name-in-bootargs.patch \
                        file://0038-Added-configurations-for-xM-Rev-A-board.patch \
                        file://0039-OMAP3-beagle-setenv-beaglerev-for-AxBx-Cx-xMA-for-be.patch \
+                       file://0001-OMAP-mmc-add-support-for-second-and-third-mmc-chan.patch \
+                      file://0001-OMAP3-Beagle-enable-support-for-second-and-third-m.patch \
+                      file://0038-BeagleBoard-Added-LED-driver.patch \
+                      file://0039-Add-led-command.patch \
+                      file://0040-BeagleBoard-Check-for-ramdisk-on-boot.patch \
+                      file://0041-BeagleBoard-Enabled-LEDs.patch \
+                      file://0042-BeagleBoard-New-command-for-status-of-USER-button.patch \
+                      file://0043-BeagleBoard-Add-CONFIG_SYS_MEMTEST_SCRATCH.patch \
                        file://fw_env.config \
 "
 SRCREV_beagleboard = "ca6e1c136ddb720c3bb2cc043b99f7f06bc46c55"