Browse Source
Merge pull request #1656 from masahir0y/uniphier
uniphier: clean-up and improve SCP handling code
pull/1662/head
Antonio Niño Díaz
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
6 additions and
29 deletions
-
plat/socionext/uniphier/uniphier.h
-
plat/socionext/uniphier/uniphier_bl2_setup.c
-
plat/socionext/uniphier/uniphier_io_storage.c
-
plat/socionext/uniphier/uniphier_scp.c
|
|
@ -41,7 +41,6 @@ int uniphier_nand_init(uintptr_t *block_dev_spec); |
|
|
|
int uniphier_usb_init(unsigned int soc, uintptr_t *block_dev_spec); |
|
|
|
|
|
|
|
int uniphier_io_setup(unsigned int soc); |
|
|
|
int uniphier_check_image(unsigned int image_id); |
|
|
|
|
|
|
|
struct image_info; |
|
|
|
struct image_info *uniphier_get_image_info(unsigned int image_id); |
|
|
|
|
|
@ -88,16 +88,6 @@ void bl2_el3_plat_arch_setup(void) |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
if (!skip_scp) { |
|
|
|
ret = uniphier_check_image(SCP_BL2_IMAGE_ID); |
|
|
|
if (ret) { |
|
|
|
WARN("SCP_BL2 image not found. SCP_BL2 load will be skipped.\n"); |
|
|
|
WARN("You must setup SCP by other means.\n"); |
|
|
|
skip_scp = 1; |
|
|
|
uniphier_bl2_kick_scp = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (skip_scp) { |
|
|
|
struct image_info *image_info; |
|
|
|
|
|
|
|
|
|
@ -335,21 +335,3 @@ int plat_get_image_source(unsigned int image_id, uintptr_t *dev_handle, |
|
|
|
|
|
|
|
return io_dev_init(*dev_handle, init_params); |
|
|
|
} |
|
|
|
|
|
|
|
int uniphier_check_image(unsigned int image_id) |
|
|
|
{ |
|
|
|
uintptr_t dev_handle, image_spec, image_handle; |
|
|
|
int ret; |
|
|
|
|
|
|
|
ret = plat_get_image_source(image_id, &dev_handle, &image_spec); |
|
|
|
if (ret) |
|
|
|
return ret; |
|
|
|
|
|
|
|
ret = io_open(dev_handle, image_spec, &image_handle); |
|
|
|
if (ret) |
|
|
|
return ret; |
|
|
|
|
|
|
|
io_close(image_handle); |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
@ -12,7 +12,9 @@ |
|
|
|
#define UNIPHIER_ROM_RSV3 0x5980120c |
|
|
|
|
|
|
|
#define UNIPHIER_STMBE2COM 0x5f800030 |
|
|
|
#define UNIPHIER_STMTOBEIRQ 0x5f800060 |
|
|
|
#define UNIPHIER_BETOSTMIRQ0PT 0x5f800070 |
|
|
|
#define UNIPHIER_BEIRQCLRPT 0x5f800072 |
|
|
|
|
|
|
|
#define UNIPHIER_SCP_READY_MAGIC 0x0000b6a5 |
|
|
|
|
|
|
@ -59,6 +61,10 @@ static void uniphier_scp_send_packet(const uint8_t *packet, int packet_len) |
|
|
|
} |
|
|
|
|
|
|
|
mmio_write_8(UNIPHIER_BETOSTMIRQ0PT, 0x55); |
|
|
|
|
|
|
|
while (!(mmio_read_32(UNIPHIER_STMTOBEIRQ) & BIT(1))) |
|
|
|
; |
|
|
|
mmio_write_8(UNIPHIER_BEIRQCLRPT, BIT(1) | BIT(0)); |
|
|
|
} |
|
|
|
|
|
|
|
static void uniphier_scp_send_cmd(const uint8_t *cmd, int cmd_len) |
|
|
|