- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs. - Remove duplicated code. - Add spl_boot_device() that returns the statically chosen boot device. Signed-off-by: Tom Rini <trini@ti.com>master
parent
d97b4ce805
commit
3f7f2414ef
@ -0,0 +1,16 @@ |
||||
#
|
||||
# Copyright (C) 2012, Texas Instruments, Incorporated - http://www.ti.com/
|
||||
#
|
||||
# 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 "as is" WITHOUT ANY WARRANTY of any
|
||||
# kind, whether express or implied; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
ifndef CONFIG_SPL_BUILD |
||||
ALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.ais
|
||||
endif |
@ -0,0 +1,32 @@ |
||||
/*
|
||||
* (C) Copyright 2012 |
||||
* Texas Instruments, <www.ti.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 _ASM_ARCH_SPL_H_ |
||||
#define _ASM_SPL_H_ |
||||
|
||||
#define BOOT_DEVICE_NAND 1 |
||||
#define BOOT_DEVICE_SPI 2 |
||||
#define BOOT_DEVICE_MMC1 3 |
||||
#define BOOT_DEVICE_MMC2 4 /* dummy */ |
||||
#define BOOT_DEVICE_MMC2_2 5 /* dummy */ |
||||
|
||||
#endif |
@ -1,62 +0,0 @@ |
||||
/*
|
||||
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
|
||||
* |
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA. |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <mmc.h> |
||||
|
||||
DECLARE_GLOBAL_DATA_PTR; |
||||
|
||||
static void mmc_load_image(struct mmc *mmc) |
||||
{ |
||||
s32 err; |
||||
void (*uboot)(void) __noreturn; |
||||
|
||||
err = mmc->block_dev.block_read(0, CONFIG_SYS_MMC_U_BOOT_OFFS, |
||||
CONFIG_SYS_MMC_U_BOOT_SIZE/512, |
||||
(u32 *)CONFIG_SYS_TEXT_BASE); |
||||
|
||||
if (err <= 0) { |
||||
printf("spl: error reading image %s, err - %d\n", |
||||
"u-boot.img", err); |
||||
hang(); |
||||
} |
||||
uboot = (void *) CONFIG_SYS_TEXT_BASE; |
||||
(*uboot)(); |
||||
} |
||||
|
||||
void spl_mmc_load(void) |
||||
{ |
||||
struct mmc *mmc; |
||||
int err; |
||||
void (mmc_load_image)(struct mmc *mmc) __noreturn; |
||||
|
||||
mmc_initialize(gd->bd); |
||||
mmc = find_mmc_device(0); |
||||
if (!mmc) { |
||||
puts("spl: mmc device not found!!\n"); |
||||
hang(); |
||||
} else { |
||||
puts("spl: mmc device found\n"); |
||||
} |
||||
err = mmc_init(mmc); |
||||
if (err) { |
||||
printf("spl: mmc init failed: err - %d\n", err); |
||||
hang(); |
||||
} |
||||
mmc_load_image(mmc); |
||||
} |
Loading…
Reference in new issue