2018-11-02 14:21:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* K3: Common Architecture initialization
|
|
|
|
*
|
|
|
|
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
|
|
|
* Lokesh Vutla <lokeshvutla@ti.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <spl.h>
|
|
|
|
#include "common.h"
|
|
|
|
#include <dm.h>
|
|
|
|
#include <remoteproc.h>
|
2019-03-08 06:17:33 +00:00
|
|
|
#include <linux/soc/ti/ti_sci_protocol.h>
|
|
|
|
|
|
|
|
struct ti_sci_handle *get_ti_sci_handle(void)
|
|
|
|
{
|
|
|
|
struct udevice *dev;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = uclass_get_device_by_name(UCLASS_FIRMWARE, "dmsc", &dev);
|
|
|
|
if (ret)
|
|
|
|
panic("Failed to get SYSFW (%d)\n", ret);
|
|
|
|
|
|
|
|
return (struct ti_sci_handle *)ti_sci_get_handle_from_sysfw(dev);
|
|
|
|
}
|
2018-11-02 14:21:05 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_SYS_K3_SPL_ATF
|
|
|
|
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* It is assumed that remoteproc device 1 is the corresponding
|
2019-02-04 18:58:47 +00:00
|
|
|
* Cortex-A core which runs ATF. Make sure DT reflects the same.
|
2018-11-02 14:21:05 +00:00
|
|
|
*/
|
|
|
|
ret = rproc_dev_init(1);
|
2019-02-04 18:58:47 +00:00
|
|
|
if (ret)
|
|
|
|
panic("%s: ATF failed to initialize on rproc (%d)\n", __func__,
|
|
|
|
ret);
|
2018-11-02 14:21:05 +00:00
|
|
|
|
|
|
|
ret = rproc_load(1, spl_image->entry_point, 0x200);
|
2019-02-04 18:58:47 +00:00
|
|
|
if (ret)
|
|
|
|
panic("%s: ATF failed to load on rproc (%d)\n", __func__, ret);
|
2018-11-02 14:21:05 +00:00
|
|
|
|
2019-02-04 18:58:47 +00:00
|
|
|
/* Add an extra newline to differentiate the ATF logs from SPL */
|
2018-11-02 14:21:05 +00:00
|
|
|
printf("Starting ATF on ARM64 core...\n\n");
|
|
|
|
|
|
|
|
ret = rproc_start(1);
|
2019-02-04 18:58:47 +00:00
|
|
|
if (ret)
|
|
|
|
panic("%s: ATF failed to start on rproc (%d)\n", __func__, ret);
|
2018-11-02 14:21:05 +00:00
|
|
|
|
2019-02-04 18:58:47 +00:00
|
|
|
debug("ATF started. Waiting indefinitely...\n");
|
2018-11-02 14:21:05 +00:00
|
|
|
while (1)
|
|
|
|
asm volatile("wfe");
|
|
|
|
}
|
|
|
|
#endif
|