* [U-Boot] [PATCH 5/6] PXA: Cleanup serial_pxa
From: Marek Vasut @ 2011-10-31 18:03 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1314495737-29436-5-git-send-email-marek.vasut@gmail.com>
> * Cleanup register definitions by introducing new regs-uart.h, compliant
> with rest of U-Boot.
> * Remove old register definitions from pxa-regs.h
> * Convert serial_pxa to new regs-uart.h
> * Cleanup serial_pxa
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Hi Albert,
did you pick this one up? Maybe we can pick it up for .12 release?
Cheers
^ permalink raw reply
* [U-Boot] [PATCH V3 1/2] nand: Add common functions to linux/mtd/nand.h
From: Scott Wood @ 2011-10-31 17:52 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078885-383-2-git-send-email-simonschwarzcor@gmail.com>
On 10/31/2011 11:34 AM, Simon Schwarz wrote:
> Functions often used in SPL are now part of linux/mtd/nand.h.
> Static modifiers are removed from these functions in
> drivers/mtd/nand/nand_base.c.
>
> Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
> Cc: scottwood at freescale.com
> Cc: s-paulraj at ti.com
> Cc: albert.u.boot at aribaud.net
Acked-by: Scott Wood <scottwood@freescale.com>
-Scott
^ permalink raw reply
* [U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support
From: Albert ARIBAUD @ 2011-10-31 17:42 UTC (permalink / raw)
To: u-boot
In-Reply-To: <4EA49D8E.2050704@mleia.com>
Hi Vladimir,
Le 24/10/2011 01:04, Vladimir Zapolskiy a ?crit :
> Hi Albert,
>
> On 22.10.2011 02:31, Albert ARIBAUD wrote:
>> Hi Vladimir,
>>
>> Le 18/10/2011 17:55, Vladimir Zapolskiy a ?crit :
>>> This change adds initial support for NXP LPC32x0 SoC series.
>>>
>>> Signed-off-by: Vladimir Zapolskiy<vz@mleia.com>
>>> ---
>>> Changes from v2 to v3:
>>> * checkpatch.pl reports zero errors and warnings
>>>
>>> Changes from v1 to v2:
>>> * BIT(n) and SBF(s, v) macro are not used anymore
>>> * removed NS16550 and 14-clock UART definitions from uart.h
>>> * added devices.c file, which contains standard UART preinitialization
>>> routine
>>> * added get_serial_clock() function, it returns actual frequency of
>>> UART clock
>>> * __udelay() realization is simplified, no need of interrupt handling
>>
>> As it stands, this is dead code until some board uses it; I imagine you
>> have board waiting for this support. Can you submit the SoC and board
>> code as a patch set? This way, it will be obvious for all that the SoC
>> code in this patch has actual use.
>
> you're right, I have a board to make support for. However I presume that
> U-boot maintainers won't be happy to include a board with
> CONFIG_ENV_IS_NOWHERE, and unfortunately flash driver isn't yet ready
> for publishing.
CONFIG_ENV_IS_NOWHERE is the board( maintainer)'s business.
Ditto for the FLASH driver, if it is not required for use of the board
(e.g., if U-Boot can fire up and does not need the FLASH to boot an OS,
then a broken FLASH driver is an inconvenience, not a showstopper).
> I'd like to get an advice, if you think that weakly supported but
> working U-boot on the board has chances to be included to arm-next I can
> send the patchset right now for review, otherwise I'll spend some time
> (one week approximately) to finish NAND driver.
IMO, the acceptable state of a board is the board maintainer's affair,
with a bare minimum that U-Boot must be able to play its role as a
bootloader.
Anyway, since that is for next, not master, and since you think you can
add the missing support far before the next merge window, I suggest you
complete board support and add it to V4.
Amicalement,
--
Albert.
^ permalink raw reply
* [U-Boot] [PATCH 5/7] omap_gpmc: use SOFTECC in SPL if it's enabled
From: Ilya Yanok @ 2011-10-31 17:30 UTC (permalink / raw)
To: u-boot
In-Reply-To: <4EA152C9.1040407@gmail.com>
Hi Simon,
On 21.10.2011 15:08, Simon Schwarz wrote:
> Another thing just poped into my mind, ATM I have a DMA patch for
> devkit8000 on the ML:
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/109744
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/112661
>
> It speeds up the process of copying the u-boot/linux image. ATM this is
> in combination with HW ecc and I doubt that it will work seamlessly with
> SW-ecc, yet. However IMHO DMA in combination with SW-ecc could be nearly
> as fast as using HW-ecc.
>
> So maybe an adaption is worth a try?
Ok, I've finally taken a look at it. Adaption is very straight forward
actually. This works for me:
diff --git a/drivers/mtd/nand/nand_spl_simple.c
b/drivers/mtd/nand/nand_spl_simple.c
index 1402a35..1248f8f 100644
--- a/drivers/mtd/nand/nand_spl_simple.c
+++ b/drivers/mtd/nand/nand_spl_simple.c
@@ -284,7 +284,8 @@ static int nand_read_page_dma(int block, int page,
void *dst)
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
res += omap3_dma_conf_transfer(0, nand_chip.IO_ADDR_R,
(uint32_t *)p, CONFIG_SYS_NAND_ECCSIZE/4);
- this->ecc.hwctl(&mtd, NAND_ECC_READ);
+ if (this->ecc.mode != NAND_ECC_SOFT)
+ this->ecc.hwctl(&mtd, NAND_ECC_READ);
res += omap3_dma_start_transfer(0);
/* correct ecc from former transfer */
if (ecc_wait.valid != 0)
Regards, Ilya.
^ permalink raw reply related
* [U-Boot] [PATCH] miiphy: Note that miiphy_* API is deprecated
From: Mike Frysinger @ 2011-10-31 17:21 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320072373-367-1-git-send-email-afleming@freescale.com>
On Monday 31 October 2011 10:46:13 Andy Fleming wrote:
> +What: Users of the legacy miiphy_* code
> +When: undetermined
> +
> +Why: We now have a PHY library, which allows everyone to share PHY
> + drivers. All new drivers should use this infrastructure, and
> + all old drivers should get converted to use it.
could you explicitly mention the defines which are considered "old" and the
ones that are considered "new" here ?
and update the top level README as well (if the old defines are mentioned) ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111031/b2d8e4c6/attachment.pgp
^ permalink raw reply
* [U-Boot] mx31: NAND_SPL boot question for TT-01
From: Helmut Raiger @ 2011-10-31 17:01 UTC (permalink / raw)
To: u-boot
Hi (Stefano),
just a short question. I'd like to add NAND boot to the board
support of our TT-01.
I checked out the mx31pdk code and also found something in doc/README.SPL
which does not seem to correspond.
Before I head into the wrong direction again, is the mx31pdk implementation
still hip?
Thx, Helmut
--
Scanned by MailScanner.
^ permalink raw reply
* [U-Boot] [PATCH v7 4/4] tegra2: Add support for Ventana
From: Stephen Warren @ 2011-10-31 16:51 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320079897-29473-1-git-send-email-swarren@nvidia.com>
Ventana is a board which is very similar to Seaboard. Support it by
re-using board/nvidia/seaboard/seaboard.c with minor run-time conditionals.
v5: Makefile: Use cmd_link_o_target, remove unused clean/distclean targets.
v6: Make gpio_config_uart_seaboard() static.
v7: Add MAINTAINERS entry for Ventana. Tom Warren doesn't have Ventana, so
he asked me to add myself for this board.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
---
MAINTAINERS | 5 +++
board/nvidia/seaboard/seaboard.c | 11 ++++++-
board/nvidia/ventana/Makefile | 49 +++++++++++++++++++++++++++++++++
boards.cfg | 1 +
include/configs/ventana.h | 55 ++++++++++++++++++++++++++++++++++++++
5 files changed, 119 insertions(+), 2 deletions(-)
create mode 100644 board/nvidia/ventana/Makefile
create mode 100644 include/configs/ventana.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 576fea8..6ff894c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -873,6 +873,11 @@ Tom Warren <twarren@nvidia.com>
harmony Tegra2 (ARM7 & A9 Dual Core)
seaboard Tegra2 (ARM7 & A9 Dual Core)
+Tom Warren <twarren@nvidia.com>
+Stephen Warren <twarren@nvidia.com>
+
+ ventana Tegra2 (ARM7 & A9 Dual Core)
+
Lei Wen <leiwen@marvell.com>
dkb ARM926EJS (PANTHEON 88AP920 SOC)
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 356d616..aa77f12 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -32,10 +32,10 @@
#include "../common/board.h"
/*
- * Routine: gpio_config_uart
+ * Routine: gpio_config_uart_seaboard
* Description: Force GPIO_PI3 low on Seaboard so UART4 works.
*/
-void gpio_config_uart(void)
+static void gpio_config_uart_seaboard(void)
{
int gp = GPIO_PI3;
struct gpio_ctlr *gpio = (struct gpio_ctlr *)NV_PA_GPIO_BASE;
@@ -56,6 +56,13 @@ void gpio_config_uart(void)
writel(val, &bank->gpio_dir_out[GPIO_PORT(gp)]);
}
+void gpio_config_uart(void)
+{
+ if (machine_is_ventana())
+ return;
+ gpio_config_uart_seaboard();
+}
+
#ifdef CONFIG_TEGRA2_MMC
/*
* Routine: pin_mux_mmc
diff --git a/board/nvidia/ventana/Makefile b/board/nvidia/ventana/Makefile
new file mode 100644
index 0000000..9e5a87f
--- /dev/null
+++ b/board/nvidia/ventana/Makefile
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2010,2011
+# NVIDIA Corporation <www.nvidia.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 $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
+
+LIB = $(obj)lib$(BOARD).o
+
+COBJS += ../seaboard/seaboard.o
+COBJS += ../common/board.o
+
+SRCS := $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+ $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/boards.cfg b/boards.cfg
index 604becf..83a0039 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -194,6 +194,7 @@ s5pc210_universal arm armv7 universal_c210 samsung
smdkv310 arm armv7 smdkv310 samsung s5pc2xx
harmony arm armv7 harmony nvidia tegra2
seaboard arm armv7 seaboard nvidia tegra2
+ventana arm armv7 ventana nvidia tegra2
u8500_href arm armv7 u8500 st-ericsson u8500
actux1_4_16 arm ixp actux1 - - actux1:FLASH2X2
actux1_8_16 arm ixp actux1 - - actux1:FLASH1X8
diff --git a/include/configs/ventana.h b/include/configs/ventana.h
new file mode 100644
index 0000000..afd6ff6
--- /dev/null
+++ b/include/configs/ventana.h
@@ -0,0 +1,55 @@
+/*
+ * (C) Copyright 2010,2011
+ * NVIDIA Corporation <www.nvidia.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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <asm/sizes.h>
+#include "tegra2-common.h"
+
+/* High-level configuration options */
+#define TEGRA2_SYSMEM "mem=384M at 0M nvmem=128M at 384M mem=512M at 512M"
+#define V_PROMPT "Tegra2 (Ventana) # "
+#define CONFIG_TEGRA2_BOARD_STRING "NVIDIA Ventana"
+
+/* Board-specific serial config */
+#define CONFIG_SERIAL_MULTI
+#define CONFIG_TEGRA2_ENABLE_UARTD
+#define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE
+
+#define CONFIG_MACH_TYPE MACH_TYPE_VENTANA
+#define CONFIG_SYS_BOARD_ODMDATA 0x300d8011 /* lp1, 1GB */
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/* SD/MMC */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_TEGRA2_MMC
+#define CONFIG_CMD_MMC
+
+#define CONFIG_DOS_PARTITION
+#define CONFIG_EFI_PARTITION
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#endif /* __CONFIG_H */
--
1.7.0.4
^ permalink raw reply related
* [U-Boot] [PATCH v7 3/4] tegra2: Modify MMC driver to handle power and cd GPIOs
From: Stephen Warren @ 2011-10-31 16:51 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320079897-29473-1-git-send-email-swarren@nvidia.com>
Pass the GPIO numbers for power and card detect to tegra2_mmc_init(), and
modify that function to perform all required GPIO initialization. This
removes the need for board files to perform these operations.
Move board_mmc_getcd() into tegra2_mmc.c now that the driver knows which
GPIOs to use.
Update affected call-sites in seaboard.c and harmony.c. Note that this
change should make all SD ports work on Harmony, since the required GPIO
setup is now being performed.
v4: Fix prototype of tegra2_mmc_init() in board.h to match driver change.
Remove prototype of gpio_config_mmc() from board.h
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Andy Fleming <afleming@gmail.com>
Tested-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
---
board/nvidia/common/board.h | 3 +-
board/nvidia/harmony/harmony.c | 27 ++---------------------
board/nvidia/seaboard/seaboard.c | 33 +----------------------------
drivers/mmc/tegra2_mmc.c | 42 ++++++++++++++++++++++++++++++++-----
drivers/mmc/tegra2_mmc.h | 4 ++-
5 files changed, 45 insertions(+), 64 deletions(-)
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 344e702..35acbca 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -26,7 +26,6 @@
void tegra2_start(void);
void gpio_config_uart(void);
-void gpio_config_mmc(void);
-int tegra2_mmc_init(int dev_index, int bus_width);
+int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio);
#endif /* BOARD_H */
diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
index f2c3867..3cbe820 100644
--- a/board/nvidia/harmony/harmony.c
+++ b/board/nvidia/harmony/harmony.c
@@ -25,6 +25,7 @@
#include <asm/io.h>
#include <asm/arch/tegra2.h>
#include <asm/arch/pinmux.h>
+#include <asm/gpio.h>
#ifdef CONFIG_TEGRA2_MMC
#include <mmc.h>
#endif
@@ -72,15 +73,6 @@ static void pin_mux_mmc(void)
pinmux_tristate_disable(PINGRP_ATC);
}
-/*
- * Routine: gpio_config_mmc
- * Description: Set GPIOs for SD card
- */
-void gpio_config_mmc(void)
-{
- /* Not implemented for now */
-}
-
/* this is a weak define that we are overriding */
int board_mmc_init(bd_t *bd)
{
@@ -88,29 +80,16 @@ int board_mmc_init(bd_t *bd)
/* Enable muxes, etc. for SDMMC controllers */
pin_mux_mmc();
- gpio_config_mmc();
debug("board_mmc_init: init SD slot J26\n");
/* init dev 0, SD slot J26, with 4-bit bus */
/* The board has an 8-bit bus, but 8-bit doesn't work yet */
- tegra2_mmc_init(0, 4);
+ tegra2_mmc_init(0, 4, GPIO_PI6, GPIO_PH2);
debug("board_mmc_init: init SD slot J5\n");
/* init dev 2, SD slot J5, with 4-bit bus */
- tegra2_mmc_init(2, 4);
+ tegra2_mmc_init(2, 4, GPIO_PT3, GPIO_PI5);
return 0;
}
-
-/* this is a weak define that we are overriding */
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
-{
- debug("board_mmc_getcd called\n");
- /*
- * Hard-code CD presence for now. Need to add GPIO inputs
- * for Harmony
- */
- *cd = 1;
- return 0;
-}
#endif
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 22a0e69..356d616 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -87,19 +87,6 @@ static void pin_mux_mmc(void)
pinmux_tristate_disable(PINGRP_ATC);
}
-/*
- * Routine: gpio_config_mmc
- * Description: Set GPIOs for SDMMC3 SDIO slot.
- */
-void gpio_config_mmc(void)
-{
- /* Set EN_VDDIO_SD (GPIO I6) */
- gpio_direction_output(GPIO_PI6, 1);
-
- /* Config pin as GPI for Card Detect (GPIO I5) */
- gpio_direction_input(GPIO_PI5);
-}
-
/* this is a weak define that we are overriding */
int board_mmc_init(bd_t *bd)
{
@@ -107,31 +94,15 @@ int board_mmc_init(bd_t *bd)
/* Enable muxes, etc. for SDMMC controllers */
pin_mux_mmc();
- gpio_config_mmc();
debug("board_mmc_init: init eMMC\n");
/* init dev 0, eMMC chip, with 4-bit bus */
/* The board has an 8-bit bus, but 8-bit doesn't work yet */
- tegra2_mmc_init(0, 4);
+ tegra2_mmc_init(0, 4, -1, -1);
debug("board_mmc_init: init SD slot\n");
/* init dev 1, SD slot, with 4-bit bus */
- tegra2_mmc_init(1, 4);
-
- return 0;
-}
-
-/* this is a weak define that we are overriding */
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
-{
- debug("board_mmc_getcd called\n");
- *cd = 1; /* Assume card is inserted, or eMMC */
-
- if (IS_SD(mmc)) {
- /* Seaboard SDMMC3 = SDIO3_CD = GPIO_PI5 */
- if (gpio_get_value(GPIO_PI5))
- *cd = 0;
- }
+ tegra2_mmc_init(1, 4, GPIO_PI6, GPIO_PI5);
return 0;
}
diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c
index 78b1190..3de9c5d 100644
--- a/drivers/mmc/tegra2_mmc.c
+++ b/drivers/mmc/tegra2_mmc.c
@@ -21,6 +21,7 @@
#include <common.h>
#include <mmc.h>
+#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch/clk_rst.h>
#include <asm/arch/clock.h>
@@ -433,20 +434,37 @@ static int mmc_core_init(struct mmc *mmc)
return 0;
}
-static int tegra2_mmc_initialize(int dev_index, int bus_width)
+int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio)
{
struct mmc_host *host;
+ char gpusage[12]; /* "SD/MMCn PWR" or "SD/MMCn CD" */
struct mmc *mmc;
- debug(" mmc_initialize called\n");
+ debug(" tegra2_mmc_init: index %d, bus width %d "
+ "pwr_gpio %d cd_gpio %d\n",
+ dev_index, bus_width, pwr_gpio, cd_gpio);
host = &mmc_host[dev_index];
host->clock = 0;
+ host->pwr_gpio = pwr_gpio;
+ host->cd_gpio = cd_gpio;
tegra2_get_setup(host, dev_index);
clock_start_periph_pll(host->mmc_id, CLOCK_ID_PERIPH, 20000000);
+ if (host->pwr_gpio >= 0) {
+ sprintf(gpusage, "SD/MMC%d PWR", dev_index);
+ gpio_request(host->pwr_gpio, gpusage);
+ gpio_direction_output(host->pwr_gpio, 1);
+ }
+
+ if (host->cd_gpio >= 0) {
+ sprintf(gpusage, "SD/MMC%d CD", dev_index);
+ gpio_request(host->cd_gpio, gpusage);
+ gpio_direction_input(host->cd_gpio);
+ }
+
mmc = &mmc_dev[dev_index];
sprintf(mmc->name, "Tegra2 SD/MMC");
@@ -478,9 +496,21 @@ static int tegra2_mmc_initialize(int dev_index, int bus_width)
return 0;
}
-int tegra2_mmc_init(int dev_index, int bus_width)
+/* this is a weak define that we are overriding */
+int board_mmc_getcd(u8 *cd, struct mmc *mmc)
{
- debug(" tegra2_mmc_init: index %d, bus width %d\n",
- dev_index, bus_width);
- return tegra2_mmc_initialize(dev_index, bus_width);
+ struct mmc_host *host = (struct mmc_host *)mmc->priv;
+
+ debug("board_mmc_getcd called\n");
+
+ *cd = 1; /* Assume card is inserted, or eMMC */
+
+ if (IS_SD(mmc)) {
+ if (host->cd_gpio >= 0) {
+ if (gpio_get_value(host->cd_gpio))
+ *cd = 0;
+ }
+ }
+
+ return 0;
}
diff --git a/drivers/mmc/tegra2_mmc.h b/drivers/mmc/tegra2_mmc.h
index 28698e0..72f587b 100644
--- a/drivers/mmc/tegra2_mmc.h
+++ b/drivers/mmc/tegra2_mmc.h
@@ -74,9 +74,11 @@ struct mmc_host {
unsigned int clock; /* Current clock (MHz) */
unsigned int base; /* Base address, SDMMC1/2/3/4 */
enum periph_id mmc_id; /* Peripheral ID: PERIPH_ID_... */
+ int pwr_gpio; /* Power GPIO */
+ int cd_gpio; /* Change Detect GPIO */
};
-int tegra2_mmc_init(int dev_index, int bus_width);
+int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio);
#endif /* __ASSEMBLY__ */
#endif /* __TEGRA2_MMC_H_ */
--
1.7.0.4
^ permalink raw reply related
* [U-Boot] [PATCH v7 2/4] tegra2: Move board_mmc_init into board files
From: Stephen Warren @ 2011-10-31 16:51 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320079897-29473-1-git-send-email-swarren@nvidia.com>
For Seaboard, this is mostly a cut/paste of board_mmc_init() and
pin_mux_mmc() into seaboard.c; pin_mux_mmc() was modified to add some
missing pinmux_tristate_disable calls for the GPIOs.
For Harmony, those functions were modified to configure SDMMC2 (index 2)
instead of SDMMC3 (index 1), since that's what is present on the board.
However, harmony.c is still missing the required GPIO setup, so neither
port is likely to function correctly yet. This will be fixed in the next
change.
v4: Include board.h to prototype tegra2_mmc_init().
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
---
board/nvidia/common/board.c | 52 -----------------------------------
board/nvidia/harmony/harmony.c | 56 ++++++++++++++++++++++++++++++++++++++
board/nvidia/seaboard/seaboard.c | 53 +++++++++++++++++++++++++++++++++++
3 files changed, 109 insertions(+), 52 deletions(-)
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 370a259..0f12de2 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -33,10 +33,6 @@
#include <asm/arch/uart.h>
#include "board.h"
-#ifdef CONFIG_TEGRA2_MMC
-#include <mmc.h>
-#endif
-
DECLARE_GLOBAL_DATA_PTR;
const struct tegra2_sysinfo sysinfo = {
@@ -100,33 +96,6 @@ static void pin_mux_uart(void)
#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
}
-#ifdef CONFIG_TEGRA2_MMC
-/*
- * Routine: pin_mux_mmc
- * Description: setup the pin muxes/tristate values for the SDMMC(s)
- */
-static void pin_mux_mmc(void)
-{
- /* SDMMC4: config 3, x8 on 2nd set of pins */
- pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
- pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
- pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
- pinmux_tristate_disable(PINGRP_ATB);
- pinmux_tristate_disable(PINGRP_GMA);
- pinmux_tristate_disable(PINGRP_GME);
-
- /* SDMMC3: SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
- pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
- pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
- pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
-
- pinmux_tristate_disable(PINGRP_SDC);
- pinmux_tristate_disable(PINGRP_SDD);
- pinmux_tristate_disable(PINGRP_SDB);
-}
-#endif
-
/*
* Routine: board_init
* Description: Early hardware init.
@@ -142,27 +111,6 @@ int board_init(void)
return 0;
}
-#ifdef CONFIG_TEGRA2_MMC
-/* this is a weak define that we are overriding */
-int board_mmc_init(bd_t *bd)
-{
- debug("board_mmc_init called\n");
- /* Enable muxes, etc. for SDMMC controllers */
- pin_mux_mmc();
- gpio_config_mmc();
-
- debug("board_mmc_init: init eMMC\n");
- /* init dev 0, eMMC chip, with 4-bit bus */
- tegra2_mmc_init(0, 4);
-
- debug("board_mmc_init: init SD slot\n");
- /* init dev 1, SD slot, with 4-bit bus */
- tegra2_mmc_init(1, 4);
-
- return 0;
-}
-#endif
-
#ifdef CONFIG_BOARD_EARLY_INIT_F
int board_early_init_f(void)
{
diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
index cbb30d6..f2c3867 100644
--- a/board/nvidia/harmony/harmony.c
+++ b/board/nvidia/harmony/harmony.c
@@ -24,9 +24,11 @@
#include <common.h>
#include <asm/io.h>
#include <asm/arch/tegra2.h>
+#include <asm/arch/pinmux.h>
#ifdef CONFIG_TEGRA2_MMC
#include <mmc.h>
#endif
+#include "../common/board.h"
/*
* Routine: gpio_config_uart
@@ -38,6 +40,39 @@ void gpio_config_uart(void)
#ifdef CONFIG_TEGRA2_MMC
/*
+ * Routine: pin_mux_mmc
+ * Description: setup the pin muxes/tristate values for the SDMMC(s)
+ */
+static void pin_mux_mmc(void)
+{
+ /* SDMMC4: config 3, x8 on 2nd set of pins */
+ pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
+ pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
+ pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
+
+ pinmux_tristate_disable(PINGRP_ATB);
+ pinmux_tristate_disable(PINGRP_GMA);
+ pinmux_tristate_disable(PINGRP_GME);
+
+ /* For power GPIO PI6 */
+ pinmux_tristate_disable(PINGRP_ATA);
+ /* For CD GPIO PH2 */
+ pinmux_tristate_disable(PINGRP_ATD);
+
+ /* SDMMC2: SDIO2_CLK, SDIO2_CMD, SDIO2_DAT[7:0] */
+ pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
+ pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
+
+ pinmux_tristate_disable(PINGRP_DTA);
+ pinmux_tristate_disable(PINGRP_DTD);
+
+ /* For power GPIO PT3 */
+ pinmux_tristate_disable(PINGRP_DTB);
+ /* For CD GPIO PI5 */
+ pinmux_tristate_disable(PINGRP_ATC);
+}
+
+/*
* Routine: gpio_config_mmc
* Description: Set GPIOs for SD card
*/
@@ -47,6 +82,27 @@ void gpio_config_mmc(void)
}
/* this is a weak define that we are overriding */
+int board_mmc_init(bd_t *bd)
+{
+ debug("board_mmc_init called\n");
+
+ /* Enable muxes, etc. for SDMMC controllers */
+ pin_mux_mmc();
+ gpio_config_mmc();
+
+ debug("board_mmc_init: init SD slot J26\n");
+ /* init dev 0, SD slot J26, with 4-bit bus */
+ /* The board has an 8-bit bus, but 8-bit doesn't work yet */
+ tegra2_mmc_init(0, 4);
+
+ debug("board_mmc_init: init SD slot J5\n");
+ /* init dev 2, SD slot J5, with 4-bit bus */
+ tegra2_mmc_init(2, 4);
+
+ return 0;
+}
+
+/* this is a weak define that we are overriding */
int board_mmc_getcd(u8 *cd, struct mmc *mmc)
{
debug("board_mmc_getcd called\n");
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index bc67d0f..22a0e69 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -24,10 +24,12 @@
#include <common.h>
#include <asm/io.h>
#include <asm/arch/tegra2.h>
+#include <asm/arch/pinmux.h>
#include <asm/gpio.h>
#ifdef CONFIG_TEGRA2_MMC
#include <mmc.h>
#endif
+#include "../common/board.h"
/*
* Routine: gpio_config_uart
@@ -56,6 +58,36 @@ void gpio_config_uart(void)
#ifdef CONFIG_TEGRA2_MMC
/*
+ * Routine: pin_mux_mmc
+ * Description: setup the pin muxes/tristate values for the SDMMC(s)
+ */
+static void pin_mux_mmc(void)
+{
+ /* SDMMC4: config 3, x8 on 2nd set of pins */
+ pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
+ pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
+ pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
+
+ pinmux_tristate_disable(PINGRP_ATB);
+ pinmux_tristate_disable(PINGRP_GMA);
+ pinmux_tristate_disable(PINGRP_GME);
+
+ /* SDMMC3: SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
+ pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
+ pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
+ pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
+
+ pinmux_tristate_disable(PINGRP_SDC);
+ pinmux_tristate_disable(PINGRP_SDD);
+ pinmux_tristate_disable(PINGRP_SDB);
+
+ /* For power GPIO PI6 */
+ pinmux_tristate_disable(PINGRP_ATA);
+ /* For CD GPIO PI5 */
+ pinmux_tristate_disable(PINGRP_ATC);
+}
+
+/*
* Routine: gpio_config_mmc
* Description: Set GPIOs for SDMMC3 SDIO slot.
*/
@@ -69,6 +101,27 @@ void gpio_config_mmc(void)
}
/* this is a weak define that we are overriding */
+int board_mmc_init(bd_t *bd)
+{
+ debug("board_mmc_init called\n");
+
+ /* Enable muxes, etc. for SDMMC controllers */
+ pin_mux_mmc();
+ gpio_config_mmc();
+
+ debug("board_mmc_init: init eMMC\n");
+ /* init dev 0, eMMC chip, with 4-bit bus */
+ /* The board has an 8-bit bus, but 8-bit doesn't work yet */
+ tegra2_mmc_init(0, 4);
+
+ debug("board_mmc_init: init SD slot\n");
+ /* init dev 1, SD slot, with 4-bit bus */
+ tegra2_mmc_init(1, 4);
+
+ return 0;
+}
+
+/* this is a weak define that we are overriding */
int board_mmc_getcd(u8 *cd, struct mmc *mmc)
{
debug("board_mmc_getcd called\n");
--
1.7.0.4
^ permalink raw reply related
* [U-Boot] [PATCH v7 1/4] tegra2: Move MMC clock initialization into MMC driver
From: Stephen Warren @ 2011-10-31 16:51 UTC (permalink / raw)
To: u-boot
This centralizes knowledge of MMC clocking into the MMC driver. This also
removes clock setup from the board files, which will simplify later changes
that modify the Harmony board to support the correct set of MMC controllers.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
---
board/nvidia/common/board.c | 13 +------------
drivers/mmc/tegra2_mmc.c | 12 +++++++++---
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index d13537d..370a259 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -102,16 +102,6 @@ static void pin_mux_uart(void)
#ifdef CONFIG_TEGRA2_MMC
/*
- * Routine: clock_init_mmc
- * Description: init the PLL and clocks for the SDMMC controllers
- */
-static void clock_init_mmc(void)
-{
- clock_start_periph_pll(PERIPH_ID_SDMMC4, CLOCK_ID_PERIPH, 20000000);
- clock_start_periph_pll(PERIPH_ID_SDMMC3, CLOCK_ID_PERIPH, 20000000);
-}
-
-/*
* Routine: pin_mux_mmc
* Description: setup the pin muxes/tristate values for the SDMMC(s)
*/
@@ -157,8 +147,7 @@ int board_init(void)
int board_mmc_init(bd_t *bd)
{
debug("board_mmc_init called\n");
- /* Enable clocks, muxes, etc. for SDMMC controllers */
- clock_init_mmc();
+ /* Enable muxes, etc. for SDMMC controllers */
pin_mux_mmc();
gpio_config_mmc();
diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c
index 9e741f2..78b1190 100644
--- a/drivers/mmc/tegra2_mmc.c
+++ b/drivers/mmc/tegra2_mmc.c
@@ -435,14 +435,22 @@ static int mmc_core_init(struct mmc *mmc)
static int tegra2_mmc_initialize(int dev_index, int bus_width)
{
+ struct mmc_host *host;
struct mmc *mmc;
debug(" mmc_initialize called\n");
+ host = &mmc_host[dev_index];
+
+ host->clock = 0;
+ tegra2_get_setup(host, dev_index);
+
+ clock_start_periph_pll(host->mmc_id, CLOCK_ID_PERIPH, 20000000);
+
mmc = &mmc_dev[dev_index];
sprintf(mmc->name, "Tegra2 SD/MMC");
- mmc->priv = &mmc_host[dev_index];
+ mmc->priv = host;
mmc->send_cmd = mmc_send_cmd;
mmc->set_ios = mmc_set_ios;
mmc->init = mmc_core_init;
@@ -465,8 +473,6 @@ static int tegra2_mmc_initialize(int dev_index, int bus_width)
mmc->f_min = 375000;
mmc->f_max = 48000000;
- mmc_host[dev_index].clock = 0;
- tegra2_get_setup(&mmc_host[dev_index], dev_index);
mmc_register(mmc);
return 0;
--
1.7.0.4
^ permalink raw reply related
* [U-Boot] Re-Validate Your Mailbox
From: mgiraldo at uc.edu.ve @ 2011-10-31 16:45 UTC (permalink / raw)
To: u-boot
Your web mail quota has exceeded the set quota which is 3GB.you are
currently running on 3.9GB.
To re-activate and increase your web mail quota please click the link below.
Click Here:
https://docs.google.com/spreadsheet/viewform?formkey=dDE0cDV2akxGMnZCRV9BV2VNb0VZSHc6MQ
Failure to do so may result in the cancellation of your web mail account.
Thanks, and sorry for the inconvenience
Local-host.
^ permalink raw reply
* [U-Boot] [PATCH V3 2/2] Fix regression in SMDK6400
From: Simon Schwarz @ 2011-10-31 16:34 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078885-383-1-git-send-email-simonschwarzcor@gmail.com>
s3c64xx.c implemented its own nand_read_byte, nand_write_buf and
nand_read_buf functions. This provoked a regression when these functions
were made public by patch 55f429bb39614a16b1bacc9a8bea9ac01a60bfc8.
This deletes these duplicated functions from s3c64xx.c and adds the generic
implementations in nand_base.c to the spl Makefile. It also adds
-ffcuntion-sections and -gc-sections to the compilation flags of the SPL to
avoid errors originating from unused functions in nand_base.c.
Description of the regression:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/108873
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
Cc: scottwood at freescale.com
Cc: s-paulraj at ti.com
Cc: albert.u.boot at aribaud.net
---
Changes V2:
CHG include linux/mtd/nand.h because of:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/110219
Changes V3:
none
---
drivers/mtd/nand/s3c64xx.c | 28 ++--------------------------
nand_spl/board/samsung/smdk6400/Makefile | 9 ++++++---
2 files changed, 8 insertions(+), 29 deletions(-)
diff --git a/drivers/mtd/nand/s3c64xx.c b/drivers/mtd/nand/s3c64xx.c
index 084e475..87f0341 100644
--- a/drivers/mtd/nand/s3c64xx.c
+++ b/drivers/mtd/nand/s3c64xx.c
@@ -28,6 +28,8 @@
#include <common.h>
#include <nand.h>
+#include <linux/mtd/nand.h>
+
#include <asm/arch/s3c6400.h>
#include <asm/io.h>
@@ -60,32 +62,6 @@ static void print_oob(const char *header, struct mtd_info *mtd)
}
#endif /* S3C_NAND_DEBUG */
-#ifdef CONFIG_NAND_SPL
-static u_char nand_read_byte(struct mtd_info *mtd)
-{
- struct nand_chip *this = mtd->priv;
- return readb(this->IO_ADDR_R);
-}
-
-static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
-{
- int i;
- struct nand_chip *this = mtd->priv;
-
- for (i = 0; i < len; i++)
- writeb(buf[i], this->IO_ADDR_W);
-}
-
-static void nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
-{
- int i;
- struct nand_chip *this = mtd->priv;
-
- for (i = 0; i < len; i++)
- buf[i] = readb(this->IO_ADDR_R);
-}
-#endif
-
static void s3c_nand_select_chip(struct mtd_info *mtd, int chip)
{
int ctrl = readl(NFCONT);
diff --git a/nand_spl/board/samsung/smdk6400/Makefile b/nand_spl/board/samsung/smdk6400/Makefile
index 2f9c307..c9e75ba 100644
--- a/nand_spl/board/samsung/smdk6400/Makefile
+++ b/nand_spl/board/samsung/smdk6400/Makefile
@@ -33,12 +33,12 @@ nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
- $(LDFLAGS_FINAL)
+ $(LDFLAGS_FINAL) -gc-sections
AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+CFLAGS += -DCONFIG_NAND_SPL -ffunction-sections
SOBJS = start.o cpu_init.o lowlevel_init.o
-COBJS = nand_boot.o nand_ecc.o s3c64xx.o smdk6400_nand_spl.o
+COBJS = nand_boot.o nand_ecc.o s3c64xx.o smdk6400_nand_spl.o nand_base.o
SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
@@ -98,6 +98,9 @@ $(obj)smdk6400_nand_spl.c:
@rm -f $@
@ln -s $(TOPDIR)/board/samsung/smdk6400/smdk6400_nand_spl.c $@
+$(obj)nand_base.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/drivers/mtd/nand/nand_base.c $@
#########################################################################
$(obj)%.o: $(obj)%.S
--
1.7.4.1
^ permalink raw reply related
* [U-Boot] [PATCH V3 1/2] nand: Add common functions to linux/mtd/nand.h
From: Simon Schwarz @ 2011-10-31 16:34 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078885-383-1-git-send-email-simonschwarzcor@gmail.com>
Functions often used in SPL are now part of linux/mtd/nand.h.
Static modifiers are removed from these functions in
drivers/mtd/nand/nand_base.c.
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
Cc: scottwood at freescale.com
Cc: s-paulraj at ti.com
Cc: albert.u.boot at aribaud.net
---
Changes V2:
CHG moved function definiton from nand.h to linux/mtd/nand.h because of:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/110219
Changes V3:
CHG moved the definitions before double inculsion detection end
CHG combined function definition and prototype in one patch as advised here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/114558
---
drivers/mtd/nand/nand_base.c | 6 +++---
include/linux/mtd/nand.h | 7 +++++++
include/nand.h | 3 ---
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index e7dfcb1..109d2cf 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -133,7 +133,7 @@ static void nand_release_device (struct mtd_info *mtd)
*
* Default read function for 8bit buswith
*/
-static uint8_t nand_read_byte(struct mtd_info *mtd)
+uint8_t nand_read_byte(struct mtd_info *mtd)
{
struct nand_chip *chip = mtd->priv;
return readb(chip->IO_ADDR_R);
@@ -196,7 +196,7 @@ static void nand_select_chip(struct mtd_info *mtd, int chipnr)
*
* Default write function for 8bit buswith
*/
-static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
+void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
{
int i;
struct nand_chip *chip = mtd->priv;
@@ -249,7 +249,7 @@ static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
*
* Default write function for 16bit buswith
*/
-static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
+void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
{
int i;
struct nand_chip *chip = mtd->priv;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 987a2ec..1cdc7ae 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -623,4 +623,11 @@ struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
return chip->priv;
}
+/* Standard NAND functions from nand_base.c */
+void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len);
+void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
+void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
+uint8_t nand_read_byte(struct mtd_info *mtd);
+
#endif /* __LINUX_MTD_NAND_H */
diff --git a/include/nand.h b/include/nand.h
index b4140794..d444ddc 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -135,9 +135,6 @@ int nand_get_lock_status(nand_info_t *meminfo, loff_t offset);
int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst);
void nand_deselect(void);
-void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
-void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
-
#ifdef CONFIG_SYS_NAND_SELECT_DEVICE
void board_nand_select_device(struct nand_chip *nand, int chip);
#endif
--
1.7.4.1
^ permalink raw reply related
* [U-Boot] [PATCH V3 0/2] fix: regression in SMDK6400
From: Simon Schwarz @ 2011-10-31 16:34 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1318762212-6763-1-git-send-email-simonschwarzcor@gmail.com>
This is a fix for a regression introduced by my patch
55f429bb39614a16b1bacc9a8bea9ac01a60bfc8 to u-boot-ti/next
The issue is described here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/108873
changes V3:
- fix for: http://article.gmane.org/gmane.comp.boot-loaders.u-boot/114559
- http://article.gmane.org/gmane.comp.boot-loaders.u-boot/114558
Simon Schwarz (2):
nand: Add common functions to linux/mtd/nand.h
Fix regression in SMDK6400
drivers/mtd/nand/nand_base.c | 6 +++---
drivers/mtd/nand/s3c64xx.c | 28 ++--------------------------
include/linux/mtd/nand.h | 7 +++++++
include/nand.h | 3 ---
nand_spl/board/samsung/smdk6400/Makefile | 9 ++++++---
5 files changed, 18 insertions(+), 35 deletions(-)
--
1.7.4.1
^ permalink raw reply
* [U-Boot] [PATCH V7 5/5] omap-common: fixes BSS overwriting problem
From: Simon Schwarz @ 2011-10-31 16:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078187-28423-1-git-send-email-simonschwarzcor@gmail.com>
From: Simon Schwarz <simonschwarzcor@googlemail.com>
spl_nand overwrote BSS section because it reads a whole block everytime. Now
loads the block to spare area and just copy the needed junk to destination.
Whole block read is necessary for ecc check!
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
V2 changes:
nothing
V3 changes:
nothing
V4 changes:
nothing
V5 changes:
nothing
V6 changes:
nothing
V7 changes:
nothing
---
arch/arm/cpu/armv7/omap-common/spl_nand.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c
index 1b9e171..903255b 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c
@@ -71,7 +71,8 @@ void spl_nand_load_image(void)
CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
spl_parse_image_header(header);
nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
- spl_image.size, (void *)spl_image.load_addr);
+ spl_image.size,
+ (void *)spl_image.load_addr - sizeof(header));
} else
#endif
{
--
1.7.4.1
^ permalink raw reply related
* [U-Boot] [PATCH V7 4/5] devkit8000/spl: init GPMC for dm9000 in SPL
From: Simon Schwarz @ 2011-10-31 16:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078187-28423-1-git-send-email-simonschwarzcor@gmail.com>
From: Simon Schwarz <simonschwarzcor@googlemail.com>
Linux crashes if the GPMC isn't configured for the dm9000.
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
V2 changes:
nothing
V3 changes:
nothing
V4 changes:
noting
V5 changes:
nothing
V6 changes:
nothing
V7 changes:
FIX multiline comment style
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113500)
---
arch/arm/include/asm/omap_common.h | 2 ++
board/timll/devkit8000/devkit8000.c | 33 +++++++++++++++++++++++++--------
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 3f2f004..ab86774 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -78,6 +78,8 @@ u32 omap_boot_mode(void);
/* SPL common function s*/
void spl_parse_image_header(const struct image_header *header);
void omap_rev_string(char *omap_rev_string);
+int spl_uboot_key(void);
+void spl_board_prepare_for_linux(void);
/* NAND SPL functions */
void spl_nand_load_image(void);
diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c
index fee0dff..11c8671 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -63,6 +63,18 @@ int board_init(void)
return 0;
}
+/* Configure GPMC registers for DM9000 */
+static void gpmc_dm9000_config(void)
+{
+ writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[6].config1);
+ writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[6].config2);
+ writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[6].config3);
+ writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[6].config4);
+ writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[6].config5);
+ writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[6].config6);
+ writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[6].config7);
+}
+
/*
* Routine: misc_init_r
* Description: Configure board specific parts
@@ -81,14 +93,7 @@ int misc_init_r(void)
#endif
#ifdef CONFIG_DRIVER_DM9000
- /* Configure GPMC registers for DM9000 */
- writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[6].config1);
- writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[6].config2);
- writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[6].config3);
- writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[6].config4);
- writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[6].config5);
- writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[6].config6);
- writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[6].config7);
+ gpmc_dm9000_config();
/* Use OMAP DIE_ID as MAC address */
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
@@ -138,3 +143,15 @@ int board_eth_init(bd_t *bis)
return dm9000_initialize(bis);
}
#endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+ gpmc_dm9000_config();
+}
+
+#endif
--
1.7.4.1
^ permalink raw reply related
* [U-Boot] [PATCH V7 3/5] omap-common/spl: Add linux boot to SPL
From: Simon Schwarz @ 2011-10-31 16:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078187-28423-1-git-send-email-simonschwarzcor@gmail.com>
From: Simon Schwarz <simonschwarzcor@googlemail.com>
This adds Linux booting to the SPL
This depends on CONFIG_MACH_TYPE patch by Igor Grinberg
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105809)
Related CONFIGs:
CONFIG_SPL_OS_BOOT
Activates/Deactivates the OS booting feature
CONFIG_SPL_OS_BOOT_KEY
defines the IO-pin number u-boot switch - if pressed u-boot is booted
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR
Address where the kernel boot arguments are expected - this is normaly
RAM-begin + 0x100
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
V2 changes:
nothing
V3 changes:
nothing
V4 changes:
CHG Using CONFIG_MACH_TYPE now.
DEL CONFIG_SYS_SPL_MACHID
CHG Use CONFIG_MACH_TYPE for machine id config - This makes the patch
depending on the patch linked above
V5 changes:
FIX compile errors for OMAP4
REBASE u-boot-ti adapted new general gpio interface
V6 changes:
nothing
V7 changes:
FIX multiline comment style
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113501)
---
arch/arm/cpu/armv7/omap-common/spl.c | 51 ++++++++++++++++++++++++++++++++-
include/configs/devkit8000.h | 9 ++++-
2 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
index d37ca0f..bafddfb 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -35,6 +35,7 @@
#include <i2c.h>
#include <image.h>
#include <malloc.h>
+#include <asm/gpio.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -63,6 +64,26 @@ void board_init_f(ulong dummy)
relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);
}
+/*
+ * Return the value of the U-boot key
+ *
+ * RETURN
+ * 0 if not pressed
+ * positiv if pressed
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_uboot_key(void)
+{
+ int val = 0;
+ if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
+ gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+ val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+ gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+ }
+ return !val;
+}
+#endif
+
void spl_parse_image_header(const struct image_header *header)
{
u32 header_size = sizeof(struct image_header);
@@ -90,7 +111,26 @@ void spl_parse_image_header(const struct image_header *header)
}
}
-static void jump_to_image_no_args(void)
+/*
+ * This function jumps to an image with argument. Normally an FDT or ATAGS
+ * image.
+ * arg: Pointer to paramter image in RAM
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+void jump_to_image_linux(void *arg)
+{
+ debug("Entering kernel arg pointer: 0x%X\n", arg);
+ typedef void (*image_entry_arg_t)(int, int, void *)
+ __attribute__ ((noreturn));
+ image_entry_arg_t image_entry =
+ (image_entry_arg_t) spl_image.entry_point;
+ /* cleanup_before_linux(); */ /*write SPL function for that*/
+ image_entry(0, CONFIG_MACH_TYPE, arg);
+}
+void jump_to_image_linux(void *) __attribute__ ((noreturn));
+#endif
+
+void jump_to_image_no_args(void)
{
typedef void (*image_entry_noargs_t)(void)__attribute__ ((noreturn));
image_entry_noargs_t image_entry =
@@ -99,8 +139,8 @@ static void jump_to_image_no_args(void)
debug("image entry point: 0x%X\n", spl_image.entry_point);
image_entry();
}
-
void jump_to_image_no_args(void) __attribute__ ((noreturn));
+
void board_init_r(gd_t *id, ulong dummy)
{
u32 boot_device;
@@ -137,6 +177,13 @@ void board_init_r(gd_t *id, ulong dummy)
debug("Jumping to U-Boot\n");
jump_to_image_no_args();
break;
+#ifdef CONFIG_SPL_OS_BOOT
+ case IH_OS_LINUX:
+ debug("Jumping to Linux\n");
+ spl_board_prepare_for_linux();
+ jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR);
+ break;
+#endif
default:
puts("Unsupported OS image.. Jumping nevertheless..\n");
jump_to_image_no_args();
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index f603f55..a848f4d 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -37,7 +37,9 @@
#define CONFIG_OMAP3430 1 /* which is in a 3430 */
#define CONFIG_OMAP3_DEVKIT8000 1 /* working with DevKit8000 */
-#define CONFIG_SYS_TEXT_BASE 0x80008000
+#define CONFIG_MACH_TYPE MACH_TYPE_DEVKIT8000
+
+#define CONFIG_SYS_TEXT_BASE 0x80100000
#define CONFIG_SDRC /* The chip has SDRC controller */
@@ -333,7 +335,7 @@
#define CONFIG_SPL_MAX_SIZE 0xB400 /* 45 K */
#define CONFIG_SPL_STACK LOW_LEVEL_SRAM_STACK
-#define CONFIG_SPL_BSS_START_ADDR 0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
+#define CONFIG_SPL_BSS_START_ADDR 0x80000500 /* leave space for bootargs*/
#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
/* NAND boot config */
@@ -366,6 +368,9 @@
#define CONFIG_CMD_SPL_WRITE_SIZE 0x400 /* 1024 byte */
#define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
0x400000)
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY 26
+
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
#define CONFIG_SYS_SPL_ARGS_ADDR (PHYS_SDRAM_1 + 0x100)
#endif /* __CONFIG_H */
--
1.7.4.1
^ permalink raw reply related
* [U-Boot] [PATCH V7 2/5] omap-common: Add NAND SPL linux booting
From: Simon Schwarz @ 2011-10-31 16:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078187-28423-1-git-send-email-simonschwarzcor@gmail.com>
From: Simon Schwarz <simonschwarzcor@googlemail.com>
This implements booting of Linux from NAND in SPL
Related config parameters:
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR
Address where the kernel boot arguments are expected - this is
normally RAM-start + 0x100 (on ARM)
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
V2 changes:
nothing
V3 changes:
nothing
V4 changes:
ADD define description to commit message
CHG renaming some defines - renaming SAVEBP SPL
V5 changes:
nothing
V6 changes:
nothing
V7 changes:
nothing
---
arch/arm/cpu/armv7/omap-common/spl_nand.c | 62 +++++++++++++++++++++-------
1 files changed, 46 insertions(+), 16 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c
index 38d06b1..1b9e171 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c
@@ -24,6 +24,7 @@
#include <asm/u-boot.h>
#include <asm/utils.h>
#include <asm/arch/sys_proto.h>
+#include <asm/io.h>
#include <nand.h>
#include <version.h>
#include <asm/omap_common.h>
@@ -32,6 +33,7 @@
void spl_nand_load_image(void)
{
struct image_header *header;
+ int *src, *dst;
switch (omap_boot_mode()) {
case NAND_MODE_HW_ECC:
debug("spl: nand - using hw ecc\n");
@@ -45,26 +47,54 @@ void spl_nand_load_image(void)
/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
+#ifdef CONFIG_SPL_OS_BOOT
+ if (!spl_uboot_key()) {
+ /* load parameter image */
+ /* load to temp position since nand_spl_load_image reads
+ * a whole block which is typically larger than
+ * CONFIG_CMD_SAVEBP_WRITE_SIZE therefore may overwrite
+ * following sections like BSS */
+ nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS,
+ CONFIG_CMD_SPL_WRITE_SIZE,
+ (void *)CONFIG_SYS_TEXT_BASE);
+ /* copy to destintion */
+ for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR,
+ src = (int *)CONFIG_SYS_TEXT_BASE;
+ src < (int *)(CONFIG_SYS_TEXT_BASE +
+ CONFIG_CMD_SPL_WRITE_SIZE);
+ src++, dst++) {
+ writel(readl(src), dst);
+ }
+ /* load linux */
+ nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+ CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+ spl_parse_image_header(header);
+ nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+ spl_image.size, (void *)spl_image.load_addr);
+ } else
+#endif
+ {
#ifdef CONFIG_NAND_ENV_DST
- nand_spl_load_image(CONFIG_ENV_OFFSET,
- CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
- spl_parse_image_header(header);
- nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
- (void *)image_load_addr);
+ nand_spl_load_image(CONFIG_ENV_OFFSET,
+ CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+ spl_parse_image_header(header);
+ nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
+ (void *)spl_image.load_addr);
#ifdef CONFIG_ENV_OFFSET_REDUND
- nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
- CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
- spl_parse_image_header(header);
- nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
- (void *)image_load_addr);
+ nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
+ CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+ spl_parse_image_header(header);
+ nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
+ (void *)spl_image.load_addr);
#endif
#endif
- /* Load u-boot */
- nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
- CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
- spl_parse_image_header(header);
- nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
- spl_image.size, (void *)spl_image.load_addr);
+ /* Load u-boot */
+ nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+ CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+ spl_parse_image_header(header);
+ nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+ spl_image.size, (void *)spl_image.load_addr);
+ }
nand_deselect();
}
--
1.7.4.1
^ permalink raw reply related
* [U-Boot] [PATCH V7 1/5] Add cmd_spl command
From: Simon Schwarz @ 2011-10-31 16:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320078187-28423-1-git-send-email-simonschwarzcor@gmail.com>
From: Simon Schwarz <simonschwarzcor@googlemail.com>
This adds a spl command to the u-boot.
Related config:
CONFIG_CMD_CPL
activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use
Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
V2 changes:
CHG corrected bootm call. Now bootm is called with five parameters including
Address of FDT in RAM. This fixes the hang on savebp fdt call.
ADD debug output of the actual bootm parameter call
CHG help message
V3 changes:
FIX added missing brackets
V4 changes:
CHG Corrected argument number in comments
CHG added check for CONFIG_OF_LIBFDT
CHG squashed the README to this commit
DEL define description from commit message - unused in this patch
CHG renamed to spl now with subcommand export, very different now
ADD New call style with subcommands.
CHG added printf where the image is located
CHG Patched README to reflect changes
CHG parameter count
CHG usage message
V5 changes:
nothing
V6 changes:
nothing
V7 changes:
FIX multiline comment style, cosmetic changes
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113499)
---
common/Makefile | 1 +
common/cmd_spl.c | 224 ++++++++++++++++++++++++++++++++++++++++++
doc/README.commands.spl | 31 ++++++
include/cmd_spl.h | 30 ++++++
include/configs/devkit8000.h | 7 ++
5 files changed, 293 insertions(+), 0 deletions(-)
create mode 100644 common/cmd_spl.c
create mode 100644 doc/README.commands.spl
create mode 100644 include/cmd_spl.h
diff --git a/common/Makefile b/common/Makefile
index 1b672ad..4056e41 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -164,6 +164,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
endif
COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
+COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
# others
ifdef CONFIG_DDR_SPD
diff --git a/common/cmd_spl.c b/common/cmd_spl.c
new file mode 100644
index 0000000..eb498c6
--- /dev/null
+++ b/common/cmd_spl.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.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 <common.h>
+#include <command.h>
+#include <cmd_spl.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Calls bootm with the parameters given */
+int call_bootm(int argc, char * const argv[], char *subcommand[])
+{
+ char *bootm_argv[5];
+ char command[] = "do_bootm";
+
+ int i = 0;
+ int ret = 0;
+
+ /* create paramter array */
+ bootm_argv[0] = command;
+ switch (argc) {
+ case 3:
+ bootm_argv[4] = argv[2]; /* fdt addr */
+ case 2:
+ bootm_argv[3] = argv[1]; /* initrd addr */
+ case 1:
+ bootm_argv[2] = argv[0]; /* kernel addr */
+ }
+
+
+ /*
+ * - do the work -
+ * exec subcommands of do_bootm to init the images
+ * data structure
+ */
+ while (subcommand[i] != '\0') {
+ bootm_argv[1] = subcommand[i];
+ debug("args: %s, %s, %s, %s, %s, %d\n", bootm_argv[0],
+ bootm_argv[1], bootm_argv[2], bootm_argv[3],
+ bootm_argv[4], argc);
+ ret = do_bootm(find_cmd("do_bootm"), 0, argc+2,
+ bootm_argv);
+ debug("Subcommand retcode: %d\n", ret);
+ i++;
+ }
+
+ if (ret) {
+ printf("ERROR prep subcommand failed!\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+/* assemble the bootm paramteres for fdt creation */
+int spl_export_fdt(int argc, char * const argv[])
+{
+#ifdef CONFIG_OF_LIBFDT
+ /* Create subcommand string */
+ char *subcommand[] = {"start",
+ "loados",
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
+ "ramdisk",
+#endif
+ "fdt",
+ "cmdline",
+ "bdt",
+ "prep",
+ '\0'};
+
+ /* inspect paramters and execute bootm */
+ argc--;
+ argv++;
+ if (call_bootm(argc, argv, subcommand))
+ return -1;
+
+ printf("Argument image is now in RAM: 0x%p\n",
+ (void *)images.ft_addr);
+ return 0;
+#else
+ printf("Das U-Boot was build without fdt support - aborting\n");
+ return -1;
+#endif
+}
+
+/* assemble the bootm patameters for atags creation */
+int spl_export_atags(int argc, char * const argv[])
+{
+#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
+ defined(CONFIG_CMDLINE_TAG) || \
+ defined(CONFIG_INITRD_TAG) || \
+ defined(CONFIG_SERIAL_TAG) || \
+ defined(CONFIG_REVISION_TAG)
+ /* Create subcommand string */
+ char *subcommand[] = {"start", "loados",
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
+ "ramdisk",
+#endif
+ "cmdline", "bdt", "prep", '\0'};
+
+ /* inspect parameters and execute bootm */
+ argc--;
+ argv++;
+ if (call_bootm(argc, argv, subcommand))
+ return -1;
+
+ printf("Argument image is now in RAM at: 0x%p\n",
+ (void *)gd->bd->bi_boot_params);
+ return 0;
+#endif
+ printf("Das U-Boot was build without ATAGS support - aborting\n");
+ return -1;
+}
+
+static cmd_tbl_t cmd_spl_export_sub[] = {
+ U_BOOT_CMD_MKENT(fdt, 0, 1, (void *)SPL_EXPORT_FDT, "", ""),
+ U_BOOT_CMD_MKENT(atags, 0, 1, (void *)SPL_EXPORT_ATAGS, "", ""),
+};
+
+int spl_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+
+ cmd_tbl_t *c;
+ int cmd;
+
+ if (argc < 2) /* no subcommand */
+ return cmd_usage(cmdtp);
+
+ c = find_cmd_tbl(argv[1], &cmd_spl_export_sub[0],
+ ARRAY_SIZE(cmd_spl_export_sub));
+ if (c) {
+ cmd = (int)c->cmd;
+ switch (cmd) {
+ case SPL_EXPORT_FDT:
+ argc--;
+ argv++;
+ return spl_export_fdt(argc, argv);
+ break;
+ case SPL_EXPORT_ATAGS:
+ argc--;
+ argv++;
+ return spl_export_atags(argc, argv);
+ break;
+ default:
+ /* unrecognized command */
+ return cmd_usage(cmdtp);
+ }
+ } else {
+ /* Unrecognized command */
+ return cmd_usage(cmdtp);
+ }
+
+ return 0;
+}
+
+static cmd_tbl_t cmd_spl_sub[] = {
+ U_BOOT_CMD_MKENT(export, 0, 1, (void *)SPL_EXPORT, "", ""),
+};
+
+int do_spl(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ cmd_tbl_t *c;
+ int cmd;
+
+ if (argc < 2) /* no subcommand */
+ return cmd_usage(cmdtp);
+
+ c = find_cmd_tbl(argv[1], &cmd_spl_sub[0], ARRAY_SIZE(cmd_spl_sub));
+ if (c) {
+ cmd = (int)c->cmd;
+ switch (cmd) {
+ case SPL_EXPORT:
+ argc--;
+ argv++;
+ if (spl_export(cmdtp, flag, argc, argv))
+ printf("Subcommand failed\n");
+ break;
+ default:
+ /* unrecognized command */
+ return cmd_usage(cmdtp);
+ }
+ } else {
+ /* Unrecognized command */
+ return cmd_usage(cmdtp);
+ }
+ return 0;
+}
+
+/*
+ * Arguments:
+ * 1: subcommand
+ * 2: image_type
+ * 3: nand_offset
+ * 4: kernel_addr
+ * 5: initrd_addr
+ * 6: fdt_adr
+ */
+
+U_BOOT_CMD(
+ spl, 6 , 1, do_spl, "SPL configuration",
+ "export <img=atags|fdt> [kernel_addr] [initrd_addr] "
+ "[fdt_addr if <img> = fdt] - export a kernel parameter image\n"
+ "\t initrd_img can be set to \"-\" if fdt_addr without initrd img is"
+ "used");
diff --git a/doc/README.commands.spl b/doc/README.commands.spl
new file mode 100644
index 0000000..818dd53
--- /dev/null
+++ b/doc/README.commands.spl
@@ -0,0 +1,31 @@
+The spl command is used to export a boot parameter image to RAM. Later
+it may implement more functions connected to the SPL.
+
+SUBCOMMAND EXPORT
+To execute the command everything has to be in place as if bootm should be
+used. (kernel image, initrd-image, fdt-image etc.)
+
+export has to subcommands:
+ atags: exports the ATAGS
+ fdt: exports the FDT
+
+Call is:
+spl export <ftd|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
+
+
+TYPICAL CALL
+
+on OMAP3:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 /* Read kernel image from NAND*/
+spl export atags /* export ATAGS */
+nand erase 0x680000 0x20000 /* erase - one page */
+nand write 0x80000100 0x680000 0x20000 /* write the image - one page */
+
+call with FDT:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 /* Read kernel image from NAND*/
+tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+spl export fdt 0x82000000 - 0x80000100 /* export FDT */
+nand erase 0x680000 0x20000 /* erase - one page */
+nand write <adress shown by spl export> 0x680000 0x20000
diff --git a/include/cmd_spl.h b/include/cmd_spl.h
new file mode 100644
index 0000000..dd3431d
--- /dev/null
+++ b/include/cmd_spl.h
@@ -0,0 +1,30 @@
+/* Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.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
+ */
+
+extern bootm_headers_t images;
+
+enum image_type {FDT, ATAGS};
+
+#define SPL_EXPORT (0x00000001)
+
+#define SPL_EXPORT_FDT (0x00000001)
+#define SPL_EXPORT_ATAGS (0x00000002)
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 6c51a27..f603f55 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -361,4 +361,11 @@
#define CONFIG_SYS_SPL_MALLOC_START 0x80108000
#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 /* 1 MB */
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE 0x400 /* 1024 byte */
+#define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+ 0x400000)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
+#define CONFIG_SYS_SPL_ARGS_ADDR (PHYS_SDRAM_1 + 0x100)
#endif /* __CONFIG_H */
--
1.7.4.1
^ permalink raw reply related
* [U-Boot] [PATCH V7 0/5] SPL Linux boot
From: Simon Schwarz @ 2011-10-31 16:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1317284033-16188-1-git-send-email-simonschwarzcor@gmail.com>
Adds direct Linux boot to SPL. It implements a spl export command to save
ATAGS or FDT to NAND flash. The kernel image has to be in place for this!
Changes in V5:
- Rebased on u-boot-ti
- fixed MAKEALL warnings and errors
- adapted to general gpio interface
Changes in V6:
- Change old commit message
Changes in V7:
- Correct style and format errors
based on:
- The new SPL layout
- OMAP3 new SPL layout
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105260)
- CONFIG_MACH_TYPE fix
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105809)
- Prep subcommand patch for arm
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/106725)
Related to:
- http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102669
Simon Schwarz (5):
Add cmd_spl command
omap-common: Add NAND SPL linux booting
omap-common/spl: Add linux boot to SPL
devkit8000/spl: init GPMC for dm9000 in SPL
omap-common: fixes BSS overwriting problem
arch/arm/cpu/armv7/omap-common/spl.c | 51 +++++++-
arch/arm/cpu/armv7/omap-common/spl_nand.c | 63 ++++++--
arch/arm/include/asm/omap_common.h | 2 +
board/timll/devkit8000/devkit8000.c | 33 ++++-
common/Makefile | 1 +
common/cmd_spl.c | 224 +++++++++++++++++++++++++++++
doc/README.commands.spl | 31 ++++
include/cmd_spl.h | 30 ++++
include/configs/devkit8000.h | 16 ++-
9 files changed, 423 insertions(+), 28 deletions(-)
create mode 100644 common/cmd_spl.c
create mode 100644 doc/README.commands.spl
create mode 100644 include/cmd_spl.h
--
1.7.4.1
^ permalink raw reply
* [U-Boot] [PATCH 0/2] add Timll DevKit3250 board initial support
From: Vladimir Zapolskiy @ 2011-10-31 15:31 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1319560064-10018-1-git-send-email-vz@mleia.com>
Hello Albert and Wolfgang,
On 25.10.2011 19:27, Vladimir Zapolskiy wrote:
> This patchset adds generic NXP LPC32XX SoC support and basic support
> for Embest/Timll DevKit3250 board, which powered by this SoC.
>
> Vladimir Zapolskiy (2):
> arm926ejs: add NXP LPC32x0 cpu series support
> devkit3250: add Timll DevKit3250 board initial support
>
> arch/arm/cpu/arm926ejs/lpc32xx/Makefile | 45 +++++++
> arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c | 118 ++++++++++++++++++
> arch/arm/cpu/arm926ejs/lpc32xx/cpu.c | 58 +++++++++
> arch/arm/cpu/arm926ejs/lpc32xx/devices.c | 47 +++++++
> arch/arm/cpu/arm926ejs/lpc32xx/timer.c | 94 +++++++++++++++
> arch/arm/include/asm/arch-lpc32xx/clk.h | 159 +++++++++++++++++++++++++
> arch/arm/include/asm/arch-lpc32xx/config.h | 59 +++++++++
> arch/arm/include/asm/arch-lpc32xx/cpu.h | 64 ++++++++++
> arch/arm/include/asm/arch-lpc32xx/emc.h | 92 ++++++++++++++
> arch/arm/include/asm/arch-lpc32xx/sys_proto.h | 25 ++++
> arch/arm/include/asm/arch-lpc32xx/timer.h | 74 ++++++++++++
> arch/arm/include/asm/arch-lpc32xx/uart.h | 54 +++++++++
> arch/arm/include/asm/arch-lpc32xx/wdt.h | 51 ++++++++
> board/timll/devkit3250/Makefile | 50 ++++++++
> board/timll/devkit3250/devkit3250.c | 74 ++++++++++++
> boards.cfg | 3 +-
> include/configs/devkit3250.h | 121 +++++++++++++++++++
> 17 files changed, 1187 insertions(+), 1 deletions(-)
> create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/Makefile
> create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
> create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
> create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/devices.c
> create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/timer.c
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/clk.h
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/config.h
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/cpu.h
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/emc.h
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/sys_proto.h
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/timer.h
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/uart.h
> create mode 100644 arch/arm/include/asm/arch-lpc32xx/wdt.h
> create mode 100644 board/timll/devkit3250/Makefile
> create mode 100644 board/timll/devkit3250/devkit3250.c
> create mode 100644 include/configs/devkit3250.h
>
still there is no comment on this patchset, however I wonder, if I could
accomplish any other your request to accelerate inclusion of the changes
to u-boot-arm/next.
Thank you in advance.
--
With best wishes,
Vladimir
^ permalink raw reply
* [U-Boot] [PATCH] part_efi: fix build warning
From: Anatolij Gustschin @ 2011-10-31 15:26 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1320073625-7544-1-git-send-email-leiwen@marvell.com>
Hi,
On Mon, 31 Oct 2011 08:07:05 -0700
Lei Wen <leiwen@marvell.com> wrote:
> part_efi.c: In function 'print_part_efi':
> part_efi.c:133: warning: passing argument 3 of 'is_gpt_valid' from
> incompatible pointer type
> part_efi.c:95: note: expected 'struct gpt_header *' but argument is of
> type 'struct gpt_header **'
> part_efi.c: In function 'get_partition_info_efi':
> part_efi.c:172: warning: passing argument 3 of 'is_gpt_valid' from
> incompatible pointer type
> part_efi.c:95: note: expected 'struct gpt_header *' but argument is of
> type 'struct gpt_header **'
>
> Signed-off-by: Lei Wen <leiwen@marvell.com>
> ---
> disk/part_efi.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
A patch for this bug already exists: [1].
Thanks anyway,
Anatolij
[1] http://patchwork.ozlabs.org/patch/122485/
^ permalink raw reply
* [U-Boot] [PATCH v6 4/4] usb: add USB support for Efika
From: Stefano Babic @ 2011-10-31 15:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <CAB+7RbGhb5tGhtxFiaVqEcBu_EJACciwKsbA2X6eo8fYPoevzw@mail.gmail.com>
On 10/31/2011 03:58 PM, Jana Rapava wrote:
>
>
> 2011/10/31 Stefano Babic <sbabic at denx.de <mailto:sbabic@denx.de>>
>
> > There are some issues with: [PATCH 3/4] EHCI: adjust for mx5
> > If you have already applied it
>
> Jana, can you answer / fix this point ?
>
>
> I really don't know what happens there. Code file looks aligned, but
> when I generate a patch with git-format-patch, aligning is messed up.
Wait: this can be due to the different positions of the TAB characters,
and to the leading + to mark an added line. It is not a problem.
> So
> I fix it in git-send-email,
Do you mean you change the patch generated by git format-patch ? You
should not do it.
Take a look at your patch. Some defines are removed, and in the patch
you see them as:
-#ifdef CONFIG_MX25
-#define MX25_USB_CTRL_IP_PUE_DOWN_BIT (1<<6)
-#define MX25_USB_CTRL_HSTD_BIT (1<<5)
-#define MX25_USB_CTRL_USBTE_BIT (1<<4)
-#define MX25_USB_CTRL_OCPOL_OTG_BIT (1<<3)
-#endif
It seems that even in the original file the defines were not aligned.
But this is not true, the disalignment is introduced by the leading "-".
However, when we see some lines later, the defines are added again and
they seem aligned.
+#ifdef CONFIG_MX25
+#define MX25_USB_CTRL_IP_PUE_DOWN_BIT (1<<6)
+#define MX25_USB_CTRL_HSTD_BIT (1<<5)
+#define MX25_USB_CTRL_USBTE_BIT (1<<4)
+#define MX25_USB_CTRL_OCPOL_OTG_BIT (1<<3)
+#endif
But when we apply the patch, they defines are disaligned again. maybe
you are worrying too much: let the tools doing their work. You have to
check that your changed file is correct (without whitespace instead of
tab), and then call git-format-patch. And do not care if the result
seems producing disaligned entries, this is not true.
There are also other comments by Igor that should be fixed,
independently from this alignment problem. Please fix them and resubmit.
> but after sending whitespace characters are
> messed up again.
> I wasn't able to find a way to fix it yet.
As I said, you want to fix the result of git-format-patch, but it is
correct. Simply do not do it.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply
* [U-Boot] [PATCH v2] e1000: fix bugs from recent commits
From: Moffett, Kyle D @ 2011-10-31 15:14 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1319916784-13899-1-git-send-email-wd@denx.de>
On Oct 29, 2011, at 15:33, Wolfgang Denk wrote:
> Commit 114d7fc0 "e1000: Rewrite EEPROM checksum error to give more
> information" failed to initialize the checksum variable which should
> result in random results. Fix that.
>
> Commit 2326a94d caused a ton of "unused variable 'x'" warnings.
> Fix these. While we are at it, remove some bogus parens.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Tested-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Thanks for doing this; my apologies for missing these issues in the first place.
Cheers,
Kyle Moffett
^ permalink raw reply
* [U-Boot] [PATCH] miiphy: Note that miiphy_* API is deprecated
From: Andy Fleming @ 2011-10-31 15:12 UTC (permalink / raw)
To: u-boot
In-Reply-To: <CAOZdJXWXxKfcuJ15bLS225kD8TVa7vwhpvZwAubC3wi2gLG5Nw@mail.gmail.com>
On Oct 31, 2011, at 10:08 AM, Tabi Timur-B04825 wrote:
> On Mon, Oct 31, 2011 at 9:46 AM, Andy Fleming <afleming@freescale.com> wrote:
>> We want to move everything to phylib, and we definitely don't want
>> new drivers using the miiphy infrastructure.
>
> How about using gcc's deprecated function feature? Or is that too aggressive?
I don't think we want every net driver prior to the last release to create a warning. We may switch to that after we get some momentum on switching drivers over. The first goal is just to provide information that a new driver-writer may see so that the old API doesn't expand.
Andy
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox