1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-04 08:51:43 +02:00
Files
u-boot-megous/arch/arm/mach-aspeed/ast2600/spl.c
Tom Rini d678a59d2d Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d, reversing
changes made to 2ee6f3a5f7.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19 08:16:36 -06:00

80 lines
1.5 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) Aspeed Technology Inc.
*/
#include <common.h>
#include <debug_uart.h>
#include <dm.h>
#include <spl.h>
#include <init.h>
#include <linux/err.h>
#include <asm/io.h>
#include <asm/arch/scu_ast2600.h>
#include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR;
void board_init_f(ulong dummy)
{
spl_early_init();
preloader_console_init();
timer_init();
dram_init();
}
/*
* Try to detect the boot mode. Fallback to the default,
* memory mapped SPI XIP booting if detection failed.
*/
u32 spl_boot_device(void)
{
int rc;
struct udevice *scu_dev;
struct ast2600_scu *scu;
rc = uclass_get_device_by_driver(UCLASS_CLK,
DM_DRIVER_GET(aspeed_ast2600_scu), &scu_dev);
if (rc) {
debug("%s: failed to get SCU driver\n", __func__);
goto out;
}
scu = devfdt_get_addr_ptr(scu_dev);
if (IS_ERR_OR_NULL(scu)) {
debug("%s: failed to get SCU base\n", __func__);
goto out;
}
/* boot from UART has higher priority */
if (scu->hwstrap2 & SCU_HWSTRAP2_BOOT_UART)
return BOOT_DEVICE_UART;
if (scu->hwstrap1 & SCU_HWSTRAP1_BOOT_EMMC)
return BOOT_DEVICE_MMC1;
out:
return BOOT_DEVICE_RAM;
}
struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
{
return (struct legacy_img_hdr *)(CONFIG_SYS_LOAD_ADDR);
}
#ifdef CONFIG_SPL_OS_BOOT
int spl_start_uboot(void)
{
/* boot linux */
return 0;
}
#endif
#ifdef CONFIG_SPL_LOAD_FIT
int board_fit_config_name_match(const char *name)
{
/* just empty function now - can't decide what to choose */
debug("%s: %s\n", __func__, name);
return 0;
}
#endif